Page 1 of 1

Append multiple files into one file.

Posted: 08 Aug 2012 18:46
by netskink
Hello

I was trying to use the vlc gui to append two files into one, but it did not work. I found a site on the wiki which gave info on how to do it. I used this method but it does not work. I get an output file with 0 bytes. Here is the batch file I used.



@echo off
set file1= xw-cw-top-heals-loss-a.avi
set file2= xw-cw-top-heals-loss-b.avi
vlc %file1% %file2% --sout "#gather:std{access=file,mux=ts,dst=out.avi}" --sout-keep

-----------------
I put this batch file in the directory where the two source avi files are located. I added the path to vlc.exe in my system path. Then I change directories to the directory where the two source files are located and run it. Running the batch file will pull up the vlc gui and it in the playlist pane it will show the two files and begin to save it - at least I think. The record button is red and it looks like it is doing something. When the red record button disables and the play progress bar stops, I close down vlc. In the folder where the two source files are located a new file named out.avi is located. However the file is zero bytes.

Once I get this working, I want to also want to merge an audio mp3 file. But, I can do that with the gui once I have a combined file.

John

Re: Append multiple files into one file.

Posted: 08 Aug 2012 19:11
by RĂ©mi Denis-Courmont
I guess your Batch file syntax is incorrect.

Re: Append multiple files into one file.

Posted: 08 Aug 2012 19:35
by netskink
The batchfile generates the following output
vlc xw-cw-top-heals-loss-a.avi xw-cw-top-heals-loss-b.avi --sout "#gather:std{access=file,mux=ts,dst=out.avi}" --sout-keep

It looks like the same format as seen here:
http://wiki.videolan.org/How_to_Merge_a ... ple_Videos
which gives the following example
% vlc file1.ps file2.ps file3.ps --sout "#gather:std{access=file,mux=ts,dst=all.ts}" --sout-keep

The only change I have is the all.ts to out.avi which I think is just a filename.

Re: Append multiple files into one file.

Posted: 08 Aug 2012 20:19
by netskink
Ahh, I've changed the mux=ts to mux=avi. I got the info via the #vlc channel on irc. I'll post the result when its done.

Re: Append multiple files into one file.

Posted: 08 Aug 2012 21:08
by netskink
Well it did not really work. After it fixed the index, it truncated as soon at the first video.

Re: Append multiple files into one file.

Posted: 09 Aug 2012 16:30
by netskink
So, it seems to work now. Here is how I did it.


@echo off
set file1= xw-cw-top-heals-loss-a.avi
set file2= xw-cw-top-heals-loss-b.avi
vlc %file1% %file2% --sout "#gather:std{access=file,mux=avi,dst=out.avi}" --sout-keep


This batch file takes two avi files and concats them to a new broken file.

Now, you need to convert/save this file using the gui to a new version. It will say the index is broken and it needs to rebuild it. Let it rebuild it.

Then you will get a new file, say out2.avi.

Re: Append multiple files into one file.

Posted: 10 Aug 2012 11:49
by Jean-Baptiste Kempf
What is the version used?

Re: Append multiple files into one file.

Posted: 10 Aug 2012 14:57
by netskink
VLC Media Player 2.0.2 Twoflower
Win7 x64 OS

Re: Append multiple files into one file.

Posted: 10 Aug 2012 16:15
by Jean-Baptiste Kempf
OK, no idea. Sorry. Virtualdub is probably better for that.

Re: Append multiple files into one file.

Posted: 10 Aug 2012 17:58
by netskink
Hello Jean-Baptiste,

Ok. Np. So I have another problem. When I do manage to get a combined sound and video file, I can play it in vlc and it will play sound along with video. However, in windows media player it will only play video. If I try to upload to google, it says undefined server error. I think because the file is damaged. If I try to open it in virtual dub, it is also broken. It will says unsupported file type.

Re: Append multiple files into one file.

Posted: 07 Sep 2012 19:09
by sam reckoner
So, it seems to work now. Here is how I did it.


@echo off
set file1= xw-cw-top-heals-loss-a.avi
set file2= xw-cw-top-heals-loss-b.avi
vlc %file1% %file2% --sout "#gather:std{access=file,mux=avi,dst=out.avi}" --sout-keep


This batch file takes two avi files and concats them to a new broken file.

Now, you need to convert/save this file using the gui to a new version. It will say the index is broken and it needs to rebuild it. Let it rebuild it.

Then you will get a new file, say out2.avi.
I'm having the same problem. Here's my command line:

Code: Select all

"C:\Program Files\VideoLAN\VLC\vlc.exe" f1.mp4 f2.mp4 --sout-keep --sout=#gather:transcode{vcodec=h264,vb=128,scale=0.5,acodec=mp3,ab=128,channels=2}:standard{access=file,mux=ts,dst=All.mp4} --sout-all "vlc://quit"
what am I missing here? The output video has no time index. Is there something to change in this command-line that will fix this?

Any help greatly appreciated!