Jump to content

GStreamer Support-Playback Audio and Video Example Pipelines

From RidgeRun Developer Wiki

Follow us on: YouTube Twitter LinkedIn Email Share this page

Share This Page






Problems running the pipelines shown on this page? Please see our GStreamer Debugging guide for help .

Audio Only Playback

An audio-only playback pipeline looks like the one below. This pipeline reads an ID3 container with MP3 audio file, demux and decodes the audio to finally play it back in the default audio device.

gst-launch-1.0 filesrc location=file_example_MP3_1MG.mp3 ! id3demux ! mpegaudioparse ! mpg123audiodec ! queue ! autoaudiosink

NOTE: To use the jack port of the Verdin i.M95 EVK, please verify the position of the S3 switch.

Video Only Playback

Video-only playback consists of taking a containerized video file and rendering it on the display. 

H.264

This example playback an AVI file container with H.264 encoded video.

 gst-launch-1.0 filesrc location=vid_only_h264.avi ! avidemux ! h264parse ! v4l2h264dec ! queue ! waylandsink

H.265

This example reproduces an MP4 file container with H.265 encoded video.

gst-launch-1.0 filesrc location=vid_only_h265.avi ! avidemux ! h265parse ! v4l2h265dec ! queue ! waylandsink

VPU Downscaling

This example uses VPU to downscale video from 1920x1080 to 720x480, downscaling takes place in the decoder.

Display:

gst-launch-1.0 filesrc location=video-only-h264.avi ! avidemux ! h264parse ! v4l2h264dec ! video/x-raw,width=720,height=480 ! v4l2h264enc ! h264parse ! waylandsink

Save downscaled version to playable file:

gst-launch-1.0 filesrc location=vid_only_AVI_1920_2_3MG.avi ! avidemux ! h264parse ! v4l2h264dec ! video/x-raw,width=720,height=480 ! v4l2h264enc ! h264parse ! mp4mux ! filesink location=downscaled_720x480.mp4

Audio/Video Playback X

An audio and video playback pipeline looks like the one below. This pipeline reads the MP4 file, demux it, extracting the audio and video stream, decode them and reproduce them on display and audio outputs

gst-launch-1.0 filesrc location=outro_h264_vid_aud.mp4 ! qtdemux name=demux \
demux.video_0 ! queue ! h264parse ! v4l2h264dec ! fakesink \
demux.audio_0 ! queue ! decodebin ! audioconvert ! audioresample ! autoaudiosink








Cookies help us deliver our services. By using our services, you agree to our use of cookies.