saravans / javacv

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

Encoding video in H.264 format is slow #452

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hello, i need to stream H.264(video codec 28) live video to Red5 server from 
Android application, i have successfully integrated javacv-ffmpeg with my 
application, tested for default codec(22 FLV), it works fine. But now i need to 
switch on codec 28 H.264.
Here is what i have done
What steps will reproduce the problem?
1.recorder.setFormat("flv");
2.recorder.setVideoCodec(28);
3.recorder.setAudioCodec(86018);
4.recorder.setSampleRate(22050);
5.recorder.setFrameRate(30.0D);
6.recorder.start();

What is the expected output? What do you see instead?
Expected to see same results as for codec 22.
This creates h.264 stream which i can see on red5 server but, it is very slow, 
looks like 2/3 frames per seconds.

What version of the product are you using? On what operating system?
I am using javacv-0.7 version

Please provide any additional information below.

Original issue reported on code.google.com by vishalc...@gmail.com on 31 Mar 2014 at 2:02

GoogleCodeExporter commented 9 years ago
setting recorder.setFormat("mp4"); crashes the application.
Here is the stacktrace

Original comment by vishalc...@gmail.com on 31 Mar 2014 at 2:24

Attachments:

GoogleCodeExporter commented 9 years ago
Have you tried the "ultrafast" preset by calling 
FrameRecorder.setVideoOption("preset", "ultrafast")?

BTW, if you still have problems, could you please copy/paste the error messages 
that you get from FFmpeg on the console? This isn't going to work on Android, 
so please use Java SE to check that, thank you.

Original comment by samuel.a...@gmail.com on 31 Mar 2014 at 2:28

GoogleCodeExporter commented 9 years ago
Thanks.. setting FrameRecorder.setVideoOption("preset", "ultrafast") works like 
charm.

Original comment by vishalc...@gmail.com on 1 Apr 2014 at 6:31

GoogleCodeExporter commented 9 years ago
Ok, good. Please ask your questions on the mailing list next time if possible, 
not here, thank you.

Original comment by samuel.a...@gmail.com on 1 Apr 2014 at 12:19