EngnzWaks / javacv

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

FFmpeg built without support for multithreading or NEON instructions #203

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.     recorder = new FFmpegFrameRecorder(savePath, 
                video_width, video_height); 
        recorder.setCodecID(avcodec.CODEC_ID_MPEG4);
        recorder.setFormat("mp4"); 
        recorder.setPixelFormat(avutil.PIX_FMT_YUV420P); 
        recorder.setBitrate(2200*1024);
        recorder.setFrameRate(30);
        try {
            recorder.start();
        } catch (com.googlecode.javacv.FrameRecorder.Exception e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
2.     Camera.Parameters parameters = camera.getParameters();
    parameters.setPreviewSize(video_width, video_height);
    parameters.setPreviewFrameRate(30);
    this.camera.setParameters(parameters);
3.     public void onPreviewFrame(byte[] data, Camera camera) {
        // TODO Auto-generated method stub
        IplImage image = IplImage.create(video_width, video_height, IPL_DEPTH_8U, 2);//1黑白2彩色
            image.getByteBuffer().put(data);
        try {
            recorder.record(image);
        } catch (com.googlecode.javacv.FrameRecorder.Exception e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
            }
    }

What is the expected output? What do you see instead?
I also set up a camera and FFmpegFrameRecorder The framerate is 30, but the 
results mp4 files will be the same as the fast-forward, for example, I shot 
video of 10 seconds, the result is only 2 seconds

What version of the product are you using? On what operating system?
Google Galaxy Nexus Android4.0.4

Please provide any additional information below.
If I set the framerate to 10, shot 10 seconds of video can be 10 seconds mp4 
files.
I have done in other models tested, the same results, you can rule out models.

Original issue reported on code.google.com by zhanght2...@gmail.com on 15 May 2012 at 3:41

Attachments:

GoogleCodeExporter commented 8 years ago
You say that it works fine at 10 FPS, so your CPU just isn't powerful enough to 
encode at 30 FPS. You could try to recompile FFmpeg with NEON instructions if 
your CPU supports that, does it?

Original comment by samuel.a...@gmail.com on 15 May 2012 at 3:46

GoogleCodeExporter commented 8 years ago
Thanks,samuel. I found the download provides the ffmpeg-0.7.11-android-arm.zip, 
which libs armeabi-v7a, I can use?

Original comment by zhanght2...@gmail.com on 15 May 2012 at 4:15

GoogleCodeExporter commented 8 years ago
Yes, recompile that and try it out. I guess it could be nice to provide more 
builds for Android. If you or someone else want to contribute these builds, 
please let me know!

Original comment by samuel.a...@gmail.com on 15 May 2012 at 8:08

GoogleCodeExporter commented 8 years ago
I verified with you that set the frame rate of 15 to shoot 10 seconds, does not 
perform record can get the 150 the contrary the number of frames is only about 
100

Original comment by zhanght2...@gmail.com on 15 May 2012 at 1:03

GoogleCodeExporter commented 8 years ago
For JavaCV 0.2, I've just upgraded the Android build to FFmpeg 0.11.1 and 
compiled with NEON instructions and pthreads, so the performance should be much 
better, on the appropriate hardware anyway. Please check it out and let me know 
the results, thanks!

Original comment by samuel.a...@gmail.com on 22 Jul 2012 at 5:46