Convert video to WebM using GStreamer

只谈情不闲聊 提交于 2019-12-03 06:20:55

问题


Documentation for GStreamer is confusing. This is still no excuse for resorting to StackOverflow.com, but still:

What is the GStreamer command line to convert any video file (from any format) to WebM (+WebM audio)?

This is the only documentation with examples I could find.

I'm stuck somewhere at 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

I'm getting a WARNING: erroneous pipeline: link without source element with no idea how to to get this thing going.

This is pretty frustrating.

Please help, thank you. :)


回答1:


You have the pipeline elements all out of order and you have syntax errors when dealing with named elements. Try something like this:

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.

This will construct the following pipeline:

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



回答2:


If you have videos with no audio (such as videos from a service like VideoBlocks), remove the audio pipeline.



来源:https://stackoverflow.com/questions/4649925/convert-video-to-webm-using-gstreamer

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!