Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handbrake crashes with certain films with Dolby Vision #5976

Closed
Mister-XY opened this issue Apr 20, 2024 · 9 comments
Closed

Handbrake crashes with certain films with Dolby Vision #5976

Mister-XY opened this issue Apr 20, 2024 · 9 comments

Comments

@Mister-XY
Copy link

Mister-XY commented Apr 20, 2024

Problem Description

Handbrake has been crashing for certain films since PR #5892.
It turns out that the films that cause Handbrake to crash all have the same HDR format.
Before the PR, Handbrake was able to convert the films, but since the PR it crashes.
However, this only happens when converting to AV1 format.

This is what the HDR Format looks like

ID : 1
ID in the original source m : 4113 (0x1011)
Format : HEVC
Format/Info : High Efficiency Video Coding
Format profile : Main 10@L5.1@High
HDR format : Dolby Vision, Version 1.0, Profile 7.6, dvhe.07.06, BL+EL+RPU, no metadata compression, Blu-ray compatible / SMPTE ST 2094 App 4, Version HDR10+ Profile B, HDR10+ Profile B compatible
Codec ID : V_MPEGH/ISO/HEVC

Activity Log, Crash Log or any other details

HandBrake Nightly 20240418214634-0adabb97d-master (2024041901)
OS: Microsoft Windows NT 10.0.22631.0
CPU: AMD Ryzen 9 7900 12-Core Processor             
Ram: 31967 MB, 
GPU Information:
  AMD Radeon(TM) Graphics - 31.0.24027.1012
Screen: 1920x1080
Temp Dir: C:\Users\Thomas\AppData\Local\Temp\
Install Dir: C:\Program Files\HandBrake Nightly\
Data Dir: C:\Users\Thomas\AppData\Roaming\HandBrake\Nightly

-------------------------------------------

 # Starting Encode ...

[07:24:15] base preset: AV1
[07:24:15] hb_init: starting libhb thread
[07:24:15] Starting work at: Sat Apr 20 07:24:15 2024
[07:24:15] 1 job(s) to process
[07:24:15] CPU: AMD Ryzen 9 7900 12-Core Processor
[07:24:15]  - logical processor count: 24
[07:24:15] Intel Quick Sync Video support: no
[07:24:15] hb_scan: path=I:\RIP\Movie.mkv, title_index=1
Input #0, matroska,webm, from 'I:\RIP\Movie.mkv':
  Metadata:
    title           : Movie
    encoder         : libmakemkv v1.17.6 (1.3.10/1.5.2) win(x64-release)
    creation_time   : 2024-04-12T05:03:02.000000Z
  Duration: 02:49:25.24, start: 0.000000, bitrate: 54355 kb/s
  Chapters:
    Chapter #0:0: start 0.000000, end 550.216333
      Metadata:
        title           : Chapter 01
    Chapter #0:1: start 550.216333, end 1146.270125
      Metadata:
        title           : Chapter 02
    Chapter #0:2: start 1146.270125, end 1620.744125
      Metadata:
        title           : Chapter 03
    Chapter #0:3: start 1620.744125, end 2271.060458
      Metadata:
        title           : Chapter 04
    Chapter #0:4: start 2271.060458, end 2779.693583
      Metadata:
        title           : Chapter 05
    Chapter #0:5: start 2779.693583, end 3346.468125
      Metadata:
        title           : Chapter 06
    Chapter #0:6: start 3346.468125, end 3936.182250
      Metadata:
        title           : Chapter 07
    Chapter #0:7: start 3936.182250, end 4638.759125
      Metadata:
        title           : Chapter 08
    Chapter #0:8: start 4638.759125, end 5361.522833
      Metadata:
        title           : Chapter 09
    Chapter #0:9: start 5361.522833, end 6062.973583
      Metadata:
        title           : Chapter 10
    Chapter #0:10: start 6062.973583, end 6551.211333
      Metadata:
        title           : Chapter 11
    Chapter #0:11: start 6551.211333, end 7173.666500
      Metadata:
        title           : Chapter 12
    Chapter #0:12: start 7173.666500, end 7531.774250
      Metadata:
        title           : Chapter 13
    Chapter #0:13: start 7531.774250, end 8065.932875
      Metadata:
        title           : Chapter 14
    Chapter #0:14: start 8065.932875, end 8563.888667
      Metadata:
        title           : Chapter 15
    Chapter #0:15: start 8563.888667, end 9177.042875
      Metadata:
        title           : Chapter 16
    Chapter #0:16: start 9177.042875, end 9735.475750
      Metadata:
        title           : Chapter 17
    Chapter #0:17: start 9735.475750, end 9892.424208
      Metadata:
        title           : Chapter 18
    Chapter #0:18: start 9892.424208, end 10165.238417
      Metadata:
        title           : Chapter 19
  Stream #0:0(eng): Video: hevc (Main 10), yuv420p10le(tv, bt2020nc/bt2020/smpte2084), 3840x2160 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 1k tbn
      Metadata:
        BPS-eng         : 53678282
        DURATION-eng    : 02:49:25.238416666
        NUMBER_OF_FRAMES-eng: 243722
        NUMBER_OF_BYTES-eng: 68206565200
        SOURCE_ID-eng   : 001011
        _STATISTICS_WRITING_APP-eng: MakeMKV v1.17.6 win(x64-release)
        _STATISTICS_WRITING_DATE_UTC-eng: 2024-04-12 05:03:02
        _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES SOURCE_ID
      Side data:
        DOVI configuration record: version: 1.0, profile: 7, level: 6, rpu flag: 1, el flag: 1, bl flag: 1, compatibility id: 6
  Stream #0:1(deu): Audio: ac3, 48000 Hz, 5.1(side), fltp, 640 kb/s (default)
      Metadata:
        title           : Surround 5.1
        BPS-eng         : 640000
        DURATION-eng    : 02:49:25.248000000
        NUMBER_OF_FRAMES-eng: 317664
        NUMBER_OF_BYTES-eng: 813219840
        SOURCE_ID-eng   : 001103
        _STATISTICS_WRITING_APP-eng: MakeMKV v1.17.6 win(x64-release)
        _STATISTICS_WRITING_DATE_UTC-eng: 2024-04-12 05:03:02
        _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES SOURCE_ID
  Stream #0:2(deu): Subtitle: hdmv_pgs_subtitle (pgssub), 1920x1080
      Metadata:
        BPS-eng         : 35903
        DURATION-eng    : 02:44:57.158104166
        NUMBER_OF_FRAMES-eng: 4776
        NUMBER_OF_BYTES-eng: 44418075
        SOURCE_ID-eng   : 0012A2
        _STATISTICS_WRITING_APP-eng: MakeMKV v1.17.6 win(x64-release)
        _STATISTICS_WRITING_DATE_UTC-eng: 2024-04-12 05:03:02
        _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES SOURCE_ID
  Stream #0:3(deu): Subtitle: hdmv_pgs_subtitle (pgssub)
      Metadata:
        BPS-eng         : 91
        DURATION-eng    : 00:52:21.617645833
        NUMBER_OF_FRAMES-eng: 4
        NUMBER_OF_BYTES-eng: 35901
        SOURCE_ID-eng   : 0012AF
        _STATISTICS_WRITING_APP-eng: MakeMKV v1.17.6 win(x64-release)
        _STATISTICS_WRITING_DATE_UTC-eng: 2024-04-12 05:03:02
        _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES SOURCE_ID
