Log in

View Full Version : Encoding for Streaming


Æfterburn
16th January 2025, 22:54
Hey all,
Remember when MeGUI had profiles for encoding for various hardware devices, such as iPod, Playstation, Xbox, etc? I know those are probably outdated now. I've moved on to dropping everything on my Plex server to let it handle streaming to all my devices these days. I was wondering if there are x264/x265 options that may facilitate streaming across a network a bit better.

I've been trying out the options from this guide: https://www.lighterra.com/papers/videoencodingh264/ and some of it makes sense. For example, using x264 and various settings for device compatibility, CBR (2-pass) for a predictable stream size, etc. I'm a bit disappointed that they recommend 64k mono audio for SD and 128k stereo for HD, and the file sizes are sadly larger than sending your encode through x265 with constant quality (1-pass) and appropriate tuning/presets.

The goal is to have videos direct-play so that the server doesn't need to transcode.

I'm hoping to put ideas together to create a MeGUI preset or two, which could be used by anyone.

Is this worth pursuing, or is this just a situation where it doesn't matter?

Z2697
17th January 2025, 04:53
It depends on your playback device and network speed.

For bitrate/network constraint I think a good choice is CRF (constant quality 1-pass) with a VBV adjusted to fit in you network speed.

The device constraint is a bit tricky, but typically a majority of modern devices - (if they can HW decode HEVC then they should be modern enough) - are not that constrained, I think keep an eye on the max reference number and you are good to go.
Most HW decoder don't like more than 6 references, if you have some older or low end device, better keep it even lower. x265 will not use more than 6 refs in presets, but some x264 preset will happily use more.
Bitrate? I assume if your network can transfer it, it's way below the btirate constraint of HW decoder, unless you have some very fascinating networking gears.
And I'm sure you are aware of the resolution and framerate constraint of the devices.

TLDR: use CRF+VBV and low ref number.

P.S. check the pixel format as well, YUV420P8 for x264, YUV420P10 for x265. There's nearly zero HW decoder for 10bit AVC.
P.P.S. some "first generation HEVC decoder" don't support 10bit :o