Hi
Link to watchdog element: watchdog
We’ve been doing some more testing and research. It seems like the watchdog don’t like the nvcompositor element, with an overlaying sink (nvdrmvideosink).
With fakesink and dump=true, we still see incoming data even with camera unplugged after stream has been running a little time. Its basically looking exactly the same as in attached picture, except freeing pipeline is not appearing, and pipeline still runs with a small amount of sporadic data coming.
Test 1:
- We tested running only a single pipe with one camera going to fakesink. Watchdog works just as supposed to, it triggers an error message (displayed with -m) which is what we want.
- By setting the watchdog timeout too low, the stream may not start. We kind of found a sweetspot with 500ms timeout.
gst-launch-1.0 -m nvv4l2camerasrc device=/dev/video0 ! watchdog timeout=500 ! "video/x-raw(memory:NVMM), format=(string)UYVY" ! nvvidconv ! "video/x-raw(memory:NVMM), format=(string)RGBA" ! fakesink dump=true
Test 2:
- We also tested a similar stream to our final solution (more cameras) with nvcompositor and two cameras. By sending the composed stream to a fakesink, the watchdog works.
- With two cameras and nvcompositor, the watchdog seems to detect no write in pipeline startup, and the pipeline may have to be restarted a few times to finally start playing.
gst-launch-1.0 -m nvcompositor name=comp \
sink_0::xpos=0 sink_0::ypos=0 sink_0::width=960 sink_0::height=540 sink_0::zorder=1 \
sink_1::xpos=960 sink_1::ypos=0 sink_1::width=960 sink_1::height=540 sink_1::zorder=2 \
! nvvidconv ! "video/x-raw(memory:NVMM), format=(string)RGBA, height=(int)1080, width=(int)1920" ! fakesink dump=true \
nvv4l2camerasrc device=/dev/video0 ! watchdog timeout=500 ! "video/x-raw(memory:NVMM), format=(string)UYVY" ! nvvidconv ! "video/x-raw(memory:NVMM), format=(string)RGBA" ! comp. \
nvv4l2camerasrc device=/dev/video1 ! watchdog timeout=500 ! "video/x-raw(memory:NVMM), format=(string)UYVY" ! nvvidconv ! "video/x-raw(memory:NVMM), format=(string)RGBA" ! comp.
Test 3:
- The watchdog also works with one single camera ending up in nvdrmvideosink.
- Also here the watchdog will not detect any writing unless we restart the stream a few times. 700ms worked out, however sometimes the stream starts playing just fine on the first try.
gst-launch-1.0 -m nvv4l2camerasrc device=/dev/video0 ! watchdog timeout=700 ! "video/x-raw(memory:NVMM), format=(string)UYVY" ! nvvidconv ! "video/x-raw(memory:NVMM), format=(string)RGBA" ! nvdrmvideosink
Test 4:
- The result we want to achieve is that the watchdog detects if one camera fails, by adding a watchdog to each camerasource.
- The watchdog can not affect our pipeline because of the need of high performance (realtime streaming) and therefore we’ll rather not use watchdog over using non Nvidia plugins in our pipeline.
- The following pipeline is one example of what we want to use.
- If one camera gets unplugged when running the following pipeline, nothing happens. The stream stops, however data will sporadically come from the unplugged camera, e.g. making the still video jump/glitch in intervals of approximately one second.
gst-launch-1.0 -m nvcompositor name=comp \
sink_0::xpos=0 sink_0::ypos=0 sink_0::width=960 sink_0::height=540 sink_0::zorder=1 \
sink_1::xpos=960 sink_1::ypos=0 sink_1::width=960 sink_1::height=540 sink_1::zorder=2 \
! nvvidconv ! "video/x-raw(memory:NVMM), format=(string)RGBA, height=(int)1080, width=(int)1920" ! nvdrmvideosink sync=false \
nvv4l2camerasrc device=/dev/video0 ! watchdog timeout=500 ! "video/x-raw(memory:NVMM), format=(string)UYVY" ! nvvidconv ! "video/x-raw(memory:NVMM), format=(string)RGBA" ! comp. \
nvv4l2camerasrc device=/dev/video1 ! watchdog timeout=500 ! "video/x-raw(memory:NVMM), format=(string)UYVY" ! nvvidconv ! "video/x-raw(memory:NVMM), format=(string)RGBA" ! comp.
Hope this clear things up, perhaps we’ve even been doing something completely wrong thats also an easy mistake. We just want to hear if anybody else face the same problems with watchdog, if not we’ll simply not use it and eventually wait until watchdog + compositor + videosink support has been added (if its not supported). Adding a screenshot from terminal when watchdog has been triggered.