Home        Store        Learn        Blog

Camera Stream Continually Restarting

Hey all, I’m starting the process of building an ROV. :grinning:
So far, I only have a raspi and camera, but don’t yet have a pixhawk controller. Many items are ordered or will be soon though!

I have a low-light USB camera ordered on Amazon that I’m trying to get connected to the companion computer. I am able to connect it and see the image in QGroundControl, but it is showing around 1 fps or so.

  • Companion is a Raspberry Pi 3B, running version 0.0.30
  • QGroundControl running on Windows 10 Laptop, tried both version 4.0.5 and some dev build, no difference.
  • Camera: Arducam 1080p USB Low Light Camera Module IMX323 H.264, MJPEG, Link to camera on Amazon

For troubleshooting to make sure the camera module is ok (as that was my first suspect), I tried plugging it directly into my laptop, and it’s working fine. I also plugged it into the same Raspberry Pi 3B but running an OctoPrint (3D printer) sd card image, and the camera module was detected and ran at a high framerate. So I believe the camera is compatible with the raspi, and that it is getting enough power from the raspi.

My next thought was the ethernet cable I am using to connect my laptop and the raspi, so I tried switching to a different ethernet cable, same issue. I tried running the speedtest function on the companion network page, and get around 95 up and down. I also switched cameras over to an old raspberry pi camera module that I have lying around, and the framerate on that video in QGroundControl is fine, so I think my connection as far as ethernet goes is good.

I checked the resource usage on the raspi, and it’s all fairly low, resource usage on my laptop is low, tried the safe mode and GPU compatibility versions of QGround, updated GPU drivers, I saw in the troubleshooting steps to put windows scaling to 100%, no difference. I also tried lowering the resolution in the camera settings in companion camera page, but no difference. All camera settings are at defaults, H.264.

All I can think is there is some setup / settings for the camera that I need to change from the default, but I don’t really know where to start with that. I did find another forum post that instructed to send the command ‘screen -r video’ in the terminal, so I tried that to see if I got the response that post said I should, but it seems what I’m getting is a bit different. Not 100% sure what I’m looking for in there though. I’ll post the results in a response to this, as it is quite long.

So to sum up, I have a video image in QGroundControl, but terrible framerate. I’ve tried to isolate the issue to the camera, ethernet cable, power delivery, etc and it all seems to be fine.
Any and all help is appreciated!!

Results from sending ‘screen -r video’ in the companion computer terminal.

I can upload as text rather than an image if needed. Thanks!!

Hi @prider, welcome to the forum :slight_smile:

Thanks for the detailed breakdown of your existing setup and what you’ve tried so far - that’s really helpful!

In the screenshot you provided of the video screen session, it seems like your camera is restarting itself after about a second of streaming (it happens once at the top, and then again near the middle, from which I assume it’s likely a repeated occurrence).

The stream itself isn’t related to QGC or the topside, which means the issue is most likely with either

  • your Companion computer,
  • the camera itself, or
  • the cable between them

You’ve mentioned that the camera works well with the same Raspberry Pi and power supply, which effectively narrows down the issue to some kind of incompatibility between the Companion video streaming functionality and what the camera is happy to output. A few more things that would be helpful to try/for us to know:

  1. Does the streaming still cut out in the same way if you reduce the framerate and/or frame size on the Camera page of the web interface?
  2. Are you running other code on the Raspberry Pi, or just the standard companion image?
  3. Does the streaming fix itself if you quit the other companion screen sessions?
    The following code (which you can type or paste into the web-terminal) quits all sessions except the webui, webterminal, and video. They restore themselves when you reboot.
    for SESSION in $(screen -ls | grep "(" | cut -f2 | grep -v -e web -e video)
    do
        screen -S $SESSION -X quit
    done
    
  4. Are you able to try with a shorter cable (to the camera) and/or stronger (higher current rating) power supply? It’s possible the Raspberry Pi is struggling to provide enough power to the camera when it’s also dealing with the loads from companion

Generally it’s not an issue to put a lot of detail/content into a single post, particularly because responses can directly quote from parts of it. If the post is getting a bit unwieldy it can be helpful to break it up with some headings, which you can learn more about in the How to Use the Blue Robotics Forums post :slight_smile:

Hi Elliot,
Thanks for the welcome and for the quick reply!

With what I’ve noticed, I was suspecting that the issue was companion computer and camera related, not QGC or anything topside. Glad I was at least somewhat on the right track. Also, thank you for renaming the post to be more related to the actual issue at hand.

I tried changing the frame size all the way down to 240p, no difference (other than some terrible image quality ha :grin: )

When I click the dropdown for framerate, 30 is the only option available, and I am unable to change it. Not sure if that is somehow related to the issue…

I’m am not running any other code on the Raspberry Pi, just the standard companion image downloaded from ardusub.com, flashed with Etcher, and then updated over wifi once installed in the Raspberry Pi.

I pasted the code into the web-terminal. I didn’t receive any sort of response in the terminal, not sure if I should have… No difference on the issue.

Ok, plugged the Raspberry Pi into a couple different power supplies. The original was a 2.5A power supply, but it’s years old so who knows. Also tried a couple fairly new power supplies at 3A, as well as a different power cable, no difference.

The cable to the camera is 1 meter long, but it terminates at the camera end with a small 4 pin connector, so I don’t have any shorter cables to replace it with. I could hack a section off and make it shorter, but I’d rather not if I can avoid it… I might be able to rig something up with a spare USB cable if needed.

Thanks for this info! I read through that post and there’s a lot of good stuff there!

The product page also mentions that the camera is compatible with MJPG as well, would that make any difference at all vs H.264? To be honest I don’t really know what difference that makes or would affect lol :slight_smile:

Thanks again for the help!

No worries :slight_smile:

Haha, shame it didn’t help, but fair on the quality.

The available options are auto-detected by the companion software, so it seems your camera advertises itself as only supporting 30fps. It’s a bit odd, but it’s possible that the camera manufacturer only implemented 30fps as an output option (perhaps to save on development costs or similar).

Yeah, that shouldn’t be the problem then - it must be something to do with this particular camera, since that Companion image at least works well with our camera and Raspberry Pi cameras.

That code shouldn’t have an output unless something goes wrong when running it. If reducing the frame-size didn’t help then I expect reducing other CPU load is unlikely to solve the problem unfortunately.

We generally recommend a 5V 6A supply, but that’s also expected to power the Pixhawk and other 5V electronics (e.g. sensors, camera tilt servo). For a Pi on its own with just a camera connected 2.5-3A should be fine.

At this stage I’m guessing your issue is unlikely to be caused by noise or power drop through the cable, because you said the same cable and Raspberry Pi worked fine running OctoPrint. If you had a shorter cable available it wouldn’t hurt to try (the cable for our camera is 20cm (8")), but I don’t think it’s worth damaging the existing cable for to check something that’s not super likely to help.

I’m thinking there’s either something that’s causing the camera to lose its connection with the RPi, or there’s perhaps some kind of timing or bitrate issue between our streaming code and your camera’s output capacity. The repeating 1s stream loss seems a bit suspicious, but if it’s Companion’s fault then I’d expect the same issue to occur with our cameras too.


I’ve taken another look at your screenshot and our streaming code, and your results seem to be unusual beyond the 1s restart. To start with,

  1. the attempting device /dev/... section is supposed to receive only a single frame (to check if the camera works), but for your setup seems to take a full second to complete, which could mean the camera takes 1s to respond with the first requested frame.
  2. From there the actual UDP stream (to the topside) is created (starting device /dev/...), but your screenshot cuts off what comes after that so I’m unsure whether the stream ends there or if something else occurs.

It would be helpful if you could provide some more of the screen session output (either another screenshot or just the text pasted into a code block).

MJPG is a different streaming format, but wouldn’t be so helpful in this case because Companion is only set up to stream H264-encoded streams, and that’s also what QGC expects, so getting that set up would involve some programming on both ends.

I thought that might be the case. Does seem a bit strange, but it is a cheap camera, so trying to save on dev costs would make sense.

Got it, makes sense.

I am planning on getting that power supply for hardwiring into the ROV itself, but yeah, right now it’s just the camera and Raspberry Pi.

Makes sense, I guess I won’t go mad and start chopping up cables :upside_down_face:

Ok, I ran the code again and I’ve pasted below what was returned. I think this time I have the entire code that was returned? I don’t see any way to scroll up or down on it, so I zoomed out the window until I couldn’t see it loading up any more code lol. I’m a bit of a noob with the terminal :slight_smile:

I guess if there’s an easier way (which I’d imagine there is) let me know.

Also, I did find that I still had my 3D printer controller board plugged into the Raspberry Pi because I’m an idiot, but I unplugged it and rebooted the pi, and it’s still the same. If I need to re-flash the companion software or something because of that let me know.

Here’s the code:


/dev/video0   /dev/video11  /dev/video14  /dev/video18
/dev/video1   /dev/video12  /dev/video15  /dev/video2
/dev/video10  /dev/video13  /dev/video16  /dev/video3
start video with width 1920 height 1080 framerate 30 device /dev/video4
Setting pipeline to PAUSED ...
ERROR: Pipeline doesn't want to pause.
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Cannot identify device '/dev/video4'.
Additional debug info:
v4l2_calls.c(606): gst_v4l2_open (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
system error: No such file or directory
Setting pipeline to NULL ...
Freeing pipeline ...
specified device /dev/video4 failed
attempting to start /dev/video0
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal data flow error.
Additional debug info:
gstbasesrc.c(2948): gst_base_src_loop (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
streaming task paused, reason not-negotiated (-4)
Execution ended after 0:00:00.242601989
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...
attempting to start /dev/video1
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal data flow error.
Additional debug info:
gstbasesrc.c(2948): gst_base_src_loop (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
streaming task paused, reason not-negotiated (-4)
ERROR: pipeline doesn't want to preroll.
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...
attempting to start /dev/video10
Setting pipeline to PAUSED ...
ERROR: Pipeline doesn't want to pause.
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Device '/dev/video10' is not a capture device.
Additional debug info:
v4l2_calls.c(628): gst_v4l2_open (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
Capabilities: 0x84204000
Setting pipeline to NULL ...
Freeing pipeline ...
attempting to start /dev/video11
Setting pipeline to PAUSED ...
ERROR: Pipeline doesn't want to pause.
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Device '/dev/video11' is not a capture device.
Additional debug info:
v4l2_calls.c(628): gst_v4l2_open (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
Capabilities: 0x84204000
Setting pipeline to NULL ...
Freeing pipeline ...
attempting to start /dev/video12
Setting pipeline to PAUSED ...
ERROR: Pipeline doesn't want to pause.
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Device '/dev/video12' is not a capture device.
Additional debug info:
v4l2_calls.c(628): gst_v4l2_open (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
Capabilities: 0x84204000
Setting pipeline to NULL ...
Freeing pipeline ...
attempting to start /dev/video13
Setting pipeline to PAUSED ...
ERROR: Pipeline doesn't want to pause.
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Device '/dev/video13' is not a capture device.
Additional debug info:
v4l2_calls.c(628): gst_v4l2_open (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
Capabilities: 0x84200002
Setting pipeline to NULL ...
Freeing pipeline ...
attempting to start /dev/video14
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal data flow error.
Additional debug info:
gstbasesrc.c(2948): gst_base_src_loop (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:                                                                                                                                                                                                                                                                                                                                                                                                                              
streaming task paused, reason not-negotiated (-4)
Execution ended after 0:00:00.000471042
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...
attempting to start /dev/video15
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal data flow error.
Additional debug info:
gstbasesrc.c(2948): gst_base_src_loop (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:                                                                                                                                                                                                                                                                                                                                                                                                                              
streaming task paused, reason not-negotiated (-4)
Execution ended after 0:00:00.000319479
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...
attempting to start /dev/video16
Setting pipeline to PAUSED ...
ERROR: Pipeline doesn't want to pause.
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Device '/dev/video16' is not a capture device.
Additional debug info:
v4l2_calls.c(628): gst_v4l2_open (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:                                                                                                                                                                                                                                                                                                                                                                                                                                   
Capabilities: 0x84a00000
Setting pipeline to NULL ...
Freeing pipeline ...
attempting to start /dev/video18
Setting pipeline to PAUSED ...
ERROR: Pipeline doesn't want to pause.
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Device '/dev/video18' is not a capture device.
Additional debug info:
v4l2_calls.c(628): gst_v4l2_open (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:                                                                                                                                                                                                                                                                                                                                                                                                                                   
Capabilities: 0x84204000
Setting pipeline to NULL ...
Freeing pipeline ...
attempting to start /dev/video2
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
/GstPipeline:pipeline0/GstV4l2Src:v4l2src0.GstPad:src: caps = "video/x-h264\,\ stream-format\=\(string\)byte-stream\,\ alignment\=\(string\)au\,\ width\=\(int\)1920\,\ height\=\(int\)1080\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ colorimetry\=\(string\)2:4:5:1\,\ framerate\=\(fraction\)30/1"
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src: caps = "video/x-h264\,\ stream-format\=\(string\)byte-stream\,\ alignment\=\(string\)au\,\ width\=\(int\)1920\,\ height\=\(int\)1080\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ colorimetry\=\(string\)2:4:5:1\,\ framerate\=\(fraction\)30/1"
/GstPipeline:pipeline0/GstH264Parse:h264parse0.GstPad:sink: caps = "video/x-h264\,\ stream-format\=\(string\)byte-stream\,\ alignment\=\(string\)au\,\ width\=\(int\)1920\,\ height\=\(int\)1080\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ colorimetry\=\(string\)2:4:5:1\,\ framerate\=\(fraction\)30/1"
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:sink: caps = "video/x-h264\,\ stream-format\=\(string\)byte-stream\,\ alignment\=\(string\)au\,\ width\=\(int\)1920\,\ height\=\(int\)1080\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ colorimetry\=\(string\)2:4:5:1\,\ framerate\=\(fraction\)30/1"
/GstPipeline:pipeline0/GstH264Parse:h264parse0.GstPad:src: caps = "video/x-h264\,\ stream-format\=\(string\)avc\,\ alignment\=\(string\)au\,\ width\=\(int\)1920\,\ height\=\(int\)1080\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ colorimetry\=\(string\)2:4:5:1\,\ framerate\=\(fraction\)30/1\,\ parsed\=\(boolean\)true\,\ profile\=\(string\)main\,\ level\=\(string\)4.1\,\ codec_data\=\(buffer\)014d4029ffe1000b674d4029965403c0113f2a01000468ee3880"                                                       
/GstPipeline:pipeline0/GstQueue:queue0.GstPad:src: caps = "video/x-h264\,\ stream-format\=\(string\)avc\,\ alignment\=\(string\)au\,\ width\=\(int\)1920\,\ height\=\(int\)1080\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ colorimetry\=\(string\)2:4:5:1\,\ framerate\=\(fraction\)30/1\,\ parsed\=\(boolean\)true\,\ profile\=\(string\)main\,\ level\=\(string\)4.1\,\ codec_data\=\(buffer\)014d4029ffe1000b674d4029965403c0113f2a01000468ee3880"                                                               
/GstPipeline:pipeline0/GstQueue:queue0.GstPad:sink: caps = "video/x-h264\,\ stream-format\=\(string\)avc\,\ alignment\=\(string\)au\,\ width\=\(int\)1920\,\ height\=\(int\)1080\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ colorimetry\=\(string\)2:4:5:1\,\ framerate\=\(fraction\)30/1\,\ parsed\=\(boolean\)true\,\ profile\=\(string\)main\,\ level\=\(string\)4.1\,\ codec_data\=\(buffer\)014d4029ffe1000b674d4029965403c0113f2a01000468ee3880"                                                              
/GstPipeline:pipeline0/GstRtpH264Pay:rtph264pay0.GstPad:src: caps = "application/x-rtp\,\ media\=\(string\)video\,\ clock-rate\=\(int\)90000\,\ encoding-name\=\(string\)H264\,\ packetization-mode\=\(string\)1\,\ profile-level-id\=\(string\)4d4029\,\ sprop-parameter-sets\=\(string\)\"Z01AKZZUA8ARPyo\\\=\\\,aO44gA\\\=\\\=\"\,\ payload\=\(int\)96\,\ ssrc\=\(uint\)767832976\,\ timestamp-offset\=\(uint\)3145304537\,\ seqnum-offset\=\(uint\)20653\,\ a-framerate\=\(string\)30"                         
/GstPipeline:pipeline0/GstFakeSink:fakesink0.GstPad:sink: caps = "application/x-rtp\,\ media\=\(string\)video\,\ clock-rate\=\(int\)90000\,\ encoding-name\=\(string\)H264\,\ packetization-mode\=\(string\)1\,\ profile-level-id\=\(string\)4d4029\,\ sprop-parameter-sets\=\(string\)\"Z01AKZZUA8ARPyo\\\=\\\,aO44gA\\\=\\\=\"\,\ payload\=\(int\)96\,\ ssrc\=\(uint\)767832976\,\ timestamp-offset\=\(uint\)3145304537\,\ seqnum-offset\=\(uint\)20653\,\ a-framerate\=\(string\)30"
/GstPipeline:pipeline0/GstRtpH264Pay:rtph264pay0.GstPad:sink: caps = "video/x-h264\,\ stream-format\=\(string\)avc\,\ alignment\=\(string\)au\,\ width\=\(int\)1920\,\ height\=\(int\)1080\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ colorimetry\=\(string\)2:4:5:1\,\ framerate\=\(fraction\)30/1\,\ parsed\=\(boolean\)true\,\ profile\=\(string\)main\,\ level\=\(string\)4.1\,\ codec_data\=\(buffer\)014d4029ffe1000b674d4029965403c0113f2a01000468ee3880"
/GstPipeline:pipeline0/GstRtpH264Pay:rtph264pay0: timestamp = 3145376575
/GstPipeline:pipeline0/GstRtpH264Pay:rtph264pay0: seqnum = 20653
Got EOS from element "pipeline0".
Execution ended after 0:00:01.017138784
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...
Success!
Frame rate set to 30.000 fps
attempting device /dev/video2 with width 1920 height 1080 framerate 30 options ! h264parse ! queue ! rtph264pay config-interval=10 pt=96 ! udpsink host=192.168.2.1 port=5600
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
/GstPipeline:pipeline0/GstV4l2Src:v4l2src0.GstPad:src: caps = "video/x-h264\,\ stream-format\=\(string\)byte-stream\,\ alignment\=\(string\)au\,\ width\=\(int\)1920\,\ height\=\(int\)1080\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ colorimetry\=\(string\)2:4:5:1\,\ framerate\=\(fraction\)30/1"
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src: caps = "video/x-h264\,\ stream-format\=\(string\)byte-stream\,\ alignment\=\(string\)au\,\ width\=\(int\)1920\,\ height\=\(int\)1080\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ colorimetry\=\(string\)2:4:5:1\,\ framerate\=\(fraction\)30/1"
/GstPipeline:pipeline0/GstH264Parse:h264parse0.GstPad:sink: caps = "video/x-h264\,\ stream-format\=\(string\)byte-stream\,\ alignment\=\(string\)au\,\ width\=\(int\)1920\,\ height\=\(int\)1080\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ colorimetry\=\(string\)2:4:5:1\,\ framerate\=\(fraction\)30/1"
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:sink: caps = "video/x-h264\,\ stream-format\=\(string\)byte-stream\,\ alignment\=\(string\)au\,\ width\=\(int\)1920\,\ height\=\(int\)1080\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ colorimetry\=\(string\)2:4:5:1\,\ framerate\=\(fraction\)30/1"
/GstPipeline:pipeline0/GstH264Parse:h264parse0.GstPad:src: caps = "video/x-h264\,\ stream-format\=\(string\)avc\,\ alignment\=\(string\)au\,\ width\=\(int\)1920\,\ height\=\(int\)1080\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ colorimetry\=\(string\)2:4:5:1\,\ framerate\=\(fraction\)30/1\,\ parsed\=\(boolean\)true\,\ profile\=\(string\)main\,\ level\=\(string\)4.1\,\ codec_data\=\(buffer\)014d4029ffe1000b674d4029965403c0113f2a01000468ee3880"                                                       
/GstPipeline:pipeline0/GstQueue:queue0.GstPad:src: caps = "video/x-h264\,\ stream-format\=\(string\)avc\,\ alignment\=\(string\)au\,\ width\=\(int\)1920\,\ height\=\(int\)1080\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ colorimetry\=\(string\)2:4:5:1\,\ framerate\=\(fraction\)30/1\,\ parsed\=\(boolean\)true\,\ profile\=\(string\)main\,\ level\=\(string\)4.1\,\ codec_data\=\(buffer\)014d4029ffe1000b674d4029965403c0113f2a01000468ee3880"                                                               
/GstPipeline:pipeline0/GstRtpH264Pay:rtph264pay0.GstPad:src: caps = "application/x-rtp\,\ media\=\(string\)video\,\ clock-rate\=\(int\)90000\,\ encoding-name\=\(string\)H264\,\ packetization-mode\=\(string\)1\,\ profile-level-id\=\(string\)4d4029\,\ sprop-parameter-sets\=\(string\)\"Z01AKZZUA8ARPyo\\\=\\\,aO44gA\\\=\\\=\"\,\ payload\=\(int\)96\,\ ssrc\=\(uint\)1774750190\,\ timestamp-offset\=\(uint\)3162072584\,\ seqnum-offset\=\(uint\)287\,\ a-framerate\=\(string\)30"                          
/GstPipeline:pipeline0/GstFakeSink:fakesink0.GstPad:sink: caps = "application/x-rtp\,\ media\=\(string\)video\,\ clock-rate\=\(int\)90000\,\ encoding-name\=\(string\)H264\,\ packetization-mode\=\(string\)1\,\ profile-level-id\=\(string\)4d4029\,\ sprop-parameter-sets\=\(string\)\"Z01AKZZUA8ARPyo\\\=\\\,aO44gA\\\=\\\=\"\,\ payload\=\(int\)96\,\ ssrc\=\(uint\)1774750190\,\ timestamp-offset\=\(uint\)3162072584\,\ seqnum-offset\=\(uint\)287\,\ a-framerate\=\(string\)30"                             
/GstPipeline:pipeline0/GstRtpH264Pay:rtph264pay0.GstPad:sink: caps = "video/x-h264\,\ stream-format\=\(string\)avc\,\ alignment\=\(string\)au\,\ width\=\(int\)1920\,\ height\=\(int\)1080\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ colorimetry\=\(string\)2:4:5:1\,\ framerate\=\(fraction\)30/1\,\ parsed\=\(boolean\)true\,\ profile\=\(string\)main\,\ level\=\(string\)4.1\,\ codec_data\=\(buffer\)014d4029ffe1000b674d4029965403c0113f2a01000468ee3880"                                                    
/GstPipeline:pipeline0/GstQueue:queue0.GstPad:sink: caps = "video/x-h264\,\ stream-format\=\(string\)avc\,\ alignment\=\(string\)au\,\ width\=\(int\)1920\,\ height\=\(int\)1080\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ colorimetry\=\(string\)2:4:5:1\,\ framerate\=\(fraction\)30/1\,\ parsed\=\(boolean\)true\,\ profile\=\(string\)main\,\ level\=\(string\)4.1\,\ codec_data\=\(buffer\)014d4029ffe1000b674d4029965403c0113f2a01000468ee3880"
/GstPipeline:pipeline0/GstRtpH264Pay:rtph264pay0: timestamp = 3162146336
/GstPipeline:pipeline0/GstRtpH264Pay:rtph264pay0: seqnum = 287
Got EOS from element "pipeline0".
Execution ended after 0:00:01.079617731
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...
starting device /dev/video2 with width 1920 height 1080 framerate 30 options ! h264parse ! queue ! rtph264pay config-interval=10 pt=96 ! udpsink host=192.168.2.1 port=5600
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
/GstPipeline:pipeline0/GstV4l2Src:v4l2src0.GstPad:src: caps = "video/x-h264\,\ stream-format\=\(string\)byte-stream\,\ alignment\=\(string\)au\,\ width\=\(int\)1920\,\ height\=\(int\)1080\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ colorimetry\=\(string\)2:4:5:1\,\ framerate\=\(fraction\)30/1"
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src: caps = "video/x-h264\,\ stream-format\=\(string\)byte-stream\,\ alignment\=\(string\)au\,\ width\=\(int\)1920\,\ height\=\(int\)1080\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ colorimetry\=\(string\)2:4:5:1\,\ framerate\=\(fraction\)30/1"
/GstPipeline:pipeline0/GstH264Parse:h264parse0.GstPad:sink: caps = "video/x-h264\,\ stream-format\=\(string\)byte-stream\,\ alignment\=\(string\)au\,\ width\=\(int\)1920\,\ height\=\(int\)1080\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ colorimetry\=\(string\)2:4:5:1\,\ framerate\=\(fraction\)30/1"
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:sink: caps = "video/x-h264\,\ stream-format\=\(string\)byte-stream\,\ alignment\=\(string\)au\,\ width\=\(int\)1920\,\ height\=\(int\)1080\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ colorimetry\=\(string\)2:4:5:1\,\ framerate\=\(fraction\)30/1"
/GstPipeline:pipeline0/GstH264Parse:h264parse0.GstPad:src: caps = "video/x-h264\,\ stream-format\=\(string\)avc\,\ alignment\=\(string\)au\,\ width\=\(int\)1920\,\ height\=\(int\)1080\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ colorimetry\=\(string\)2:4:5:1\,\ framerate\=\(fraction\)30/1\,\ parsed\=\(boolean\)true\,\ profile\=\(string\)main\,\ level\=\(string\)4.1\,\ codec_data\=\(buffer\)014d4029ffe1000b674d4029965403c0113f2a01000468ee3880"                                                       
/GstPipeline:pipeline0/GstQueue:queue0.GstPad:src: caps = "video/x-h264\,\ stream-format\=\(string\)avc\,\ alignment\=\(string\)au\,\ width\=\(int\)1920\,\ height\=\(int\)1080\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ colorimetry\=\(string\)2:4:5:1\,\ framerate\=\(fraction\)30/1\,\ parsed\=\(boolean\)true\,\ profile\=\(string\)main\,\ level\=\(string\)4.1\,\ codec_data\=\(buffer\)014d4029ffe1000b674d4029965403c0113f2a01000468ee3880"
/GstPipeline:pipeline0/GstRtpH264Pay:rtph264pay0.GstPad:src: caps = "application/x-rtp\,\ media\=\(string\)video\,\ clock-rate\=\(int\)90000\,\ encoding-name\=\(string\)H264\,\ packetization-mode\=\(string\)1\,\ profile-level-id\=\(string\)4d4029\,\ sprop-parameter-sets\=\(string\)\"Z01AKZZUA8ARPyo\\\=\\\,aO44gA\\\=\\\=\"\,\ payload\=\(int\)96\,\ ssrc\=\(uint\)2631979269\,\ timestamp-offset\=\(uint\)952461032\,\ seqnum-offset\=\(uint\)20811\,\ a-framerate\=\(string\)30"                         
/GstPipeline:pipeline0/GstUDPSink:udpsink0.GstPad:sink: caps = "application/x-rtp\,\ media\=\(string\)video\,\ clock-rate\=\(int\)90000\,\ encoding-name\=\(string\)H264\,\ packetization-mode\=\(string\)1\,\ profile-level-id\=\(string\)4d4029\,\ sprop-parameter-sets\=\(string\)\"Z01AKZZUA8ARPyo\\\=\\\,aO44gA\\\=\\\=\"\,\ payload\=\(int\)96\,\ ssrc\=\(uint\)2631979269\,\ timestamp-offset\=\(uint\)952461032\,\ seqnum-offset\=\(uint\)20811\,\ a-framerate\=\(string\)30"
/GstPipeline:pipeline0/GstRtpH264Pay:rtph264pay0.GstPad:sink: caps = "video/x-h264\,\ stream-format\=\(string\)avc\,\ alignment\=\(string\)au\,\ width\=\(int\)1920\,\ height\=\(int\)1080\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ colorimetry\=\(string\)2:4:5:1\,\ framerate\=\(fraction\)30/1\,\ parsed\=\(boolean\)true\,\ profile\=\(string\)main\,\ level\=\(string\)4.1\,\ codec_data\=\(buffer\)014d4029ffe1000b674d4029965403c0113f2a01000468ee3880"
/GstPipeline:pipeline0/GstQueue:queue0.GstPad:sink: caps = "video/x-h264\,\ stream-format\=\(string\)avc\,\ alignment\=\(string\)au\,\ width\=\(int\)1920\,\ height\=\(int\)1080\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ colorimetry\=\(string\)2:4:5:1\,\ framerate\=\(fraction\)30/1\,\ parsed\=\(boolean\)true\,\ profile\=\(string\)main\,\ level\=\(string\)4.1\,\ codec_data\=\(buffer\)014d4029ffe1000b674d4029965403c0113f2a01000468ee3880"
/GstPipeline:pipeline0/GstRtpH264Pay:rtph264pay0: timestamp = 952535386
/GstPipeline:pipeline0/GstRtpH264Pay:rtph264pay0: seqnum = 20811

For some reason the code pasted with a ton of spaces after each line, and it put me over the character limit for a post. I had to remove those spaces, hopefully I didn’t screw anything up. Thanks!

As with most unix command-line programs, it’s not immediately obvious how to use screen sessions without reading the relevant manual. If you’re interested in how to use a command-line program on unix generally the first thing to try is man <name>, which opens the ‘man page’ (manual) if there is one. Then you scroll and/or use up/down arrow keys to navigate through that, and press q to quit :slight_smile:

Commands to control a screen session start with CTRL+a, and to enter or exit scrolling mode you can press Esc, so CTRL+a then Esc to start scrolling, and just Esc to stop when you’re done.

Shouldn’t make a difference - flashing is on the SD card, and I imagine the printer controller board just registers as a random peripheral that companion ignores.

This would imply that it’s starting out trying to connect to /dev/video4, which fails the h264 output check.

It then goes on to attempt a h264-stream connection to any other video devices (lexicographic sorting, so sorted like words rather than numbers: /dev/video0, 1, 10, 11, 12, 13, 14, 15, 16, 18), which all also fail to respond like a camera (those ones likely don’t exist), before getting to /dev/video2, which succeeds (hence the “Success!”). It then sets the framerate and attempts connection again, which also succeeds, so then it starts the stream, which also seems to work fine.

Was the video working properly at that point, or still doing the 1s stuttering? From the screen output I’d expect it to be working fine (perhaps the 3D printer board was interfering in some way?). If not, given /dev/video2 was the device that connected properly it might be worth trying to select that as the camera option on the web interface Camera page, so you can check if changing the settings there works/helps.

As a note, it’s very possible that /dev/video2 and /dev/video4 both refer to the same actual device - frequently the h264-encoded stream is registered as a separate video device to the more direct other encodings, but changing the settings on one will change them for the camera itself, so end up applying to both.

When I ran the command and got that code yesterday, the active camera was set to “/dev/video4” on the camera page, but there were no options in the dropdown to change it to anything else. I do see what you are talking about though in the code, where it tries video4 and then proceeds to go down the list after it fails.
It was still having the issue yesterday when I ran that code, and after. Also, I ran that code after a reboot.

I started the Raspberry Pi today, and the active camera now says “/dev/video2” on the camera page, but still having the issue. I ran the screen -r video command again, and it looks like it is still trying to start with “/dev/video4”, and then going down the list, eventually saying success on “/dev/video2”.

After saying success for video2, it then looks like it is starting video2 a couple more times, I assume setting the framerate and starting the stream, as you mentioned in your post.

Here’s the code from today, with the active camera set to /dev/video2 (I still can’t change it, only one option there). Not sure what is changing it from video2 to video4 etc…
Again, today I ran the code after initially starting up the Raspberry Pi

Still having the issue.


/dev/video0   /dev/video11  /dev/video14  /dev/video18
/dev/video1   /dev/video12  /dev/video15  /dev/video2
/dev/video10  /dev/video13  /dev/video16  /dev/video3
start video with width 1920 height 1080 framerate 30 device /dev/video4
Setting pipeline to PAUSED ...
ERROR: Pipeline doesn't want to pause.
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Cannot identify device '/dev/video4'.
Additional debug info:
v4l2_calls.c(606): gst_v4l2_open (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
system error: No such file or directory
Setting pipeline to NULL ...
Freeing pipeline ...
specified device /dev/video4 failed
attempting to start /dev/video0
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal data flow error.
Additional debug info:
gstbasesrc.c(2948): gst_base_src_loop (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
streaming task paused, reason not-negotiated (-4)
Execution ended after 0:00:00.244715297
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...
attempting to start /dev/video1
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal data flow error.
Additional debug info:
gstbasesrc.c(2948): gst_base_src_loop (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
streaming task paused, reason not-negotiated (-4)
Execution ended after 0:00:00.011873885
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...
attempting to start /dev/video10
Setting pipeline to PAUSED ...
ERROR: Pipeline doesn't want to pause.
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Device '/dev/video10' is not a capture device.
Additional debug info:
v4l2_calls.c(628): gst_v4l2_open (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
Capabilities: 0x84204000
Setting pipeline to NULL ...
Freeing pipeline ...
attempting to start /dev/video11
Setting pipeline to PAUSED ...
ERROR: Pipeline doesn't want to pause.
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Device '/dev/video11' is not a capture device.
Additional debug info:
v4l2_calls.c(628): gst_v4l2_open (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
Capabilities: 0x84204000
Setting pipeline to NULL ...
Freeing pipeline ...
attempting to start /dev/video12
Setting pipeline to PAUSED ...
ERROR: Pipeline doesn't want to pause.
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Device '/dev/video12' is not a capture device.
Additional debug info:
v4l2_calls.c(628): gst_v4l2_open (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
Capabilities: 0x84204000
Setting pipeline to NULL ...
Freeing pipeline ...
attempting to start /dev/video13
Setting pipeline to PAUSED ...
ERROR: Pipeline doesn't want to pause.
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Device '/dev/video13' is not a capture device.
Additional debug info:
v4l2_calls.c(628): gst_v4l2_open (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
Capabilities: 0x84200002
Setting pipeline to NULL ...
Freeing pipeline ...
attempting to start /dev/video14
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal data flow error.
Additional debug info:
gstbasesrc.c(2948): gst_base_src_loop (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
streaming task paused, reason not-negotiated (-4)
Execution ended after 0:00:00.000606350
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...
attempting to start /dev/video15
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal data flow error.
Additional debug info:
gstbasesrc.c(2948): gst_base_src_loop (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
streaming task paused, reason not-negotiated (-4)
Execution ended after 0:00:00.000978118
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...
attempting to start /dev/video16
Setting pipeline to PAUSED ...
ERROR: Pipeline doesn't want to pause.
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Device '/dev/video16' is not a capture device.
Additional debug info:
v4l2_calls.c(628): gst_v4l2_open (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
Capabilities: 0x84a00000
Setting pipeline to NULL ...
Freeing pipeline ...
attempting to start /dev/video18
Setting pipeline to PAUSED ...
ERROR: Pipeline doesn't want to pause.
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Device '/dev/video18' is not a capture device.
Additional debug info:
v4l2_calls.c(628): gst_v4l2_open (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
Capabilities: 0x84204000
Setting pipeline to NULL ...
Freeing pipeline ...
attempting to start /dev/video2
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
/GstPipeline:pipeline0/GstV4l2Src:v4l2src0.GstPad:src: caps = "video/x-h264\,\ stream-format\=\(string\)byte-stream\,\ alignment\=\(string\)au\,\ width\=\(int\)1920\,\ height\=\(int\)1080\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ colorimetry\=\(string\)2:4:5:1\,\ framerate\=\(fraction\)30/1"
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src: caps = "video/x-h264\,\ stream-format\=\(string\)byte-stream\,\ alignment\=\(string\)au\,\ width\=\(int\)1920\,\ height\=\(int\)1080\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ colorimetry\=\(string\)2:4:5:1\,\ framerate\=\(fraction\)30/1"
/GstPipeline:pipeline0/GstH264Parse:h264parse0.GstPad:sink: caps = "video/x-h264\,\ stream-format\=\(string\)byte-stream\,\ alignment\=\(string\)au\,\ width\=\(int\)1920\,\ height\=\(int\)1080\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ colorimetry\=\(string\)2:4:5:1\,\ framerate\=\(fraction\)30/1"
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:sink: caps = "video/x-h264\,\ stream-format\=\(string\)byte-stream\,\ alignment\=\(string\)au\,\ width\=\(int\)1920\,\ height\=\(int\)1080\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ colorimetry\=\(string\)2:4:5:1\,\ framerate\=\(fraction\)30/1"
/GstPipeline:pipeline0/GstH264Parse:h264parse0.GstPad:src: caps = "video/x-h264\,\ stream-format\=\(string\)avc\,\ alignment\=\(string\)au\,\ width\=\(int\)1920\,\ height\=\(int\)1080\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ colorimetry\=\(string\)2:4:5:1\,\ framerate\=\(fraction\)30/1\,\ parsed\=\(boolean\)true\,\ profile\=\(string\)main\,\ level\=\(string\)4.1\,\ codec_data\=\(buffer\)014d4029ffe1000b674d4029965403c0113f2a01000468ee3880"
/GstPipeline:pipeline0/GstQueue:queue0.GstPad:sink: caps = "video/x-h264\,\ stream-format\=\(string\)avc\,\ alignment\=\(string\)au\,\ width\=\(int\)1920\,\ height\=\(int\)1080\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ colorimetry\=\(string\)2:4:5:1\,\ framerate\=\(fraction\)30/1\,\ parsed\=\(boolean\)true\,\ profile\=\(string\)main\,\ level\=\(string\)4.1\,\ codec_data\=\(buffer\)014d4029ffe1000b674d4029965403c0113f2a01000468ee3880"
/GstPipeline:pipeline0/GstQueue:queue0.GstPad:sink: caps = "video/x-h264\,\ stream-format\=\(string\)avc\,\ alignment\=\(string\)au\,\ width\=\(int\)1920\,\ height\=\(int\)1080\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ colorimetry\=\(string\)2:4:5:1\,\ framerate\=\(fraction\)30/1\,\ parsed\=\(boolean\)true\,\ profile\=\(string\)main\,\ level\=\(string\)4.1\,\ codec_data\=\(buffer\)014d4029ffe1000b674d4029965403c0113f2a01000468ee3880"
/GstPipeline:pipeline0/GstRtpH264Pay:rtph264pay0.GstPad:src: caps = "application/x-rtp\,\ media\=\(string\)video\,\ clock-rate\=\(int\)90000\,\ encoding-name\=\(string\)H264\,\ packetization-mode\=\(string\)1\,\ profile-level-id\=\(string\)4d4029\,\ sprop-parameter-sets\=\(string\)\"Z01AKZZUA8ARPyo\\\=\\\,aO44gA\\\=\\\=\"\,\ payload\=\(int\)96\,\ ssrc\=\(uint\)3920285909\,\ timestamp-offset\=\(uint\)383893126\,\ seqnum-offset\=\(uint\)30062\,\ a-framerate\=\(string\)30"
/GstPipeline:pipeline0/GstFakeSink:fakesink0.GstPad:sink: caps = "application/x-rtp\,\ media\=\(string\)video\,\ clock-rate\=\(int\)90000\,\ encoding-name\=\(string\)H264\,\ packetization-mode\=\(string\)1\,\ profile-level-id\=\(string\)4d4029\,\ sprop-parameter-sets\=\(string\)\"Z01AKZZUA8ARPyo\\\=\\\,aO44gA\\\=\\\=\"\,\ payload\=\(int\)96\,\ ssrc\=\(uint\)3920285909\,\ timestamp-offset\=\(uint\)383893126\,\ seqnum-offset\=\(uint\)30062\,\ a-framerate\=\(string\)30"
/GstPipeline:pipeline0/GstRtpH264Pay:rtph264pay0.GstPad:sink: caps = "video/x-h264\,\ stream-format\=\(string\)avc\,\ alignment\=\(string\)au\,\ width\=\(int\)1920\,\ height\=\(int\)1080\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ colorimetry\=\(string\)2:4:5:1\,\ framerate\=\(fraction\)30/1\,\ parsed\=\(boolean\)true\,\ profile\=\(string\)main\,\ level\=\(string\)4.1\,\ codec_data\=\(buffer\)014d4029ffe1000b674d4029965403c0113f2a01000468ee3880"
/GstPipeline:pipeline0/GstRtpH264Pay:rtph264pay0: timestamp = 383965694
/GstPipeline:pipeline0/GstRtpH264Pay:rtph264pay0: seqnum = 30062
Got EOS from element "pipeline0".
Execution ended after 0:00:01.018415004
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...
Success!
Frame rate set to 30.000 fps
attempting device /dev/video2 with width 1920 height 1080 framerate 30 options ! h264parse ! queue ! rtph264pay config-interval=10 pt=96 ! udpsink host=192.168.2.1 port=5600
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
/GstPipeline:pipeline0/GstV4l2Src:v4l2src0.GstPad:src: caps = "video/x-h264\,\ stream-format\=\(string\)byte-stream\,\ alignment\=\(string\)au\,\ width\=\(int\)1920\,\ height\=\(int\)1080\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ colorimetry\=\(string\)2:4:5:1\,\ framerate\=\(fraction\)30/1"
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src: caps = "video/x-h264\,\ stream-format\=\(string\)byte-stream\,\ alignment\=\(string\)au\,\ width\=\(int\)1920\,\ height\=\(int\)1080\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ colorimetry\=\(string\)2:4:5:1\,\ framerate\=\(fraction\)30/1"
/GstPipeline:pipeline0/GstH264Parse:h264parse0.GstPad:sink: caps = "video/x-h264\,\ stream-format\=\(string\)byte-stream\,\ alignment\=\(string\)au\,\ width\=\(int\)1920\,\ height\=\(int\)1080\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ colorimetry\=\(string\)2:4:5:1\,\ framerate\=\(fraction\)30/1"
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:sink: caps = "video/x-h264\,\ stream-format\=\(string\)byte-stream\,\ alignment\=\(string\)au\,\ width\=\(int\)1920\,\ height\=\(int\)1080\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ colorimetry\=\(string\)2:4:5:1\,\ framerate\=\(fraction\)30/1"
/GstPipeline:pipeline0/GstH264Parse:h264parse0.GstPad:src: caps = "video/x-h264\,\ stream-format\=\(string\)avc\,\ alignment\=\(string\)au\,\ width\=\(int\)1920\,\ height\=\(int\)1080\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ colorimetry\=\(string\)2:4:5:1\,\ framerate\=\(fraction\)30/1\,\ parsed\=\(boolean\)true\,\ profile\=\(string\)main\,\ level\=\(string\)4.1\,\ codec_data\=\(buffer\)014d4029ffe1000b674d4029965403c0113f2a01000468ee3880"
/GstPipeline:pipeline0/GstQueue:queue0.GstPad:src: caps = "video/x-h264\,\ stream-format\=\(string\)avc\,\ alignment\=\(string\)au\,\ width\=\(int\)1920\,\ height\=\(int\)1080\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ colorimetry\=\(string\)2:4:5:1\,\ framerate\=\(fraction\)30/1\,\ parsed\=\(boolean\)true\,\ profile\=\(string\)main\,\ level\=\(string\)4.1\,\ codec_data\=\(buffer\)014d4029ffe1000b674d4029965403c0113f2a01000468ee3880"
/GstPipeline:pipeline0/GstRtpH264Pay:rtph264pay0.GstPad:src: caps = "application/x-rtp\,\ media\=\(string\)video\,\ clock-rate\=\(int\)90000\,\ encoding-name\=\(string\)H264\,\ packetization-mode\=\(string\)1\,\ profile-level-id\=\(string\)4d4029\,\ sprop-parameter-sets\=\(string\)\"Z01AKZZUA8ARPyo\\\=\\\,aO44gA\\\=\\\=\"\,\ payload\=\(int\)96\,\ ssrc\=\(uint\)3092305727\,\ timestamp-offset\=\(uint\)172045509\,\ seqnum-offset\=\(uint\)3618\,\ a-framerate\=\(string\)30"
/GstPipeline:pipeline0/GstFakeSink:fakesink0.GstPad:sink: caps = "application/x-rtp\,\ media\=\(string\)video\,\ clock-rate\=\(int\)90000\,\ encoding-name\=\(string\)H264\,\ packetization-mode\=\(string\)1\,\ profile-level-id\=\(string\)4d4029\,\ sprop-parameter-sets\=\(string\)\"Z01AKZZUA8ARPyo\\\=\\\,aO44gA\\\=\\\=\"\,\ payload\=\(int\)96\,\ ssrc\=\(uint\)3092305727\,\ timestamp-offset\=\(uint\)172045509\,\ seqnum-offset\=\(uint\)3618\,\ a-framerate\=\(string\)30"
/GstPipeline:pipeline0/GstRtpH264Pay:rtph264pay0.GstPad:sink: caps = "video/x-h264\,\ stream-format\=\(string\)avc\,\ alignment\=\(string\)au\,\ width\=\(int\)1920\,\ height\=\(int\)1080\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ colorimetry\=\(string\)2:4:5:1\,\ framerate\=\(fraction\)30/1\,\ parsed\=\(boolean\)true\,\ profile\=\(string\)main\,\ level\=\(string\)4.1\,\ codec_data\=\(buffer\)014d4029ffe1000b674d4029965403c0113f2a01000468ee3880"
/GstPipeline:pipeline0/GstQueue:queue0.GstPad:sink: caps = "video/x-h264\,\ stream-format\=\(string\)avc\,\ alignment\=\(string\)au\,\ width\=\(int\)1920\,\ height\=\(int\)1080\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ colorimetry\=\(string\)2:4:5:1\,\ framerate\=\(fraction\)30/1\,\ parsed\=\(boolean\)true\,\ profile\=\(string\)main\,\ level\=\(string\)4.1\,\ codec_data\=\(buffer\)014d4029ffe1000b674d4029965403c0113f2a01000468ee3880"
/GstPipeline:pipeline0/GstRtpH264Pay:rtph264pay0: timestamp = 172117922
/GstPipeline:pipeline0/GstRtpH264Pay:rtph264pay0: seqnum = 3618
Got EOS from element "pipeline0".
Execution ended after 0:00:01.057488041
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...
starting device /dev/video2 with width 1920 height 1080 framerate 30 options ! h264parse ! queue ! rtph264pay config-interval=10 pt=96 ! udpsink host=192.168.2.1 port=5600
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
/GstPipeline:pipeline0/GstV4l2Src:v4l2src0.GstPad:src: caps = "video/x-h264\,\ stream-format\=\(string\)byte-stream\,\ alignment\=\(string\)au\,\ width\=\(int\)1920\,\ height\=\(int\)1080\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ colorimetry\=\(string\)2:4:5:1\,\ framerate\=\(fraction\)30/1"
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src: caps = "video/x-h264\,\ stream-format\=\(string\)byte-stream\,\ alignment\=\(string\)au\,\ width\=\(int\)1920\,\ height\=\(int\)1080\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ colorimetry\=\(string\)2:4:5:1\,\ framerate\=\(fraction\)30/1"
/GstPipeline:pipeline0/GstH264Parse:h264parse0.GstPad:sink: caps = "video/x-h264\,\ stream-format\=\(string\)byte-stream\,\ alignment\=\(string\)au\,\ width\=\(int\)1920\,\ height\=\(int\)1080\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ colorimetry\=\(string\)2:4:5:1\,\ framerate\=\(fraction\)30/1"
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:sink: caps = "video/x-h264\,\ stream-format\=\(string\)byte-stream\,\ alignment\=\(string\)au\,\ width\=\(int\)1920\,\ height\=\(int\)1080\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ colorimetry\=\(string\)2:4:5:1\,\ framerate\=\(fraction\)30/1"
/GstPipeline:pipeline0/GstH264Parse:h264parse0.GstPad:src: caps = "video/x-h264\,\ stream-format\=\(string\)avc\,\ alignment\=\(string\)au\,\ width\=\(int\)1920\,\ height\=\(int\)1080\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ colorimetry\=\(string\)2:4:5:1\,\ framerate\=\(fraction\)30/1\,\ parsed\=\(boolean\)true\,\ profile\=\(string\)main\,\ level\=\(string\)4.1\,\ codec_data\=\(buffer\)014d4029ffe1000b674d4029965403c0113f2a01000468ee3880"
/GstPipeline:pipeline0/GstQueue:queue0.GstPad:sink: caps = "video/x-h264\,\ stream-format\=\(string\)avc\,\ alignment\=\(string\)au\,\ width\=\(int\)1920\,\ height\=\(int\)1080\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ colorimetry\=\(string\)2:4:5:1\,\ framerate\=\(fraction\)30/1\,\ parsed\=\(boolean\)true\,\ profile\=\(string\)main\,\ level\=\(string\)4.1\,\ codec_data\=\(buffer\)014d4029ffe1000b674d4029965403c0113f2a01000468ee3880"
/GstPipeline:pipeline0/GstQueue:queue0.GstPad:sink: caps = "video/x-h264\,\ stream-format\=\(string\)avc\,\ alignment\=\(string\)au\,\ width\=\(int\)1920\,\ height\=\(int\)1080\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ colorimetry\=\(string\)2:4:5:1\,\ framerate\=\(fraction\)30/1\,\ parsed\=\(boolean\)true\,\ profile\=\(string\)main\,\ level\=\(string\)4.1\,\ codec_data\=\(buffer\)014d4029ffe1000b674d4029965403c0113f2a01000468ee3880"
/GstPipeline:pipeline0/GstRtpH264Pay:rtph264pay0.GstPad:src: caps = "application/x-rtp\,\ media\=\(string\)video\,\ clock-rate\=\(int\)90000\,\ encoding-name\=\(string\)H264\,\ packetization-mode\=\(string\)1\,\ profile-level-id\=\(string\)4d4029\,\ sprop-parameter-sets\=\(string\)\"Z01AKZZUA8ARPyo\\\=\\\,aO44gA\\\=\\\=\"\,\ payload\=\(int\)96\,\ ssrc\=\(uint\)1551084166\,\ timestamp-offset\=\(uint\)1625779770\,\ seqnum-offset\=\(uint\)9075\,\ a-framerate\=\(string\)30"
/GstPipeline:pipeline0/GstUDPSink:udpsink0.GstPad:sink: caps = "application/x-rtp\,\ media\=\(string\)video\,\ clock-rate\=\(int\)90000\,\ encoding-name\=\(string\)H264\,\ packetization-mode\=\(string\)1\,\ profile-level-id\=\(string\)4d4029\,\ sprop-parameter-sets\=\(string\)\"Z01AKZZUA8ARPyo\\\=\\\,aO44gA\\\=\\\=\"\,\ payload\=\(int\)96\,\ ssrc\=\(uint\)1551084166\,\ timestamp-offset\=\(uint\)1625779770\,\ seqnum-offset\=\(uint\)9075\,\ a-framerate\=\(string\)30"
/GstPipeline:pipeline0/GstRtpH264Pay:rtph264pay0.GstPad:sink: caps = "video/x-h264\,\ stream-format\=\(string\)avc\,\ alignment\=\(string\)au\,\ width\=\(int\)1920\,\ height\=\(int\)1080\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ colorimetry\=\(string\)2:4:5:1\,\ framerate\=\(fraction\)30/1\,\ parsed\=\(boolean\)true\,\ profile\=\(string\)main\,\ level\=\(string\)4.1\,\ codec_data\=\(buffer\)014d4029ffe1000b674d4029965403c0113f2a01000468ee3880"
/GstPipeline:pipeline0/GstRtpH264Pay:rtph264pay0: timestamp = 1625852328
/GstPipeline:pipeline0/GstRtpH264Pay:rtph264pay0: seqnum = 9075

Here’s a screenshot of the camera section from today, with only /dev/video2 in the dropdown.

Definitely odd - once again the video screen message log seems to end up in a position where the video is streaming fine.

By “some dev build”, did you mean actually some dev build, or 4.1.4? If you haven’t tried 4.1.4 yet then I’d suggest trying that out, and testing the different “Video decode priority” options (General tab of Application Settings (click purple QGC logo in the top left corner)).

If that doesn’t help then I’ll ask the software team if they’ve got any ideas that I haven’t already, and if not we might need to set up a call or something next week to see if there’s anything particularly weird going on with your system.

The dev build was version: Development HEAD:f9ebc2720 2021-08-31 06:55:11 +0000 which I believe I got to from some google search. I think I also tried 4.0.6 at some point.

Here’s what I tried tonight:

  • Installed QGC 4.1.4 (from the link you provided) on my desktop computer rather than my laptop.
  • Tried all of the options for the “Video decode priority”, restarting QGC each time.
  • Also tried changing the file format in QGC from mkv to mp4, turning off low latency mode, each time restarting QGC.
  • Flashed a fresh install of the companion software onto the SD card, and tried version 0.0.22, 0.0.29, 0.0.30.

None of those changes made any difference, still the same behavior as before.

If you could ask the software team that would be great, and we can try some things they come up with.
Beyond that I don’t know if it’s worth it to you guys to pursue, as it’s not even a BR camera or product.

If your team would like to keep investigating the issue beyond that to find the root of the problem, or to potentially avoid issues in the future with other folks, then great!
If at that point it’s not worth it to you to keep investigating though, I understand and I can return the camera and get a different option, whether it’s the BR camera or whatnot.

I really do appreciate your efforts here, just don’t want you to feel like you’re wasting your time on it or anything. I’ll keep trying things as long as you want to, but just let me know when it’s a lost cause and I’ll send it back or find a different use for it. :slight_smile: Thanks!

That seems reasonably comprehensive - a shame those options didn’t help. I’ve asked the software team if they’ve got any ideas.

One more (unlikely to help but worth a check) option from my end is to get the sdp file from http://192.168.2.2:2770/vlc.sdp, and try running it using VLC (VideoLan). It should have basically the same video display as what QGC gets via gstreamer, but doesn’t hurt to try another video player just in case QGC or gstreamer are doing something weird/unexpected.

It may also be worth trying another topside computer if that’s possible - although given it worked fine with the RPi camera then I don’t expect it’s likely to be a magic bullet.

I’d be interested to know if the same issue occurs via our companion beta software, which uses a different program for managing cameras than the current companion. If that does happen to solve the issue I still wouldn’t recommend using it in production/for work purposes (given it’s intentionally unstable beta software), but at least that would be another known benefit of the way things are going :slight_smile:

I appreciate your understanding that we don’t have infinite resources. We’ll continue suggesting things to try while we can think them, and hopefully we can help you solve the issue, but if we run out of ideas before the problem is solved then we’ll just have to ask you to try a different camera :slight_smile:

Ran the stream with VLC, I was able to see the image, but it was immediately frozen until I restarted the stream in VLC, then it would update to a recent frame and freeze again. Not sure if I screwed something up here, I pretty much left the settings on default.

I have tried using both my desktop and laptop computer, no difference. I could try a different Raspberry Pi sometime this week, I’d need to get it from my brother’s house.

I got the beta software installed, and also got the stream playing in QGC. Issue seems exactly the same, only updating every second or so.

I did notice that the beta companion software is giving me an error notification every few seconds saying that it could not fetch the current autopilot platform, and it could not fetch available MAVLink endpoints.
I assume that’s because I don’t have a Pixhawk yet to connect to the Raspberry Pi. However, would this checking / notification process be interrupting the camera stream and causing the issue? Not sure if that could be related or if they’re completely separate, but it’s something I noticed.
I should be receiving the Pixhawk sometime in the next 2 weeks, it’s somewhere in shipping.

On another note, the beta companion software looks great! I did have some issues getting it to connect to the topside computer (had to restart a few times, reflash the image, etc) but it’s a beta version, so…
Looks like it’s going in a great direction though, adding a ton of functionality, nice UI etc. I’m excited for the full release!

Sounds good! The return window for the camera goes through the end of January 2022, so I’m not worried in that regard. I will probably get the BR camera as well when I place my order for other parts, and then if we do get this one working I’ll use it as a second camera, and if we don’t get it working I’ll return it.

Thanks!

I spoke with the software team today, and they were quite surprised that VLC at least wasn’t working, since it tends to be really robust at receiving streams.

A few suggestions, if you’d like to try them:

  • run gstreamer with more verbose logging, (e.g. GST_DEBUG=5 or 6)
    • go to webterminal/ssh (companion 0, not beta)
    • nano companion/scripts/start_video.sh to edit the video file
    • change this line to be
      bash -c "export GST_DEBUG=5 && export LD_LIBRARY_...<rest of existing stuff>"
      
    • restart companion, and see whether there’s anything interesting in the video screen session (it will likely have a lot more in it)
  • try receiving the stream with gstreamer on the topside (you’ll likely need to install it), potentially also using GST_DEBUG
    set GST_DEBUG=5
    gst-launch-1.0 udpsrc port=5600 ! application/x-rtp, payload=96 ! rtpjitterbuffer ! rtph264depay ! h264parse ! avdec_h264 ! autovideosink
    
  • instead of streaming to the topside, try streaming to a file on companion, which can then be analysed with ffmpeg
    gst-launch-1.0 -v v4l2src device=/dev/video2 do-timestamp=true ! video/x-h264, width=1920, height=1080, framerate=30/1 ! h264parse ! queue ! mp4mux ! filesink location=file.mp4
    

The fair point was also made that octoprint is almost certainly using the mjpg-encoded stream instead of the h264 one, so that’s not a particularly meaningful datapoint of “the camera works with other software” kind of thing (we still don’t know if the h264 encoding works properly) :slight_smile:

Tried both 5 and 6, and viewed the screen session each time. It definitely had more in it lol, but it is continuously scrolling at a million miles an hour. More on this below.

I installed gstreamer on the topside, and I was able to get the stream going through that, however it has the same behavior.
When using GST_DEBUG I got the same continuously scrolling output as before (on the topside this time), but I was able to stop it and copy like 4000 lines of the output to notepad++ so I could take a look at it.

After looking at it, I’m unable to make any sense of the output, and I’ll readily admit that it’s far beyond my knowledge. :grin:

I didn’t even think about that, but after looking it up I think your right and it is using mjpg streamer. After seeing that, I think there has to be something wrong with the camera itself when using h264 or some sort of incompatibility with how it was implemented by arducam. I’m just gonna send the darn thing back at this point.

That being said, I really appreciate you taking the time to help me troubleshoot this and trying to get the issue figured out, even though it didn’t end up working in the end. Thank you!

1 Like