Home Merging 2 Mp4 videos Using FFMPEG [writing minds]
Reply: 0

Merging 2 Mp4 videos Using FFMPEG [writing minds]

user1315
1#
user1315 Published in May 24, 2018, 11:17 pm

I'm trying to concatenate multiple videos[Different Source] on Android. I have already used ffmpeg for other needs,Its working fine.But here when am trying to merge videos[diff codecs in audio and video and resolution] it merges and give an output but The video output we get is corrupted after 5-10 seconds and cannot be played further.works fine if all videos are from same source. i can provide the videos i have used .

This is the code i have used

ffmpeg -i video1.avi -i video2.mp4 -i video3.webm -filter complex “[0:v:0] [0:a:0] [1:v:0] [1:a:0] [2:v:0] [2:a:0] concat=n=3:v=1:a=1 [v] [a]” -map “[v]” -map “[a]” output_video.mp4

also i tried using

-f concat -i " + path + "list.txt -c copy " + path + mergedVideoName + ".mp4

All the videos used here are run under these command for making video resolution audio sample rate and video codecs same

ffmpeg -i 2_NVW3BCYHFNZC4K09.mp4   -vf scale=1280:720,setsar=16:9  -ar 44100 test4.mp4 -hide_banner

Gradle dependency used:

compile 'com.writingminds:FFmpegAndroid:0.3.2'

THIS CODE WORKS FINE WITH ANY VIDEOS IN SYSTEM[PC] AND NOT IN ANDROID DEVICE

Thanks in advance

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.355683 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO