Last active
April 30, 2021 08:21
-
-
Save TakamiChie/e4b66e674ee56c7e7ecbf31dc7e70405 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
@echo off | |
rem パスの通ったフォルダにファイルを置いておくと、`mp3tomp4 abc.mp3 abc.png`みたいな感じでコマンドを呼べる。デスクトップにabc.mp4が生成される。 | |
set %FILES= | |
rem Create file args | |
if "%~2"=="" ( | |
echo Drop two or more files. | |
pause | |
exit /b | |
) | |
set STEM=%~n1 | |
setlocal enabledelayedexpansion | |
for %%a in (%*) do ( | |
set FILES=!FILES! -i "%%a" | |
echo Input "%%a" | |
) | |
echo Output:"%USERPROFILE%\Desktop\%STEM%.mp4" | |
rem Call ffmpeg | |
ffmpeg!FILES! -y -v error -loop 1 -vcodec libx264 -acodec aac -ab 160k -ac 2 -ar 48000 -pix_fmt yuv420p "%USERPROFILE%\Desktop\%STEM%.mp4" | |
endlocal | |
rundll32 user32.dll,MessageBeep | |
pause |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment