2014-10-19 75 views
1

我試圖用gmpreamer(v0.10)將.ogv文件與.mp3文件複合成一個.ogv唯一的視頻文件 以獲得包含視頻和音頻的.ogv文件。我嘗試這條管道:如何在gstreamer中複用音頻和視頻

gst-launch-0.10 filesrc location="video.ogv" ! oggdemux ! queue ! oggmux name=mux ! filesink location="test.ogv" filesrc location="audio.mp3" ! audioconvert ! vorbisenc ! queue ! mux. 

當我使用這個命令行,我得到一個錯誤:

ERROR : of element /GstPipeline:pipeline0/GstAudioConvert:audioconvert0 : not negotiated 
Additional debogging information : 
gstbasetransform.c(2541): gst_base_transform_handle_buffer(): /GstPipeline:pipeline0/GstAudioConvert:audioconvert0: 
not negotiated 
ERROR : the pipeline refuse to pass in preparation phase 

我看不出有什麼不對。任何建議? 謝謝。

回答

3

您需要在filesrc和audioconvert之間添加MP3解碼器,或者只需在解碼器中添加MP3解碼器。

gst-launch-0.10 filesrc location="video.ogv" ! oggdemux ! queue ! oggmux name=mux ! filesink location="test.ogv" 
    filesrc location="audio.mp3" ! decodebin ! audioconvert ! vorbisenc ! queue ! mux. 
+0

非常感謝,它完美的工作! – oxwrite 2014-10-19 14:13:39