简体   繁体   English

使用带有 pylonsrc 的 Python3 gstreamer1.0 使用 basler 相机和 pylon5 在处理循环中给出错误

[英]Using Python3 gstreamer1.0 with pylonsrc using basler camera and pylon5 gives error in the processing loop

I am using in python3 gstreamer1.0 with pylonsrc element to capture from a basler camera, video segments.我在 python3 gstreamer1.0使用pylonsrc元素从basler相机捕获视频片段。

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" ! [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"翻转=“假”! videoconvert !视频转换! xvimagesink] 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.我注意到的是,我运行了许多其他消耗资源的进程,例如,如果我打开 Chrome,则会出现此错误。 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 ... [正在将管道设置为 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 0:00:00.586949696 22636 0x50fb70 调试 pylonsrc gstpylonsrc.c:921:gst_pylonsrc_set_caps:将上限设置为视频/x-raw,格式=(字符串)RGB,宽度=(整数)1280,高度=(整数)7分数)0/1
New clock: GstSystemClock新时钟:GstSystemClock
0:00:13.221158272 22636 0x50fb70 ERROR pylonsrc gstpylonsrc.c:2100:gst_pylonsrc_create: Error in the image processing loop. 0:00:13.221158272 22636 0x50fb70 错误 pylonsrc gstpylonsrc.c:2100:gst_pylonsrc_create:图像处理循环出错。
ERROR: from element /GstPipeline:pipeline0/GstPylonsrc:pylonsrc0: Internal data flow error.错误:来自元素 /GstPipeline:pipeline0/GstPylonsrc:pylonsrc0:内部数据流错误。

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 ... ] gstbasesrc.c(2948): gst_base_src_loop (): /GstPipeline:pipeline0/GstPylonsrc:pylonsrc0: 流任务暂停,原因错误 (-5) 执行结束后 0:00:12.634486400 将管道设置为 PAUSED ... ]

I think the problem is caused by the CPU interrupts.我认为问题是由 CPU 中断引起的。

The whole camera application runs on Nvidia TX2 with Ubuntu 16.04LTS.整个相机应用程序在 Nvidia TX2 和 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. Nvidia CAN 控制器在主 CPU 上创建中断,这会干扰在相同 CPU 内核上运行中断的相机应用程序。

Also i have seen that 2 cores(denver processor) out of 6 were not working.此外,我还看到 6 个内核中有 2 个(丹佛处理器)不工作。

I have activated all cores and moved (affinity) the can0 and can1 interrupts on these newly activated cores.我已激活所有内核并移动(关联)这些新激活内核上的 can0 和 can1 中断。

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.但我建议修改 gstpylonsrc.c 第 2099 行中的文件,并设置其他条件,即如果没有抓取任何帧,则保留最后一帧。 This will avoid stopping the pipeline.这将避免停止管道。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM