How to merge several MP4 files into one?

Microsoft Windows specific usage questions
Forum rules
Please post only Windows specific questions in this forum category. If you don't know where to post, please read the different forums' rules. Thanks.
Theofilos
New Cone
New Cone
Posts: 4
Joined: 15 Jan 2023 17:09

How to merge several MP4 files into one?

Postby Theofilos » 15 Jan 2023 17:33

Hello

How to merge several MP4 files into one?

I have VLC 3.0.11.
After selecting File>Open multiple files..., I selected several mp4 files to merge.
At the bottom I selected convert.
This showed up
Image
There is no way to select the destination file, because VLC took both multiple source files (that's good) and multiple destination files (that's bad). There should be one.

Regards

Lotesdelere
Cone Master
Cone Master
Posts: 9960
Joined: 08 Sep 2006 04:39
Location: Europe

Re: How to merge several MP4 files into one?

Postby Lotesdelere » 16 Jan 2023 09:11

I'm not sure it's doable with VLC, at least through the GUI. Because VLC is not an editor.

You'd better use a dedicated video editor tool such as AviDemux:
http://avidemux.sourceforge.net

Theofilos
New Cone
New Cone
Posts: 4
Joined: 15 Jan 2023 17:09

Re: How to merge several MP4 files into one?

Postby Theofilos » 16 Jan 2023 11:24

Apparently this is possible:
https://docs.videolan.me/vlc-user/3.0/e ... ideos.html

I have 3 MP4 files with audio track only:
sample1.mp4 - 26:44
sample2.mp4 - 0:04
sample3.mp4 - 7:45
I transcoded them just in case, but it doesn't change anything.

I used Mode I.

Code: Select all

vlc sample1.mp4 sample2.mp4 sample3.mp4 --sout="#gather:std{access=file, mux=ts, dst=wynik.mp4}" --sout-keep
Firstly, VLC incorrectly shows a time of 7:52 for the result.mp4 file. The time runs on.

Image
Image

Secondly, the wynik.mp4 has only 26:44, i.e. the files have not been merged.

Why?

Lotesdelere
Cone Master
Cone Master
Posts: 9960
Joined: 08 Sep 2006 04:39
Location: Europe

Re: How to merge several MP4 files into one?

Postby Lotesdelere » 17 Jan 2023 10:20

For an MP4 final file you should use mux=mp4, not ts.

Theofilos
New Cone
New Cone
Posts: 4
Joined: 15 Jan 2023 17:09

Re: How to merge several MP4 files into one?

Postby Theofilos » 17 Jan 2023 13:02

Thank you very much.
It does indeed work.
So there is an error in the documentation.

One more thing.
After entering the command (under Windows):

Code: Select all

vlc sample1.mp4 sample2.mp4 sample3.mp4 --sout="#gather:std{access=file, mux=mp4, dst=wynik.mp4}" --sout-keep
Three instances of the VLC window appear. Two disappear and one remains.
The resulting file wynik.mp4 has zero value for a very long time.
It is not clear whether to close the window or wait.
Nothing happens in the window.

Lotesdelere
Cone Master
Cone Master
Posts: 9960
Joined: 08 Sep 2006 04:39
Location: Europe

Re: How to merge several MP4 files into one?

Postby Lotesdelere » 18 Jan 2023 11:21

I'm sorry but I'm not familiar enough with VLC command line syntax, let's hope a dev will clarify that.

jimmyjak
Blank Cone
Blank Cone
Posts: 11
Joined: 25 Aug 2021 23:05

Re: How to merge several MP4 files into one?

Postby jimmyjak » 23 Jan 2023 00:09

Yeah, merging never seems to finish. File size stays at 0 for a long time, then jumps up to a real value, but the file always stays in use by VLC. When you finally close VLC, the file size jumps up a little more and is properly closed. If you try to play the file, all the audio past file1 is gone. Video plays to the end, but file seems corrupted somehow.

chrisjj2
Blank Cone
Blank Cone
Posts: 16
Joined: 02 Oct 2019 21:38

Re: How to merge several MP4 files into one?

Postby chrisjj2 » 29 Jan 2023 13:30

I'm guessing Merge is a misnomer, the operation in fact being Concatenate.


Return to “VLC media player for Windows Troubleshooting”

Who is online

Users browsing this forum: No registered users and 27 guests