Page 1 of 1

Merge videos of different bitrate and resolution

Posted: Wed Sep 18, 2013 12:33 pm
by Priyal
Hello

I want to merge many video clips that has audio in them and are of different bitrates as well as use different codecs.

I tried the following command:

ffmpeg -i 1.mp4 -sameq 1.mpg
ffmpeg -i 2.mp4 -sameq 2.mpg
cat 1.mpg 2.mpg | ffmpeg -f mpeg -i - -sameq -vcodec mpeg4 output.mp4

But output.mp4 does not have synchronized audio or sometimes has no audio.

I also tried combination of mp4box but faced similar issue.

ffmpeg -i D:\n.mp4 -c:v libx264 -vf scale=426:238 -r 60 -c:a aac -ar 48000 -b:a 160k -strict experimental -f mpegts D:\1.ts

ffmpeg -i D:\new.mp4 -c:v libx264 -vf scale=426:238 -r 60 -c:a aac -ar 48000 -b:a 160k -strict experimental -f mpegts D:\2.ts

mp4box -cat D:\1.mp4 -cat D:\2.mp4 D:\13.mp4

I also tried mencoder:

mencoder -audio-preload 0.0 -oac copy -ovc copy -o D:\output1.mp4 D:\test.mp4 D:\n.mp4

But it gave poor distracted video.

Please suggest the solution for merging videos.

Thanks in advance

Re: Merge videos of different bitrate and resolution

Posted: Fri May 03, 2019 7:59 am
by Harleycarr
I'm having a similar issue trying to concate 2 mp4 files and the second one has audio out of sync-progressively worse as it plays. I need to merge looslessly and without realizing-encoding. it seems that either the fps are different, or the timestamp do not align. I'm not sure how to solve the problem though. Have you had any luck with your own solution? I am limited to only Android software solutions.