Omxplayer


39 posts   Page 1 of 2   1, 2
by paaland » Thu May 31, 2012 4:20 pm
Anyone compiled omxplayer for Raspbian? I tried the pre-compiled version for Debian Sqeeze, and that failed miserably.
Dragon 32>BBC Model B>PC>PC>PC>PC>Raspberry PI (circle complete)
User avatar
Posts: 68
Joined: Mon Mar 12, 2012 2:30 pm
Location: Norway
by paaland » Thu May 31, 2012 5:43 pm
Tried myself. But after cloning the git repositrory and trying to compile ffmpeg it fails:

arm-unknown-linux-gnueabi-gcc is unable to create an executable file.
C compiler test failed.


I guess compiling stuff on Raspbian is not just running make as it was in Debian :) Tried changing -mfloat-abi=softfp to hardfp in the Makefile, but that did not help.
Dragon 32>BBC Model B>PC>PC>PC>PC>Raspberry PI (circle complete)
User avatar
Posts: 68
Joined: Mon Mar 12, 2012 2:30 pm
Location: Norway
by mpthompson » Thu May 31, 2012 6:24 pm
paaland wrote:I guess compiling stuff on Raspbian is not just running make as it was in Debian :) Tried changing -mfloat-abi=softfp to hardfp in the Makefile, but that did not help.


In general, something that compiles on Debian should compile under Raspbian. Gcc should automatically take care of most of the issues with the hard float instructions and abi. However, if the application you are building specify such things themselves, it may take some tweaking to get things going under Debian or Raspbian armhf.

BTW, the gcc floating-point options for -mfloat-abi are:

    soft: Full software floating point.
    softfp: Use the FPU, but remain compatible with soft-float code.
    hard: Full hardware floating point.

Also, if the -mfpu options is specified, it should be '-mfpu=vfp' for an Raspbian compiled binaries.

More information here: http://wiki.debian.org/ArmHardFloatPort
User avatar
Forum Moderator
Forum Moderator
Posts: 620
Joined: Fri Feb 03, 2012 7:18 pm
Location: San Carlos, CA
by plugwash » Fri Jun 01, 2012 11:01 am
paaland wrote:
arm-unknown-linux-gnueabi-gcc is unable to create an executable file.
C compiler test failed.

well "arm-unknown-linux-gnueabi-gcc" doesn't exist so it seems like the build system is doing something screwy in determining the name of the gcc executable it should be using.

I guess compiling stuff on Raspbian is not just running make as it was in Debian :)

It should be unless the build system for the program in question is being stupid

Tried changing -mfloat-abi=softfp to hardfp in the Makefile,

The correct value is hard not hardfp.
Last edited by plugwash on Fri Jun 01, 2012 11:05 am, edited 1 time in total.
Forum Moderator
Forum Moderator
Posts: 2242
Joined: Wed Dec 28, 2011 11:45 pm
by paaland » Fri Jun 01, 2012 11:03 am
Tried that as well. But it still fails to compile. I'll leave it to someone with more knowledge to try :)
Dragon 32>BBC Model B>PC>PC>PC>PC>Raspberry PI (circle complete)
User avatar
Posts: 68
Joined: Mon Mar 12, 2012 2:30 pm
Location: Norway
by tk321 » Sat Jun 02, 2012 6:53 pm
I've also failed to compile omxplayer. I'm trying to avoid compiling ffmpeg myself and instead use packages provided by debian, but I guess that's where the problem lies. I suspect debian is not providing ffmpeg dev packages anymore and has moved to the fork libav. So all I can get is
Code: Select all
apt-get install libpcre3-dev libavfilter-dev libavformat-dev libavcodec-dev

After this, "make" compiles for a bit but then terminates with
Code: Select all
DllAvFilter.h:55:37: fatal error: libavfilter/avcodec.h: No such file or directory
compilation terminated.

