lpms
lpms copied to clipboard
Auto-create ABR list based on incoming video parameters
Is your feature request related to a problem? Please describe. There is no sensible ABR default now - the developer has to worry about setting ABR for each video when doing transcoding. It can get potentially complex if the node has multiple input videos at the same time.
Describe the solution you'd like
Simple logic to automatically create ABR list based on incoming video parameters. We can add a method in ffmpeg_segment_transcoder.go
called autoDetectABRProfiles
that takes a HLSSegment
and returns a list of VideoProfile
.
The logic:
- Only support 16x9 and 4x3, standard resolutions.
- Based on input resolution, create an ABR list that includes everything in the standard resolutions list below the input resolution.
- Try to guess FPS, and select the same FPS for the ABS list.
Describe alternatives you've considered
We could dynamically decide on the ABR list and accept non-standard formats. But that requires for us to move away from the enumerated VideoProfile
concept and create dynamic VideoProfiles
. We'd have to do some fuzzy math to "snap into" standard resolutions.
Additional context This feature depends on https://github.com/livepeer/lpms/issues/83
In go-livepeer
, we can create a -autoABR
flag, default to true
. If -autoABR
is set to false, rely on the user to set the transcode profiles. Otherwise, try to automatically set the ABR list.
Standard ABR Lists 16x9
- P1080p60fps16x9
- P1080p30fps16x9
- P720p60fps16x9
- P720p30fps16x9
- P576p60fps16x9
- P576p30fps16x9
- P360p60fps16x9
- P360p30fps16x9
- P288p60fps16x9
- P288p30fps16x9
- P144p60fps16x9
- P144p30fps16x9
4x3
- P960p60fps4x3
- P960p30fps4x3
- P480p60fps4x3
- P480p30fps4x3
- P240p60fps4x3
- P240p30fps4x3
- P120p60fps4x3
- P120p30fps4x3
Should the default for 60 FPS inputs be to only output 60 FPS outputs? I don't know what the normal expectation is for users.
60fps downsampled to 30fps seems reasonable for ABR, since it's a big savings. Naturally, a 30fps video shouldn't be upsampled to 60fps in this case.
The reason I'm asking is because that's a long list of output streams (can one node encode all in realtime?) if the input is 60fps. It would do all rendition in both 30 and 60? A shorter way of asking this, is "what is the default outputs in the case of a 1080p60fps16x9 input?" Maybe it's all of them.
Yeah the list itself is a bit curious, eg 520x576 is a PAL resolution which typically runs at 24fps (not 30/60) and there's no NTSC equivalent in the list, as far as I can tell. In practice 60fps is probably not really needed for anything under 720p.
I think we should have all of these profiles defined in goclient already. If not, I'd actually be against adding new profiles to the current set, because adding new ones is a bit of a process. I'm not too concerned with fixing this at the moment, because once gas accounting is in, that'll remove the need to have so much structure around the video profiles.
In theory, going from 60fps to 30fps with the same resolution, an encoder could be configured to allow dropping every other frame before the muxer. It's not something we support right now though.