0

I am trying to re-encode existing video frames to create a video which will have all frames as keyframes(I-frames). The current grafika project has a CameraCaptureActivity which in turn uses VideoEncoderCore to encode videos. I have modified this to record a video from camera so that i'll have all frames as Keyframes but this module has lot of moving parts and that is making it hard to uncouple it from renderer and camera to have a smooth pipeline of frames going into encoded video with all supplied frames as keyframes. Any Ideas?

saurabytes
  • 9
  • 1
  • 3
  • You can't set flags on buffers with Surface-input mode, so you're limited to setting the frame rate to 1 FPS, and setting the I-frame interval to 1, in the MediaCodec config. See also http://stackoverflow.com/questions/22987816/ . – fadden Apr 14 '14 at 23:00
  • For the CameraCaptureActivity I am still using the highest FPS available but have set the I frame interval to 0 which is pushing out all framedata as I frames. Thats working as expected. What I am curious about is how to use the mixer and encoder with already available data and still get all I-frames – saurabytes Apr 15 '14 at 15:35
  • I'm not sure I'm understanding. MediaMuxer doesn't re-encode anything, it just repackages whatever it gets from the encoder. If you want to have previously-encoded data stored as nothing but I-frames you'd need to decode and re-encode it. – fadden Apr 15 '14 at 18:15
  • Yeah, @fadden you are right. I have setup the encoder(VideoEncoderCore) for CameraCaptureActivity with a format that says the `IFRAME_INTERVAL = 0;`. This is recording a video with all I-frames. I wanna do something similar in which i'll provide decoded data from a video to some sort of encoder pipeline which will encode the given data as an I-frame into a video. Sorry, if m not making myself clear. – saurabytes Apr 15 '14 at 22:19
  • The DecodeEditEncode example from bigflake is probably closer to what you want (http://bigflake.com/mediacodec/#DecodeEditEncodeTest). – fadden Apr 15 '14 at 22:34

0 Answers0