omxplayer - GPU enabled video player


169 posts   Page 4 of 7   1, 2, 3, 4, 5, 6, 7
by tk321 » Sun Jun 03, 2012 9:34 pm
Right, so you're using ffmpeg .h files but linking against libav. I'm surprised this worked out well.
Posts: 31
Joined: Sat Jun 02, 2012 6:09 pm
Location: UK
by tk321 » Sun Jun 03, 2012 10:44 pm
Ok, I changed a few lines in DllAvFilter.h and DllAvFilter.h and finally got it to compile with libav under raspbian. Unfortunately, omxplayer doesn't output a picture so I'm still doing something wrong, but that'll have to wait till tomorrow.

Code: Select all
DllAvUtil.h:
...
extern "C" {
#if (defined USE_EXTERNAL_FFMPEG)
  #if (defined HAVE_LIBAVUTIL_AVUTIL_H)
    #include <libavutil/avutil.h>
    #include <libavutil/mathematics.h>                  // add this line
    #include <libavfilter/vsrc_buffer.h>                // add this line
...

DllAvFilter.h:
...
  #if LIBAVFILTER_VERSION_INT >= AV_VERSION_INT(2,8,0)
    #include <libavcodec/avcodec.h>  // change this
  #elif LIBAVFILTER_VERSION_INT >= AV_VERSION_INT(2,7,0)
...
  virtual int avfilter_request_frame(AVFilterLink *link) { return ::avfilter_request_frame(link); }
// add below (not sure what I'm doing is right)
#if LIBAVFILTER_VERSION_INT >= AV_VERSION_INT(2,15,0)
  virtual int av_vsrc_buffer_add_frame(AVFilterContext *buffer_filter, AVFrame *frame, int flags) {
   AVRational pixel_aspect;
   pixel_aspect.num=1;
   pixel_aspect.den=1;
    return ::av_vsrc_buffer_add_frame(buffer_filter, frame, flags, pixel_aspect);
  }
#elif LIBAVFILTER_VERSION_INT >= AV_VERSION_INT(2,13,0)
...

I might have changed another include path, but can't remember now. Finally needed another package "apt-get install libswscale-dev" and then "export LD_LIBRARY_PATH=/opt/vc/lib" and then "make".
Posts: 31
Joined: Sat Jun 02, 2012 6:09 pm
Location: UK
by karapuzo » Mon Jun 04, 2012 5:54 am
karapuzo wrote:Is there anyway to play with the aspect ratio using parameters for omxplayer?

My TV is a bit quirky - it's 1024x768 but the physical ration is 16:9 - so the pixels are in a sense rectangular instead of square.

omxplayer shows 16:9 video with large black bars across the top and bottom. (xbmc has the same problem - even after doing calibration)

When I am using VLC I am setting the ration to 4:3 (even thought the video is 16:9) and that fills the entire screen.


Managed to get it working correctly by setting the video to 1280x720 , 720p , CEA mode 4.
The TV displays the ratio correctly now.
Posts: 2
Joined: Sat Jun 02, 2012 3:58 pm
by spennig » Mon Jun 04, 2012 6:25 am
tk321 wrote:Right, so you're using ffmpeg .h files but linking against libav. I'm surprised this worked out well.


No. I'm linking against the files provided by the Arch ffmpeg package, which includes the libav* headers and libraries. That's how Arch works. There is no separate libav (or -dev) package in Arch.You should stop trying to judge Arch in Debian terms.

That's why it works. It's a consistent Arch build. There is nothing surprising about.
User avatar
Posts: 84
Joined: Mon Aug 29, 2011 11:34 am
Location: New Forest
by siriusfox » Fri Jun 08, 2012 1:46 am
Has anyone successfully got any sort of network streaming to work with this guy? The source code has a few references to http, mms, and rtmp, but I haven't been able to get them to work as a stream. I've gotten http to work playing a video file sitting on a server, but never a http stream or mms stream out of something like vlc on another machine.
Posts: 8
Joined: Sat Nov 26, 2011 6:15 am
by Aldasa » Fri Jun 08, 2012 11:34 am
I have it streaming sopcast from my PC. works great.

omxplayer -o hdmi http://192.168.0.2:8902/tv.ts
Posts: 4
Joined: Sat Feb 18, 2012 1:25 pm
by leinad » Fri Jun 08, 2012 3:11 pm
And viewing TWiT Live with omxplayer -o local http://bglive-a.bitgravity.com/twit/live/low works as well, which is quite useful. Even though it does crash occasionally.

One thing which is total a bummer is the fact that it won't decode mpeg-2 streams. I've successfully streamed TV channels from a server, but the server, which has the TV card, needs to transcode the stream into an mpeg-4 stream at 30%-40% CPU usage, which is not acceptable to me.

I'd love to hear about a solution of having the raspi decode 3-4 Mbps mpeg-2 streams.
Posts: 4
Joined: Fri Jun 08, 2012 2:42 pm
by alanpich » Sat Jun 09, 2012 9:55 pm
spennig wrote:There are a set of key-presses and effects in omxplayer.cpp, including p and space to pause, arrow keys to move, q to quit, s for subtitles and more that you can RTFS for.


I'm probably missing something (and i installed from the deb referenced in this thread rather than building myself) but how exactly does one pipe these key commands into omxplayer? Simply typing them on an attached keyboard doesnt work, neither does echo 'p' > /dev/tty1
Posts: 9
Joined: Sat Jun 09, 2012 9:20 pm
by alexeames » Sat Jun 09, 2012 10:30 pm
alanpich wrote:
spennig wrote:There are a set of key-presses and effects in omxplayer.cpp, including p and space to pause, arrow keys to move, q to quit, s for subtitles and more that you can RTFS for.


I'm probably missing something (and i installed from the deb referenced in this thread rather than building myself) but how exactly does one pipe these key commands into omxplayer? Simply typing them on an attached keyboard doesnt work, neither does echo 'p' > /dev/tty1


I found some of them worked OK with keyboard. For example the cursor keys move about in the video. I've defected to OpenELEC though as you get a gui front-end (although I think it drives Omxplayer) which makes it easier to skip about however you want. It does require a separate SD card though, so may not be ideal for everyone.
Alex Eames RasPi.TV HDMIPi.com RasP.iO
User avatar
Posts: 2065
Joined: Sat Mar 03, 2012 11:57 am
Location: UK
by alanpich » Sat Jun 09, 2012 10:45 pm
I'm trying my hardest to avoid xbmc purely because I don't want the gui on the main display (the aim of my project is to get the gui running over http, and the main display just to show the video). Starting omxplayer from tty1 console accepts the space/pause command, but i cant figure out where to pipe it over ssh or from any other process
Posts: 9
Joined: Sat Jun 09, 2012 9:20 pm
by nommo » Sun Jun 10, 2012 10:38 am
siriusfox wrote:Has anyone successfully got any sort of network streaming to work with this guy? The source code has a few references to http, mms, and rtmp, but I haven't been able to get them to work as a stream. I've gotten http to work playing a video file sitting on a server, but never a http stream or mms stream out of something like vlc on another machine.


Hey Siriusfox,

I am also messing around with streaming (Shoutcast at the mo) and wasn't getting very far ;)

Code: Select all
~$ omxplayer -o hdmi http://listen.di.fm/public3/lounge.pls


Turns out osxplayer doesn't seem to like .pls or m3u files, so I tried grabbing one of the server entries from the .pls file:

Code: Select all
~$ omxplayer -o hdmi http://160.79.128.61:5036


And although it coughs up a few errors - it now makes all the right noises :D

Code: Select all
Using network protocols without global network initialization. Please use avformat_network_init(), this will become mandatory later.
Using network protocols without global network initialization. Please use avformat_network_init(), this will become mandatory later.
Using network protocols without global network initialization. Please use avformat_network_init(), this will become mandatory later.
[mp3 @ 0x14ef650] Header missing
[mp3 @ 0x14e70a0] max_analyze_duration 5000000 reached at 5015510
[mp3 @ 0x14e70a0] Estimating duration from bitrate, this may be inaccurate
file : http://160.79.128.61:5036 reult 0 format mp3 audio streams 1 video streams 0 chapters 0 subtitles 0
Audio codec mp3 channels 2 samplerate 44100 bitspersample 16
[mp3 @ 0x14eeb90] Header missing
Early model B with Raspbian updating Xively (was Cosm) with CurrentCost Envi plus NAS, Get Iplayer, YT (whitey) and a general ssh linux playpen plus a 512MB model B with OpenElec.
Posts: 37
Joined: Sun Jun 10, 2012 10:17 am
Location: UK
by pauly24 » Wed Jun 13, 2012 6:34 pm
Can a playlist be setup with omxplayer?
Posts: 59
Joined: Fri May 18, 2012 2:42 pm
by matias » Thu Jun 14, 2012 2:10 pm
Hi there,

As this is my first post, I'd like to greet all Raspberry Pi designers and users. It's a great community and (since last friday :] ) I'm thrilled to be a part of it. I just looked into the sources of omxplayer, and discovered, that the -d switch (deinterlace) works only for SD video (namely less or equal than 720x576).