[07:24:15] scan: decoding previews for title 1
[AVHWDeviceContext @ 00000195041d35c0] Cannot load nvcuda.dll
[AVHWDeviceContext @ 00000195041d35c0] Could not dynamically load CUDA
hwaccel: failed to create hwdevice
[07:24:15] scan: audio 0x1: ac3, rate=48000Hz, bitrate=640000 Deutsch (AC3, 5.1 ch, Dolby Digital EX, 640 kbps)
[07:24:17] using container PAR 1:1
[07:24:17] scan: 10 previews, 3840x2160, 23.976 fps, autocrop = 276/276/0/0, aspect 16:9, PAR 1:1, color profile: 9-16-9, chroma location: topleft
[07:24:17] scan: mastering display metadata: r(0.6800,0.3200) g(0.2650,0.6900) b(0.1500 0.0600) wp(0.3127, 0.3290) min_luminance=0.000100, max_luminance=1000.000000
[07:24:17] scan: content light level: max_cll=1052, max_fall=400
[07:24:17] scan: dolby vision configuration record: version: 1.0, profile: 7, level: 6, rpu flag: 1, el flag: 1, bl flag: 1, compatibility id: 6
[07:24:17] scan: hdr10+ dynamic metadata found
[07:24:17] libhb: scan thread found 1 valid title(s)
[07:24:17] Starting Task: Subtitle Scan
[07:24:17] job configuration:
[07:24:17]  * source
[07:24:17]    + I:\RIP\Movie.mkv
[07:24:17]    + title 1, chapter(s) 1 to 19
[07:24:17]    + container: matroska,webm
[07:24:17]    + data rate: 54355 kbps
[07:24:17]  * destination
[07:24:17]    + I:\Encode\Movie.AV1.mkv
[07:24:17]    + container: Matroska (libavformat)
[07:24:17]      + chapter markers
[07:24:17]  * video track
[07:24:17]    + decoder: hevc 10-bit (yuv420p10le)
[07:24:17]    + filters
[07:24:17]      + Framerate Shaper (mode=1)
[07:24:17]        + frame rate: 23.976 fps -> constant 23.976 fps
[07:24:17]      + Crop and Scale (width=3840:height=1608:crop-top=276:crop-bottom=276:crop-left=0:crop-right=0)
[07:24:17]        + source: 3840 * 2160, crop (276/276/0/0): 3840 * 1608, scale: 3840 * 1608
[07:24:17]      + RPU converter (mode=7:scale-factor-x=1.000000:scale-factor-y=1.000000:crop-top=276:crop-bottom=276:crop-left=0:crop-right=0:pad-top=0:pad-bottom=0:pad-left=0:pad-right=0)
[07:24:17]    + Output geometry
[07:24:17]      + storage dimensions: 3840 x 1608
[07:24:17]      + pixel aspect ratio: 1 : 1
[07:24:17]      + display dimensions: 3840 x 1608
[07:24:17]  * Foreign Audio Search: Passthrough, Forced Only, Default
[07:24:17]    + subtitle, Deutsch (PGS) (track 0, id 0x2, Picture)
[07:24:17]    + subtitle, Deutsch (PGS) (track 1, id 0x3, Picture)
[07:24:17] sync: expecting 243721 video frames
[07:24:51] reader: done. 1 scr changes
[07:24:51] work: average encoding speed for job is 0.000000 fps
[07:24:51] vfr: 0 frames output, 0 dropped and 0 duped for CFR/PFR
[07:24:51] vfr: lost time: 0 (0 frames)
[07:24:51] vfr: gained time: 0 (0 frames) (0 not accounted for)
[07:24:51] hevc-decoder done: 0 frames, 0 decoder errors
[07:24:51] sync: got 0 frames, 243721 expected
[07:24:51] Subtitle track 0 (id 0x2) 'Deutsch (PGS)': 2388 hits (0 forced)
[07:24:51] Subtitle track 1 (id 0x3) 'Deutsch (PGS)': 2 hits (0 forced)
[07:24:51] Found a subtitle candidate with id 0x3
[07:24:51] Starting Task: Encoding Pass
[07:24:51] job configuration:
[07:24:51]  * source
[07:24:51]    + I:\RIP\Movie.mkv
[07:24:51]    + title 1, chapter(s) 1 to 19
[07:24:51]    + container: matroska,webm
[07:24:51]    + data rate: 54355 kbps
[07:24:51]  * destination
[07:24:51]    + I:\Encode\Movie.AV1.mkv
[07:24:51]    + container: Matroska (libavformat)
[07:24:51]      + chapter markers
[07:24:51]  * video track
[07:24:51]    + decoder: hevc 10-bit (yuv420p10le)
[07:24:51]    + filters
[07:24:51]      + Framerate Shaper (mode=1)
[07:24:51]        + frame rate: 23.976 fps -> constant 23.976 fps
[07:24:51]      + Crop and Scale (width=3840:height=1608:crop-top=276:crop-bottom=276:crop-left=0:crop-right=0)
[07:24:51]        + source: 3840 * 2160, crop (276/276/0/0): 3840 * 1608, scale: 3840 * 1608
[07:24:51]      + RPU converter (mode=7:scale-factor-x=1.000000:scale-factor-y=1.000000:crop-top=276:crop-bottom=276:crop-left=0:crop-right=0:pad-top=0:pad-bottom=0:pad-left=0:pad-right=0)
[07:24:51]    + Output geometry
[07:24:51]      + storage dimensions: 3840 x 1608
[07:24:51]      + pixel aspect ratio: 1 : 1
[07:24:51]      + display dimensions: 3840 x 1608
[07:24:51]    + encoder: AV1 10-bit (SVT)
[07:24:51]      + preset:  5
[07:24:51]      + options: film-grain=8:enable-overlays=1
[07:24:51]      + profile: auto
[07:24:51]      + level:   auto
[07:24:51]      + quality: 20.00 (RF)
[07:24:51]      + color profile: 9-16-9
[07:24:51]      + color range: tv
[07:24:51]      + chroma location: topleft
[07:24:51]      + mastering display metadata: r(0.6800,0.3200) g(0.2650,0.6900) b(0.1500 0.0600) wp(0.3127, 0.3290) min_luminance=0.000100, max_luminance=1000.000000
[07:24:51]      + content light level: max_cll=1052, max_fall=400
[07:24:51]      + dolby vision configuration record: version: 1.0, profile: 10, level: 6, rpu flag: 1, el flag: 0, bl flag: 1, compatibility id: 1
[07:24:51]      + hdr10+ dynamic metadata
[07:24:51]  * subtitle track 1, Deutsch (PGS) (track 1, id 0x3, Picture) -> Passthrough, Default
[07:24:51]  * audio track 1
[07:24:51]    + name: Surround 5.1
[07:24:51]    + decoder: Deutsch (AC3, 5.1 ch, Dolby Digital EX, 640 kbps) (track 1, id 0x1)
[07:24:51]      + bitrate: 640 kbps, samplerate: 48000 Hz
[07:24:51]    + AC3 Passthru
[07:24:51] sync: expecting 243721 video frames
Svt[info]: -------------------------------------------
Svt[info]: SVT [version]:	SVT-AV1 Encoder Lib v2.0.0
Svt[info]: SVT [build]  :	GCC 13.2.0	 64 bit
Svt[info]: -------------------------------------------
Svt[info]: Number of logical cores available: 24
Svt[info]: Number of PPCS 93
Svt[info]: [asm level on system : up to avx512]
Svt[info]: [asm level selected : up to avx512]
Svt[info]: -------------------------------------------
Svt[info]: SVT [config]: main profile	tier (auto)	level (auto)
Svt[info]: SVT [config]: width / height / fps numerator / fps denominator 		: 3840 / 1608 / 24000 / 1001
Svt[info]: SVT [config]: bit-depth / color format 					: 10 / YUV420
Svt[info]: SVT [config]: preset / tune / pred struct 					: 5 / VQ / random access
Svt[info]: SVT [config]: gop size / mini-gop size / key-frame type 			: 245 / 16 / key frame
Svt[info]: SVT [config]: BRC mode / rate factor 					: CRF / 20
Svt[info]: SVT [config]: film grain synth / denoising / level 				: 1 / 0 / 8
Svt[info]: -------------------------------------------
[07:24:52] sync: first pts video is 0
[07:24:52] sync: "Chapter 1" (1) at frame 1 time 0
[07:24:52] sync: first pts audio 0x1 is 0

 # Encode Stopped

