Skip to content

Instantly share code, notes, and snippets.

@TakamiChie
Last active August 3, 2022 01:42
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TakamiChie/9eb9c1f380d14f1522ed0b9091d2bb38 to your computer and use it in GitHub Desktop.
Save TakamiChie/9eb9c1f380d14f1522ed0b9091d2bb38 to your computer and use it in GitHub Desktop.
音声と画像をマージして一つの動画を作成する
# $dstfile 静止画ファイル
# $dstfile2 音声ファイル(静止画ファイルと順序を入れ替えても問題ない)
# $output 出力するファイル。省略時はデスクトップ上にoutput.mp4というファイル名で出力される
function voice2movie ([parameter(mandatory=$true)][String] $dstfile,
[parameter(mandatory=$true)][String] $dstfile2,
[parameter(mandatory=$false)][String] $output="${env:UserProfile}\Desktop\output.mp4") {
ffmpeg -loop 1 -r 30000/1001 -i $dstfile -i $dstfile2 `
-vcodec libx264 -acodec aac -strict experimental `
-ab 320k -ac 2 -ar 48000 -pix_fmt yuv420p `
-shortest $output
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment