kh_trim.bat

Browser view only. Use the download link if you want to save the file.

Back to Toolbox
@echo off
if exist ffmpeg.exe goto substok
goto error3
:substok

if x%1x == xx goto help
if x%2x == xx goto help

:: 2 parameters passed in.  Let's check them out
if exist %1 goto param1ok
goto error1
:param1ok
set videofile="%~1"
set outfile="%~n1_trimmed%~x1"
set trimlength=%2
goto doit


:doit
echo ===================
echo TRIMMING VIDEO
echo ===================
Title Merging %videofile% and %audiofile%...
set launchstring=ffmpeg -y -threads 0 -i %videofile% -vcodec copy -acodec copy -t %2 %outfile%
echo Launching: %launchstring%
%launchstring%
goto end

:error1
echo File %1 doesn't exist
goto end

:error3
echo ffmpeg.exe not found here
goto end

:help
echo Usage: %~n0 [video filename] [trimlength ie, "0:1:27" in hh:mm:ss or mm:ss]
echo.      Trims unwanted video from the END of the original

:end
Title Command Prompt