2014-05-30 19:27:55 +01:00
|
|
|
# ffmpeg
|
|
|
|
|
2016-01-07 17:31:27 +00:00
|
|
|
> Video conversion tool.
|
2014-05-30 19:27:55 +01:00
|
|
|
|
2016-01-07 17:31:27 +00:00
|
|
|
- Extract the sound from a video and save it as MP3:
|
2014-05-30 19:27:55 +01:00
|
|
|
|
2017-09-25 15:59:11 +01:00
|
|
|
`ffmpeg -i {{video.mp4}} {{sound}}.mp3`
|
2014-05-30 19:27:55 +01:00
|
|
|
|
2016-12-24 00:29:40 +00:00
|
|
|
- Convert frames from a video or GIF into individual numbered images:
|
2014-05-30 19:27:55 +01:00
|
|
|
|
2017-09-23 05:11:41 +01:00
|
|
|
`ffmpeg -i {{video.mpg|video.gif}} {{frame_%d.png}}`
|
2014-05-30 19:27:55 +01:00
|
|
|
|
2017-09-23 05:11:41 +01:00
|
|
|
- Combine numbered images (frame_1.jpg, frame_2.jpg, etc) into a video or GIF:
|
2014-05-30 19:27:55 +01:00
|
|
|
|
2017-09-23 05:11:41 +01:00
|
|
|
`ffmpeg -i {{frame_%d.jpg}} -f image2 {{video.mpg|video.gif}}`
|
|
|
|
|
|
|
|
- Extract a single frame from a video at time mm:ss and save it as a 128x128 resolution image:
|
|
|
|
|
|
|
|
`ffmpeg -i {{video.mp4}} -ss {{mm:ss}} -frames 1 -s {{128x128}} -f image2 {{image.png}}`
|
2014-05-30 19:27:55 +01:00
|
|
|
|
2016-01-07 17:31:27 +00:00
|
|
|
- Convert AVI video to MP4. AAC Audio @ 128kbit, Video @ 1250Kbit:
|
2014-05-30 19:27:55 +01:00
|
|
|
|
2017-09-23 05:11:41 +01:00
|
|
|
`ffmpeg -i {{input_video}}.avi -acodec libfaac -ab 128k -vcodec mpeg4 -b 1250K {{output_video}}.mp4`
|