Skip to content

Instantly share code, notes, and snippets.

@Fire-
Created July 10, 2015 05:46
Show Gist options
  • Save Fire-/5f88514915eb8358d87b to your computer and use it in GitHub Desktop.
Save Fire-/5f88514915eb8358d87b to your computer and use it in GitHub Desktop.
cut content with ffmpeg
@echo off
:begin
if "%~1" == "" goto end
set "done="
set "start_ts="
set "end_ts="
echo(
echo "Cutting: %~1"
echo(
set /p start_ts="Enter starting timestamp ( Format: hh:mm:ss.mus, eg: 00:38:32.570 ): "
set /p end_ts="Enter ending timestamp ( format: hh:mm:ss.mus, eg: 00:57:42.700 ): "
ffmpeg -i "%~1" -ss %start_ts% -to %end_ts% -c copy "%~1_%date:~7,2%-%date:~4,2%-%date:~10,4%_%time:~0,2%_%time:~3,2%_%time:~6,2%".mp4
echo(
set /p done="Done with this file? [Y|n]: "
if not "%done%" == "n" (shift)
goto begin
:end
echo(
echo "All done!"
echo(
@Fire-
Copy link
Author

Fire- commented Jul 10, 2015

It requires ffmpeg's executable to be in the PATH

note: echo( prints a blank line

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment