Skip to content

Instantly share code, notes, and snippets.

@doccaico
Created October 17, 2020 07:26
Show Gist options
  • Select an option

  • Save doccaico/cbd1d1dc97cb13a2c4ef62b441f67f8f to your computer and use it in GitHub Desktop.

Select an option

Save doccaico/cbd1d1dc97cb13a2c4ef62b441f67f8f to your computer and use it in GitHub Desktop.
FFMPEG を使ってmp3からTwitterで使うmp4を作る (1枚の静止画を使って)
# width not divisible by 2 というエラーが出る場合は -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" を追加する
ffmpeg -loop 1 -i blue.jpg -i ~/Desktop/aa.mp3 -shortest -b:a 320000 -pix_fmt yuv420p -vcodec libx264 out.mp4
# そもそもアップロードできない
# ffmpeg -loop 1 -i black.jpg -i input.mp3 -shortest -b 1000k -vcodec libx264 out.mp4
# これだとtwitterでは音がきこえなかった
# ffmpeg -loop 1 -i black.jpg -i input.mp3 -shortest -b 1000k -acodec copy out.mp4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment