Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 4906

Troubleshooting • Re: gstreamer v4l2h264enc not working in recent kernel 6..6

$
0
0
This is kinda embarrassing. I booted up one older rpi4 with kernel (6.1.0-rpi4-rpi-v8) I think that's Bookworm? Flashed from PI Imager in 10/2023. The gstreamer script on there also halts on 0.00:01, no updated packages at all just booted the rpi4 and I am sure this has been working before it was a plug-n play where the rpi4 is connected to HDMI and the stream was visible on a local server.

With your suggestion above I was able to make this pipeline progress past 0:00:01 when I pipe it to a filesink.

Code:

gst-launch-1.0 -v v4l2src device=/dev/video0 ! 'video/x-raw, width=800, height=600, framerate=20/1, format=YUY2' ! videoconvert ! v4l2h264enc ! 'video/x-h264,level=(string)3.2' ! filesink location=video.xyz
which is something I wasn't able to do before (I still can't play a H264 file).

Any idea how to debug every step of the gstreamer pipeline or any idea where to go from here?

one other attempt I was doing is to use ffmpeg:

Code:

ffmpeg -f v4l2 -framerate 20 -video_size 800x600 -i /dev/video0 -vcodec h264_v4l2m2m -b:v 1000K -maxrate 1200K -bufsize 500K -f rtsp -rtsp_transport tcp rtsp://localhost:8554/test
this works in terms of hardware encoding (very minmal CPU use) but this stream crashes after 3-5 minutes with error:

Code:

[h264_v4l2m2m @ 0x55821d7e80] Failed to get buffer for src frame: Resource temporarily unavailable    Last message repeated 2 times[h264_v4l2m2m @ 0x55821d7e80] V4L2 capture poll unexpected timeout: events=0x145[h264_v4l2m2m @ 0x55821d7e80] Failed to get buffer for src frame: Resource temporarily unavailable[h264_v4l2m2m @ 0x55821d7e80] V4L2 capture poll unexpected timeout: events=0x145[h264_v4l2m2m @ 0x55821d7e80] Failed to get buffer for src frame: Resource temporarily unavailable[h264_v4l2m2m @ 0x55821d7e80] V4L2 capture poll unexpected timeout: events=0x145Error submitting video frame to the encoder:03:04.70 bitrate=N/A dup=0 drop=2 speed=0.974xConversion failed!
Thank you so much for your help.

Statistics: Posted by hak89 — Tue Mar 19, 2024 7:55 pm



Viewing all articles
Browse latest Browse all 4906

Trending Articles