Jump to content

Recommended settings for mp4 hdr?


MrWGT13

Recommended Posts

MrWGT13

In Article https://support.emby.media/support/solutions/articles/44001160796-apple-tv some restrictions are noted for direct play with apple tv:

Direct Play Media Formats

Video — h.264,h.265 (hevc) in m4v,mp4,mov container
Subtitles - srt,ssa,ass,sub,vtt
Audio – aac,ac3 (Dolby Digital),mp3
Best Practices for Direct Play

Ensure your media meets the above criteria.

If using h.265 make sure your videos are tagged as hcv1 and not as hev1.

Are there further restrictions or recommentations like bitrate of AC3 and max bitrate of video stream, level of hecv, B-ref-mode, length of gop and so on? Some created files plays fine and some have audio dropout (pause and unpause solves it) or "paused video/audio for some seconds whichs starts again itself".

Example for created video:

Format                                   : MPEG-4
Format-Profil                            : Base Media
Codec-ID                                 : iso4 (iso4)
Dateigröße                               : 22,9 GiB
Dauer                                    : 3 h 2 min
Modus der Gesamtbitrate                  : variabel
Gesamte Bitrate                          : 18,0 Mb/s
Kodierungs-Datum                         : UTC 2023-01-21 16:23:02
Tagging-Datum                            : UTC 2023-01-21 16:23:02
Kodierendes Programm                     : GPAC-2.2-rev0-gab012bbf-master

Video
ID                                       : 1
Format                                   : HEVC
Format/Info                              : High Efficiency Video Coding
Format-Profil                            : Main 10@L5.1@High
HDR format                               : SMPTE ST 2086, HDR10 compatible
Codec-ID                                 : hvc1
Codec-ID/Info                            : High Efficiency Video Coding
Dauer                                    : 3 h 2 min
Bitrate                                  : 17,5 Mb/s
maximale Bitrate                         : 46,5 Mb/s
Breite                                   : 3 840 Pixel
Höhe                                     : 1 608 Pixel
Bildseitenverhältnis                     : 2,40:1
Modus der Bildwiederholungsrate          : konstant
Bildwiederholungsrate                    : 23,976 (24000/1001) FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0 (Type 2)
Bit depth                                : 10 bits
Bits/(Pixel*Frame)                       : 0.118
Stream-Größe                             : 22,4 GiB (97%)
Titel                                    : video
Sprache                                  : Deutsch
Kodierungs-Datum                         : UTC 2023-01-21 16:23:02
Tagging-Datum                            : UTC 2023-01-21 16:23:42
Color range                              : Limited
Color primaries                          : BT.2020
Transfer characteristics                 : PQ
Matrix coefficients                      : BT.2020 non-constant
Mastering display color primaries        : Display P3
Mastering display luminance              : min: 0.0050 cd/m2, max: 4000 cd/m2
Maximum Content Light Level              : 801 cd/m2
Maximum Frame-Average Light Level        : 188 cd/m2
mdhd_Duration                            : 10949480
Codec configuration box                  : hvcC

Audio
ID                                       : 2
Format                                   : AC-3
Format/Info                              : Audio Coding 3
Commercial name                          : Dolby Digital
Codec-ID                                 : ac-3
Dauer                                    : 3 h 2 min
Bitraten-Modus                           : konstant
Bitrate                                  : 448 kb/s
maximale Bitrate                         : 473 kb/s
Kanäle                                   : 6 Kanäle
Channel layout                           : L R C LFE Ls Rs
Samplingrate                             : 48,0 kHz
Bildwiederholungsrate                    : 31,250 FPS (1536 SPF)
Compression mode                         : Lossy
Stream-Größe                             : 585 MiB (2%)
Titel                                    : audio
Sprache                                  : Deutsch
Service kind                             : Complete Main
Default                                  : Ja
Alternate group                          : 1
Kodierungs-Datum                         : UTC 2023-01-21 16:23:39
Tagging-Datum                            : UTC 2023-01-21 16:23:42

Tnx Gerd

Edited by MrWGT13
Link to comment
Share on other sites

Hi, none that I'm aware of. Are there any common differences between the ones that drop out and the ones that don't?

Link to comment
Share on other sites

I saw this sort of behavior when I deviated from the suggested presets in handbrake. I used to raise the video quality a couple of notches and bump the bitrate of the audio as well. While I never found the source of the issue I suspect it was bit rate related. Once I used the handbrake device presets all my problems went away. While Apple doesn't provide really great guidance on maximum/average bit rates it supports their HLS specification provides some indications as shown below:

image.thumb.png.c5a7d64f38dece218e3e46f55b8b4fe9.png

The average bitrate in your output is close to or exceeds the recommendations here. So while I don't have an exact answer for you my anecdotal experience says stick with Handbrake device presets or use similar ones to Handbrake with whatever workflow you use to encode your media. I hope this helps!

Edited by corey
Link to comment
Share on other sites

MrWGT13

Tnx corey for the link https://developer.apple.com/documentation/http_live_streaming/http_live_streaming_hls_authoring_specification_for_apple_devices. I'm currently reading trough the spec. I assume i've to adjust some encoding parameters. The most important (i think) are:

  • 1.6b. Profile, Level, and Tier for HEVC MUST be less than or equal to Main 10 Profile, Level 5.1, High Tier.
  • 1.7. High Dynamic Range (HDR) HEVC video MUST be HDR10, HLG, or DolbyVision.
  • 1.9. Profile and Level for Dolby Vision MUST be Profile 5 (single layer 10-bit HEVC) and less than or equal to Level 7.
  • 1.10. You SHOULD use video formats in which the parameter sets are stored in the sample descriptions, rather than the samples. (That is, use 'avc1', 'hvc1', or 'dvh1' rather than 'avc3', 'hev1', or 'dvhe'.)
  • 1.11. For backward compatibility, content SHOULD NOT use a higher level than required by the content resolution and frame rate.
  • 1.13. Key frames (IDRs) SHOULD be present every two seconds.
  • video bitrate according to Table 3
  • 1.34. For maximum compatibility when UHD video resolution is provided, some UHD variants SHOULD be less than or equal to 15 Mbit/s.
  • 1.35 For HDR10 content, the Mastering Display Color Volume and Content Light Level Information SEI messages SHOULD be present.
  • Supported audio codec/bitrate according to chapter 2.

I'm using high tier level 5.1 for my encodings. But 1.11 states that for backward compatibility i should not use  a higher level than required. For UHD level 5.0 should be sufficent according to wikipedia. I'll try...

Link to comment
Share on other sites

MrWGT13

I reencoded some of my hdr discs with different settings with fastflix and nvencc advanced options "--gop-len 48 --max-bitrate 36000" and setting B-Frames to 4. I'm not sure if setting "--gop-len 48" forces a key frame (IDR) as recommended from apple (see above). But the default gop-len of nvencc with 240 frames could be a little long.

This reduced the peak bitrate of encoded file and had only minor influence on average. Being 54 years old and sitting 3m away of a 50" hdr tv i see no difference 😅. The last 4 movies played without problems and i'm reencoding some other files which had problems.

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...