Changes between Version 6 and Version 7 of Create a video slideshow from images


Ignore:
Timestamp:
May 6, 2013, 10:19:31 AM (4 years ago)
Author:
slhck
Comment:

reorder examples, add audio example

Legend:

Unmodified
Added
Removed
Modified
  • Create a video slideshow from images

    v6 v7  
    1 This will create a video slideshow (using video codec libx264) from series of png images, named named img001.png, img002.png, img003.png, ... 
     1This will create a video slideshow (using video codec libx264) from series of PNG images, named named img001.png, img002.png, img003.png, …  
    22 
    3 ''(each image will have a duration of 5 seconds)'' 
     3Here, each image will have a duration of 5 seconds (the inverse of 1/5 frames per second). By telling FFmpeg to set the input file's FPS option (frames per second) to some very low value, we made FFmpeg duplicate frames at the output and thus we achieved to display each image for some time on screen: 
    44{{{ 
    55ffmpeg -f image2 -r 1/5 -i img%03d.png -c:v libx264 -r 30 out.mp4 
     
    99{{{ 
    1010ffmpeg -f image2 -r 1/15 -i img%03d.png -c:v libx264 -r 30 out.mp4 
    11 }}} 
    12  
    13 If you want to create a video out of just one image, this will do (output video duration is set to 30 seconds): 
    14 {{{ 
    15 ffmpeg -loop 1 -f image2 -i img.png -c:v libx264 -t 30 out.mp4 
    1611}}} 
    1712 
     
    2520}}} 
    2621 
     22'''Important:''' All images in a series need to be of the same size and format. 
    2723 
    28 '''Important:''' 
    29 All images in a series need to be of the same size and format. 
     24If you want to create a video out of just one image, this will do (output video duration is set to 30 seconds with `-t 30`): 
     25{{{ 
     26ffmpeg -loop 1 -f image2 -i img.png -c:v libx264 -t 30 out.mp4 
     27}}} 
    3028 
    31 '''Explanation:''' 
    32 By telling FFmpeg to set the input file's FPS option (frames per second) to some very low value, we made FFmpeg duplicate frames at the output and thus we achieved to display each image for some time on screen :) 
     29If you want to add audio (e.g. `audio.wav`) to one "poster" image, you need `-shortest` to tell it to stop after the audio stream is finished. We use the internal AAC encoder, but you can [[AACEncodingGuide|use any other AAC encoder]] as well: 
     30{{{ 
     31ffmpeg -shortest -loop 1 -f image2 -i img.png -i audio.wav -c:v libx264 -c:a aac -strict experimental -b:a 192k out.mp4 
     32}}} 
     33 
    3334 
    3435'''See also:'''