saravans / javacv

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

Ability to do a direct stream copy of audio and / or video instead of re-encoding #456

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
Default behaviour and of Framegrabber and Framerecorder.

What is the expected output? What do you see instead?
Ability to do a direct stream copy of video and/or audio into the output 
container file. Instead, video / audio is decoded from source and re-encoded in 
output. 

What version of the product are you using? On what operating system?
Version 0.7 for Android

Please provide any additional information below.
This would be a useful feature and knock back on CPU time for certain 
operations. In addition, the original quality of the source will be maintained 
instead of loosing quality through re-encoding.

Original issue reported on code.google.com by johannmy...@gmail.com on 3 Apr 2014 at 8:12

GoogleCodeExporter commented 9 years ago
Would be great, I agree.

Original comment by samuel.a...@gmail.com on 11 Apr 2014 at 2:14

GoogleCodeExporter commented 9 years ago
Samuel, any idea how to go about this?

Original comment by johannmy...@gmail.com on 11 Apr 2014 at 3:19

GoogleCodeExporter commented 9 years ago
We can short circuit the code in FFmpegFrameGrabber and FFmpegFrameRecorder, 
that's not a problem. Feel free to do what needs to be done and upload your 
changes here.

The problem is coming with a nice API that supports everything.

Original comment by samuel.a...@gmail.com on 11 Apr 2014 at 11:06

GoogleCodeExporter commented 9 years ago
Hi Samuel,

I have tried copying the audio packets directly from the FFMPEGFrameGrabber to 
the FFMPEGFrameRecorder (and thus skipping the encoding to and from a Frame) 
but I get an error -22 on av_interleaved_write_frame which according to my 
research might have something to do with the fact that the pointers to the 
video packets are needed to write the audio. I'm using a recorder instance that 
in a previous step has written video frames and is still open so I'm assuming 
that various video stream pointers are still initialized from previous writing 
of video packets.

My knowledge is very limited on FFMPEG so to be honest I don't really know what 
I'm doing here, just best guesses on my part. Any advice would be appreciated!

Original comment by johannmy...@gmail.com on 18 Apr 2014 at 7:14

GoogleCodeExporter commented 9 years ago
My advice? Check what they do in ffmpeg.c, and do the same thing in your 
application :)

Original comment by samuel.a...@gmail.com on 18 Apr 2014 at 11:35