gacopl / dvmkv2mp4

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

Frame rate change, dvhe removal #14

Open cwills75 opened 2 years ago

cwills75 commented 2 years ago

Hi, I tried running this on Ubuntu 20.04, and it converted the .mkv -> .mp4, but looking at both of them with Mediainfo, it removed the dvhe 8.07 information and changed the frame rate from 23.976 to 25, along with the duration.

mediainfo

gacopl commented 2 years ago

Did you follow instructions precisely and are you sure you are using correct version of mp4box ?

If so please paste run log but i am sure it is either wrong version of mp4box or borked source material

pon., 8 sie 2022, 17:48 użytkownik cwills75 @.***> napisał:

Hi, I tried running this on Ubuntu 20.04, and it converted the .mkv -> .mp4, but looking at both of them with Mediainfo, it removed the dvhe 8.07 information and changed the frame rate from 23.976 to 25, along with the duration.

[image: mediainfo] https://user-images.githubusercontent.com/35116072/183458965-669c6853-377e-4286-90e5-3d900240e541.png

— Reply to this email directly, view it on GitHub https://github.com/gacopl/dvmkv2mp4/issues/14, or unsubscribe https://github.com/notifications/unsubscribe-auth/AARMKIBNYLBZ2OYGC4DIW4DVYET5TANCNFSM555TU6YA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

cwills75 commented 2 years ago

It's a new install I just did to test this out. I think I followed everything correctly. Where would a log file be? I re-ran it in a new folder and here is the output, along with MP4Box -version info:

log

gacopl commented 2 years ago

Log looks ok, can you show ffmpeg version ? The dvhe version removal is ok it is a trick to make it work on some tvs, the frame rate change to me it looks like the video stream is 25fps and the mkv had wrong metadata

pon., 8 sie 2022 o 23:25 cwills75 @.***> napisał(a):

It's a new install I just did to test this out. I think I followed everything correctly. Where would a log file be? I re-ran it in a new folder and here is the output, along with MP4Box -version info:

[image: log] https://user-images.githubusercontent.com/35116072/183517423-8e9ba213-41fb-4004-8d6a-e6247cd59faf.png

— Reply to this email directly, view it on GitHub https://github.com/gacopl/dvmkv2mp4/issues/14#issuecomment-1208628106, or unsubscribe https://github.com/notifications/unsubscribe-auth/AARMKIHGAT6G4RF5H7W53Y3VYF3NDANCNFSM555TU6YA . You are receiving this because you commented.Message ID: @.***>

cwills75 commented 2 years ago

Sure, it's 4.4.2.0. Let me know if I should try anything else. Here's my normal process I use for a profile 7/8 file. I ran this yesterday, and it converted fine with 23.976 frame rate. I do a Handbrake step to compress the video down, but leave audio/subs as-is, keeping the tracks I want.

  1. Use ffmpeg and dovi tool to extract the RPU and convert it to Dolby Vision Profile 8.1.

ffmpeg -i input.mkv -c:v copy -vbsf hevc_mp4toannexb -f hevc - | dovi_tool -m 2 extract-rpu - -o RPU.bin

  1. Encode original DV file in Handbrake, rename output file to cooked.mkv.

  2. Use gMKVExtractGUI to extract the hevc video track (rename to cooked.hevc), audio tracks, subtitles and chapters from encoded.mkv.

  3. Use dovi tool to inject the RPU from step 2 into the encoded .hevc file

dovi_tool inject-rpu -i cooked.hevc --rpu-in RPU.bin -o injected.hevc

  1. Use MKVToolnix multiplexer to mux the new MKV with the injected.hevc, audio, sub and chapter files.

ffmpeg

Mediainfo comparison on OG file and one with above process:

compare_1

gacopl commented 2 years ago

I guess the handbrake does something to stream making it recognizable as 25 fps. In my workflow i dont set anywhere fps setting what comes in gets muxed except audio processing when needed we dont touch stream just mux it with mp4box.

  1. if possible share with me the video pre and after compression
  2. you can try to manually set fps switch on mp4box in the script by adding :fps=23.976 to the .hevc stream add

wt., 9 sie 2022 o 15:05 cwills75 @.***> napisał(a):

Sure, it's 4.4.2.0. Let me know if I should try anything else. Here's my normal process I use for a profile 7/8 file. I ran this yesterday, and it converted fine with 23.976 frame rate. I do a Handbrake step to compress the video down, but leave audio/subs as-is, keeping the tracks I want.

  1. Use ffmpeg and dovi tool to extract the RPU and convert it to Dolby Vision Profile 8.1.

ffmpeg -i input.mkv -c:v copy -vbsf hevc_mp4toannexb -f hevc - | dovi_tool -m 2 extract-rpu - -o RPU.bin

1.

Encode original DV file in Handbrake, rename output file to cooked.mkv. 2.

Use gMKVExtractGUI to extract the hevc video track (rename to cooked.hevc), audio tracks, subtitles and chapters from encoded.mkv. 3.

Use dovi tool to inject the RPU from step 2 into the encoded .hevc file

dovi_tool inject-rpu -i cooked.hevc --rpu-in RPU.bin -o injected.hevc

  1. Use MKVToolnix multiplexer to mux the new MKV with the injected.hevc, audio, sub and chapter files.

[image: ffmpeg] https://user-images.githubusercontent.com/35116072/183653814-1a12669c-5f86-4985-8d63-701dd5a35b3c.png

Mediainfo comparison on OG file and one with above process:

[image: compare_1] https://user-images.githubusercontent.com/35116072/183653950-d9fc00d0-4a6d-4c6c-9f4d-c9e4eab720c8.png

— Reply to this email directly, view it on GitHub https://github.com/gacopl/dvmkv2mp4/issues/14#issuecomment-1209357364, or unsubscribe https://github.com/notifications/unsubscribe-auth/AARMKICBAFK5N2JJNEJDM33VYJJSTANCNFSM555TU6YA . You are receiving this because you commented.Message ID: @.***>

cwills75 commented 2 years ago

I sent you an email with a link to the zipped files. pw: gacopl

Let me know if you didn't get it.

SibrenVasse commented 1 year ago

Had the same issue with a file. Specifying the FPS when muxing fixed the issue. See 7df1e98ca824b9d70f8b46e686006f704affa4ef.

gacopl commented 1 year ago

Great that's exactly what i meant i suggest you make a switch for it as if i know life properly as many releases this might help there is same or equal number of releases that will be borked by this fps switch. And testing this is cumbersome.

Happy to accept PR :)

JustasBud commented 2 months ago

Had the same issue with a file. Specifying the FPS when muxing fixed the issue. See 7df1e98.

Thanks @SibrenVasse - had the same issue of it incorrectly guessing fps to 25. The issue was fixed by using your solution