View Full Version : tool for join videos in batch mode?
cr0n=0sTT88
20th November 2013, 23:25
Hi,
Does anyone know a tool for join videos in batch mode? I don't want re-enconde. I only want join doing direct stream copy.
I have 400 videos in avi format and each video it's splitted in 20 parts. I know how to join the videos one by one but is too much work.
does anyone can help me?
All parts of each video have the same characteristics. But not all videos have the same characteristics.
The file-names of the videos it's similar, for example:
video-1-01.avi
video-1-02.avi
video-1-03.avi
video-1-04.avi
...
video-2-01.avi
video-2-02.avi
video-2-03.avi
video-2-04.avi
...
Thank you!
setarip_old
21st November 2013, 00:49
Hi!
Please clarify - Do you want to create ONE video comprised of 8,000 joined video parts (20x400), or do you want to recreate 400 videos so that they are the same as your original 400 .AVI videos?
cr0n=0sTT88
21st November 2013, 00:53
Hi!
Please clarify - Do you want to create ONE video comprised of 8,000 joined video parts (20x400), or do you want to recreate 400 videos so that they are the same as your original 400 .AVI videos?
I want re-create 400 videos in avi (I don't want re-encode, only join). the original videos have been divided into several parts each one. Sorry for my poor english!
setarip_old
21st November 2013, 01:53
the original videos have been divided into several parts each one.So why don't you just batch copy your 400 original files/videos? (I won't ask why you split them before copying them...)
cr0n=0sTT88
21st November 2013, 02:16
So why don't you just batch copy your 400 original files/videos? (I won't ask why you split them before copying them...)
I'm sorry, but I don't understand what is your question. I have a set of videos and each video is divided into several parts. I don't have the complete videos, I only have the parts of this videos. I want to get the full videos. To get the full videos from the parts I want to join such parties.
That is, I have this:
video-1-01.avi
video-1-02.avi
video-1-03.avi
video-1-04.avi
And I want to get this (adding each part):
video-1.avi
I want do it this for the 400 avi's videos.
It's simple. Do you understand what I want to do? Sorry for my poor english, i'm spanish speaker.
Thank you friend!
therube
21st November 2013, 04:00
Various methods with FFmepg, How to concatenate (join, merge) media files (https://trac.ffmpeg.org/wiki/How%20to%20concatenate%20(join,%20merge)%20media%20files).
Video to Video Converter (http://www.videohelp.com/tools/Video-to-Video-Converter).
Tools | Join Video Files | Add... -> OK, then choose Direct Stream Copy, make sure your container is what you want, then OK, & in a few seconds it should be complete.
You would have to do each 20-file set separately.
And it assumes that they all have the same characteristics...
It will then losslessly go about joining them.
Do verify that they playback correctly when you're done, no glitches at the joined spots, that they seek as expected...
(Other similar programs exist to join. If one doesn't work correctly, can't hurt to try another as it may use a different method to go about it. Though I've found Video To Video to be quite adept.)
cr0n=0sTT88
21st November 2013, 15:57
Various methods with FFmepg, How to concatenate (join, merge) media files (https://trac.ffmpeg.org/wiki/How%20to%20concatenate%20(join,%20merge)%20media%20files).
Video to Video Converter (http://www.videohelp.com/tools/Video-to-Video-Converter).
Tools | Join Video Files | Add... -> OK, then choose Direct Stream Copy, make sure your container is what you want, then OK, & in a few seconds it should be complete.
You would have to do each 20-file set separately.
And it assumes that they all have the same characteristics...
It will then losslessly go about joining them.
Do verify that they playback correctly when you're done, no glitches at the joined spots, that they seek as expected...
(Other similar programs exist to join. If one doesn't work correctly, can't hurt to try another as it may use a different method to go about it. Though I've found Video To Video to be quite adept.)
Hi, thank you for the information! I can do it with the software "video to video converter" but the problem is that this is very much work because I need do it for 400 videos.
I prefer ffmpeg but I don't know how to do the script! :'(
¿does anyone can help me for make the script conversion for ffmpeg? I think that it is simply for anyone that know scriping language code.
I only want join all parts of the videos for each video.
It is. I have 400x20 videos (approximately). I will have 400 videos after of joining.
The name of the each video is different but ALL parts include -01, -02, -03... Any videos have 20 parts, other videos have 3 parts, other videos have N parts.
I have the parts of the videos with this format file-name:
nameofvideo1-01.avi [identical characteristics off all parts]
nameofvideo1-02.avi
nameofvideo1-03.avi
...
nameofvideo1-0N.avi
nameofvideo2-01.avi
nameofvideo2-02.avi
nameofvideo2-03.avi
...
nameofvideo2-0N.avi
...
nameofvideoM-01.avi
nameofvideoM-02.avi
nameofvideoM-03.avi
...
nameofvideoM-0N.avi
I want get this:
nameofvideo1-concatenated.avi
nameofvideo2-concatenated.avi
...
nameofvideoM-concatenated.avi
We assume that each video:
1) is in avi/xvid/mp3 format.
2) i don't want re-encode. I only want join/concatenate the different parts in only one file.
3) all videos are in the same directory.
Anyone with knowledge of scriping language code can help me?
Thanks everyone!!!
Selur
21st November 2013, 16:11
if it doesn't have to be done in a console:
start Avi-Mux Gui
drag&drop all the file in it
select all the files
press 'generate data source fomm files'
press 'start', enter name of output avi, save
wait for 'Process finished'-Popup
cr0n=0sTT88
21st November 2013, 16:30
if it doesn't have to be done in a console:
start Avi-Mux Gui
drag&drop all the file in it
select all the files
press 'generate data source fomm files'
press 'start', enter name of output avi, save
wait for 'Process finished'-Popup
thank you for the tutorial friend. Avi-mux gui also works fine but the problem is the same. I need do it this for each video and this is very work. I need a script for do it ALL videos automatically. Or I need any soft that do it the same automatically.
Thank you!
cr0n=0sTT88
21st November 2013, 16:35
I will try to make the script. This might work? :P
@echo off
set "ffmpeg_bin=C:\ffmpeg\ffmpeg-git-b6ff81d-win64-static\bin\ffmpeg.exe"
set "out_path=D:\Bandeja Entrada\Vídeos"
cd /D "D:\Bandeja Entrada\Vídeos"
for %%f in (*.avi) do (
%ffmpeg_bin% -f concat -i ????
)
therube
21st November 2013, 20:40
%ffmpeg_bin% -f concat -i ????
You're going to want a '-c copy' in there, or else it will re-encode to the output.
%ffmpeg_bin% -f concat -i ???? -c copy ...
cr0n=0sTT88
21st November 2013, 21:12
Thanks for the help but if someone don't tell me exactly how to do it I think that I won't be able to do it! :p
:script::script::script:
:D
Reino
21st November 2013, 23:01
In this case you don't need a batch-script. Just create a text-file:
file '/path/to/file1.avi'
file '/path/to/file2.avi'
file '/path/to/file3.avi'
...
file '/path/to/file400.avi'
...and run ffmpeg once from commandline:
ffmpeg.exe -f concat -i filelist.txt -c copy video-concat.avi
Worked for me with a bunch of ts-files.
cr0n=0sTT88
22nd November 2013, 11:05
In this case you don't need a batch-script. Just create a text-file:
file '/path/to/file1.avi'
file '/path/to/file2.avi'
file '/path/to/file3.avi'
...
file '/path/to/file400.avi'
...and run ffmpeg once from commandline:
ffmpeg.exe -f concat -i filelist.txt -c copy video-concat.avi
Worked for me with a bunch of ts-files.
is this code for join since file1 until file400 in only one video-file?
Reino
22nd November 2013, 18:40
Yes it is. I haven't actually tried it on avi-files, but I succesfully joined 38 ts-files together this way.
cr0n=0sTT88
22nd November 2013, 21:10
Yes it is. I haven't actually tried it on avi-files, but I succesfully joined 38 ts-files together this way.
ok, thank you. But I need a different thing for solve the problem.
My problem is join all files at the same time. Not one by one. I need one script that search inside of the directory and analyze the filenames of the videos. After join each video without re-encode.
I explain in the post 7 (http://forum.doom9.org/showthread.php?p=1654602#post1654602).
Reino
24th November 2013, 11:34
To ask for such a batch-script I think you're better off at http://stackoverflow.com (http://stackoverflow.com) or alike.
Asmodian
25th November 2013, 03:47
You can generate the list file with a for loop but this would need to be run once in each directory in which you want to merge all avi files.
@echo off
set ffmpeg_bin="C:\ffmpeg\ffmpeg-git-b6ff81d-win64-static\bin\ffmpeg.exe"
for %%f in (*.avi) do echo file '%%f'>>mylist.txt
%ffmpeg_bin% -f concat -i mylist.txt -c copy concat.avi
cr0n=0sTT88
25th November 2013, 09:50
You can generate the list file with a for loop but this would need to be run once in each directory in which you want to merge all avi files.
@echo off
set ffmpeg_bin="C:\ffmpeg\ffmpeg-git-b6ff81d-win64-static\bin\ffmpeg.exe"
for %%f in (*.avi) do echo file '%%f'>>mylist.txt
%ffmpeg_bin% -f concat -i mylist.txt -c copy concat.avi
thank you for your script.
one question: do I need create an TXT file for each video for joining process?
do you can modify the script for not need the TXT file? I prefer that the script search inside of the directory each video! is it possible?
all videos have the same format! name1-01.avi, name1-02.avi, name1-03.avi... name1-NN.avi ; name2-01.avi, name2-02.avi, name2-03.avi... name2-NN.avi. Name of the each video is different!
is it very difficult make an script that detect the videos?
Thank you!
Reino
25th November 2013, 18:26
Thx for the script Asmodian. This seems to work when the files are named movie-01.ts, movie-02.ts, movie-03.ts ... movie-38.ts, but mine are named movie-1.ts, movie-2.ts, movie-3.ts ... movie-38.ts, which results in:
file 'movie-1.ts'
file 'movie-10.ts'
file 'movie-11.ts'
file 'movie-12.ts'
file 'movie-13.ts'
file 'movie-14.ts'
file 'movie-15.ts'
file 'movie-16.ts'
file 'movie-17.ts'
file 'movie-18.ts'
file 'movie-19.ts'
file 'movie-2.ts'
file 'movie-20.ts'
file 'movie-21.ts'
file 'movie-22.ts'
file 'movie-23.ts'
file 'movie-24.ts'
file 'movie-25.ts'
file 'movie-26.ts'
file 'movie-27.ts'
file 'movie-28.ts'
file 'movie-29.ts'
file 'movie-3.ts'
file 'movie-30.ts'
file 'movie-31.ts'
file 'movie-32.ts'
file 'movie-33.ts'
file 'movie-34.ts'
file 'movie-35.ts'
file 'movie-36.ts'
file 'movie-37.ts'
file 'movie-38.ts'
file 'movie-4.ts'
file 'movie-5.ts'
file 'movie-6.ts'
file 'movie-7.ts'
file 'movie-8.ts'
file 'movie-9.ts'
I've tried the DOS sort command (http://www.computerhope.com/sorthlp.htm), but without any luck. Do you know how to correct the sorting in this case?
cr0n=0sTT88, you don't have to create a txt-file yourself. The batch-script will do it for you.
Change the path to ffmpeg for your situation, copy the bat-file to the directory with all the movie segments and just run it.
Asmodian
25th November 2013, 21:36
Sorry, I don't have a solution for that. Smart Sorting hasn't made it to for loops. :(
To mux an entire directory tree you can call the previous batch file from another one:
concat.bat
@echo off
set ffmpeg_bin="C:\ffmpeg\ffmpeg-git-b6ff81d-win64-static\bin\ffmpeg.exe"
cd %1
for %%f in (*.avi) do echo file '%%f'>>mylist.txt
%ffmpeg_bin% -f concat -i mylist.txt -c copy concat.avi
concatall.bat
@echo off
FOR /D /R %%a IN (*) DO CALL concat.bat %%~pa
cr0n=0sTT88
29th November 2013, 22:42
thank you for the script! I will test it!!!
Reino
13th April 2017, 17:43
Do you know how to correct the sorting in this case?
Provided that the video files are downloaded chronologically:
@ECHO OFF
SET ffmpeg_bin="ffmpeg.exe"
FOR /F %%A IN ('DIR /B /O:D ^| FIND "*.ts"') DO ECHO file '%%~fA' >> filelist.txt
%ffmpeg_bin% -f concat -safe 0 -i "filelist.txt" -c copy -bsf:a aac_adtstoasc concat.mp4
(DIR /B /O:D to sort by date)
filelist.txt:
file 'D:\full-path-name\movie-1.ts'
file 'D:\full-path-name\movie-2.ts'
file 'D:\full-path-name\movie-3.ts'
file 'D:\full-path-name\movie-4.ts'
file 'D:\full-path-name\movie-5.ts'
file 'D:\full-path-name\movie-6.ts'
file 'D:\full-path-name\movie-7.ts'
file 'D:\full-path-name\movie-8.ts'
file 'D:\full-path-name\movie-9.ts'
file 'D:\full-path-name\movie-10.ts'
...
cr0n=0sTT88
13th April 2017, 19:47
Provided that the video files are downloaded chronologically:
@ECHO OFF
SET ffmpeg_bin="ffmpeg.exe"
FOR /F %%A IN ('DIR /B /O:D ^| FIND "*.ts"') DO ECHO file '%%~fA' >> filelist.txt
%ffmpeg_bin% -f concat -safe 0 -i "filelist.txt" -c copy -bsf:a aac_adtstoasc concat.mp4
(DIR /B /O:D to sort by date)
filelist.txt:
file 'D:\full-path-name\movie-1.ts'
file 'D:\full-path-name\movie-2.ts'
file 'D:\full-path-name\movie-3.ts'
file 'D:\full-path-name\movie-4.ts'
file 'D:\full-path-name\movie-5.ts'
file 'D:\full-path-name\movie-6.ts'
file 'D:\full-path-name\movie-7.ts'
file 'D:\full-path-name\movie-8.ts'
file 'D:\full-path-name\movie-9.ts'
file 'D:\full-path-name\movie-10.ts'
...
thank you for the information sir.
It is intersting to know for if one day I need to do another time!
:thanks:
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.