View Full Version : Bit-efficient encoding of karaoke lyric video?
mc510
15th March 2021, 05:23
I've made some very simple karaoke lyric videos, with a solid color background, and solid color text lyrics. The only motion is a color change that wipes across the lyrics and periodically the entire screen of text is replaced with the next group of lyrics. It seems like it should be possible to compress this video to a very low bitrate, since almost nothing changes from frame to frame. Simply encoding (ffmpeg libx264) with a low bitrate produces terrible video quality though. Is there a different codec, or advanced settings, or encoder that would do a better job?
rwill
15th March 2021, 09:57
You have not specified your x264 settings. Most relevant settings in this scenario are keyframe interval, bitrate, VBV maxrate/buffer and video resolution.
tormento
15th March 2021, 11:03
Is there a different codec, or advanced settings, or encoder that would do a better job?
Think about using SubStation Alpha subtitles (.ass) instead of encoding the video. You can control font, color, background, position on screen etc. Plus, "superimposing" to any video you have would be really trivial.
benwaggoner
15th March 2021, 17:35
You have not specified your x264 settings. Most relevant settings in this scenario are keyframe interval, bitrate, VBV maxrate/buffer and video resolution.
Yeah, I used to do the out-of-box intro video encodes for a line of tablets. They were cell-style line art for the most part, and only played locally. Using a 20 second GOP and 16 b-frames helped a lot. And --preset placebo was still almost realtime given the simplicity and zero-noise of the content. Using --tune-animation was a good start.
I think I got them <200 Kbps for an excellent-quality 1080p24. And down to ~80 Kbps using x265, as that kind of content is particularly well suited for HEVC using --tskip.
mc510
15th March 2021, 18:54
Thanks guys, this is pointing me in some good directions. I should have mentioned that I ran ffmpeg x264 encoding pretty much with defaults because I don't really understand any encoder settings except for bitrate and image size. I did play around with those, sizes down to something like 160x240, and bitrates from maybe 300 to 2500 ... for any image size I would get decent quality only by using a video-like bitrate (when I was imagining that I should be able to get down to 10% or 20% of "normal" bitrates given how little changes in the frames). I think I may have tried --tune-animation but can't remember for sure.
Sounds like I should read up on keyframe interval, VBV maxrate/buffer, GOP, b-frames. Probably no reason for me to not to try x265 also.
benwaggoner
15th March 2021, 19:18
I'd start with --preset veryslow and --tune animation. Maybe --preset placebo if you've got time (still very fast when I encoded similar content). Depending on how it was captured, if there's analog noise some --nr could help a lot too.
mc510
15th March 2021, 20:51
I'd start with --preset veryslow and --tune animation. Maybe --preset placebo if you've got time (still very fast when I encoded similar content). Depending on how it was captured, if there's analog noise some --nr could help a lot too.
Excellent; thanks much Ben!
mc510
21st March 2021, 22:22
Think about using SubStation Alpha subtitles (.ass) instead of encoding the video. You can control font, color, background, position on screen etc. Plus, "superimposing" to any video you have would be really trivial.
I've been looking into this, because I like the idea of having the lyrics in a simple text file. But as far as I can tell, .ass can only be played on top of video, and can't be played on top of mp3 ... at least not by any available video/music player, like VLC. Too bad!
butterw2
21st March 2021, 23:13
mux audio with solid color background video + ass subtitles = Bit-efficient
benwaggoner
22nd March 2021, 18:22
mux audio with solid color background video + ass subtitles = Bit-efficient
Yeah, doing a flat color, simple gradient, or even a static image with a 20 sec GOP can be very high quality at very low bitrates. I'd use 16 b-frames to improve random access.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.