1

I am using below demo for creating slow and fast motion video in android application.

https://github.com/google/grafika

I am able to play slow and fast motion video in application but now i want to export this video to SD card.

I use TextureView to show video in app. I use this java file to control speed of video. https://github.com/google/grafika/blob/master/src/com/android/grafika/SpeedControlCallback.java

How can i do this? any help will be appreciated.

fadden
  • 51,356
  • 5
  • 116
  • 166
Kishor Ramani
  • 607
  • 1
  • 6
  • 12

1 Answers1

1

Hi you have to use a MediaMuxer, call AddTrack for the video track and write the data to this track to the muxer after encoding each frame. You can see some examples in grafika page, one of them could be this: https://github.com/google/grafika/blob/master/src/com/android/grafika/ContinuousCaptureActivity.java (here you canhow to do both displaying on screen and recording on SD) and another one: https://github.com/google/grafika/blob/master/src/com/android/grafika/CameraCaptureActivity.java

Also you can find more examples here: http://www.bigflake.com/mediacodec/

Thanks

Gabriel Bursztyn
  • 656
  • 8
  • 24
  • You are welcome. If you think that it has answered your question, please check the answer as the accepted one. – Gabriel Bursztyn Feb 02 '16 at 14:38
  • Also you can check http://stackoverflow.com/questions/34996433/decoding-video-and-encoding-again-by-mediacodec-gets-a-corrupted-file/ where I have left a solution without the Mediamuxer you should add it. – Gabriel Bursztyn Feb 02 '16 at 14:39