This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM62P: ffmpeg is stuck on the `ppoll` syscall when encoding raw video into H.264 using h264_v4l2m2m

Part Number: AM62P

Tool/software:

I'm developing a simple application in C++ to encode a raw video stream into H.264, using wave5 for accelerating the encoding. I'm using libavcodec (along with all the other sister libraries) to access the wave5, in particular using the h264_v4l2m2m encoder.

I noticed that the avcodec_send_frame function freezes. That's because it is stuck waiting for events:

ppoll([{fd=5, events=POLLIN|POLLPRI|POLLOUT|POLLRDNORM|POLLWRNORM}], 1, NULL, NULL, 0

At first I thought it's a bug of mine, but then I managed to reproduce the freeze with this ffmpeg command from CLI on Yocto Scarthgap:

ffmpeg -f rawvideo -pix_fmt yuv420p -s:v 352x288 -r 30 -i BUS_352x288_30_orig_01.yuv -c:v h264_v4l2m2m /tmp/out.h264

I'm not sure I can link the raw video file I used, but it's easily discoverable on the internet should you need that exact video.

---

For double checking, I wrote a Gstreamer pipeline to achieve the same goal, and it works:

gst-launch-1.0 filesrc location=BUS_352x288_30_orig_01.yuv ! rawvideoparse width=352 height=288 format=i420 framerate=30/1 colorimetry=bt709 ! v4l2h264enc ! filesink location=/tmp/out.h264 sync=true