Facebook Twitter Instagram Pinterest YouTube
    Trending
    • Add Kodi to RetroPie Menu
    • Disable Auto-login in Raspberry Pi OS
    • Raspberry Pi Cloud Storage with MEGA
    • RetroPie Temperature Monitor from Menu
    • Pi Pico Pinout and Power Pins
    • Install Arduino IDE on Raspberry Pi
    • Raspberry Pi 400 SSD Upgrade
    • Raspberry Pi Temperature Monitoring
    Facebook Twitter Instagram Pinterest YouTube RSS
    Raspberry Pi SpyRaspberry Pi Spy
    • Home
    • Categories
      • General
      • Hardware
      • Programming
      • Python
      • Software
      • Tutorials & Help
    • BerryClip
      • BerryClip Instructions
      • BerryClip Plus Instructions
      • Videos & Reviews
    • Buy
      • Buy Pi
      • Buy Pi Accessories
      • Buy Books
    • Tools
      • Ultimate Raspberry Pi Alexa Skill
      • Pi Power Estimator App
      • Pi-Lite 14×9 LED Matrix Sprite Editor
      • RPiREF Pin-out Reference App
      • Simple Ohm’s Law Calculator
      • Web Sites & Links
    • Tutorials & Help
        Featured
        November 9, 20200

        Raspberry Pi Temperature Monitoring

        Recent
        May 6, 2022

        Add Kodi to RetroPie Menu

        February 26, 2022

        Disable Auto-login in Raspberry Pi OS

        February 2, 2022

        Raspberry Pi Cloud Storage with MEGA

      1. Contact Us
      2. Site Map
      Raspberry Pi SpyRaspberry Pi Spy
      You are at:Home»Hardware»Camera Module»Playing Videos on the Raspberry Pi Command Line
      HD Video With Omxplayer

      Playing Videos on the Raspberry Pi Command Line

      25
      By Matt on June 12, 2013 Camera Module, Software, Tutorials & Help

      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.

      Installation

      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

      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 :

      omxplayer

      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/
                                            freefont/FreeSans.ttf)
          --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.

      Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
      Previous ArticleHow To Setup A Web Server On Your Raspberry Pi
      Next Article 12000mAh Li-on Battery Power Bank Test

      Related Posts

      Add Kodi to RetroPie Menu

      Disable Auto-login in Raspberry Pi OS

      Raspberry Pi Cloud Storage with MEGA

      25 Comments

      1. chris.tal on June 14, 2013 11:29 am

        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. :/

        Reply
      2. Sunil on July 8, 2013 8:19 am

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

        Thanks and regards
        Sunil

        Reply
      3. vijay on November 27, 2013 4:22 am

        Hi
        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.

        Reply
        • Matt on November 28, 2013 10:08 am

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

          Reply
        • Thomas on August 26, 2014 9:58 pm

          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

          Reply
      4. monkeypi on November 28, 2013 1:13 pm

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

        Reply
        • Opiel16 on December 7, 2013 12:05 am

          You may have the same problem I did – your volume is possibly zero
          Type alsamixer to see volume control – if this doesn’t work maybe you need to update or install some stuff, this page got me through my problems;
          http://elinux.org/R-Pi_Troubleshooting#Sound

          Reply
      5. Natha on August 7, 2014 4:56 pm

        Hi
        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
        Thanks

        Reply
        • Matt on August 9, 2014 11:21 am

          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.

          Reply
      6. Gonzalo on September 12, 2014 11:21 pm

        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.

        Reply
      7. Marco Rossi on January 19, 2015 4:22 pm

        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?

        Reply
      8. TVM on February 26, 2015 7:28 pm

        (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

        Reply
        • Matt on February 26, 2015 7:56 pm

          Are you in the correct directory when you type the command? Are you typing exactly the same filename including the correct upper and lowercase letters?

          Reply
          • TVM on March 17, 2015 8:52 pm

            must i put the directory of the file in the command?

            Reply
      9. Dustin on March 14, 2015 2:07 pm

        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.

        Reply
        • tegtom on May 12, 2015 1:33 pm

          Hi Dustin,

          I use for a pinball project this HDMI monitor (AMAZON):
          5-Zoll-LCD-HDMI 800 × 480 High Resolution für Raspberry Pi 2 Modell B / Raspberry Pi Modell B / B + / A +

          I am still working on the project. Therefore I pick up the signals from the contact matrix (parallel to the pinball) and play short sounds and video files with the raspberry pi B+ (disabled PIN sound).

          I think I can finish my programming in two weeks and the I know how it works.

          Best wishes
          Thomas

          Reply
      10. karu on May 19, 2015 6:44 am

        how can i continuously loop play a movie with omxplayer?

        Reply
        • Matt on May 22, 2015 8:07 pm

          Try RPiLooper http://curioustechnologist.com/post/118279299189/rpilooper-v3-image-for-raspberry-pi-2-available

          Reply
      11. Dave on June 13, 2015 3:02 am

        Hi, I was wondering if you guys could help me? I’m new to both linux and the pi. Any ways I went and got one of these pi’s so I can use it as a security camera monitor station with a tv running 24/7 mounted to the wall of my living room. So the problem im having is when I run the command

        omxplayer http://[The cams IP]/videostream.cgi

        I get the error

        tvservice-client: Failed to connect to TV service: -1

        Can you guys help me out with this one? Ive done searched google to the point that my modem is about to explode and send the universe into another dimension

        Reply
        • Matt on June 20, 2015 12:40 am

          Take a look at this post : Make A Raspberry Pi IP Camera Viewer

          Reply
      12. Eli Porter on June 16, 2015 3:25 pm

        If your name of your mp4 is too long type the first word than press Tab and it will fill in the rest

        Reply
      13. Lee on July 31, 2015 8:07 am

        I created a remote session to run omxplayer to play continuely a video. But, when the session is ended, the video will stop too. Is there any way to keep the video playing even the session ended? Thanks in advance!

        Reply
        • Lee on August 6, 2015 1:18 pm

          I solved this problem by creating a session in Pi desktop.

          Reply
      14. forumisto on November 5, 2015 6:36 pm

        hello

        I want lauch omxplayer from other process, I use:

        omxplayer “http://host/video.m3u8” & (from command line)

        but the video does not start

        If I don’t use & from command line the video starts.

        thanks

        Reply
      15. 3duser on March 20, 2016 3:58 am

        How to exhibit only the right eye view from 3dmvc.mkv file in 2d with omxplayer?

        Reply

      Leave A Reply Cancel Reply

      This site uses Akismet to reduce spam. Learn how your comment data is processed.

      Recent Posts
      May 6, 2022

      Add Kodi to RetroPie Menu

      February 26, 2022

      Disable Auto-login in Raspberry Pi OS

      February 2, 2022

      Raspberry Pi Cloud Storage with MEGA

      January 7, 2022

      RetroPie Temperature Monitor from Menu

      January 24, 2021

      Pi Pico Pinout and Power Pins

      Categories
      • 1-wire
      • 3D Printing
      • Add-ons
      • BBC Micro:bit
      • BerryClip
      • Books
      • Camera Module
      • Cases
      • Events
      • General
      • Hardware
      • I2C
      • Infographics
      • Interfaces
      • Minecraft
      • Model A+
      • Model B+
      • News
      • Pi Models
      • Pi Zero
      • Power
      • Programming
      • Python
      • Raspberry Pi OS
      • Raspbian
      • RetroGaming
      • Robotics
      • Sensors
      • Software
      • SPI
      • Tutorials & Help
      Tags
      3D Printing Arduino audio battery berryclip Birthday bluetooth cambridge camera CamJam DigiMakers display games GPIO I2C interface Kickstarter LCD LED Linux media Minecraft Model A Model B motionEyeOS PCB photography photos Pi-Lite portable power python Raspberry Jam Raspberry Pi Bootcamp raspbian Retrogaming retroPie screen SD card security sensor SPI temperature ultrasonic video
      Raspberry PI Related
      • Adafruit Blog
      • Average Maker
      • Official RaspBerry Pi Site
      • Raspberry Pi Pod
      • RasPi.tv
      • RaspTut
      • Stuff About Code
      Tech Resources
      • MattsBits – Pi Resources
      • Microbit Spy
      • Technology Spy
      Archives
      About

      Unofficial site devoted to the Raspberry Pi credit card sized computer offering tutorials, guides, resources,scripts and downloads. We hope to help everyone get the most out of their Pi by providing clear, simple articles on configuring, programming and operating it.

      Popular Posts
      September 19, 2014

      Top 5 Reasons The Raspberry Pi Sucks

      July 27, 2012

      16×2 LCD Module Control Using Python

      October 20, 2013

      Analogue Sensors On The Raspberry Pi Using An MCP3008

      Recent Posts
      May 6, 2022

      Add Kodi to RetroPie Menu

      February 26, 2022

      Disable Auto-login in Raspberry Pi OS

      February 2, 2022

      Raspberry Pi Cloud Storage with MEGA

      Facebook Twitter Instagram Pinterest YouTube RSS

      Entries RSS | Comments RSS

      This site is not associated with the official Raspberrypi.org site or the Raspberry Pi Foundation. Raspberry Pi is a trademark of the Raspberry Pi Foundation.

      Copyright © 2022 - All Rights Reserved - Matt Hawkins

      Type above and press Enter to search. Press Esc to cancel.