6

I'm looking to decode and demux an mp4 file with gst-launch-1.0. Instead of using a bin - decodebin - I'd rather work with the seperate elements. Unfortunately, I did not find this.

My question is simple: what basic elements are contained in the decodebin?

If you can direct me to a place where I can find the composition of other bins or autopluggers that whould also be nice.

Ricardo
  • 335
  • 1
  • 4
  • 13

2 Answers2

7

gst-launch-1.0 can create .dot file with pipeline diagram every time pipeline changes state. To enable this functionality, set GST_DEBUG_DUMP_DOT_DIR variable to path where generated files should be saved. In this dir gst-launch-1.0 will create files like 0.00.00.069441527-gst-launch.READY_PAUSED.dot. You can then convert them to .png files using dot from ghraphviz package. To convert one file, use following command:

dot -Tpng 0.00.00.069441527-gst-launch.READY_PAUSED.dot -o0.00.00.069441527-gst-launch.READY_PAUSED.png

You also can convert them all, using following command in bash shell:

ls -1 *.dot | xargs -I{} dot -Tpng {} -o{}.png

You can find more details here: How to generate a Gstreamer pipeline diagram (graph)

Daniel Frużyński
  • 2,091
  • 19
  • 28
6

The decodebin will use all available elements in your gstreamer installation. Remember that you can launch the pipeline with decodebin and using verbose -v and guess what elements is the decodebin creating. For example, in the next pipeline that plays succesfully a mp4 file (video and audio):

gst-launch-1.0 -v filesrc location=/home/usuario/GST_/BigBuckBunny_320x180.mp4 ! queue ! qtdemux name=demuxer demuxer.video_0 ! queue ! decodebin ! videoconvert ! autovideosink demuxer.audio_0 ! queue ! decodebin ! audioconvert ! autoaudiosink

Watching the output I can conclude that the resulting pipeline is:

gst-launch-1.0 -v filesrc location=/home/usuario/GST_/BigBuckBunny_320x180.mp4 ! queue ! qtdemux name=demuxer demuxer.video_0 ! queue ! h264parse ! avdec_h264 ! videoconvert ! autovideosink demuxer.audio_0 ! queue ! aacparse ! avdec_aac ! audioconvert ! autoaudiosink

The playback components from gstreamer are available here. The playbin element will give you the full pipeline (video, audio, etc...) from the uri input.

For example, if you even don't know what kind of source you have, you can use playbin element:

gst-launch-1.0 playbin uri=file:///home/usuario/GST_/BigBuckBunny_320x180.mp4 -v

This will play automatically the file (if it is possible), and verbose output will show you the used plugins and status information.

jgorostegui
  • 1,290
  • 1
  • 8
  • 13