2009-03-16 20:00:25     ffmpeg 0.5 build

Document created by Aaronwu Employee on Aug 14, 2013
Version 1Show Document
  • View in full screen mode

2009-03-16 20:00:25     ffmpeg 0.5 build

Adam Dershowitz (UNITED STATES)

Message: 71055   


Has anyone had any luck getting the new ffmpeg 0.5 to run on a blackfin?


I had to make a few minor changes to the Makefile and to one other file, due to a link error.  Now it builds fine, and starts to run.  It opens the file, reports the typical ffmpeg stream info and mapping.  Then it immediatly reports:


Illegal Instruction and dumps.


The dump starts with:


Undefiled instruction


-May be used to emulate instructions that are not defined for a particular processor implementation.




I have tried to build both with --enable-swscale and without.  But give me the same result.


Any idea what is happening or how I can track it down?  I figured that since ffmpeg actually had a release it would be worth upgrading, especially since one of the reported changes is blackfin optimizations.








For anyone who wants to try the changes compile for themselves it was just a few things, so I didn't include a patch file, but I can if anyone wants.


For now:


in ffmpeg/Makefile




VER = ffmpeg-0.5 (from ffmpeg-svn11114)


--target-os=linux (from Linux it reported unknown)




--enable-postproc (was enable-pp on old version)


--disable-stripping (was disable-strip on old version)


Also in the romfs instruction I had to add libswscale.so.? to the list, when I have --enable-swscale.


Finally, there was a bug in libswscale/yuv2rgb.c around line 461.  It had:


t = sws_ff_bfin_yuv2rgb_get_func_ptr(c);  (This function is not defined, so gives a link error)


and it should be:




I also reported this bug to the ffmpeg developer list.




2009-03-16 20:07:48     Re: ffmpeg 0.5 build

Mike Frysinger (UNITED STATES)

Message: 71056   


i created a new Makefile, but i didnt test it running on the board.  it's attached if people want it.






2009-03-19 19:01:27     Re: ffmpeg 0.5 build

Adam Dershowitz (UNITED STATES)

Message: 71286   


I am curious if anyone has had any luck actually running this?  I can build it fine.  But if I run it on a 527 EZKit board, it starts, prints out the typical startup info then gives me an "Illegal instruction"


I have been in touch with the ffmpeg developers, but it seems that most of the Blackfin related changes were actually done by Marc Hoffman, and seem very similar to what is already in svn-11114.  So I am not sure why I can't get the new version to run at all.






2009-03-20 00:07:03     Re: ffmpeg 0.5 build

Mike Frysinger (UNITED STATES)

Message: 71290   


yes, Marc did the Blackfin work, but he no longer works for ADI


i have not attempted to run ffmpeg yet on actual hardware ... that's why i havent committed it




2009-03-20 17:37:05     Re: ffmpeg 0.5 build

Adam Dershowitz (UNITED STATES)

Message: 71320   


I have tried to run ffmpeg_g (which should be the debug version) with a remote debugger.  But when it crashes if I try to do a backtrace it seems that the stack is corrupt.


It also seems that ffmpeg and ffmpeg_g are identical, but it does seem to run with remote debugging.


Is it possible that the problem just relates to the amount of memory and that an early memory request then overwrites some code?


While running in the debugger the problem crops up before it even starts to do any actual decoding.




2009-03-23 04:35:55     Re: ffmpeg 0.5 build


Message: 71363   




If you think stack overflow may be a cause, you may try to check stack or set stacksize as this:




Also, why do you choose to use ffmpeg-0.5? As I understand, bug report/fix for ffmpeg is still based on svn trunk, not the released version.






2009-03-23 11:52:40     Re: ffmpeg 0.5 build

Adam Dershowitz (UNITED STATES)

Message: 71374   


I did try playing with some stack stuff, as you had suggested, but didn't have any luck finding the problem that way.


I was trying to update to 0.5 because there have been a bunch of changes and improvements to ffmpeg, so I figured instead of using the code from a few years ago it was time to go with the release version.  Of the many improvements listed with the release is Blackfin optimization.


And given the fact that it compiles I figured that was a good sign, but I am now pretty baffled about why I can't get it to actually run.  I even tried building a simple version of apiexample.c (included with the release).  I had to make a few minor changes (I took out the decoding audio part, and changed header locations).  And that now does compile, but also gives the illegal instruction.  The code itself is simple enough the it narrows it down to the libavcodec library used by both.  But that is as far as I have gotten in fixing it.




2009-03-23 14:19:15     Re: ffmpeg 0.5 build

Mike Frysinger (UNITED STATES)

Message: 71382   


the code in our uclinux dist is far from "a few years" old.  more like one year.  and it has all the Blackfin changes in it already.