jloyd / javacv

Automatically exported from code.google.com/p/javacv
GNU General Public License v2.0
0 stars 0 forks source link

ffmpeg-0.6.1-android doesn't work on HTC HD2? #63

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.Create Android project targeted at 2.2.1
2.debug with cellphone htc hd2
3.use code:
 FFmpegFrameGrabber c = new FFmpegFrameGrabber("/sdcard/320.avi");

        try {
            c.start();
        } catch (Exception e1) {
            // TODO Auto-generated catch block
            e1.printStackTrace();
        }
then, it would block infinitely at line "c.start()".
The movie is coded as 480*320 mpeg4.
So what's the problem? This device doesn't support fpu or something else?
Or if I could use other method to load viedo on Android? 

What is the expected output? What do you see instead?

What version of the product are you using? On what operating system?
HTC HD2

Please provide any additional information below.

Original issue reported on code.google.com by haix2...@gmail.com on 2 May 2011 at 3:15

GoogleCodeExporter commented 9 years ago
Do you get any messages in the log file?

Original comment by samuel.a...@gmail.com on 2 May 2011 at 4:58

GoogleCodeExporter commented 9 years ago
I attach log and statck snap image. In logcat, there are many "no jni_onload 
found in ....so, skipping init".  It block at " if 
(av_find_stream_info(pFormatCtx) < 0) {" when I step in start() method of 
FFmpegFrameGrabber.

Original comment by haix2...@gmail.com on 2 May 2011 at 6:06

Attachments:

GoogleCodeExporter commented 9 years ago
Can you look further in the log for any other messages? And please send text 
files, not screenshots

Original comment by samuel.a...@gmail.com on 2 May 2011 at 6:14

GoogleCodeExporter commented 9 years ago
Also, please make sure the same file works with FFmpeg on Windows, Linux, Mac 
OS X, etc.

Original comment by samuel.a...@gmail.com on 2 May 2011 at 6:22

GoogleCodeExporter commented 9 years ago
I have attached my log exported from logcat. And I test my video on Windows, 
and change it to other file format, like avi, wmv, mp4(all have the same 
encoder mpeg4). And I also tested when use Android SDK API MediaPlayer to play, 
it's ok. But I cannot load with FFmpegFrameGrabber. And I don't know is there 
any other way to load viedo then construct it to IplImage, except 
FFmpegFrameGrabber. thx.

Original comment by haix2...@gmail.com on 2 May 2011 at 7:29

Attachments:

GoogleCodeExporter commented 9 years ago
Are you trying to tell me there is nothing further in your log? If so, can you 
please make it clear? Tell me something like: "This is ALL my log, there is 
nothing else in it." thank you

And I didn't ask you if your file works in Windows Media Player or Android 
Media Player. I asked you to test if it worked with **FFmpeg** on /another/ 
platform than Android.

Original comment by samuel.a...@gmail.com on 2 May 2011 at 7:32

GoogleCodeExporter commented 9 years ago
I'm sorry to attach a wrong file. This log file is just exported from LogCat. 
And I'm sure my video file works with ffmpeg on windows.

Original comment by haix2...@gmail.com on 2 May 2011 at 7:49

Attachments:

GoogleCodeExporter commented 9 years ago
Alright, the file works with FFmpeg under Windows. Can you send me this file? 
Or another preferably smaller file that also does not work? thanks

Original comment by samuel.a...@gmail.com on 2 May 2011 at 8:00

GoogleCodeExporter commented 9 years ago
I attach my test video now. Thx.

Original comment by haix2...@gmail.com on 2 May 2011 at 8:06

Attachments:

GoogleCodeExporter commented 9 years ago
I'm using javacv-bin-20110407.zip and ffmpeg-0.6.1-android.zip. Thx.

Original comment by haix2...@gmail.com on 2 May 2011 at 8:09

GoogleCodeExporter commented 9 years ago
There is definitely a problem, but I have not figured out why it's acting like 
that yet...

Original comment by samuel.a...@gmail.com on 7 May 2011 at 9:36

GoogleCodeExporter commented 9 years ago
I've been trying the same code today on the LG Optimus using a 3gp video and 
get the same hang when av_find_stream_info is called. I can get the C version 
of the code to work that FFmpegFrameGrabber is based on but no luck with opencv 
Java :(

I've found a similar error refered to that suggested using 
av_lockmgr_register(), afraid I'm a n00b when it comes to exactly what 
threading is going on between Java and C in the bindings and how to debug it :(

Thanks for providing the libs Samuel, I've got further today with java opencv 
than I have in the past couple of weeks building from src :)

Original comment by dbrrredp...@googlemail.com on 7 May 2011 at 6:55

GoogleCodeExporter commented 9 years ago
The link to the av_find_stream_info locking indefinately I found here: 
http://libav-users.943685.n4.nabble.com/Very-slow-av-find-stream-info-td2251814.
html

Original comment by dbrrredp...@googlemail.com on 7 May 2011 at 7:48

GoogleCodeExporter commented 9 years ago
Ok, I got it working. Android's buggy library loader does not support symver, 
but the build tools say it does and FFmpeg is relying on that for backward 
compatibility. Since we don't need backward compatibility however, we can 
simply remove those bits. This new recompiled version works:
http://javacv.googlecode.com/files/ffmpeg-0.6.3-android.zip
Enjoy!

FYI, the problem is related to this:
https://lists.libav.org/pipermail/ffmpeg-user/2011-January/028389.html
What is & How to solve "Diverting av_*_packet function calls to libavcodec. 
Recompile to improve performance"

Original comment by samuel.a...@gmail.com on 8 May 2011 at 7:37

GoogleCodeExporter commented 9 years ago
Nice one! I can confirm the fix works for me too :)

Original comment by dbrrredp...@googlemail.com on 8 May 2011 at 9:15

GoogleCodeExporter commented 9 years ago
It works now!!!  Thank you samuel!

Original comment by haix2...@gmail.com on 10 May 2011 at 2:21