omxplayer - GPU enabled video player


169 posts   Page 2 of 7   1, 2, 3, 4, 5 ... 7
by marcelh18 » Mon May 21, 2012 5:06 pm
Hi guys, I followed the steps you described and installation of omxplayer was succesful. The video plays well, however there is now sound :( What could be wrong?
P.S. The sound module is working and I have sound when playing mp3 songs with the moc player.
Thanks in advance.
Posts: 9
Joined: Sun May 20, 2012 5:27 pm
by alexeames » Mon May 21, 2012 6:13 pm
See here on the previous page Dom helped me with this issue. If you'll pardon the pun it was very sound advice :lol:
viewtopic.php?p=80598#p80598

type omxplayer -h to see the command line arguments
(-o might be the one you want to look at)
Alex Eames RasPi.TV HDMIPi.com RasP.iO
User avatar
Posts: 2096
Joined: Sat Mar 03, 2012 11:57 am
Location: UK
by marcelh18 » Mon May 21, 2012 6:34 pm
alexeames wrote:See here on the previous page Dom helped me with this issue. If you'll pardon the pun it was very sound advice :lol:
viewtopic.php?p=80598#p80598

type omxplayer -h to see the command line arguments
(-o might be the one you want to look at)


Thx for the answer :)
The "omxplayer -o hdmi /home/pi/video.mkv" worked like a charm for me :)
Posts: 9
Joined: Sun May 20, 2012 5:27 pm
by marcelh18 » Mon May 21, 2012 6:53 pm
Now I have another question. How can I change the sound volume while the video is playing?
Posts: 9
Joined: Sun May 20, 2012 5:27 pm
by alexeames » Mon May 21, 2012 9:31 pm
marcelh18 wrote:Now I have another question. How can I change the sound volume while the video is playing?


TV remote? :lol:
Alex Eames RasPi.TV HDMIPi.com RasP.iO
User avatar
Posts: 2096
Joined: Sat Mar 03, 2012 11:57 am
Location: UK
by marcelh18 » Tue May 22, 2012 11:11 am
alexeames wrote:
marcelh18 wrote:Now I have another question. How can I change the sound volume while the video is playing?


TV remote? :lol:

It works, but if I set the volume to max on tv than the sounds gets crappy as the speakers start making an anoying noise.
Posts: 9
Joined: Sun May 20, 2012 5:27 pm
by alexeames » Tue May 22, 2012 12:59 pm
Google for omxplayer.cpp you'll find it on github.
Line 456 onwards describe various keyboard functions.

case 'j' and case 'k' might be of interest? Although I'm not very sure about that. Best i can do. I told you remote control because I know it works :lol:
Alex Eames RasPi.TV HDMIPi.com RasP.iO
User avatar
Posts: 2096
Joined: Sat Mar 03, 2012 11:57 am
Location: UK
by marcelh18 » Tue May 22, 2012 10:00 pm
alexeames wrote:Google for omxplayer.cpp you'll find it on github.
Line 456 onwards describe various keyboard functions.

case 'j' and case 'k' might be of interest? Although I'm not very sure about that. Best i can do. I told you remote control because I know it works :lol:

Those buttons do not work, but anyway thank you for the reply :)
Cheers.
Posts: 9
Joined: Sun May 20, 2012 5:27 pm
by Patrik » Fri May 25, 2012 10:18 am
Hi,

I can't get it to work and I always get a "have a nice day" message.

Code: Select all
    [matroska,webm @ 0x17947c0] max_analyze_duration 0 reached at 0
    file : test.mkv reult 0 format matroska,webm audio streams 2 video streams 1 chapters 0 subtitles 3
    Video codec omx-h264 width 1920 height 1080 profile 100 fps 23.976025

    have a nice day ;)

I tried everything, but still the same.
I'm using the hdmi port with a hdmi-dvi cable and the analog output.

If I try the composite output with my TV, then there is only sound for a few seconds, then some noise every 2-3seconds and no picture.
Code: Select all
    [matroska,webm @ 0x8ff740] max_analyze_duration 0 reached at 0
    file : test.mkv reult 0 format matroska,webm audio streams 2 video streams 1 chapters 0 subtitles 3
    Video codec omx-h264 width 1920 height 1080 profile 100 fps 23.976025
    Audio codec ac3 channels 8 samplerate 48000 bitspersample 16

I tried it with a simple avi file, but still the same.
Code: Select all
file : test.avi reult 22 format avi audio streams 1 video streams 1 chapters 0 subtitles 0
Video codec omx-mpeg4 width 576 height 432 profile 15 fps 25.000000
Audio codec mp3 channels 2 samplerate 48000 bitspersample 16
Posts: 20
Joined: Fri Feb 17, 2012 7:22 pm
by Spider.007 » Fri May 25, 2012 2:07 pm
what are the contents of the generated logfile? It's generated in the directory you play movies from and is called omxplayer.log
Posts: 34
Joined: Sat May 19, 2012 11:24 am
by Patrik » Fri May 25, 2012 5:45 pm
Posts: 20
Joined: Fri Feb 17, 2012 7:22 pm
by dom » Fri May 25, 2012 11:57 pm
@Patrik
What memory split are you running with? omxplayer won't run with the 224M split.
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 4104
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge
by Patrik » Sat May 26, 2012 4:55 pm
Thanks dom, now it's working great.

Is there a way to hide console content while watching e.g. 4:3 videos?
Posts: 20
Joined: Fri Feb 17, 2012 7:22 pm
by dom » Sat May 26, 2012 5:21 pm
You should be able to blank console. Something like:
setterm -blank force && omxplayer <filename>

