在 GStreamer 中混合音频和视频冻结
Posted
技术标签:
【中文标题】在 GStreamer 中混合音频和视频冻结【英文标题】:Muxing audio and video in GStreamer freezes 【发布时间】:2014-04-09 10:20:06 【问题描述】:谁能提供混合视频和音频的工作管道示例?我找到了一个 here 并尝试更改它以使用我需要的编码器,但它似乎不起作用。
管道如下所示:
gst-launch -v v4l2src always-copy=true num-buffers=200 input-src=composite ! \
"video/x-raw-yuv,format=(fourcc)NV12,width=480,height=320" ! \
TIVidenc1 codecName=h264enc engineName=codecServer byteStream=FALSE ! \
queue ! muxer. \
alsasrc num-buffers=200 ! "audio/x-raw-int,width=16" ! \
TIAudenc1 codecName=aaclcenc engineName=codecServer ! queue ! muxer. \
avimux name=muxer ! filesink location=output_cap_.avi
当我运行此管道时,它会冻结。这是输出:
(gst-launch-0.10:1792): GStreamer-WARNING **: External plugin loader failed. This most likely means that the plugin loader helper binar
y was not found or could not be run. If you are running an uninstalled GStreamer setup, you might need to update your gst-uninstalled s
cript so that the GST_PLUGIN_SCANNER environment variable gets set.
(gst-launch-0.10:1792): GStreamer-WARNING **: Failed to load plugin '/opt/gstreamer/lib/gstreamer-0.10/libgstmad.so': /opt/gstreamer/li
b/libid3tag.so.0: undefined symbol: id3_frametype_obsolete
Setting pipeline to PAUSED ...
davinci_resizer davinci_resizer.2: RSZ_G_CONFIG:0:1:124
davinci_previewer davinci_previewer.2: ipipe_set_preview_config
vpfe-capture vpfe-capture: IPIPE Chained
vpfe-capture vpfe-capture: Resizer present
EVM: switch to tvp5146 SD video input
tvp514x 1-005d: tvp5146 (Version - 0x03) found at 0xba (DaVinci I2C adapter)
tvp514x 1-005d: invalid control id 9963780
tvp514x 1-005d: invalid control id 9963781
tvp514x 1-005d: invalid control id 9963782
tvp514x 1-005d: invalid control id 9963783
tvp514x 1-005d: invalid control id 9963784
tvp514x 1-005d: invalid control id 9963785
tvp514x 1-005d: invalid control id 9963786
tvp514x 1-005d: invalid control id 9963787
tvp514x 1-005d: invalid control id 9963788
tvp514x 1-005d: invalid control id 9963789
tvp514x 1-005d: invalid control id 9963790
tvp514x 1-005d: invalid control id 9963791
tvp514x 1-005d: invalid control id 9963792
tvp514x 1-005d: invalid control id 9963793
tvp514x 1-005d: invalid control id 9963795
tvp514x 1-005d: invalid control id 9963796
tvp514x 1-005d: invalid control id 9963797
tvp514x 1-005d: invalid control id 9963798
tvp514x 1-005d: invalid control id 9963799
tvp514x 1-005d: invalid control id 9963800
tvp514x 1-005d: invalid control id 9963801
tvp514x 1-005d: invalid control id 9963802
tvp514x 1-005d: invalid control id 9963803
tvp514x 1-005d: invalid control id 9963804
tvp514x 1-005d: invalid control id 9963805
tvp514x 1-005d: invalid control id 9963806
tvp514x 1-005d: invalid control id 9963807
tvp514x 1-005d: invalid control id 9963808
tvp514x 1-005d: invalid control id 9963809
/GstPipeline:pipeline0/GstAlsaSrc:alsasrc0: actual-buffer-time = 200000
/GstPipeline:pipeline0/GstAlsaSrc:alsasvpfe-capture vpfe-capture: width = 1, height = 1, bpp = 2
rc0: actual-latevpfe-capture vpfe-capture: adjusted width = 16, height = 2, bpp = 2, bytesperline = 32, sizeimage = 64
ncy-time = 10000
/GstPipeline:pipeline0/GstAlsavpfe-capture vpfe-capture: width = 32768, height = 32768, bpp = 2
Src:alsasrc0.Gstvpfe-capture vpfe-capture: adjusted width = 2176, height = 1536, bpp = 2, bytesperline = 4352, sizeimage = 6684672
Pad:src: caps = vpfe-capture vpfe-capture: width = 1, height = 1, bpp = 1
audio/x-raw-int,vpfe-capture vpfe-capture: adjusted width = 32, height = 2, bpp = 1, bytesperline = 32, sizeimage = 96
endianness=(int)1234, signed=(boolean)true, widvpfe-capture vpfe-capture: width = 32768, height = 32768, bpp = 1
th=(int)16, deptvpfe-capture vpfe-capture: adjusted width = 2176, height = 1536, bpp = 1, bytesperline = 2176, sizeimage = 5013504
h=(int)16, rate=(int)44100, channels=(int)2
vpfe-capture vpfe-capture: width = 480, height = 320, bpp = 1
vpfe-capture vpfe-capture: adjusted width = 480, height = 320, bpp = 1, bytesperline = 480, sizeimage = 230400
/GstPipeline:pipeline0/GstV4l2Src:v4l2src0: queue-size = 3
/GstPipeline:pipeline0/GstV4l2Src:v4l2src0.GstPad:src: caps = video/x-raw-yuv, format=(fourcc)NV12, framerate=(fraction)25/1, width=(in
t)480, height=(int)320
Pipeline is live and does not need PREROLL ...
WARNING: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Video input device did not accept new frame rate setting.
Additional debug info:
v4l2src_calls.c(342): gst_v4l2src_set_capture (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
system error: Invalid argument
Setting pipeline to PLAYING ...
New clock: GstAudiosrcClock
/GstPipeline:pipeline0/GstCapsFilter:capsfilter1.GstPad:src: caps = audio/x-raw-int, endianness=(int)1234, signed=(boolean)true, width=
(int)16, depth=(int)16, rate=(int)44100, channels=(int)2
/GstPipeline:pipeline0/GstCapsFilter:capsfilter1.GstPad:sink: caps = audio/x-raw-int, endianness=(int)1234, signed=(boolean)true, width
=(int)16, depth=(int)16, rate=(int)44100, channels=(int)2
/GstPipeline:pipeline0/GstCapsFilter:capsfilter1.GstPad:sink: caps = audio/x-raw-int, endianness=(int)1234, signed=(boolean)true, width
=(int)16, depth=(int)16, rate=(int)44100, channels=(int)2
/GstPipeline:pipeline0/GstTIAudenc1:tiaudenc10.GstPad:sink: caps = audio/x-raw-int, endianness=(int)1234, signed=(boolean)true, width=(
int)16, depth=(int)16, rate=(int)44100, channels=(int)2
/GstPipeline:pipeline0/GstTIAudenc1:tiaudenc10.GstPad:src: caps = audio/mpeg, mpegversion=(int)4, channels=(int)2, rate=(int)44100, bit
rate=(int)64000
/GstPipeline:pipeline0/GstQueue:queue1.GstPad:sink: caps = audio/mpeg, mpegversion=(int)4, channels=(int)2, rate=(int)44100, bitrate=(i
nt)64000
/GstPipeline:pipeline0/GstQueue:queue1.GstPad:src: caps = audio/mpeg, mpegversion=(int)4, channels=(int)2, rate=(int)44100, bitrate=(in
t)64000
/GstPipeline:pipeline0/GstTIVidenc1:tividenc10.GstPad:src: caps = video/x-h264, framerate=(fraction)30000/1001, width=(int)480, height=
(int)320, codec_data=(buffer)01640028ffe1005967640028ad84054562b8ac5474202a2b15c562a3a1015158ae2b151d080a8ac57158a8e84054562b8ac5474202
a2b15c562a3a10248521393c9f27e4fe4fc9f279b9b34d081242909c9e4f93f27f27e4f93cdcd9a6b40f053201000468ee3cb0
/GstPipeline:pipeline0/GstQueue:queue0.GstPad:sink: caps = video/x-h264, framerate=(fraction)30000/1001, width=(int)480, height=(int)32
0, codec_data=(buffer)01640028ffe1005967640028ad84054562b8ac5474202a2b15c562a3a1015158ae2b151d080a8ac57158a8e84054562b8ac5474202a2b15c5
62a3a10248521393c9f27e4fe4fc9f279b9b34d081242909c9e4f93f27f27e4f93cdcd9a6b40f053201000468ee3cb0
/GstPipeline:pipeline0/GstQueue:queue0.GstPad:src: caps = video/x-h264, framerate=(fraction)30000/1001, width=(int)480, height=(int)320
, codec_data=(buffer)01640028ffe1005967640028ad84054562b8ac5474202a2b15c562a3a1015158ae2b151d080a8ac57158a8e84054562b8ac5474202a2b15c56
2a3a10248521393c9f27e4fe4fc9f279b9b34d081242909c9e4f93f27f27e4f93cdcd9a6b40f053201000468ee3cb0
/GstPipeline:pipeline0/GstAviMux:muxer.GstPad:video_00: caps = video/x-h264, framerate=(fraction)30000/1001, width=(int)480, height=(in
t)320, codec_data=(buffer)01640028ffe1005967640028ad84054562b8ac5474202a2b15c562a3a1015158ae2b151d080a8ac57158a8e84054562b8ac5474202a2b
15c562a3a10248521393c9f27e4fe4fc9f279b9b34d081242909c9e4f93f27f27e4f93cdcd9a6b40f053201000468ee3cb0
有很多硬件特定的东西,但也许我只是使用了错误的语法。
【问题讨论】:
【参考方案1】:我不知道到底是什么问题,但我想指出您链接的 avimux 示例适用于 gstreamer-1.0(它适用于我)。但是,我看到您使用的 gstreamer 0.10 现在已经很老了。如果可能,请尝试升级到最新版本,看看是否有帮助。
【讨论】:
无法升级,没有足够的时间和知识来移植第三方插件。以上是关于在 GStreamer 中混合音频和视频冻结的主要内容,如果未能解决你的问题,请参考以下文章