VideoHelp Forum




+ Reply to Thread
Results 1 to 19 of 19
  1. All AVI and WAV files have same names in one folder. Using Machete, Virtualdub I can merge/mux/multiplex them one by one.
    Because each file is 3gb it takes 5-6 minutes for one file. I have more than 100 files. How can i automate this? Which program can do this for me? I only need merge/mux option, nothing else.
    Quote Quote  
  2. I'm a MEGA Super Moderator Baldrick's Avatar
    Join Date
    Aug 2000
    Location
    Sweden
    Search Comp PM
    You can use ffmpeg.

    Download ffmpeg( http://ffmpeg.zeranoe.com/builds/win32/static/ and choose a recent build). Put the ffmpeg.exe in same folder as your files.

    Open notepad and put the following text
    Code:
    for %%a in ("*.avi") do ffmpeg -i "%%~na.wav" -i "%%~na.avi" -acodec copy -vcodec copy "newfiles\%%~na.avi"
    pause
    and save as it batch.bat. Be sure to select save as and choose all files under save as type.

    Create a folder newfiles in same folder as your avi files.
    Double click on the batch.bat
    You will see if you get any errors.

    Try first with a just one avi and wav file in a folder and see how it works.


    edit: I have made a detailed ffmpeg batch guide also: https://forum.videohelp.com/threads/356314-How-to-batch-convert-and-multiplex-any-files-with-ffmpeg
    Last edited by Baldrick; 29th May 2013 at 02:25.
    Quote Quote  
  3. Thank you for your answer. I will try it when i go home.
    Quote Quote  
  4. I'm a MEGA Super Moderator Baldrick's Avatar
    Join Date
    Aug 2000
    Location
    Sweden
    Search Comp PM
    Let me know if it works...or not.
    Quote Quote  
  5. Member
    Join Date
    Aug 2007
    Location
    Isle of Man
    Search Comp PM
    Originally Posted by Baldrick View Post
    You can use ffmpeg.
    Nice use of ~n expansion, I learnt something today.

    It might be safer to quote filenames on the command line also, i.e.
    Code:
    for %%a in ("*.avi") do ffmpeg -i "%%~na.wav" -i "%%~na.avi" -acodec copy -vcodec copy newfiles\"%%~na.avi"
    Cheers,
    Francois
    Quote Quote  
  6. I'm a MEGA Super Moderator Baldrick's Avatar
    Join Date
    Aug 2000
    Location
    Sweden
    Search Comp PM
    Originally Posted by fvisagie View Post
    Originally Posted by Baldrick View Post
    You can use ffmpeg.
    Nice use of ~n expansion, I learnt something today.

    It might be safer to quote filenames on the command line also, i.e.
    Code:
    for %%a in ("*.avi") do ffmpeg -i "%%~na.wav" -i "%%~na.avi" -acodec copy -vcodec copy newfiles\"%%~na.avi"
    Cheers,
    Francois
    Yep, it strips the extension. Very useful.

    THanks for the quote tips. Or else wont it work with files with spaces in the name. Updating the guide.
    Quote Quote  
  7. Wow. Thanks for this. I wasn't quite sure where to start with ffmpeg before.
    Quote Quote  
  8. Thanks very much. It worked without any problem. I was looking for such a solution to automate it. Thanks again.
    Now i need to convert all of these AVI files to any format. These are more than 300 gb broadcast files. Its too much 300 gb.
    How can i convert these files to divx or mwv automatically? Can you help me again please?
    Quote Quote  
  9. I'm a MEGA Super Moderator Baldrick's Avatar
    Join Date
    Aug 2000
    Location
    Sweden
    Search Comp PM
    You could also convert directly in fffmpeg. But it's easier to use a gui-application with batch convert support like xmedia recode, video to video converter, etc.

    But give more details about the source files(use mediainfo, open avi, view->text and copy everything) and how much you would like to compress them.
    Quote Quote  
  10. Member
    Join Date
    Nov 2002
    Location
    United States
    Search Comp PM
    You don't need to run the bat file from a command prompt. just run the .bat file.



    Put the bat file and ffmpeg in the "Newfolder" and double click the bat file.

    Code:
    for %%a in ("*.avi") do ffmpeg -i "%%~na.wav" -i "%%~na.avi" -acodec copy -vcodec copy "C:\newfolder\newfiles\%%~na.avi"
    if would be better if the newfile folder was not in the newfolder. Then you could put a copy of the bat file and ffmpeg in any folder with avi and wav and run it.

    Code:
    for %%a in ("*.avi") do ffmpeg -i "%%~na.wav" -i "%%~na.avi"  -acodec copy -vcodec copy "C:\newfiles\%%~na.avi"
    Quote Quote  
  11. Member
    Join Date
    Nov 2002
    Location
    United States
    Search Comp PM
    [QUOTE=Baldrick;2243981][QUOTE=fvisagie;2243975]
    Originally Posted by Baldrick View Post

    THanks for the quote tips. Or else wont it work with files with spaces in the name. Updating the guide.
    That's all you have to do is put in quotes? So I've been changing the file names for nothing? It's no problem since I use a script to change folders at a time but...
    Quote Quote  
  12. Originally Posted by Baldrick View Post
    You could also convert directly in fffmpeg. But it's easier to use a gui-application with batch convert support like xmedia recode, video to video converter, etc.

    But give more details about the source files(use mediainfo, open avi, view->text and copy everything) and how much you would like to compress them.
    Here is the file info. I have enough space, good quality is fine for me.



    General
    Complete name : D:\biten\00002013-02-23.avi
    Format : AVI
    Format/Info : Audio Video Interleave
    Commercial name : DVCPRO
    Format profile : OpenDML
    File size : 3.17 GiB
    Duration : 14mn 58s
    Overall bit rate mode : Constant
    Overall bit rate : 30.3 Mbps
    Writing application : Lavf55.7.100

    Video
    ID : 0
    Format : DV
    Commercial name : DVCPRO
    Codec ID : dvsd
    Codec ID/Hint : Sony
    Duration : 14mn 58s
    Bit rate mode : Constant
    Bit rate : 24.4 Mbps
    Encoded bit rate : 28.8 Mbps
    Width : 720 pixels
    Height : 576 pixels
    Display aspect ratio : 4:3
    Frame rate mode : Constant
    Frame rate : 25.000 fps
    Standard : PAL
    Color space : YUV
    Chroma subsampling : 4:2:0
    Bit depth : 8 bits
    Scan type : Interlaced
    Scan order : Bottom Field First
    Compression mode : Lossy
    Bits/(Pixel*Frame) : 2.357
    Time code of first frame : 00:00:00:00
    Time code source : Subcode time code
    Stream size : 3.01 GiB (95%)

    Audio
    ID : 1
    Format : PCM
    Format settings, Endianness : Little
    Format settings, Sign : Signed
    Codec ID : 1
    Duration : 14mn 58s
    Bit rate mode : Constant
    Bit rate : 1 536 Kbps
    Channel(s) : 2 channels
    Sampling rate : 48.0 KHz
    Bit depth : 16 bits
    Stream size : 164 MiB (5%)
    Alignment : Aligned on interleaves
    Interleave, duration : 21 ms (0.53 video frame)
    Quote Quote  
  13. I'm a MEGA Super Moderator Baldrick's Avatar
    Join Date
    Aug 2000
    Location
    Sweden
    Search Comp PM
    Originally Posted by DarrellS View Post
    You don't need to run the bat file from a command prompt. just run the .bat file.
    But you will miss all the errors then....if any. BUt you could add a pause to the batch and it will work. Good idea!..
    Quote Quote  
  14. I'm a MEGA Super Moderator Baldrick's Avatar
    Join Date
    Aug 2000
    Location
    Sweden
    Search Comp PM
    [QUOTE=DarrellS;2244283][QUOTE=Baldrick;2243981]
    Originally Posted by fvisagie View Post
    Originally Posted by Baldrick View Post

    THanks for the quote tips. Or else wont it work with files with spaces in the name. Updating the guide.
    That's all you have to do is put in quotes? So I've been changing the file names for nothing? It's no problem since I use a script to change folders at a time but...
    Yup!
    Quote Quote  
  15. I'm a MEGA Super Moderator Baldrick's Avatar
    Join Date
    Aug 2000
    Location
    Sweden
    Search Comp PM
    Originally Posted by yken View Post
    Originally Posted by Baldrick View Post
    You could also convert directly in fffmpeg. But it's easier to use a gui-application with batch convert support like xmedia recode, video to video converter, etc.

    But give more details about the source files(use mediainfo, open avi, view->text and copy everything) and how much you would like to compress them.
    Here is the file info. I have enough space, good quality is fine for me.



    General
    Complete name : D:\biten\00002013-02-23.avi
    Format : AVI
    Format/Info : Audio Video Interleave
    Commercial name : DVCPRO
    Format profile : OpenDML
    File size : 3.17 GiB
    Duration : 14mn 58s
    Overall bit rate mode : Constant
    Overall bit rate : 30.3 Mbps
    Writing application : Lavf55.7.100

    Video
    ID : 0
    Format : DV
    Commercial name : DVCPRO
    Codec ID : dvsd
    Codec ID/Hint : Sony
    Duration : 14mn 58s
    Bit rate mode : Constant
    Bit rate : 24.4 Mbps
    Encoded bit rate : 28.8 Mbps
    Width : 720 pixels
    Height : 576 pixels
    Display aspect ratio : 4:3
    Frame rate mode : Constant
    Frame rate : 25.000 fps
    Standard : PAL
    Color space : YUV
    Chroma subsampling : 4:2:0
    Bit depth : 8 bits
    Scan type : Interlaced
    Scan order : Bottom Field First
    Compression mode : Lossy
    Bits/(Pixel*Frame) : 2.357
    Time code of first frame : 00:00:00:00
    Time code source : Subcode time code
    Stream size : 3.01 GiB (95%)

    Audio
    ID : 1
    Format : PCM
    Format settings, Endianness : Little
    Format settings, Sign : Signed
    Codec ID : 1
    Duration : 14mn 58s
    Bit rate mode : Constant
    Bit rate : 1 536 Kbps
    Channel(s) : 2 channels
    Sampling rate : 48.0 KHz
    Bit depth : 16 bits
    Stream size : 164 MiB (5%)
    Alignment : Aligned on interleaves
    Interleave, duration : 21 ms (0.53 video frame)
    Your source is interlaced....if you want it in avi divx/xvid or mp4/mkv h264 you should deinterlace it. I'm no deinterlace expert so I can't recommend the best convert method. Maybe you should make a new thread for the avi dvcpro to divx conversion.
    Quote Quote  
  16. I'm a MEGA Super Moderator Baldrick's Avatar
    Join Date
    Aug 2000
    Location
    Sweden
    Search Comp PM
    Originally Posted by DarrellS View Post
    if would be better if the newfile folder was not in the newfolder. Then you could put a copy of the bat file and ffmpeg in any folder with avi and wav and run it.

    Code:
    for %%a in ("*.avi") do ffmpeg -i "%%~na.wav" -i "%%~na.avi"  -acodec copy -vcodec copy "C:\newfiles\%%~na.avi"
    And put the ffmpeg c:\ffmpeg and you will never have to copy it around also.
    Code:
    for %%a in ("*.avi") do c:\ffmpeg\ffmpeg -i "%%~na.wav" -i "%%~na.avi"  -acodec copy -vcodec copy "C:\newfiles\%%~na.avi"
    Updating the guide with some tips. Thanks.
    Quote Quote  
  17. Member
    Join Date
    Nov 2002
    Location
    United States
    Search Comp PM
    Originally Posted by Baldrick View Post
    Originally Posted by DarrellS View Post
    if would be better if the newfile folder was not in the newfolder. Then you could put a copy of the bat file and ffmpeg in any folder with avi and wav and run it.

    Code:
    for %%a in ("*.avi") do ffmpeg -i "%%~na.wav" -i "%%~na.avi"  -acodec copy -vcodec copy "C:\newfiles\%%~na.avi"
    And put the ffmpeg c:\ffmpeg and you will never have to copy it around also.
    Code:
    for %%a in ("*.avi") do c:\ffmpeg\ffmpeg -i "%%~na.wav" -i "%%~na.avi"  -acodec copy -vcodec copy "C:\newfiles\%%~na.avi"
    Updating the guide with some tips. Thanks.
    Thanks for that tip. I have copies of ffmpeg all over my hard drives.

    How do you add the pause command? I tried yesterday when I was getting errors and counldn't do a screen capture fast enough to see the errors.
    Quote Quote  
  18. I'm a MEGA Super Moderator Baldrick's Avatar
    Join Date
    Aug 2000
    Location
    Sweden
    Search Comp PM
    Just add pause

    like
    Code:
    for %%a in ("*.avi") do c:\ffmpeg\ffmpeg -i "%%~na.wav" -i "%%~na.avi"  -acodec copy -vcodec copy "C:\newfiles\%%~na.avi"
    pause
    Quote Quote  
  19. Member
    Join Date
    Nov 2002
    Location
    United States
    Search Comp PM
    OK. It goes on a separate line. I put it at the end.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!