Search code examples
androidffmpegvideo-processingandroid-mediacodec

Adding Overlays to Videos export as a video in android


So i have a video for eg. a race car video and i created a overlay view (transparent relative layout) which includes some progress bar related to speed and performance now i need to export full video as seen in this view so can anyone please help me i have gone through ffmpeg,opencv but no success.

Similar Ios Overlay


Solution

  • You will be able to achieve using opencv org.bytedeco.javacpp, i used FFmpegFrameGrabber for garbing frame and FFmpegFrameRecorder recording this images back to mp4 with the same audio codex.

    Dependencies needed:

        compile group: 'org.bytedeco', name: 'javacv', version: '1.4'
        compile group: 'org.bytedeco.javacpp-presets', name: 'opencv', version: '3.4.0-1.4', classifier: 'android-arm'
        compile group: 'org.bytedeco.javacpp-presets', name: 'ffmpeg', version: '3.4.1-1.4', classifier: 'android-arm'