Skip to content

Instantly share code, notes, and snippets.

@ngocongcan
Created October 14, 2018 03:31
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 ngocongcan/106b31d488ab348a6679841e65d7dcdb to your computer and use it in GitHub Desktop.
Save ngocongcan/106b31d488ab348a6679841e65d7dcdb to your computer and use it in GitHub Desktop.
@ECHO OFF
Setlocal EnableDelayedExpansion
set INPUT=C:\Users\Administrator\Desktop\ffmpeg-20180410-d64183e-win64-static\ffmpeg-20180410-d64183e-win64-static\bin\A1
set OUTPUT=C:\Users\Administrator\Desktop\ffmpeg-20180410-d64183e-win64-static\ffmpeg-20180410-d64183e-win64-static\bin\A2
: encode video
for %%i in ("input\*.mp4") DO ffmpeg -i "%%i" -ss 00:00:05 -to 00:12:57 -c copy "output/%%~ni.mp4"
pause
REM -i: This specifies the input file. In that case, it is (input.mp4).
REM -ss: Used with -i, this seeks in the input file (input.mp4) to position.
REM 00:01:00: This is the time your trimmed video will start with.
REM -to: This specifies duration from start (00:01:40) to end (00:12:57).
REM 00:02:00: This is the time your trimmed video will end with.
REM -c copy: This is an option to trim via stream copy. (NB: Very fast)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment