2011-01-10 277 views
8

的文檔GStreamer令人困惑。這仍然是訴諸StackOverflow.com沒有任何藉口,但還是:使用GStreamer將視頻轉換爲WebM

什麼的GStreamer命令行轉換任何視頻文件(從任何格式)的WebM(+ WebM的音頻)?

This is the only documentation with examples I could find

我在gst-launch-0.10 webmmux name=mux ! filesrc location=oldfile.ext ! filesink location=newfile.webm ! name=demux ! demux. ! ffmpegcolorspace ! vp8enc ! queue ! mux.video_0 ! demux. ! progressreport ! audioconvert ! audiorate ! vorbisenc ! queue ! mux.audio_0

地方卡住我得到一個WARNING: erroneous pipeline: link without source element不知道如何讓這件事去。

這很令人沮喪。

請幫忙,謝謝。 :)

回答

17

您的管道元素全部不按順序,並且在處理命名元素時出現語法錯誤。嘗試是這樣的:

gst-launch-0.10 filesrc location=oldfile.ext ! decodebin name=demux ! queue ! ffmpegcolorspace ! vp8enc ! webmmux name=mux ! filesink location=newfile.webm demux. ! queue ! progressreport ! audioconvert ! audioresample ! vorbisenc ! mux.

這將構建以下管道:

 
       filesrc 
        | 
       decodebin 
       | | 
     +-------+ +-------+ 
     |     | 
     |     queue 
     queue     | 
     |    progressreport 
     |     | 
ffmpegcolorspace  audioconvert 
     |     | 
     |    audioresample 
     vp8enc    | 
     |    vorbisenc 
     |     | 
     +-------+ +-------+ 
       | | 
       webmmux 
        | 
       filesink 
+0

我收到一個錯誤。下面是詳細信息(粘貼到記事本/類似內容,並用換行符替換' - >',以使其可讀):流水線正在PREROLLING ... - >錯誤:來自元素/ GstPipeline:pipeline0/GstDecodeBin:demux/GstAviDemux:avidemux0 :內部數據流錯誤。 - >其他調試信息: - > gstavidemux.c(5134):gst_avi_demux_loop():/ GstPipeline:pipeline0/GstDecodeBin:demux/GstAviDemux:avidemux0: - > streaming stopped,reason not-linked - > ERROR:pipeline不想預卷。 - >將管道設置爲NULL ... - >釋放管道... – 2011-01-11 18:51:17

1

如果你有一個不帶音頻視頻(如像VideoBlocks服務視頻),去除音頻管道。