Which indeed does not exist under libavfilter but under /usr/include/libavcodec/avcodec.h. Modifying the source doesn't solve the issue as other errors pop up, which is probably due to the ffmpeg/libav issue. So I guess the solution is either to get ffmpeg-dev from debian (is this possible?) or convince the author of omxplayer to make it work with libav?

Detailled compile steps below. Clone the git-repo (which is set up for cross-compile) and download the Makefile.* for native compilation:
Code: Select all
$ git clone https://github.com/huceke/omxplayer/
$ wget http://seyrsnys.myzen.co.uk/rpi/omxplayer-rpi-build-settings.tar.gz

Replace Makefile.include with the version by omxplayer-rpi-build-settings.tar.gz and modify to use hard fpu:
Code: Select all
CFLAGS                  += ... -mfloat-abi=hard ...

Then simply "make".
Posts: 31
Joined: Sat Jun 02, 2012 6:09 pm
Location: UK
by louisb » Sat Jun 02, 2012 10:05 pm
I'm trying to avoid compiling ffmpeg myself and instead use packages provided by debian,


Do you mean Debian or Raspbian? because Debian packages will not work on Raspbian (unless they don't use any floating point instructions like in the kernel). Is ffmpeg available in raspbian yet? have you got Omxplayer to compile ok on rpi debian (if not that might be the next thing to try) then make sure we have the same equivalent packages on both platforms.

Louis
Posts: 47
Joined: Wed Mar 07, 2012 7:08 am
by plugwash » Sat Jun 02, 2012 10:52 pm
libav is indeed in raspbian (it was something of a fight but I got it to come out clean in the end). ffmpeg is no longer in either debian or raspbian afaict.
Forum Moderator
Forum Moderator
Posts: 2242
Joined: Wed Dec 28, 2011 11:45 pm
by SkG » Sun Jun 03, 2012 10:12 am
ffmpeg is in Debian Multimedia repository (that is a common must-have repository on Desktop Debian) I have it from there on my desktop computer.

http://www.deb-multimedia.org/dists/tes ... ary-armel/

On the other hand... I did the same that tk321 said (use omxplayer-rpi-build-settings.tar.gz Makefiles) but changing all softfp to hard on Makefile, Makefile.include and Makefile.ffmpeg.

But I tried to do it by compiling also ffmpeg, but it random crashes during compiling with this message:
"gcc: internal compiler error: Terminado (killed) (program cc1)" I think that I can translate Terminado for Finished.

I think that the best way to do it is by cross compiling it, but I don't have experience on it... I can try cross-compiling with distcc (I used it in my gentoo days) but not enough time at the moment. (My University finals are coming)
Posts: 29
Joined: Sat May 19, 2012 9:28 am
Location: Madrid, Spain
by tk321 » Sun Jun 03, 2012 1:28 pm
Yes I meant raspbian, and no it also doesn't compile under debian6 without recompiling ffmpeg. I guess the main point including ffmpeg into omxplayer was because omxplayer doesn't work with libav. So I'm also trying to compile ffmpeg now but this just takes ages. Note, there's a mean line in Makefile.ffmpeg:
Code: Select all
compile:
        cd ffmpeg; \
        make -j9

The option "-j9" allows "make" to start 9 parallel gcc sessions and eventually the pi will run out of memory. I guess that's why you get "gcc: internal compiler error". Just remove "-j9" and it'll hopefully work better.
Posts: 31
Joined: Sat Jun 02, 2012 6:09 pm
Location: UK
by tk321 » Sun Jun 03, 2012 1:43 pm
Update: Nope, even without "-j 9" the pi runs out of memory and I'm not even running X11. So I guess native compile of ffmpeg is out of the question.

Code: Select all
...
libavcodec/h264.c:4085:21: warning: initialization discards const qualifier from pointer target type [enabled by default]                                     

cc1: out of memory allocating 16602960 bytes after a total of 79687680 bytes
Posts: 31
Joined: Sat Jun 02, 2012 6:09 pm
Location: UK
by SkG » Sun Jun 03, 2012 3:57 pm
tk321 wrote:
Code: Select all
cc1: out of memory allocating 16602960 bytes after a total of 79687680 bytes


I think that the only way we can do it then is crosscompiling it then.
Posts: 29
Joined: Sat May 19, 2012 9:28 am
Location: Madrid, Spain
by tk321 » Sun Jun 03, 2012 7:20 pm
SkG wrote:I think that the only way we can do it then is crosscompiling it then.

Or on a vm with qemu, or on the pi with swap turned on (maybe even on an external hd)...
Posts: 31
Joined: Sat Jun 02, 2012 6:09 pm
Location: UK
by ian.macarthur123 » Sun Jun 03, 2012 8:14 pm
tk321 wrote:Or on a vm with qemu, or on the pi with swap turned on (maybe even on an external hd)...


Yeah - I'd go for that (large swap on an external USB disk) as I've managed to build a few big packages (though not ffmpeg) on my pi now, even with -j3 set to make, and didn't go OOM...

So, that would be my tip, anyway!
Posts: 32
Joined: Thu Nov 17, 2011 10:58 pm
Location: Edinburgh
by plugwash » Sun Jun 03, 2012 11:53 pm
My suggestion would be to use qemu in user mode. I setup a dev vm with qemu-user based chroots for those who don't fancy setting it up themselves.

viewtopic.php?f=66&t=7345
Forum Moderator
Forum Moderator
Posts: 2242
Joined: Wed Dec 28, 2011 11:45 pm
by shirro » Mon Jun 04, 2012 12:33 am
I successfully compiled omxplayer on the Pi under Debian Squeeze. I think when I did the Raspbian one I may have cheated and done it on Raspbian on another arm board but with a bit of swap and removing that -j I am pretty sure it would work on the Pi.

I badly hacked the Makefiles I am afraid so I am not all that keen to distribute them but they can be taken from http://dl.dropbox.com/u/432382/hacked-r ... xfiles.tgz - I did this while sleep deprived and choking on phlegm so really, really messy. If you must redistribute, please tidy it up first.

A compiled omxplayer for Raspbian is at http://dl.dropbox.com/u/432382/omxplayer-dist.tgz - the bin and lib contents need to be copied into /usr. It will get packaged eventually it it hasn't been already. I struggle to keep up sometimes.
Posts: 248
Joined: Tue Jan 24, 2012 4:54 am
by tk321 » Mon Jun 04, 2012 10:32 am
That's some good work shirro! However, do you actually get a picture? I don't:
Code: Select all
$ LD_LIBRARY_PATH=/opt/vc/lib/:../lib ./omxplayer.bin ~/mnt/test.flv
* failed to open vchiq instance
$ sudo chmod a+rw /dev/vchiq
$ LD_LIBRARY_PATH=/opt/vc/lib/:../lib ./omxplayer.bin ~/mnt/test.flv
[flv @ 0x16f8e60] Estimating duration from bitrate, this may be inaccurate
file : /home/raspbian/mnt/test.flv reult 99 format flv audio streams 1 video streams 1 chapters 0 subtitles 0
Video codec omx-h264 width 854 height 480 profile 77 fps 29.970030
Audio codec aac channels 2 samplerate 44100 bitspersample 16

So it works but doesn't output anything. Same problem with my own compiled binary. What am I doing wrong?
Posts: 31
Joined: Sat Jun 02, 2012 6:09 pm
Location: UK
by shirro » Mon Jun 04, 2012 11:19 am
I have only tried it on h264 and xvid codecs in .mp4 or .avi containers. It works for me. It looks to be decoding the .flv format ok but I haven't tried that. What is your memory split? You will need 192 or 128, the 224 will not work.
Posts: 248
Joined: Tue Jan 24, 2012 4:54 am
by tk321 » Mon Jun 04, 2012 2:33 pm
Thanks, it was the memory, I'm using pisces image which defaults to 224MB.

I've forked omxplayer so that it natively compiles on the pi under raspbian using the libav*-dev libraries (no need to compile ffmpeg anymore). You'll need a few additional dev-packages to make it work, but I don't exactly remember all of them, but basically it goes like this:
Code: Select all
$ apt-get install libpcre3-dev libavfilter-dev libavformat-dev libavcodec-dev libswscale-dev
$ git clone https://github.com/ttk592/omxplayer
$ cd omxplayer
$ make
$ make dist                       # optional
$ sudo chmod a+rw /dev/vchiq      # in case it is not writable by the user
$ ./omxplayer file.avi            # be sure you are not on the 224MB split

Any feedback welcome, also what needs to be done to get a package like this into one of the official repos?
Posts: 31
Joined: Sat Jun 02, 2012 6:09 pm
Location: UK
by plugwash » Mon Jun 04, 2012 2:45 pm
tk321 wrote:Any feedback welcome, also what needs to be done to get a package like this into one of the official repos?

We are looking at creating archive areas for this stuff in the raspbian repo it will just take a bit of time.

Once we have created the archive areas someone trusted (currently mpthompson or I but we probablly need to think about expanding this list) will need to review what you have done, build it and upload it to the repo.
Forum Moderator
Forum Moderator
Posts: 2242
Joined: Wed Dec 28, 2011 11:45 pm
by shirro » Mon Jun 04, 2012 2:57 pm
tk321 wrote:I've forked omxplayer so that it natively compiles on the pi under raspbian using the libav*-dev libraries


Nice. I should have tried that. Compiling the ffmpeg stuff takes a lot of the time and having duplicates of the libraries is just silly. I will have to rebuild using your repo now :-)
Posts: 248
Joined: Tue Jan 24, 2012 4:54 am
by SkG » Mon Jun 04, 2012 6:58 pm
tk321 wrote:I've forked omxplayer so that it natively compiles on the pi under raspbian using the libav*-dev libraries (no need to compile ffmpeg anymore)


