Changes between Version 13 and Version 14 of Slideshow
- Timestamp:
- Aug 27, 2014, 6:45:48 PM (12 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Slideshow
v13 v14 12 12 You can specify two frame rates: 13 13 14 * The rate according to which the images are read, by setting `- r` before `-i`. The default for reading input is `-r 25` which will be set if no `-r` is specified.15 * The output frame rate for the video stream by setting `-r` after `-i` , or by using the `fps` filter. If you want the input and output frame rates to be the same, then just declare an input `-r` and the output will inherit the same value.14 * The rate according to which the images are read, by setting `-framerate` before `-i`. The default for reading input is `-framerate 25` which will be set if no `-framerate` is specified. 15 * The output frame rate for the video stream by setting `-r` after `-i` or by using the `fps` filter. If you want the input and output frame rates to be the same, then just declare an input `-framerate` and the output will inherit the same value. 16 16 17 By using a separate `-r` (frames per second) for the input and output you can control the duration at which each input is displayed and tell ffmpeg the frame rate you want for the output file. If the input `-r` is lower than the output `-r` then ffmpeg will duplicate frames to reach your desired output frame rate. If the input `-r` is higher than the output `-r` then ffmpegwill drop frames to reach your desired output frame rate.17 By using a separate frame rate for the input and output you can control the duration at which each input is displayed and tell `ffmpeg` the frame rate you want for the output file. If the input `-framerate` is lower than the output `-r` then `ffmpeg` will duplicate frames to reach your desired output frame rate. If the input `-framerate` is higher than the output `-r` then `ffmpeg` will drop frames to reach your desired output frame rate. 18 18 19 19 In this example each image will have a duration of 5 seconds (the inverse of 1/5 frames per second). The video stream will have a frame rate of 30 fps by duplicating the frames accordingly: 20 20 21 21 {{{ 22 ffmpeg - r1/5 -i img%03d.png -c:v libx264 -r 30 -pix_fmt yuv420p out.mp422 ffmpeg -framerate 1/5 -i img%03d.png -c:v libx264 -r 30 -pix_fmt yuv420p out.mp4 23 23 }}} 24 24 … … 28 28 29 29 {{{ 30 ffmpeg - r1/5 -start_number 126 -i img%03d.png -c:v libx264 -r 30 -pix_fmt yuv420p out.mp430 ffmpeg -framerate 1/5 -start_number 126 -i img%03d.png -c:v libx264 -r 30 -pix_fmt yuv420p out.mp4 31 31 }}} 32 32 … … 36 36 37 37 {{{ 38 ffmpeg - r1/5 -i img%03d.png -c:v libx264 -vf fps=25 -pix_fmt yuv420p out.mp438 ffmpeg -framerate 1/5 -i img%03d.png -c:v libx264 -vf fps=25 -pix_fmt yuv420p out.mp4 39 39 }}} 40 40 … … 42 42 43 43 {{{ 44 ffmpeg - r1/5 -i img%03d.png -c:v libx264 -vf "fps=25,format=yuv420p" out.mp444 ffmpeg -framerate 1/5 -i img%03d.png -c:v libx264 -vf "fps=25,format=yuv420p" out.mp4 45 45 }}} 46 46 47 47 == Color space conversion and chroma sub-sampling == 48 48 49 By default when using `libx264`, and depending on your input, ffmpegwill attempt to avoid color subsampling. Technically this is preferred, but unfortunately almost all video players, excluding FFmpeg based players, and many online video services only support the YUV color space with 4:2:0 chroma subsampling. Using the options `-pix_fmt yuv420p` or `-vf format=yuv420p` will maximize compatibility.49 By default when using `libx264`, and depending on your input, `ffmpeg` will attempt to avoid color subsampling. Technically this is preferred, but unfortunately almost all video players, excluding FFmpeg based players, and many online video services only support the YUV color space with 4:2:0 chroma subsampling. Using the options `-pix_fmt yuv420p` or `-vf format=yuv420p` will maximize compatibility. 50 50 51 51 == Using a glob pattern == … … 54 54 55 55 {{{ 56 ffmpeg - r1 -pattern_type glob -i '*.jpg' -c:v libx264 out.mp456 ffmpeg -framerate 1 -pattern_type glob -i '*.jpg' -c:v libx264 out.mp4 57 57 }}} 58 58 … … 60 60 61 61 {{{ 62 ffmpeg - r1 -pattern_type glob -i '*.png' -c:v libx264 -pix_fmt yuv420p out.mp462 ffmpeg -framerate 1 -pattern_type glob -i '*.png' -c:v libx264 -pix_fmt yuv420p out.mp4 63 63 }}} 64 64 … … 83 83 * [http://ffmpeg.org/ffmpeg-formats.html#image2-2 FFmpeg image file demuxer documentation] 84 84 * [[Create a thumbnail image every X seconds of the video]] 85 * [[ x264EncodingGuide|x264 Encoding Guide]]85 * [[Encode/H.264|H.264 Encoding Guide]]
