Playing a video on command line with gstreamer

Here's how to play a video on the command line using ``gst-launch``: gst-launch filesrc ! decodebin ! autovideosink You can also replace the ``xvimagesink`` with ``autovideosink``. I can't see the difference between the two. gst-launch filesrc ! decodebin ! autovideosin ## Pipeline contents This pipeline is very simple and has only a few elements: ### filesrc This is a source element and reads in the file based on the ``location`` parameter, and just spits that out to the next element. The location parameter can be a local relative filepath ### decodebin ``decodebin`` is a simple catch all 'decode this what ever it is' element. It turns raw data into a video stream. It's very handy and convient and means you don't have to think about how to decode the incoming data. It passes the video stream on to the next elementin the pipeline. ### autovideosink This element is a sink and the incoming video stream just get displayed on your screen in a little window. This shows you the video. ## Limitations You can't skip forward, rewind or pause in this, and to stop playin you'll have to close the window. If you have a problem with a video file with gstreamer, or a gstreamer application, this is a simple way to see if it will play OK. If the video file doesn't play with this approach, then you probably don't have correct codecs or there is something wrong with the video file.

This entry is tagged: