From 999df15f7cc348d45f8fe7b5113a10aa44a37625 Mon Sep 17 00:00:00 2001 From: Henry Vindin Date: Tue, 24 Oct 2017 08:24:54 +1100 Subject: [PATCH] add more examples to ffmpeg based on examples in ffmpeg site docs --- pages/common/ffmpeg.md | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/pages/common/ffmpeg.md b/pages/common/ffmpeg.md index 28e32c1cf..637b2be02 100644 --- a/pages/common/ffmpeg.md +++ b/pages/common/ffmpeg.md @@ -4,7 +4,7 @@ - Extract the sound from a video and save it as MP3: -`ffmpeg -i {{video.mp4}} {{sound}}.mp3` +`ffmpeg -i {{video.mp4}} -vn -codec:audio {{sound}}.mp3` - Convert frames from a video or GIF into individual numbered images: @@ -14,10 +14,19 @@ `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: +- Quickly 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}}` +`ffmpeg -ss {{mm:ss}} -i {{video.mp4}} -frames 1 -s {{128x128}} -f image2 {{image.png}}` -- Convert AVI video to MP4. AAC Audio @ 128kbit, Video @ 1250Kbit: +- Convert AVI video to MP4. AAC Audio @ 128kbit, h264 Video @ 1250kbit (Gives a predictable file size at lower quality): + +`ffmpeg -i {{input_video}}.avi -codec:audio aac -b:audio 128k -codec:video libx264 -b:video 1250K {{output_video}}.mp4` + +- Convert AVI video to MP4. AAC Audio @ 128kbit, h264 Video @ CRF 23, Preset of very slow (Good trade off with file size/speed/quality), also allow faststart by moving the MOOV atom to the start of the file after processing: + +`ffmpeg -i {{input_video}}.avi -codec:audio aac -b:audio 128k -codec:video libx264 -crf 23 --preset veryslow --movflags +faststart {{output_video}}.mp4` + +- Remux MKV video to MP4. No re-encoding of video or audio streams, convert subtitles stream to MP4 compatible codec: + +`ffmpeg -i {{inpupt_video}}.mkv -codec:audio copy -codec:video copy -codec:s mov_text --movflags +faststart {{output_video}}.mp4` -`ffmpeg -i {{input_video}}.avi -acodec libfaac -ab 128k -vcodec mpeg4 -b 1250K {{output_video}}.mp4`