Log in

View Full Version : Need to join several MP4 files - mp4box or ffmpeg? Or neither?


Cyber Akuma
17th July 2017, 21:25
I am running on a Windows machine.

I need to join several mp4 files that my camcorder split into 4GB files (though I don't know why since my SDcard is formatted in exFAT). No need for any transitions in-between or re-encoding or anything like that, they are one continious video and I just want to combine the files themselves into a single one, there should be no gaps from when my camcorder split them.

Would it be better to use mp4box or ffmpeg for this? Or is there another better solution?

I tried using mp4box but I can't figure out the proper syntax, everything I Google uses a different one. Namely, it's not clear if you should use -add for the first file and -cat for all the others, or just use -cat for all of the files.

E.G.:

MP4Box -add file1.mp4 -cat file2.mp4 -cat file3.mp4 -cat file4.mp4 -new output.mp4
vs
MP4Box -cat file1.mp4 -cat file2.mp4 -cat file3.mp4 -cat file4.mp4 -new output.mp4

Is there even a difference between what would happen if I used one or the other?

manolito
18th July 2017, 02:38
Maybe you should try out MP4Joiner...
www.mp4joiner.org

Cheers
manolito

pc_speak
24th July 2017, 04:54
for %%a in (*.mp4) do echo file '%%a' >> list.txt
ffmpeg -safe 0 -f concat -i list.txt -vcodec copy -acodec copy video.mp4
del list.txt

Cheers

Ghitulescu
24th July 2017, 06:01
for %%a in (*.mp4) do echo file '%%a' >> list.txt
ffmpeg -safe 0 -f concat -i list.txt -vcodec copy -acodec copy video.mp4
del list.txt
In theory all programs and solutions work, in reality only the one below:

https://forum.doom9.org/showthread.php?t=174644

ffmpeg -i input1.mp4 -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate1.ts
ffmpeg -i input2.mp4 -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate2.ts
ffmpeg -i "concat:intermediate1.ts|intermediate2.ts" -c copy -bsf:a aac_adtstoasc output.mp4

SaundraChaffin
14th August 2017, 07:56
In theory all programs and solutions work, in reality only the one (http://freebaccarat.info) below:

https://forum.doom9.org/showthread.php?t=174644

ffmpeg -i input1.mp4 -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate1.ts
ffmpeg -i input2.mp4 -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate2.ts
ffmpeg -i "concat:intermediate1.ts|intermediate2.ts" -c copy -bsf:a aac_adtstoasc output.mp4

Oh, that's quite handy!
Thanks!