Skip to content

Instantly share code, notes, and snippets.

@Quackward
Created June 25, 2021 17:51
Show Gist options
  • Save Quackward/f9f5f6237a4ad5aad068d6724d7dfcb4 to your computer and use it in GitHub Desktop.
Save Quackward/f9f5f6237a4ad5aad068d6724d7dfcb4 to your computer and use it in GitHub Desktop.

Revisions

  1. Quackward created this gist Jun 25, 2021.
    43 changes: 43 additions & 0 deletions dropDuplicateFrames.bat
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,43 @@
    @echo off
    :: HEYA!! batch script made by clairvoire@gmail, use however you like!
    :: be sure to fulfill the below requirements!
    :: * requires ffmpeg.exe in the same directory

    :: Things you can change:
    :: This is the appended name for the output, put anything you like here:
    set convertFilenameAdd=_frameDrop


    :: ----------------------------------------------------------------------------------------------------------
    :: check the requirement, omit this if block if you don't have a requirement!
    if not exist "ffmpeg.exe" (
    echo please have ffmpeg.exe in the same directory
    pause
    goto :eof
    )

    :: makes sure we actually dragged and dropped files on the bat file!
    if "%~1" == "" (
    echo You gotta drag the video files onto this bat for it to work
    echo You can drop as many files as you like
    echo The outputted files will have the same name as the input ...
    echo ... with this appended: "%convertFilenameAdd%.EXT"
    pause
    goto :eof
    )


    :loop

    :: Put your commands you want to loop with below! This batch script can be modified to work with other stuff
    :: "%~1" is your input file(s) name (one at a time, we loop over all of them if more than one)
    :: "%~x1" is the file's extension
    :: "%~dpn1" is the file's name without the extension, but with the path?
    :: batch scripts have super dumb and bad escapes and quotation stuff, listen, you might need to figure it out
    :: it's more than I can explain here aha...
    ffmpeg.exe -i "%~1" -qmin 1 -qmax 4 -filter_complex "[0:v]mpdecimate=64*2.0:64*1.75:0.975,setpts=N/FRAME_RATE/TB" -map 0:v -an %~dpn1"%convertFilenameAdd%"%~x1

    shift
    if not "%~1" == "" goto loop

    pause