Page 4 of 7

Re: omxplayer - GPU enabled video player

Posted: Sun Jun 03, 2012 9:34 pm
by tk321
Right, so you're using ffmpeg .h files but linking against libav. I'm surprised this worked out well.

Re: omxplayer - GPU enabled video player

Posted: Sun Jun 03, 2012 10:44 pm
by tk321
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".

Re: omxplayer - GPU enabled video player

Posted: Mon Jun 04, 2012 5:54 am
by karapuzo
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.

Re: omxplayer - GPU enabled video player

Posted: Mon Jun 04, 2012 6:25 am
by spennig
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.

Re: omxplayer - GPU enabled video player

Posted: Fri Jun 08, 2012 1:46 am
by siriusfox
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.

Re: omxplayer - GPU enabled video player

Posted: Fri Jun 08, 2012 11:34 am
by Aldasa
I have it streaming sopcast from my PC. works great.

omxplayer -o hdmi http://192.168.0.2:8902/tv.ts

Re: omxplayer - GPU enabled video player

Posted: Fri Jun 08, 2012 3:11 pm
by leinad
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.

Re: omxplayer - GPU enabled video player

Posted: Sat Jun 09, 2012 9:55 pm
by alanpich
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

Re: omxplayer - GPU enabled video player

Posted: Sat Jun 09, 2012 10:30 pm
by alexeames
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.

Re: omxplayer - GPU enabled video player

Posted: Sat Jun 09, 2012 10:45 pm
by alanpich
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

Re: omxplayer - GPU enabled video player

Posted: Sun Jun 10, 2012 10:38 am
by nommo
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

Re: omxplayer - GPU enabled video player

Posted: Wed Jun 13, 2012 6:34 pm
by pauly24
Can a playlist be setup with omxplayer?

Re: omxplayer - GPU enabled video player

Posted: Thu Jun 14, 2012 2:10 pm
by matias
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?

Re: omxplayer - GPU enabled video player

Posted: Sat Jun 16, 2012 1:37 pm
by nommo
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!

Re: omxplayer - GPU enabled video player

Posted: Sat Jun 16, 2012 2:03 pm
by dom
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...

Re: omxplayer - GPU enabled video player

Posted: Sat Jun 23, 2012 8:57 pm
by Byro
Hello everyone,
on debian wheezy I had to use aptitude instead of apt-get to solve the dependencies.

Re: omxplayer - GPU enabled video player

Posted: Sat Jun 23, 2012 9:39 pm
by Byro
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

Re: omxplayer - GPU enabled video player

Posted: Thu Jul 05, 2012 10:41 pm
by niall300
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?

Re: omxplayer - GPU enabled video player

Posted: Thu Jul 05, 2012 10:43 pm
by netomx
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

Re: omxplayer - GPU enabled video player

Posted: Thu Jul 05, 2012 11:09 pm
by niall300
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

Re: omxplayer - GPU enabled video player

Posted: Thu Jul 05, 2012 11:41 pm
by netomx
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

Re: omxplayer - GPU enabled video player

Posted: Fri Jul 06, 2012 12:10 am
by niall300
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?

Re: omxplayer - GPU enabled video player

Posted: Fri Jul 06, 2012 12:13 am
by netomx
Ok, first enable sound:

sudo modprobe snd_bcm2835

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

omxplayer -o hdmi testfile.avi

Re: omxplayer - GPU enabled video player

Posted: Fri Jul 06, 2012 9:26 am
by dom
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.

Re: omxplayer - GPU enabled video player

Posted: Fri Jul 06, 2012 11:44 am
by niall300
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