how do you build gstreamer's gst-launch pipelines?

2.6k views Asked by At

Let's say you have a video file.
As far as I searched, you first need to know what container it uses by mediainfo command.

$ mediainfo your_path_to_a_video.file

you then need to find a demuxer for the container, so you do

$ gst-inspect-1.0 | grep your_container_name_such_as_ogg

now that you have a proper demuxer, such as oggdemux, you can split video and audio. If you want to display the video, you first need to know the codec name, and you will need to decode it to output to the screen.
Going back to the mediainfo output, you go find the video Format, and you do

$ gst-inspect-1.0 | grep format_name_such_as_theora

You will find theoradec and you check its details by

$ gst-inspect-1.0 | decoder_name_such_as_theoradec

to see the sink and src. You now find the src is video/x-raw so you will need to find the final sink to output the video on display, such as xvimagesink.

I am just writing this all based on a web page in Japanese, and I didn't find any other pages that explained more than this (either in English or Japanese).

I want to find pages explaining how one can complete a pipeline based on mediainfo and so on. Even after I read the web page, I am still not sure how to match capabilities between elements to elements.

How do you build your pipelines?
How do you match caps?

1

There are 1 answers

1
Mathieu_Du On

If all you want is to playback your video file, you can do:

gst-launch-1.0 playbin uri=file:///path/to/your/video

If you need to decode it to a raw video format and do further processing, you can :

gst-launch-1.0 uridecodebin uri=file:///path/to/your/video ! video/x-raw ! further_processing

Same goes with audio, and you can even name your uridecodebin to separate audio and video:

gst-launch-1.0 uridecodebin uri=file:///path/to/your/video name=d ! video/x-raw ! further_video_processing d. ! audio/x-raw ! further_audio_processing

If you want to see what the actual pipeline looks like, you can set the GST_DEBUG_DUMP_DOT_DIR environment variable to dump a dot representation:

GST_DEBUG_DUMP_DOT_DIR=$PWD gst-launch-1.0 playbin uri=file:///path/to/your/video

Then:

dot -Tsvg name_of_the_dot_file.dot -o mypipeline.svg

Edit : as for the documents I read to figure this out, the "application development manual", the manual page for gst-launch and gst-inspect along with the various docs here : http://cgit.freedesktop.org/gstreamer/gstreamer/tree/docs should get you started.