9

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

Ory Band
  • 14,716
  • 14
  • 59
  • 66

2 Answers2

18

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
cdhowie
  • 158,093
  • 24
  • 286
  • 300
  • I'm getting an error. Here's the details (paste it to notepad/similar and replace '-->' with newlines to make this readable): Pipeline is PREROLLING ... --> ERROR: from element /GstPipeline:pipeline0/GstDecodeBin:demux/GstAviDemux:avidemux0: Internal data stream error. --> Additional debug info: --> gstavidemux.c(5134): gst_avi_demux_loop (): /GstPipeline:pipeline0/GstDecodeBin:demux/GstAviDemux:avidemux0: --> streaming stopped, reason not-linked --> ERROR: pipeline doesn't want to preroll. --> Setting pipeline to NULL ... --> Freeing pipeline ... – Ory Band Jan 11 '11 at 18:51
  • Which gstreamer version? It looks like the avidemux element is having trouble detecting the format of some streams. – cdhowie Jan 11 '11 at 19:42
  • 0.10 for OSX. I installed using homebrew (the new MacPorts). I have tried executing the same line on my virtualbox Ubuntu, and it works perfectally. What am I missing? – Ory Band Jan 11 '11 at 20:44
  • This is also hapenning with very simple commands. I.E. `gst-launch-0.10 filesrc location=horse.mp3 ! decodebin ! audioconvert ! osxaudiosink` I'm getting the **streaming task paused, reason not-linked (-1)** and **pipeline doesn't want to preroll** error all the time. It works on my Ubuntu (replacing `osxaudiosink` with `alsasink`). – Ory Band Jan 11 '11 at 21:02
  • @Ory: The question you just linked is *this* question, silly. And to answer your question, it's likely that you are missing some codecs and decodebin can't find one suitable for the content of the AVI. – cdhowie Jan 11 '11 at 21:21
  • Correct! This is the link to the other similiar problem: http://stackoverflow.com/questions/4094990/gstreamer-mac-os-x-udpsink-problem – Ory Band Jan 11 '11 at 21:32
  • 1
    I have eventually managed to understand the source of this. I was missing the *gst-ffmpeg* plugin. I installed it and everything worked. Thanks for the answer and thorugh help! :) – Ory Band Jan 11 '11 at 21:33
1

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

user319249
  • 145
  • 1
  • 8