[07:27:28] work: average encoding speed for job is 0.870255 fps
[07:27:28] vfr: 116 frames output, 0 dropped and 0 duped for CFR/PFR
[07:27:28] vfr: lost time: 0 (0 frames)
[07:27:28] vfr: gained time: 0 (0 frames) (0 not accounted for)

What Operating System are you running?

Windows 11

What version of HandBrake are you running?

Nightly

Where did you download HandBrake from?

snapshot

@Nomis101
Copy link
Contributor

Maybe this is because this movie also has HDR10+ in addition to the Dolby Vision information. All my movies without HDR10+ did not crash. Could you provide a small sample? Some seconds would be enough .

@Mister-XY
Copy link
Author

Mister-XY commented Apr 20, 2024

I think you're right, the movies that crash Handbrake have this in them
"Version HDR10+ Profile B, HDR10+ Profile B compatible".
Unfortunately I only have Staxrip to edit, but I can't edit DolbyVision films with StaxRip.

edit: i have found a sample from Kodi server where i can test HDR samples.
https://kodi.wiki/view/Samples
https://mega.nz/file/GaQ2AZRB#_CGi8bQ4-SVgLPLEtEGwWxO-b-W_sC6LL6z3dd4mDYs

@Nomis101
Copy link
Contributor

Thanks. With this "Hybrid HDR10+ with Dolby Vision Sample" I can reproduce a crash with AV1.

