Skip to content

Instantly share code, notes, and snippets.

@lxfly2000
Last active June 5, 2023 06:34
Show Gist options
  • Save lxfly2000/66a6ba733477cecf258cdd4299633c0c to your computer and use it in GitHub Desktop.
Save lxfly2000/66a6ba733477cecf258cdd4299633c0c to your computer and use it in GitHub Desktop.
用于快速剪辑视频的命令行
@echo off
::注意保存为ANSI编码格式
if "%~3"=="" (
echo 本工具可以快速剪辑视频。
echo 命令行:%~n0 ^<视频或音频文件^> ^<起始时间hh:mm:ss^> ^<结束时间hh:mm:ss^>
echo 其中时间选项可以只写到分或秒,即mmm:ss或sss.
goto:eof
)
::此处指定FFmpeg的存放位置
set FFMPEG_PATH=D:\ffmpeg
path %path%;%FFMPEG_PATH%\bin
ffmpeg -i "%~1" -ss %2 -to %3 -c copy "%~dpn1_cut.mp4"
#!/system/bin/sh
if (($# < 3)) then
echo "使用方法:$0 <视频文件> <起始时间> <结束时间>"
echo "时间格式可以是:h:m:s, m:s或s."
exit 1
fi
ffmpeg -i "$1" -ss $2 -to $3 -c copy "${1%.*}_cut.mp4"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment