Dusk-Labs / dim

Dim, a media manager fueled by dark forces.
GNU Affero General Public License v3.0
3.74k stars 154 forks source link

Video playback performance #465

Open vgarleanu opened 1 year ago

vgarleanu commented 1 year ago

When playing back a media that will be transcoded, the latency from pressing play to seeing the first video frame is very high. Sometimes several seconds +. We could decrease the latency by encoding the first couple of seconds with a faster (and lower quality) video preset at the expense of bandwidth, after a couple of seconds of video have been encoded we would start transcoding with a better, higher quality preset.

The main issue I can see is us not accurately being able to stitch the "two" streams together without having video gaps, or losing frames, or worse yet, causing the player to freak out and crash. Implementing this, we would use a lot of techniques from the split and stitch method of distributed transcoding.

vgarleanu commented 1 year ago

Its likely that smaller keyframes will also be necessary to reduce latency as much as possible. With this feature however we could increase the quality of the video while maintaining good UX by sacrificing a couple of seconds of video