@galad87
Copy link
Contributor

galad87 commented Apr 20, 2024

It looks like a bug in SVT-AV1, it doesn't calculate a size correctly if there is more than one ITUT_T35 payload, in this case there is one of Dolby Vision and one for HDR10+. Let's see if I can fix it.

@galad87
Copy link
Contributor

galad87 commented Apr 20, 2024

Should be fixed in 09fae90. Please check if both HDR10+ and Dolby Vision are still read by your player if you can.

@Mister-XY
Copy link
Author

Mister-XY commented Apr 20, 2024

OK, after compile i can encode.
It change from

Dolby Vision, Version 1.0, Profile 7.6, dvhe.07.06, BL+EL+RPU, no metadata compression, Blu-ray compatible / 
SMPTE ST 2094 App 4, Version HDR10+ Profile B, HDR10+ Profile B compatible

to

Dolby Vision, Version 1.0, Profile 10.1, dav1.10.08, BL+RPU, no metadata compression, HDR10 compatible / 
SMPTE ST 2086, Version HDR10, HDR10 compatible / SMPTE ST 2086, Version HDR10, HDR10 compatible

@galad87
Copy link
Contributor

galad87 commented Apr 20, 2024

There was another unrelated issue fixed in 608b0bc, probably you should update before making another encode.

@galad87 galad87 closed this as completed Apr 20, 2024
@Mister-XY
Copy link
Author

Thanks, I compiled it again but nothing has changed or should nothing change?

@galad87
Copy link
Contributor

galad87 commented Apr 20, 2024

It was writing the Dolby Vision RPUs in the wrong format. But mediainfo doesn't show any info about that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants