[FFmpeg-user] Create slideshow with ffmpeg from still images

thljcl jiachielee at live.com
Tue Jul 30 18:54:33 CEST 2013


If you file size is your concern, you can re-encode it using lossy
compression after you’ve done with the editing process. I specifically
choose lossless compression and no chroma subsampling to preserve the video
quality. It’s playable by VLC, Media Player Classic Home Cinema, or Windows
Media Player (with K-Lite Codec Pack Mega).
With regards to compatibility, I know that setting of YUV444P and H.264 High
4:4:4 Predictive Profile (Hi444PP) is not exactly widely compatible with
most media players or commercially available media players. It’s meant for
keeping the master copy for future editing.
Again, if compatibility is your concern,

ffmpeg -i "input.mkv" -vcodec "libx264" -crf "18" -pix_fmt "yuv420p"
"output.mkv"

This is a tradeoff of image quality for compatibility and file size. -crf
“18” may be considered a good choice for preserving image quality when it
comes to lossy compression. While it’s generally unpredictable to know the
average bit rate for a given constant rate factor, I do have a theory behind
the algorithms to determine the average bit rate from constant rate factor.
If you are interested, I can post it here as well. For myself, I generally
choose different constant rate factor value for different videos. You may
have wondered why I did not do lossy compression on the slideshows I
created.
The short answer is for local computer playback it is simply unnecessary for
slideshows.
Slideshows are really different from animation in a number of aspects. First
of all, there are many frame duplicates because of the slide of a certain
length. In H.264 inter-frame picture prediction lossless compression, we can
reduce the file size by reducing the redundancy across the frames. Of
course, based on my own tests, H.264 inter-frame picture prediction is not
perfect or ideal in any sense, although considered excellent in comparison
with other codecs. The low bit rate is due to the repetition of the same
image; rather than the reduction of image quality. This is what inter-frame
compression does. This is somewhat similar to repeating the same characters
in text file and compressing it using 7-zip.
Also, when the bit rate is low, it will take less resources for a CPU to
decode it. For live video or animations, however, things are entirely
different. While I may still keep the master copy, it’s not used for local
playback because of the lack of computing resources to decode it quickly
enough during the playback. If I can’t play it even on my PC, why I still
keep it? It is master copy, folks. Lossy compression is required for local
playback. The bit rate for the lossless version is usually very high. Unless
for the purpose of distribution or sharing, I generally don’t do chroma
subsampling even if I do lossy compression.
As far as I know, YouTube cannot decode YUV444p correctly. So you still need
to re-encode it before you want to upload it to YouTube.




--
View this message in context: http://ffmpeg-users.933282.n4.nabble.com/Create-slideshow-with-ffmpeg-from-still-images-tp4660277p4660324.html
Sent from the FFmpeg-users mailing list archive at Nabble.com.


More information about the ffmpeg-user mailing list