Created
November 24, 2021 10:38
-
-
Save Plasmoxy/0e523479126b4b02ca961969ef4c8690 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Vidmod by Plasmoxy | |
# - clip editor for ffmpeg | |
$cmd = $args[0] | |
$fname = $args[1] | |
# cut with reencoding | |
# vidmod cut source.mp4 0:00 0:04 | |
if ($cmd -eq "cut") { | |
$from = $args[2] | |
$to = $args[3] | |
ffmpeg -i "$fname" -ss "$from" -to "$to" -async 1 "$fname.cut.mp4" | |
} | |
# cut without reencoding (can miss keyframes) | |
# vidmod cut source.mp4 0:00 0:04 | |
if ($cmd -eq "cutc") { | |
$from = $args[2] | |
$to = $args[3] | |
ffmpeg -i "$fname" -ss "$from" -to "$to" -async 1 "$fname.cut.mp4" | |
} | |
# downscale by half | |
# vidmod desize source.mp4 | |
if ($cmd -eq "desize") { | |
ffmpeg -i "$fname" -vf "scale=iw/2:ih/2" "$fname.desize.mp4" | |
} | |
# reduce bitrate to specified number (units 2M=2 Mbps, 64k = 64kbps) | |
# vidmod bitrate source.mp4 2M | |
if ($cmd -eq "bitrate") { | |
ffmpeg -i "$fname" -b:v $args[2] "$fname.bitrate.mp4" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment