2
votes

I am using in python3 gstreamer1.0 with pylonsrc element to capture from a basler camera, video segments.

For example using this pipeline:

[GST_DEBUG=pylonsrc:5 gst-launch-1.0 pylonsrc userid="testCam" imageformat=rgb8 lightsource="off" autoexposure="continuous" autowhitebalance="continuous" autogain="continuous" limitbandwidth="false" flipx="false" flipy="false" ! videoconvert ! xvimagesink]

Sometimes the Error in the processing loop appears and recording is stopped.

What I have noticed is that I run a lot of other processes which consume resources and if for example I open chromium this error appears. Another example is when i process a lot of data coming from Ethernet and other protocols, then some threads are starting to process this data the error appears and camera stop.

I have tried different pipelines and all have this problem when I use a lot of system resources.

Details regarding the error:

[Setting pipeline to PLAYING ...
0:00:00.586949696 22636 0x50fb70 DEBUG pylonsrc gstpylonsrc.c:921:gst_pylonsrc_set_caps: Setting caps to video/x-raw, format=(string)RGB, width=(int)1280, height=(int)720, framerate=(fraction)0/1
New clock: GstSystemClock
0:00:13.221158272 22636 0x50fb70 ERROR pylonsrc gstpylonsrc.c:2100:gst_pylonsrc_create: Error in the image processing loop.
ERROR: from element /GstPipeline:pipeline0/GstPylonsrc:pylonsrc0: Internal data flow error.

Additional debug info:

gstbasesrc.c(2948): gst_base_src_loop (): /GstPipeline:pipeline0/GstPylonsrc:pylonsrc0: streaming task paused, reason error (-5) Execution ended after 0:00:12.634486400 Setting pipeline to PAUSED ... ]

1

1 Answers

1
votes

I think the problem is caused by the CPU interrupts.

The whole camera application runs on Nvidia TX2 with Ubuntu 16.04LTS.

The Nvidia CAN controllers creates interrupts on main CPU which interfere with the camera application that runs interrupts on the same CPU cores.

Also i have seen that 2 cores(denver processor) out of 6 were not working.

I have activated all cores and moved (affinity) the can0 and can1 interrupts on these newly activated cores.

Now i am not lossing frames so no error in the processing loop anymore.

But i recommand to modify file in gstpylonsrc.c line 2099 and put in else condition that if no frame is grabbed keep the last frame. This will avoid stopping the pipeline.

Details: {https://github.com/zingmars/gst-pylonsrc/issues/5}