Skip to content

Instantly share code, notes, and snippets.

@Philmist
Last active August 10, 2021 04:07
Show Gist options
  • Save Philmist/0e6f7a78f44b5bdbd97782432e4ab4cf to your computer and use it in GitHub Desktop.
Save Philmist/0e6f7a78f44b5bdbd97782432e4ab4cf to your computer and use it in GitHub Desktop.
ffmpegでフレーム数を上に表示させる
ffmpeg -i '.\2021-08-07 05-38-37.mkv' -vf "drawtext=fontfile=meiryo.ttc:text=%{n}:x=(w-tw)/2:y=h-(2*1h):fontcolor=white:box=1:boxcolor=0x00000099:fontsize=72" -y -c:v h264_nvenc test.mkv
Param(
[string]$Target,
[string]$Output = "frames.mkv"
)
$TargetFile = Resolve-Path $Target
$FFmpegArgs = @('-i ', "`"$TargetFile`"", '-vf "drawtext=fontfile=meiryo.ttc:text=%{n}:x=(w-tw)/2:y=h-(2*1h):fontcolor=white:box=1:boxcolor=0x00000099:fontsize=72"', '-y', '-c:v h264_nvenc', "`"$Output`"")
$arg = $FFmpegArgs -join " "
$arg = 'ffmpeg ' + $arg
Write-Host $arg
Invoke-Expression $arg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment