å°å ¥æ¹æ³
XCodeã®ã³ãã³ãã©ã¤ã³ãã¼ã«ãã¤ã³ã¹ãã¼ã«
xcode-select --install
Homebrewãã¤ã³ã¹ãã¼ã«
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
公式サイトã«ã¤ã³ã¹ãã¼ã«ã³ãã³ããè¨è¼ããã¦ããã®ã§ãããããã®ã¾ã¾ã¿ã¼ããã«ã«è²¼ãä»ãã¾ãã
ffmpegãã¤ã³ã¹ãã¼ã«
brew install ffmpeg
Homebrewãã¤ã³ã¹ãã¼ã«ã§ããã°ãffmpegã®ã¤ã³ã¹ãã¼ã«ã¯ç°¡åã§ãã
lameãã¤ã³ã¹ãã¼ã«
brew install lame
lameãã¤ã³ã¹ãã¼ã«ãã¦ããã¾ãã
ffmpegã®ã³ãã³ãä¾
公式のドキュメントã«ãã¹ã¦è¨è¼ããã¦ããã®ã§ãããå人çã«ãã使ããã®ãã¾ã¨ãã¦ããã¾ãã
åç»ã®ç¡é³å
ffmpeg -i input.mp4 -an output.mp4
é£çªpng â mp4
0.pngã1.pngã2.pngã3.pngã¨ããå½åè¦åã§ãå ¨ã¦ãåããµã¤ãºã®é£çªpngã®å ´åã
ffmpeg -r 1 -i %d.png -pix_fmt yuv420p filename.mp4
ã§ã1FPSã®åç»ãçæã§ãã¾ãã
é£çªpng â gifã¢ãã¡
0.pngã1.pngã2.pngã3.pngã¨ããå½åè¦åã§ãå ¨ã¦ãåããµã¤ãºã®é£çªpngã®å ´åã
ffmpeg -i %d.png -vf palettegen palette.png
ã§ãpalette.pngãçæå¾ã
ffmpeg -f image2 -r 1 -i %d.png -i palette.png -filter_complex paletteuse filename.gif
ã§ã1FPSã®ã¢ãã¡ã¼ã·ã§ã³ãçæã§ãã¾ãã
webm â mp4
ffmpeg -i filename.webm -pix_fmt yuv420p filename.mp4
mp4 â gifã¢ãã¡
ffmpeg -i filename.mp4 -r 8 filename.gif
ãã¤ã8FPSãããã«ãããã¨ãå¤ãã§ãã
mp4 â mpeg2
ffmpeg -i filename.mp4 -vcodec mpeg2video filename.mpeg
mp4 â mp3
ffmpeg -i filename.mp4 filename.mp3
aiff â mp3
ffmpeg -i filename.aiff filename.mp3
mp4ã®ã¯ããã
ffmpeg -i input.mp4 -vf crop=640:480:0:0 output.mp4
ð (0, 0)ã®ãã¸ã·ã§ã³ãã640x480ã®åç»ãåãåºãã¾ãã
åè
blog.kimizuka.org
ç´è¿ã§ã¿ã¼ããã«ã®å±¥æ´ã«æ®ã£ã¦ããã³ãã³ãã¯ãããªæãã§ãããæãåºã次第追è¨ãã¾ãã