VideoHelp Forum
+ Reply to Thread
Results 1 to 5 of 5
Thread
  1. Hi all,

    I have aprroximelty 70 mp4's in a folder and they all have a 20 second intro on them

    I am looking for the commands to make FFMPEG batch trim the first 20 seconds off each file.
    Thanks for any help.


    Daniel
    Quote Quote  
  2. I managed to batch trim all 70 of the files using ffmpeg

    the commands i used are;
    set ffmpeg="C:\ffmpeg\bin\ffmpeg.exe"
    for %f in ("*.mp4") do ffmpeg -i "%f" -ss 00:00:20.000 -c:v copy -c:a copy "trimmed\%f.mp4"
    Quote Quote  
  3. Member
    Join Date
    Dec 2005
    Location
    Canada
    Search Comp PM
    Not certain, but shouldn't a .bat filet have %% instead of a single %.
    Quote Quote  
  4. Member racer-x's Avatar
    Join Date
    Mar 2003
    Location
    3rd Rock from the Sun
    Search Comp PM
    Originally Posted by taonas View Post
    I managed to batch trim all 70 of the files using ffmpeg

    the commands i used are;
    set ffmpeg="C:\ffmpeg\bin\ffmpeg.exe"
    for %f in ("*.mp4") do ffmpeg -i "%f" -ss 00:00:20.000 -c:v copy -c:a copy "trimmed\%f.mp4"
    That script wouldn't work when I tried it. However this one does. Create a folder named "trimmed" first and use correct path to ffmpeg:

    for %%a in ("*.mp4") do "C:\FFmbc\ffmpeg" -i %%a -ss 00:00:20.000 -c:v copy -c:a copy trimmed\%%a

    pause
    Got my retirement plans all set. Looks like I only have to work another 5 years after I die........
    Quote Quote  
  5. I had to update the file with quotes to encapsulate the long file names with spaces. I'm clipping 5 seconds to trim an annoying watermark.

    for %%a in ("*.mp4") do C:\ffmpeg\bin\ffmpeg.exe -i "%%a" -ss 00:00:05.000 -c:v copy -c:a copy "trimmed\%%a"

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