Last active
January 13, 2021 20:08
-
-
Save jennings/97df20fe561a13aa03d3de6e65fb003e to your computer and use it in GitHub Desktop.
This file contains 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
<# | |
Burns a timecode into a video using ffmpeg. | |
#> | |
param( | |
$Path, | |
$OutFile, | |
$Rate | |
) | |
if ($null -eq $Rate) { | |
"No Rate provided, defaulting to NTSC (30000/1001)" | |
$Rate = "30000/1001" | |
} | |
$dropFrameRates = "30000/1001", "60000/1001", "29.97", "59.94", "ntsc" | |
$timecodePattern = if ($Rate -in $dropFrameRates) { "00\:00\:00;00" } else { "00\:00\:00\:00" } | |
$filter = @" | |
drawtext="timecode='${timecodePattern}':rate=${Rate}:fontsize=72:fontcolor='white':boxcolor=0x000000AA:box=1:x=10:y=10" | |
"@ | |
ffmpeg -y -i $Path -vf $filter $OutFile |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment