views:

111

answers:

2

This works:

gst-launch-0.10 \
videotestsrc ! ffmpegcolorspace ! 'video/x-raw-yuv' ! mux. \
audiotestsrc ! audioconvert ! 'audio/x-raw-int,rate=44100,channels=1' ! mux. \
avimux name=mux ! filesink location=gst.avi

I can let it run for a while, kill it, and then totem gst.avi displays a nice test card with tone.

However, trying to do something more useful like

gst-launch-0.10 \
filesrc location=MVI_2034.AVI ! decodebin name=dec \
dec. ! ffmpegcolorspace ! 'video/x-raw-yuv' ! mux. \
dec. ! audioconvert ! 'audio/x-raw-int,rate=44100,channels=1' ! mux. \
avimux name=mux ! filesink location=gst.avi

it just displays

Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...

and then stalls indefinitely.

What's the trick to get the version with decodebin rolling ?

A: 

your pipeline seems to be correct. however, gst-launch is a limited tool - i would suggest coding the pipeline in python or ruby for better debugging.

Jeremiah Rose
+1  A: 

Aha... this does what I want:

gst-launch-0.10 \
filesrc location=MVI_2034.AVI ! decodebin name=dec \
dec. ! queue ! ffmpegcolorspace ! 'video/x-raw-yuv' ! queue ! mux. \
dec. ! queue ! audioconvert ! 'audio/x-raw-int,channels=1' ! audioresample ! 'audio/x-raw-int,rate=44100' ! queue ! mux. \
avimux name=mux ! filesink location=gst.avi

The queue elements (both leading and trailing) do appear to be crucial.

Further experiments adding things like videoflip or

videorate ! 'video/x-raw-yuv,framerate=25/1'

into the video part of the pipeline all work as expected.

timday
When muxing or demuxing, having buffers is required. That's where the queue elements come in. You can fine tune it further by specifying the number of buffers in the queue.
Sid H
Thanks for the tip. Turns out while the pipeline above works for some 640x480 video, I had to raise the trailing video queue's max-size-bytes to get it to not deadlock with 1280x720 content.
timday