3

我正在使用 TI DM365 EVM 来录制视频和音频。我需要对这两个流进行编码并将它们保存在 .avi 或 .mp4 等容器文件中。我正在使用以下 gstreamer 管道:

gst-launch v4l2src always-copy=FALSE num-buffers=-1 do-timestamp=TRUE !'video/x-raw-yuv,format=(fourcc)NV12,width=1280,height=720,framerate=30/1' !队列 !TIVidenc1 codecName=h264enc engineName=codecServer byteStream=false genTimeStamps=true !队列 !多路复用器。alsasrc num-buffers=-1 typefind=TRUE do-timestamp=TRUE !音频/x-raw-int,宽度=16 !队列 !TIAudenc1 codecName=aaclcenc engineName=codecServer genTimeStamps=true name=aenc!队列 !多路复用器。avimux 名称=多路复用器!文件接收器位置=vidaudtest.avi 同步=true

结果是我得到了一个 .avi 文件,但是当我使用 Totem Movie Player 在 PC 上播放该文件时,视频播放速度过快,而音频则以正常速度播放。例如,在一个 5 分钟的文件中,视频在 40 秒内播放完毕。

此外,在录制时,我收到以下几条消息:

WARNING: from element /GstPipeline:pipeline0/GstAlsaSrc:alsasrc0: Can't record audio fast enough
Additional debug info:
gstbaseaudiosrc.c(822): gst_base_audio_src_create (): /GstPipeline:pipeline0/GstAlsaSrc:alsasrc0:
Dropped 33516 samples. This is most likely because downstream can't keep up and is consuming samples too slowly.

有没有其他人看到过这种行为?有什么想法或解决方案吗?

4

1 回答 1

0

我想问题是您的设备无法以您要求的速率传送帧。一个可能的解决方案是通过一个videorate元素运行它来“重新采样”您的视频流:

v4l2src ! 'video/x-raw-yuv,format=(fourcc)NV12,width=1280,height=720' ! videorate force-fps=30  ! ...

更新:或者这样的东西也可以工作:

... ! 'video/x-raw-yuv,format=(fourcc)NV12,width=1280,height=720' ! videorate ! 'video/x-raw-yuv,framerate=(fraction)30/1' ! ...
于 2012-10-23T07:06:58.227 回答