Sometimes I upload audiobooks to youtube, they are usually recorded from radio stations. Few people listen to the radios nowadays, especially when these audio books are broadcasted at late night after midnight, especially not every single parts of 30 epizodes. But when it is uploaded to youtube in one video, many like to listen to them, usually a couple of ten-thousand views in a year. These audio books are not issued on CD so I have to make a cover. I simply look for a suiting image, usually the cover of the original book or anthology in case of novels. So the video is consisted completely of a still image from beginning to the end. Sometimes 5-10 seconds fade-in and fade-out at the beginning and the end. Even seldom more than one image is utilized, for example 15-20 illustrating images for an 3 minutes poem or short novel, with 5-10 seconds of dissolve effect between two images, which still means a lot of repeating frames in the video. Which codec and settings would be optimal for such a scenario? Till now I am using h264 with ultrafast preset, with stillimage tune parameter and -crf settings at 20, fps is set only to 2 when no fade and dissolve effects are applied:
Code:ffmpeg -loop 1 -r 2 -i <image.png> -i <audio.mp3> -c:v libx264 -tune stillimage -preset ultrafast -crf 20 -c:a copy -shortest -pix_fmt yuv420p output.mkv
Quality and file size is acceptable, 90% of file data is the audio stream. However encoding time is quite long, which is not a problem for an 1 hour reading, but it is long for a 10 hour book. Once I tried to decrease the framerate from 2 to 0.1, thus much less frames would need to be encoded, but Youtube didn't accepted such a low framrate videos. Would be better some faster alternative codec which provides similarly small filesize and honors the repeating frames somehow. For example only 1 frame is really encoded, and the other video frames are only a reference to the one and only encoded frame. It is also important that the codec must work with youtube.
+ Reply to Thread
Results 1 to 5 of 5
-
Last edited by konstantinusz; 11th Dec 2016 at 21:38.
-
-tune stillimage perhaps does not let deblocking do much work in a sense of not letting image to be blurred somehow, so picture is more detailed,
but you can also try to lower keyframes, to the point of having only one for the whole video, check if encoding gets faster. If there is only one image for example, it is very appropriate, I tested video encoded like that while ago for Youtube and it was accepted. File gets significantly smaller.
-keyint infinite
note , that files encoded like that are not meant for playback, because seeking might be slow
also check this -force_key_frames , never used it myself though, but it could work, using ffmpeg documentation, search this on this page: https://www.ffmpeg.org/ffmpeg.html#Advanced-Video-Options
maybe it would work together with that infinite keyframe , maybe not
you can try something like this: -force_key_frames 0:00:00,0:10:00,0:20:00
it should force keyframe in 0, 10th and 20th minute for example. -
Who knows how Youtube encodes and what the reason is. Maybe it's the audio.
You could try to encode using variable framerate, i.e. make the still images just one picture each and then make their show-time long via timecodes using e.g. mkvmerge. But I do not know if Youtube will encode those correctly, faster or not at all.
/edit:
Oh, I misunderstood. I thought you meant Youtube took long to encode but you were actually talking about your PC. Still, VFR could do the same there.Last edited by sneaker; 12th Dec 2016 at 10:19.
Similar Threads
-
Which codec and settings to use with FFmpeg for temporary transcoding?
By konstantinusz in forum Video ConversionReplies: 15Last Post: 4th Dec 2016, 18:07 -
Best encoding settings for audio w. still image (song video) ?
By knez18 in forum Video ConversionReplies: 6Last Post: 8th May 2014, 16:20 -
Trying to extract 1 image from multiple videos with FFMPEG
By mordor in forum Newbie / General discussionsReplies: 2Last Post: 13th Apr 2013, 18:31 -
Converting image to videos with different time rate using ffmpeg
By radiaku in forum Video ConversionReplies: 2Last Post: 2nd Jan 2013, 12:31 -
ffmpeg : understanding mpeg4 encoding settings
By feelart in forum Video ConversionReplies: 0Last Post: 11th May 2012, 09:00