Hi there,
I'm looking for a way to constrain the bitrate spikes produced by x264 using 2-pass encoding. I sometimes do movie nights with a few friends through Plex's Watch Together feature. I'd rather encode a movie with x264 a day before than using Plex's transcoder because even with HW acceleration disabled, the results aren't exactly high quality. Although I'd need to use QuickSync either way because my Plex server is hosted on an older machine which only really allows for 1 simultaneous software transcode.
My upload speed is only about 36 Mbps, so for serving 2 remote clients simultaneously I would be in the ballpark of around 15 Mbps average bitrate in x264's 2-pass mode. However, I noticed in the past that in some complex scenes, one of the clients would need to buffer occasionally because of the bitrate spikes. So I did some test encodes using different vbv settings and analyzed them using Bitrate Viewer for comparison.
A 1080p video at 10 Mbps avg bitrate resulted in the following:
vbv-bufsize: 78,125 kbps | vbv-maxrate 62,500 kbps-> Output size: 561,383 KB | Avg: 10,020 kbps | Max: 18,964 kbps | Min: 4,893 kbps
vbv-bufsize: 20,000 kbps | vbv-maxrate 30,000 kbps-> Output size: 561,486 KB | Avg: 10,024 kbps | Max: 16,553 kbps | Min: 4,776 kbps
vbv-bufsize: 10,000 kbps | vbv-maxrate 10,000 kbps-> Output size: 553,349 KB | Avg: 9,702 kbps | Max: 12,670 kbps | Min: 5,756 kbps
vbv-init was set to 0.90 for all encodes. The quality differences between those encodes were very minor, almost unnoticeable even in the peak bitrate parts of the video.
But I'm kind of afraid I violated any encoder/decoder "rules", especially by setting the buffer and fillrate to 10 000 kbit/s. I've read about buffer overflow and underflow but I'm still a bit confused if that even matters in my use case? Is there even a way to balance the buffer so that it does neither underflow or overflow, and if not I assume it's better to overflow? I tried checking for vbv compliance using the perl script and VBV Checker 1.9 but I didn't get any of those to work. All clients will use Plex for Windows for streaming and I'm not sure how Plex as a player handles these buffers since it's network buffering either way.
I get that trying to achieve vbv compliance for certain devices is necessary, but would I run into any issues by doing this taking my use case into account?
Thanks in advance![]()
+ Reply to Thread
Results 1 to 1 of 1
-
Last edited by sebastiaaan; 15th Nov 2023 at 04:22.
Similar Threads
-
can anybody optimize the accident video and find the guilty party ?
By curieux in forum Newbie / General discussionsReplies: 7Last Post: 7th Dec 2022, 01:23 -
Optimize bad source material ripped from MakeMKV
By marco000 in forum Video ConversionReplies: 11Last Post: 21st Jun 2021, 10:18 -
FFMpeg demux but keeping max bitrate tag
By kalemvar1 in forum Video ConversionReplies: 2Last Post: 12th Jun 2021, 09:58 -
x264 - bitrate always spikes high during beginning of video
By palaceplace in forum Video ConversionReplies: 9Last Post: 30th Sep 2019, 16:36 -
How to optimize video conversion? (H.265)
By villaquien in forum Video ConversionReplies: 6Last Post: 19th Aug 2019, 16:08