Playing Videos On the Raspberry Pi Command Line

If Full HD Logoyou need to play video files and you don’t want to install a full media solution such as XBMC then you can play them directly from the command line using Omxplayer. This is a media player created by Edgar Hucek specifically for the Raspberry Pi and it takes advantage of the Pi’s GPU.


Omxplayer is installed on the latest Raspbian image so you may already have it installed. If not you can install it using :

sudo apt-get update
sudo apt-get -y install omxplayer

Basic Usage

To play a video file you just need to type :

omxplayer myvideo.mp4

If you are using HDMI you should use this command to pass audio over the HDMI interface :

omxplayer -o hdmi myvideo.mp4

HD Video With Omxplayer

Other Command Line Options

If you type :


you will be presented with a list of the available command line options :

Usage: omxplayer [OPTIONS] [FILE]
Options :
-h / --help                print this help
-n / --aidx  index         audio stream index    : e.g. 1
-o / --adev  device        audio out device      : e.g. hdmi/local
-i / --info                dump stream format and exit
-s / --stats               pts and buffer stats
-p / --passthrough         audio passthrough
-d / --deinterlace         deinterlacing
-w / --hw                  hw audio decoding
-3 / --3d mode             switch tv into 3d mode (e.g. SBS/TB)
-y / --hdmiclocksync       adjust display refresh rate to match
                           video (default)
-z / --nohdmiclocksync     do not adjust display refresh rate to
                           match video
-t / --sid index           show subtitle with index
-r / --refresh             adjust framerate/resolution to video
-l / --pos                 start position (in seconds)
    --boost-on-downmix     boost volume when downmixing
    --subtitles path       external subtitles in UTF-8 srt form at
    --font path            subtitle font
                           (default: /usr/share/fonts/truetype/
    --font-size size       font size as thousandths of screen height
                           (default: 55)
    --align left/center    subtitle alignment (default: left)
    --lines n              number of lines to accommodate in the
                           subtitle buffer (default: 3)

Keyboard Shortcuts

Here are the keyboard shortcuts that you can use to control features within the player :

Space or p   Pause/Resume
q            Exit OMXPlayer
z            Show Info

-            Decrease Volume
+            Increase Volume

i            Previous Chapter
o            Next Chapter

Left Arrow   Seek -30
Right Arrow  Seek +30
Down Arrow   Seek -600
Up Arrow     Seek +600

1            Increase Speed
2            Decrease Speed

j            Previous Audio stream
k            Next Audio stream
n            Previous Subtitle stream
m            Next Subtitle stream
s            Toggle subtitles
d            Subtitle delay -250 ms
f            Subtitle delay +250 ms

Omxplayer is particularly useful if you are creating videos with the Pi camera module and want to playback the files from the command line.

This entry was posted in Camera Module, Software, Tutorials & Help and tagged , , . Bookmark the permalink.

15 Responses to Playing Videos On the Raspberry Pi Command Line

  1. chris.tal says:

    It can even play streams and accepts some ffmpeg style URL options. Too bad the audio and video desyncs after a few hours for me. :/

  2. Sunil says:

    Hi All,
    I want to control the omxplayer using c script ,,
    How can i do this?
    please help me..

    Thanks and regards

  3. vijay says:

    when i am using omx player myvideo.mp4.It is just showing blank screen and going
    any please help me.what is the problem with the omx player please help me.

    • Matt says:

      Where did you get myvideo.mp4 from? Have you tried another file?

    • Thomas says:

      It looks like your typing the wrong name.if you are typing ‘omx’ and then ‘player filename.mp4′
      Then it won’t recocnise you. The program is called ‘omxplayer’,
      not ‘omx’ then ‘player’…

      So if you just type:
      omxplayer filename.mp4

      It should work. It’s an easy mistake to make if you don’t know, I hope that this helps.

      Thomas Asche

  4. monkeypi says:

    im getting no sound even if i use omxplayer -o hdmi (file) any simple help much appreciated I’m noob

  5. Natha says:

    When i use omxplayer video.h264
    I have problem with display a video.
    omxplayer video.h264
    video.h264 not found but one of the video file displaying.
    please help me

    • Matt says:

      If the error message is saying the file isn’t found it either doesn’t exist or is spelt wrong. Check the filename and make sure you are in the correct directory.

  6. Gonzalo says:

    Hello, thanks for your time and very good tutorial,

    I have to do a python program where I can select a video from GPIO pin, so could you tell me if is posible to select video in a python Script? I have that question because I dont Know what happen if I change the video in the program and what happen with HDMI video.

    Thanks for your time.

    Best regards.

  7. Marco Rossi says:

    When I am running 2 instances of omxplayer on the Raspberry-Pi, if a pause one of them (p) and then resume it, the other one then freezes for 1 or 2 seconds.

    What can I do to remedy this?

  8. TVM says:

    (sorry for my bad english)
    ive got omxplayer and ive got an mp4 file on my raspberery pi 2 and i type the commend ” omxplayer (filename).mp4 but the engine says me the file wasnt found
    What did i wrong
    Thanks for replys

  9. Dustin says:

    I’m trying to get video to play on the raspberry pi display. It’s a non-hdmi display. One that connects to the 40-pin header. After attempting to play, I think the video is playing, it’s just sending the video to the HDMI port. Because I can use keyboard controls to control the video and information displays in the command line on the display connected to the RPi.

    The reason behind wanting to play it on the tiny screen, is to have a version of Jurassic Park without sound, play on the tiny screen. I’m then going to mount the Pi and the screen inside of a Jurassic Park pinball machine. So that when the machine is turned on, the video auto-plays. I found the little display perfect size for this. Just an accent, to the machine, nothing over-whelming.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>