Closed Alanko5 closed 2 years ago
@kingslay please, is it possible to solve this problem?
for codecs: hev1, (edvh/dvhe), (hvcC+dvcC) for profiles: 5 and 7
Is AVSampleBufferDisplayLayer the layer? What player did you use to play it. I used vlc, which is the same as ksplayer
I use KSPlayer on AppleTV.
KSPlayer not detect colorPrimaries: yCbCrMatrix:
Dolby Vision have single video layer and dual video layer:
http://bilder.hifi-forum.de/max/867239/dolby-vision-single-dual-layer_850774.png
This example use dynamic hdr metadata (Dolby Vision) and use dual (video) layer for playing. https://sheri.eu/iscc/dolby-vision-amaze-(dolby-vision).mp4
VLCKit not support HDR formats. VLCKit convert HDR to SDR. VLCKit not support DV metadata for playing.
This can be done only if ffmpeg supports Dolby Vision dual video layer
Infuse (use ffmpeg) support dual layer DolbyVision.
but apple tv not support. 😢
@kingslay DV FEL (profile 7) Include HDR layer and dynamic metadata layer.
Can you please at least play only HDR layer?
Detection for DolbyVision stream
case HEVC_NAL_UNSPECIFIED_63:
// The dolby vision enhancement layer doesn't actually use NAL units 63 and 62,
// it uses a special syntax that uses 0x7E01 and 0x7C01 as separator that makes
// the Dolby Extension Layer (EL) appear as unspecified/unused NAL units (62 and 63),
// but the actual NAL information starts after that extra header.
if (nal_type_full == 0x7C01)
{
CLog::Log(LOGDEBUG, "%s - frame(%llu), dolby vision enhancement layer of 0x7C01 with size(%d)",
__FUNCTION__, frameCount, nal_size);
}
else if (nal_type_full == 0x7E01)
CLog::Log(LOGDEBUG, "%s - frame(%llu), dolby vision enhancement layer of 0x7E01 with size(%d)",
__FUNCTION__, frameCount, nal_size);
else
{
CLog::Log(LOGDEBUG, "%s - frame(%llu), HEVC_NAL_UNSPECIFIED_62/63 with size(%d)",
__FUNCTION__, frameCount, nal_size);
}
break;
https://github.com/MrMC/mrmc/commit/5e6d1dc9e65fc64d1af9d320fcdbfa80e662f488
// missing in ffmpeg for DolbyVison (dvhe)
if (pStream->codec->codec_id == AV_CODEC_ID_NONE)
{
if (pStream->codec->codec_tag == MKTAG('d','v','h','e'))
{
pStream->codec->codec_id = AV_CODEC_ID_HEVC;
CLog::Log(LOGERROR, "%s - dvhe, detected forcing AV_CODEC_ID_HEVC", __FUNCTION__);
}
}
// overlap in ffmpeg of DV Video and DolbyVison (dvh1)
// hack force it to AV_CODEC_ID_HEVC, should fix ffmpeg.
if (pStream->codec->codec_id == AV_CODEC_ID_DVVIDEO)
{
if (pStream->codec->codec_tag == MKTAG('d','v','h','1'))
{
pStream->codec->codec_id = AV_CODEC_ID_HEVC;
CLog::Log(LOGERROR, "%s - AV_CODEC_ID_DVVIDEO detected, forcing AV_CODEC_ID_HEVC", __FUNCTION__);
}
}
if (!CSettings::GetInstance().GetBool(CSettings::SETTING_VIDEOPLAYER_USEVIDEOTOOLBOX_HEVC_HDR) &&
(hints.profile == FF_PROFILE_HEVC_MAIN_10 ||
hints.profile == FF_PROFILE_HEVC_REXT ||
hints.codec_tag == MKTAG('d','v','h','1') ||
hints.codec_tag == MKTAG('d','v','h','e') ||
hints.codec_tag == MKTAG('D','O','V','I')))
{
// if bt2020+, kick it to AVFoundataion
if (hints.colortransfer >= AVCOL_TRC_SMPTE2084)
return false;
// only AVFoundataion can handle DolbyVision
if (hints.codec_tag == MKTAG('d','v','h','1') ||
hints.codec_tag == MKTAG('d','v','h','e') ||
hints.codec_tag == MKTAG('D','O','V','I'))
return false;
}
HDR video if use one layer is good. (https://sylvan.apple.com/Aerials/2x/Videos/LA_A006_C008_2K_HDR_HEVC.mov -> is playing correctly)
But if DV use 2 layers then KSplayer not show correctly: https://user-images.githubusercontent.com/71501260/114447418-ae9e9d00-9bd2-11eb-87cd-75ca210165c3.mov
Corect visualisation: https://sheri.eu/iscc/IMG_1091.MOV
sample: https://sheri.eu/iscc/dolby-vision-amaze-(dolby-vision).mp4
KSPlayer track info: video name: und bitRate: 18057854 fps: 23.976025 bitDepth: 10 colorPrimaries: colorPrimaries: yCbCrMatrix: codecType: ehvd