我正在使用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!排队! MUX。 alsasrc num-buffers = -1 typefind = TRUE do-timestamp = TRUE! audio / x-raw-int,width = 16!排队! TIAudenc1 codecName = aaclcenc engineName = codecServer genTimeStamps = true name = aenc!排队! MUX。 avimux name = mux! filesink location = vidaudtest.avi sync = 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.
还有其他人看过这种行为吗?任何想法或解决方案?
答案 0 :(得分: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' ! ...