ivan16luis / javacv

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

FFmpegFrameRecorder has no support for audio #160

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
hi, samuel, 
    I am new to Android, android I want to use javacv/ffmpeg to encode camera data into .flv(h.264/aac), can javacv/ffmpeg be used in this way?
    Thank you very much!
What steps will reproduce the problem?
1.I have got data from Android camera(in onPreviewFrame(byte[] data, Camera 
camera))
2.I want to use JavaCV/FFmpeg to encode the data into flv(h.264/aac)
3.Can javacv/ffmpeg be used in this way?

What is the expected output? What do you see instead?
I just want to know that can javacv/ffmpeg be used in this way? And it would be 
better there is a demo, ha.

What version of the product are you using? On what operating system?
andriod 2.3, lenovo S2005A

Please provide any additional information below.
I would very much appreciate if you help me, thank you.

Original issue reported on code.google.com by zhangqia...@gmail.com on 27 Feb 2012 at 3:22

GoogleCodeExporter commented 9 years ago
Sure it's possible. It requires some coding, you'll find what you need to know 
around the site and the mailing list, but I'll keep this issue opened as a RFE 
for a sample... Let me know if you would like to contribute your code if you 
get it working, thank you.

Original comment by samuel.a...@gmail.com on 27 Feb 2012 at 3:41

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
No, I think the easiest way would be to use FFmpegFrameRecorder. We can copy 
the YUV byte[] data into an IplImage, call cvCvtColor() on that, and write the 
output image using the recorder, e.g.:

FrameRecorder recorder = new FFmpegFrameRecorder("video.mp4", imageWidth, 
imageHeight); 
recorder.setCodecID(CODEC_ID_MPEG4);
recorder.setFormat("mp4");
recorder.setPixelFormat(PIX_FMT_YUV420P);
recorder.start();
// loop ...
cvCvtColor(yuvimage, bgrimage, CV_YUV420sp2BGR)
recorder.record(bgrimage);

I guess though if we are going to write YUV420P video data anyway, we should 
allow YUV images as input to FFmpegFrameRecorder and skip the RGB conversions 
... 

Or if you do no wish the OpenCV dependency, then you can always copy 
FFmpegFrameRecorder and hack your own mod. I am sure someone has done something 
like that. You should ask on the mailing list...

Original comment by samuel.a...@gmail.com on 28 Feb 2012 at 4:50

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]