YouTubeHDR / hdr_metadata

159 stars 38 forks source link

P0: Framerate bug in HDR to SDR video stream conversion #2

Closed zmarty closed 7 years ago

zmarty commented 7 years ago

As mentioned in another closed item, I am using DNxHR + mkvmerge.

HDR test video: https://www.youtube.com/watch?v=WW2DKBGCvEs

Expected: Video plays fine on both SDR and HDR screens (in terms of frame rate)

What actually happens: The video plays correctly on HDR screens with Chrome Ultra at about 23.976 fps, while it plays at about 5 or so in all SDR versions of the stream.

How I repro-ed the issue:

zmarty commented 7 years ago

Let me take that back. It does not play with 5 fps in all SDR versions of the stream. I tried on a Samsung S5 Android phone and there it works fine (stream with a different codec gets served on a Samsung S5?)

YouTubeHDR commented 7 years ago

Thanks for reporting the bug. We will take care of it ASAP.

zmarty commented 7 years ago

This is so bizarre. I uploaded a new 4K HDR video (again using DNxHR HQX exported from Resolve and run through mkvmerge). Now even the HDR version has low framerate when using Chromecast Ultra.

Also, when I try to play any of my HDR videos on my (SDR) Samsung S5 phone I see: "There was a problem while playing. Tap to retry". Retrying it does not help.

Video: https://www.youtube.com/watch?v=26OvbSdUOu4

zmarty commented 7 years ago

Also, if I look at the same video on the PC the only three resolution options are: Auto, 1440p, 2160p. Something weird is definitely going on because YouTube used to generate the lower resolution streams first?

zmarty commented 7 years ago

Could it be the audio? I uploaded a video twice, once with audio and once without. The one with audio has framerate issues in SDR (Chrome, WIndows). The one without audio has no issues.

With audio (bad): https://www.youtube.com/watch?v=LHYA1KMRQgg Without audio (good): https://www.youtube.com/watch?v=jTpNQkH58LQ

zmarty commented 7 years ago

The issue continues with newly uploaded videos. I tried videos with audio, without audio, 23.976 fps, 59.94 fps, 60 fps. It does not seem to make much difference.

Here is what I observe: Once I upload a video and wait maybe a half hour if I view it on a Chromecast Ultra most often than not the video has low framerate. If I come back in 5-6 more hours I often get the same video but with the correct framerate. However, I see other users of my channel reporting issues with SDR and HDR versions of the streams even after 24 hours or so.

My theory is that some percentage of streams YouTube transcodes for each video are bad, but I cannot find a pattern on when and how YouTube decides to use the bad streams. Or maybe it's something else, don't know.

In any case, some sort of status update would be most helpful.

zmarty commented 7 years ago

Oh wow, so I took another look at the "Stats for nerds" on the PC (SDR) and I sort of figured it out:

When I play one of my 60fps videos with incorrect framerate I see: 3840x2160@6 (yes, six frames not 60 as the original video I uploaded!) When I play one of my 24fps videos with correct framerate I see: 3840 x 2160@24 (which is normal and expected)

I don't believe you intended to transcode at six frames per second, so this looks like a bug to me. Some sort of ETA would be most helpful as this is a pretty huge blocker for me.

YouTubeHDR commented 7 years ago

I checked the video and see that the VP9 stream generated by YouTube has incorrect frame rate. All the viewers using Chrome browser will watch the vp9 stream. The users with h264 streams will see the correct fps. I have triggered the transcoding procedure again which will generate the correct fps soon.

zmarty commented 7 years ago

Thank you so much for the update. Is the problem fixed for new uploads going forward?

Can you also please check the rest of the videos here: https://www.youtube.com/channel/UCve7_yAZHFNipzeAGBI5t9g/videos

Most of the videos on the channel (except a few ones) have the same issue.

zmarty commented 7 years ago

A few more details:

YouTubeHDR commented 7 years ago

Sure, I will re-transcode all the videos in your channel. Basically, the problem happens when the video has huge frames. We are working on a solution which will fix the issue.

zmarty commented 7 years ago

Great thank you so much. Meanwhile for new videos I will temporarily use H.264 10 bit in MKV which does not seem to have this issue.

zmarty commented 7 years ago

A few videos got fixed and I can see them correctly in SDR.

However, there are four more that still have framerate issues. Can you please trigger transcoding for them?

https://www.youtube.com/watch?v=5W_WVfxv6Ts https://www.youtube.com/watch?v=a1qUCspct0w https://www.youtube.com/watch?v=qXR_ONPftFM https://www.youtube.com/watch?v=MYCnoODKsAo

YouTubeHDR commented 7 years ago

I triggered the transcoding of those videos. They should be fixed soon.

zmarty commented 7 years ago

Is this issue actually fixed for new videos?

zmarty commented 7 years ago

The first video still has framerate issues on Chrome (SDR version): https://www.youtube.com/watch?v=5W_WVfxv6Ts

Can you please double check it?

The last 3 videos play correctly now.

I separately uploaded a fifth video as a very large DNxHR file and that one got converted correctly.

YouTubeHDR commented 7 years ago

Sorry I missed that video. I have started it. Should be good soon.