From c1349815a3455db8190d30bd8f4c326778f265e4 Mon Sep 17 00:00:00 2001 From: Matthew Clark Date: Fri, 23 Feb 2018 08:07:52 +0000 Subject: [PATCH] Describe playbin better --- basics.md | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/basics.md b/basics.md index d091965..5d800b5 100644 --- a/basics.md +++ b/basics.md @@ -10,17 +10,25 @@ export SRC=/home/me/videos/test.mp4 ### Play a video (with audio) - +`playbin` is a magical element that can play anything: ``` -gst-launch-1.0 -v playbin uri=file://$SRC +gst-launch-1.0 playbin uri=file://$SRC ``` -or, if you'd rather have more control of the pipeline: +This works with video, audio, RTMP streams, and so much more. + +The 'bin' in 'playbin' means that under-the-hood, it's a collection of elements. For example, we can achieve the same thing by going to the next level of elements, which separate the decoding part from the playing part: + +``` +gst-launch-1.0 filesrc location=$SRC ! decodebin ! playsink +``` + +Or, we can split down even further: ``` gst-launch-1.0 filesrc location=$SRC ! \ - qtdemux name=demux demux.audio_0 ! queue ! decodebin ! audioconvert ! audioresample ! \ + qtdemux name=demux demux.audio_0 ! queue ! decodebin ! audioconvert ! audioresample ! \ autoaudiosink \ demux.video_0 ! queue ! \ decodebin ! videoconvert ! videoscale ! autovideosink @@ -88,3 +96,4 @@ gst-launch-1.0 -v \ decodebin ! videoconvert ! videoscale ! video/x-raw,width=100 ! videorate ! video/x-raw,framerate=5/1 ! \ autovideosink ``` +