might do it (not tested).
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 4104
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge
by spennig » Sat May 26, 2012 5:42 pm
I fear not, because omxplayer writes to the console as it starts. I had a cunning script that did something like:

CON=$(sudo fgconsole)
trap "sudo chvt $CON" INT QUIT TERM EXIT
sudo chvt 2
/usr/bin/omxplayer "$@"

to switch to an empty VT, but omxplayer still spews out its informational message. Perhaps appending ">/dev/null 2>&1" may help ... to see next time the headless Pi / Π / \U3a0 is connected to a monitor.
User avatar
Posts: 84
Joined: Mon Aug 29, 2011 11:34 am
Location: New Forest
by Patrik » Sat May 26, 2012 5:50 pm
dom wrote:You should be able to blank console. Something like:
setterm -blank force && omxplayer <filename>

might do it (not tested).

Thanks it's working if I use it directly, but when I stop playback the screen remains blank, so how can I restore it?
(By the way after a few minutes of idle in the console it gets blank automatically, so how can I set it back or prevent this?)

I usually use ssh to control things and start the videos and this way setterm is not working.
I'm not an expert in this, so is there a way to set it blank (and restore it) from ssh?

And is there a way to start a video from ssh and then close the connection, but the video playback remains unchanged (so it would not stop)?
Last edited by Patrik on Sat May 26, 2012 6:11 pm, edited 1 time in total.
Posts: 20
Joined: Fri Feb 17, 2012 7:22 pm
by dom » Sat May 26, 2012 6:08 pm
setterm -blank force && ./omxplayer <filename> && setterm -blank poke
might bring it back after omxplayer exits.

Unfortunately this won't work from an ssh conection, as it has its own term. Someone who know more about this might know how to blank a different term.

To keep video playing when ssh closes, you need to investigate "nohup"
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 4104
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge
by Patrik » Sat May 26, 2012 6:22 pm
Okay, so thanks spenning for the script.

nohup working great, but when I close the ssh connection the console output appears on the screen.

Anyone has any idea how to solve this?

By the way, how can I stop the video playback with a new ssh connection?
Posts: 20
Joined: Fri Feb 17, 2012 7:22 pm
by dmf » Sat May 26, 2012 10:13 pm
I managed to get videos to play from inside the gui with a custom command line(omxplayer -o hdmi %f), but once they are started I have no control.
And also if there is a space in the file name, multiple copies open at the same time and compete for dominance.

any ideas?
Posts: 2
Joined: Sat May 26, 2012 10:07 pm
by Musicalbudgie » Sun May 27, 2012 2:14 am
I gather that omxplayer supports subtitles, but I can't seem to get them to display.

I have some mkv files with the subtitles contained in them. Pressing s doesn't seem to do anything.

Any suggestions?
Posts: 7
Joined: Sun May 27, 2012 1:05 am
by dstahlke » Sun May 27, 2012 2:40 am
To use setterm from ssh, you need to just redirect it to /dev/tty0. The following commands need to be run as root (sudo won't do it because the '>' part won't get run under sudo).

Code: Select all
# prevent screensaver from powering down display
setterm -blank 0 -powerdown 0 > /dev/tty0

# clear the display and turn off the flashing cursor
clear > /dev/tty0
setterm -cursor 0 > /dev/tty0

# turn the cursor back on when done with omxplayer
setterm -cursor 1 > /dev/tty0
Posts: 1
Joined: Sun May 27, 2012 2:32 am
by dom » Sun May 27, 2012 10:17 am
dmf wrote:I managed to get videos to play from inside the gui with a custom command line(omxplayer -o hdmi %f), but once they are started I have no control.
And also if there is a space in the file name, multiple copies open at the same time and compete for dominance.

You need quotes around the %f (e.g. "%f") to handle filenames with spaces.
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 4104
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge
by raspberrypivictim » Mon May 28, 2012 7:40 am
Musicalbudgie wrote:I have some mkv files with the subtitles contained in them. Pressing s doesn't seem to do anything.

Not sure, but I think you should try the -t option when running omxplayer from the command line.
Code: Select all
-t / --sid index               show subtitle with index

s key is used for stats, acording to the help
Code: Select all
-s / --stats                   pts and buffer stats

Talking a bit more about subtitles, I would like to know if anyone has been able to use external srt files. I cannot find the option.

On the other hand, Is there a way to embed srt files into a mp4/avi file? Not over the video stream, but into a "channel" (not sure if this is the proper name) to use it with the -t option.

Thank you very much in advance.
Posts: 29
Joined: Sun Jan 22, 2012 10:35 pm
by raspberrypivictim » Mon May 28, 2012 6:12 pm
I don't know how to edit my last comment to avoid doble post effect. Sorry for that. After googling a while I'am able to answer myself.

I have used mkvtoolnix to insert srt files into avi/mp4 with success. Omxplayer recognizes it when loading.

I have used the -t 1 option to load them but problem is subtitles are shown in the shell as standard text, not over the image.

Any ideas?, thank you very much in advance.
Posts: 29
Joined: Sun Jan 22, 2012 10:35 pm
by Musicalbudgie » Mon May 28, 2012 6:53 pm
I had a go running with the -t option before, but it wouldn't accept it.

Just now tried passing a number into it, tried 0, 1, 2 and 3 on separate attempts. It played but no subtitles would show, not even in the shell either.
Posts: 7
Joined: Sun May 27, 2012 1:05 am