So my question is: as - judging from the source - deinterlacing on RPi is hardware based, are there there any hardware reasons for applying such limit or can we safely deinterlace and scale 1080i to 720p?
Posts: 4
Joined: Mon Jun 11, 2012 1:08 pm
by nommo » Sat Jun 16, 2012 1:37 pm
pauly24 wrote:Can a playlist be setup with omxplayer?


I've been wondering the same thing... google says no. I've tried a few formats to no avail (m3u & pls). Hmm - I might try xml...

I wouldn't know where to start trying to make that happen, but it would certainly be handy!
Early model B with Raspbian updating Xively (was Cosm) with CurrentCost Envi plus NAS, Get Iplayer, YT (whitey) and a general ssh linux playpen plus a 512MB model B with OpenElec.
Posts: 37
Joined: Sun Jun 10, 2012 10:17 am
Location: UK
by dom » Sat Jun 16, 2012 2:03 pm
matias wrote:So my question is: as - judging from the source - deinterlacing on RPi is hardware based, are there there any hardware reasons for applying such limit or can we safely deinterlace and scale 1080i to 720p?


No, deinterlace is done in (vectorised) software on GPU. It uses quite an advanced algorithm, and can only deal with SD.
I do have a plan to implement something cheaper, that can go up to 1080i, but there are a lot of plans on my list...
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 4013
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge
by Byro » Sat Jun 23, 2012 8:57 pm
Hello everyone,
on debian wheezy I had to use aptitude instead of apt-get to solve the dependencies.
Posts: 3
Joined: Sat Jun 23, 2012 8:51 pm
Location: Slovenia
by Byro » Sat Jun 23, 2012 9:39 pm
Also, the libpcre3 lib is in /lib/arm-linux-gnueabi
so my sym link was
sudo ln -s /lib/arm-linux-gnueabi/libpcre.so.3 /lib/libpcre.so.1
Posts: 3
Joined: Sat Jun 23, 2012 8:51 pm
Location: Slovenia
by niall300 » Thu Jul 05, 2012 10:41 pm
seem to have omxplayer installed but I don't know how to run it, any help would be appreciated as I am a linux newbie thanks
tried typing both omxplayer and sudo omxplayer at prompt in terminal but can't find it?
Posts: 15
Joined: Thu Jul 05, 2012 5:35 pm
by netomx » Thu Jul 05, 2012 10:43 pm
niall300 wrote:seem to have omxplayer installed but I don't know how to run it, any help would be appreciated as I am a linux newbie thanks
tried typing both omxplayer and sudo omxplayer at prompt in terminal but can't find it?


it works like that, omxplayer, if not, you didn't install it
Posts: 80
Joined: Tue Oct 11, 2011 4:06 am
by niall300 » Thu Jul 05, 2012 11:09 pm
managed to get to the omxplayer directory typed "./omxplayer" error while loading shared libraries: libavutil.so.51: cannot open shared object file: no such file or directory
Posts: 15
Joined: Thu Jul 05, 2012 5:35 pm
by netomx » Thu Jul 05, 2012 11:41 pm
niall300 wrote:managed to get to the omxplayer directory typed "./omxplayer" error while loading shared libraries: libavutil.so.51: cannot open shared object file: no such file or directory


you didn't installed it well - try the debian package
Posts: 80
Joined: Tue Oct 11, 2011 4:06 am
by niall300 » Fri Jul 06, 2012 12:10 am
ok now if i type omxplayer within the bin directory it gives me a list of "switches" or options such as -h / help etc, if i type omxplayer followed by filename.avi it says
have a nice day?
Posts: 15
Joined: Thu Jul 05, 2012 5:35 pm
by netomx » Fri Jul 06, 2012 12:13 am
Ok, first enable sound:

sudo modprobe snd_bcm2835

then, specify the sound, if hdmi, or local (headphones)

omxplayer -o hdmi testfile.avi
Posts: 80
Joined: Tue Oct 11, 2011 4:06 am
by dom » Fri Jul 06, 2012 9:26 am
netomx wrote:Ok, first enable sound:

sudo modprobe snd_bcm2835

then, specify the sound, if hdmi, or local (headphones)

omxplayer -o hdmi testfile.avi


omxplayer doesn't use ALSA so no need for modprobe.
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 4013
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge
by niall300 » Fri Jul 06, 2012 11:44 am
thanks for all the help it seems that maybe my power supply maybe the problem it only outputs 400ma. I believe i need at least 700ma, will get e new power supply and try again
Posts: 15
Joined: Thu Jul 05, 2012 5:35 pm