From 7cce91b3c0b1c8a97619df8dd845dbdad0f57b28 Mon Sep 17 00:00:00 2001 From: Agniva De Sarker Date: Sat, 23 Sep 2017 09:41:41 +0530 Subject: [PATCH] ffmpeg: add extract frame example and other tweaks (#1477) --- pages/common/ffmpeg.md | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/pages/common/ffmpeg.md b/pages/common/ffmpeg.md index ebdc1e8c5..8ba1d30b1 100644 --- a/pages/common/ffmpeg.md +++ b/pages/common/ffmpeg.md @@ -4,16 +4,20 @@ - Extract the sound from a video and save it as MP3: -`ffmpeg -i {{video_filename}} -vn -ar 44100 -ac 2 -ab 192 -f mp3 {{sound.mp3}}` +`ffmpeg -i {{video.mp4}} -vn -ar 44100 -ac 2 -ab 192 -f mp3 {{sound}}.mp3` - Convert frames from a video or GIF into individual numbered images: -`ffmpeg -i {{video_or_gif_filename}} {{image%d.png}}` +`ffmpeg -i {{video.mpg|video.gif}} {{frame_%d.png}}` -- Combine numbered images (image1.jpg, image2.jpg, etc) into a video or GIF: +- Combine numbered images (frame_1.jpg, frame_2.jpg, etc) into a video or GIF: -`ffmpeg -f image2 -i {{image%d.jpg}} {{video.mpg_or_video.gif}}` +`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}}` - Convert AVI video to MP4. AAC Audio @ 128kbit, Video @ 1250Kbit: -`ffmpeg -i {{in.avi}} -acodec libfaac -ab 128k -vcodec mpeg4 -b 1250K {{out.mp4}}` +`ffmpeg -i {{input_video}}.avi -acodec libfaac -ab 128k -vcodec mpeg4 -b 1250K {{output_video}}.mp4`