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:使用 h264_v4l2m2m 将原始视频编码为 H.264时、FFmpeg 卡在`ppoll` syscall 上

Guru**** 2323210 points
请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1522783/am62p-ffmpeg-is-stuck-on-the-ppoll-syscall-when-encoding-raw-video-into-h-264-using-h264_v4l2m2m

部件号:AM62P

工具/软件:

我正在使用 C++开发一个简单的应用程序、将原始视频流编码为 H.264、使用 Wave5加速编码。 我正在使用 libavcodec(以及所有其他姊妹库)来访问 wave5,特别是使用 h264_v4l2m2m 编码器。

我注意到avcodec_send_frame功能冻结了。 这是因为它一直在等待事件:

ppoll ([{FD=5、Events=Pollin|POLLPRI|POLLOUT|POLLLRDNORM|POLLWRNORM}]、1、NULL、NULL、 0

起初,我认为这是我的一个错误,但后来我设法重现冻结使用这个 ffmpeg 命令从 yocto Scarthgap 上的 CLI :

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

我不确定我可以链接我使用的原始视频文件、但如果您需要准确的视频、它很容易在互联网上发现。

——

对于仔细检查、我编写了一个 GStreamer 流水线以实现相同的目标、它得到了:

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