Changes between Version 13 and Version 14 of Slideshow


Ignore:
Timestamp:
Aug 27, 2014, 9:45:48 PM (5 years ago)
Author:
llogan
Comment:

use -framerate instead of -r for image2 demuxer, update H.264 link

Legend:

Unmodified
Added
Removed
Modified
  • Slideshow

    v13 v14  
    1212You can specify two frame rates:
    1313
    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.
    1616
    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 ffmpeg will drop frames to reach your desired output frame rate.
     17By 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.
    1818
    1919In 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:
    2020
    2121{{{
    22 ffmpeg -r 1/5 -i img%03d.png -c:v libx264 -r 30 -pix_fmt yuv420p out.mp4
     22ffmpeg -framerate 1/5 -i img%03d.png -c:v libx264 -r 30 -pix_fmt yuv420p out.mp4
    2323}}}
    2424
     
    2828
    2929{{{
    30 ffmpeg -r 1/5 -start_number 126 -i img%03d.png -c:v libx264 -r 30 -pix_fmt yuv420p out.mp4
     30ffmpeg -framerate 1/5 -start_number 126 -i img%03d.png -c:v libx264 -r 30 -pix_fmt yuv420p out.mp4
    3131}}}
    3232
     
    3636
    3737{{{
    38 ffmpeg -r 1/5 -i img%03d.png -c:v libx264 -vf fps=25 -pix_fmt yuv420p out.mp4
     38ffmpeg -framerate 1/5 -i img%03d.png -c:v libx264 -vf fps=25 -pix_fmt yuv420p out.mp4
    3939}}}
    4040
     
    4242
    4343{{{
    44 ffmpeg -r 1/5 -i img%03d.png -c:v libx264 -vf "fps=25,format=yuv420p" out.mp4
     44ffmpeg -framerate 1/5 -i img%03d.png -c:v libx264 -vf "fps=25,format=yuv420p" out.mp4
    4545}}}
    4646
    4747== Color space conversion and chroma sub-sampling ==
    4848
    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.
     49By 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.
    5050
    5151== Using a glob pattern ==
     
    5454
    5555{{{
    56 ffmpeg -r 1 -pattern_type glob -i '*.jpg' -c:v libx264 out.mp4
     56ffmpeg -framerate 1 -pattern_type glob -i '*.jpg' -c:v libx264 out.mp4
    5757}}}
    5858
     
    6060
    6161{{{
    62 ffmpeg -r 1 -pattern_type glob -i '*.png' -c:v libx264 -pix_fmt yuv420p out.mp4
     62ffmpeg -framerate 1 -pattern_type glob -i '*.png' -c:v libx264 -pix_fmt yuv420p out.mp4
    6363}}}
    6464
     
    8383* [http://ffmpeg.org/ffmpeg-formats.html#image2-2 FFmpeg image file demuxer documentation]
    8484* [[Create a thumbnail image every X seconds of the video]]
    85 * [[x264EncodingGuide|x264 Encoding Guide]]
     85* [[Encode/H.264|H.264 Encoding Guide]]