

That’s it! merged.mkv is the file you want.Gradle Dependency implementation "com.writingminds:FFmpegAndroid:0.3.2"Ĭommand to concate two videos side by side into one val cmd : arrayOf("-y", "-i", videoFile!!.path, "-i", videoFileTwo!!.path, "-filter_complex", "hstack", outputFile.path)Ĭommand to append two videos (one after another) into one val cmd : arrayOf("-y", "-i", videoFile!!.path, "-i", videoFileTwo!!.path, "-strict", "experimental", "-filter_complex", $ avconv -i video.mkv -itsoffset 00:00:00.2 -i audio96.aac -acodec copy -vcodec copy merged.mkv Let’s say that you need to add some delay to the audio as well. Copy audio and video tracks to the same directory and merge them.


$ avconv -i audio.aac -c:a aac -b:a 96k audio96.aac To convert the audio bitrate to 96kbps:.$ avconv -i handbrake_out.mkv -an -vcodec copy video.mkv Extract the video track from HandBrake output (which is in MKV format).$ avconv -i original.mp4 -map 0:3 -vn -acodec copy audio.aac $ avconv -i original.mp4 -vn -acodec copy audio.aac Check the audio track information from the original file.Other tools that come in handy (due to codec issues) are mencoder and mkvtoolnix. As transcoding takes time, in many cases I extract the audio track from the source multimedia file and merge it with the video track of the HandBrake output. I prefer to keep the audio bitrate at 96 kbps but sometimes the sound quality of the output audio file is compromised. Sometimes I face a problem while transcoding multimedia files with HandBrake.