Perfect! I'm trying it. If there is no real dependencies with ffmpeg I think you can clean Makefile a little bit more and delete Makefile.ffmpeg and that source is ready for Raspbian.
Posts: 29
Joined: Sat May 19, 2012 9:28 am
Location: Madrid, Spain
by john.mills » Mon Jun 04, 2012 7:41 pm
Hi Shirro,

Apologies if this sounds an uninformed question, is there a technical reason as to why Omxplayer will not run on systems with 224MB RAM? Surely we need to maximise the amount of RAM available to the PI hardware for other tasks, or does OMXplayer just need 64 of dedicated RAM as a minimum? Would it be possible to correct Omxplayer to work with 224MB systems?

Best regards and thanks,

John
Posts: 81
Joined: Mon Apr 09, 2012 5:23 am
by SkG » Mon Jun 04, 2012 8:38 pm
Hi,

I made some Makefile cleaning and created the scrips for making .deb
Can anyone test this deb?
https://github.com/downloads/skgsergio/omxplayer/omxplayer_0.0.1-amdhf.deb

First you will need to install this:
apt-get install libpcre3 libavfilter2 libavformat53 libavcodec53 libswscale2 libpcrecpp0 libva-x11-1 libva1
Then:
dpkg -i omxplayer_0.0.1-amdhf.deb

I will try tomorrow into a clean setup
Posts: 29
Joined: Sat May 19, 2012 9:28 am
Location: Madrid, Spain
by SkG » Mon Jun 04, 2012 9:08 pm
I made some test with my deb and with binarys from shirro and I cant get any video output. I'm using 192 and 128...
Posts: 29
Joined: Sat May 19, 2012 9:28 am
Location: Madrid, Spain