Skip to content

Instantly share code, notes, and snippets.

@mono0x mono0x/concat.cmd
Created Apr 16, 2018

Embed
What would you like to do?
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
You can’t perform that action at this time.