gacopl / dvmkv2mp4

Convert any Dolby Vision/HDR10+ MKV to DV MP4 that runs on many devices
198 stars 36 forks source link

dvmkv2mp4 Segmentation fault and no resultant MP4 #40

Closed ChrisLynchHPE closed 1 year ago

ChrisLynchHPE commented 1 year ago

I'm trying to use this utility to convert HDR-10 MKV video to MP4. Everything appears to run fine until the final MP4 video is created. Here is the full output from the console run:

root@server:/mnt/g/Temp# dvmkv2mp4 -l eng
dvmkv2mp4 0.3.0-dev - easily convert Dolby Vision or HDR10+ mkvs to Dolby Vision MP4
Created by github.com/gacopl, Released under GPLv3

Starting Conversions Tue Aug 29 09:09:49 PDT 2023
Converting HDR10+ to DV8: "HDR-10.2160p.Video.mkv"
ionice -c 3 ffmpeg -i "HDR-10.2160p.Video.mkv" -y -loglevel error -stats -map 0:v:0 -c:v copy -vbsf hevc_mp4toannexb -f hevc BL.hevc -map 0:v:0 -c:v copy -vbsf hevc_mp4toannexb -f hevc - -map 0:1 -c:a:0 copy 1.eng.eac3 -map 0:2 -c:s:0 copy "HDR-10.2160p.Video DV-MP4.eng2.srt" -map 0:3 -c:s:0 copy "HDR-10.2160p.Video DV-MP4.eng3.srt" -map 0:4 -c:s:0 copy "HDR-10.2160p.Video DV-MP4.eng4.srt" | ionice -c 3 hdr10plus_tool extract -o hdr10plus_metadata.json -
frame=83484 fps=316 q=-1.0 Lq=-1.0 size=10377156kB time=00:58:01.95 bitrate=24414.4kbits/s speed=13.2x
Reading parsed dynamic metadata... Done.
Reordering metadata... Done.
Generating and writing metadata to JSON file... Done.
cp: cannot stat 'HDR-10.2160p.Video.*.srt': No such file or directory
Metadata seems ok proceeding
Parsing HDR10+ JSON file...
Generating metadata...
Generated metadata for 83484 frames
Done.
Parsing RPU file...
Processing input video for frame order info...
Computing frame indices..
Rewriting file with interleaved RPU NALs..
ionice -c 3 MP4Box -add BL_RPU.hevc:dv-profile=8 -add "1.eng.eac3":sopt:gfreg=ffdmx -lang 2=eng -name 2="" -delay 2=0 -tmp ./tmp -brand mp42isom -ab dby1 "HDR-10.2160p.Video DV-MP4.mp4"
[H263Dmx] garbage before first frame!
Track Importing H263 - Width 1409 Height 1152 FPS 15000/1000 SAR 0/0
/usr/local/bin/dvmkv2mp4: line 379: 27924 Segmentation fault      (core dumped) ionice -c 3 MP4Box -add BL_RPU.hevc:dv-profile=8 -add "1.eng.eac3":sopt:gfreg=ffdmx -lang 2=eng -name 2="" -delay 2=0 -tmp ./tmp -brand mp42isom -ab dby1 "HDR-10.2160p.Video DV-MP4.mp4"
Conversions runtime: 0:11:49 (hh:mm:ss)

It looks like this is what's causing the MP4 to not be created:

/usr/local/bin/dvmkv2mp4: line 379: 27924 Segmentation fault      (core dumped) ionice -c 3 MP4Box -add BL_RPU.hevc:dv-profile=8 -add "1.eng.eac3":sopt:gfreg=ffdmx -lang 2=eng -name 2="" -delay 2=0 -tmp ./tmp -brand mp42isom -ab dby1 "HDR-10.2160p.Video DV-MP4.mp4"

I'm doing this in WSL Ubuntu 20.04 image.

root@server:/mnt/g/Temp# uname -ra
Linux server 4.4.0-20348-Microsoft #1311-Microsoft Tue Nov 15 10:11:00 PST 2022 x86_64 x86_64 x86_64 GNU/Linux
root@server:/mnt/g/Temp# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.6 LTS
Release:        20.04
Codename:       focal
root@server:/mnt/g/Temp# dvmkv2mp4 -v
dvmkv2mp4 0.3.0-dev - easily convert Dolby Vision or HDR10+ mkvs to Dolby Vision MP4
Created by github.com/gacopl, Released under GPLv3
ChrisLynchHPE commented 1 year ago

Hmmm.... I have a sample cut of the source MKV, and it converted without issue. Not sure why, so maybe something during the conversion? Not sure if the line above the segmentation fault error has anything to do with the problem.

gacopl commented 1 year ago

Segmentation fault may be cause by lack of memory make sure WSL hav sufficient limits set also it was not tested in WSL so i cannot help