Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does this gstreamer pipeline stall?

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 ?

like image 392
timday Avatar asked Jun 14 '10 23:06

timday


People also ask

What is GStreamer pipeline?

GStreamer is a pipeline-based multimedia framework that links together a wide variety of media processing systems to complete complex workflows. For instance, GStreamer can be used to build a system that reads files in one format, processes them, and exports them in another.


1 Answers

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.

like image 124
timday Avatar answered Oct 21 '22 09:10

timday