How to use libavformat for a separate encoder?

Posted by Brendon Tsai on Stack Overflow See other posts from Stack Overflow or by Brendon Tsai
Published on 2014-06-05T03:21:15Z Indexed on 2014/06/05 3:25 UTC
Read the original article Hit count: 178

Filed under:
|
|
|

I've build a encoder based on the sample of QUALCOMM, which captures the video and compresses it into h264 file. I am using Android 4.2.2. Now I want to add a mp4 muxer into this encoder(actually, just video will be fine, I don't need audio).

I want to use FFMpeg. But after I read the example, I found out that the muxer was using the encoder of FFMpeg. I don't know how to use the muxer part for another encoder.

I've read this post, but I don't understand how the code provide video stream to the muxer. I think that mainly because I don't understand these code:

AVCodecContext * strmCodec = oFmtCtx->streams[0]->codec;

// Fill the required properties for codec context.
// *from the documentation:
// *The user sets codec information, the muxer writes it to the output.
// *Mandatory fields as specified in AVCodecContext
// *documentation must be set even if this AVCodecContext is
// *not actually used for encoding.
my_tune_codec(strmCodec); 

Can anyone give me a hint? Thank you!

© Stack Overflow or respective owner

Related posts about android

Related posts about video