title: Android MediaCodec Time Scaling
body: <p>I'm attempting to adjust the speed of a video (either slower or faster) using MediaCodec.  I'm able to user this for doing real-time filtering by decoding - filtering - encoding.  However, I'm having difficulty adjusting the rate at which the decoding / encoding is done as well as adjusting timestamps to:
  1) duplicate frames to be sent to encoder
  2) drop frames from decoder going to encoder</p>
  
  <p>To end with a final 30fps video that has adjusted duration and perceived speed.</p>
  
  <p>I've looked at this link:
  <a href="https://android.googlesource.com/platform/cts/+/jb-mr2-release/tests/tests/media/src/android/media/cts/ExtractDecodeEditEncodeMuxTest.java" rel="nofollow">https://android.googlesource.com/platform/cts/+/jb-mr2-release/tests/tests/media/src/android/media/cts/ExtractDecodeEditEncodeMuxTest.java</a></p>
  
  <p>How can I pause/resume decoding / encoding to accommodate these needs?
  Is there an alternative way to do this with MediaCodec?</p>
  
  <p>Thanks!</p>