Skip to content

Instantly share code, notes, and snippets.

@mono0x
Created April 16, 2018 12:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mono0x/f4aa4f6bdc39f67590f984a23094fb8c to your computer and use it in GitHub Desktop.
Save mono0x/f4aa4f6bdc39f67590f984a23094fb8c to your computer and use it in GitHub Desktop.
Concat movie files using ffmpeg (for Windows)
@echo off
setlocal EnableExtensions
:genuniq
set "tmpfile=%tmp%\bat~%RANDOM%.txt"
if exist "%tmpfile%" goto :genuniq
set "output=%~dpn1_combined%~x1"
:loop
set "f=%~f1"
rem replace \ to /
set "f=%f:\=/%"
rem replace & to ^&
set "f=%f:&=^&%"
echo file '%f%' >> "%tmpfile%"
shift
if not "%~1" == "" goto loop
ffmpeg.exe -f concat -safe 0 -i "%tmpfile%" -c copy "%output%"
del "%tmpfile%"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment