Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Convert video to WebM using GStreamer

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. :)

like image 423
Ory Band Avatar asked Jan 10 '11 18:01

Ory Band


2 Answers

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
like image 146
cdhowie Avatar answered Oct 20 '22 01:10

cdhowie


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

like image 37
user319249 Avatar answered Oct 20 '22 01:10

user319249