View Full Version : Reencoding DV/HDR10+ UHD HDR BD (saving space) in 2025 using AVIsynth
Stereodude
15th June 2025, 16:47
Is my understanding here correct?
I can re-encode the Base Layer of a Dolby Vision or HDR10+ UHD BD using AVIsynth + x265 as I would do with a normal HDR10 UHD BD and then use DoVi_Scripts to copy the EL + RPU (for DV) from the source .mkv onto the re-encoded HDR10 only .mkv and end up with a smaller file that still has DV like the original source?
Kuler087
15th June 2025, 17:12
You can't mux the original P7 EL/RPU into a re-encoded BL, the output would be incorrect. You have to bake the EL into the BL and convert the RPU to P8. All of this is automated in DS Workflow 8-2-1.
For HDR10+, in DS you would need to manually extract(6-6) and inject(1) it into the re-encoded video..
Z2697
15th June 2025, 20:05
Technically you can. The output is technically incorrectly (or less accurate) but it doesn't matter, at least by my standards.
But how do you play dual layer DV.
Kuler087
15th June 2025, 20:15
Actually, it does matter and it will be inaccurate.
Plot your re-encoded P7 rip and the original remux, the RPU will be missing frames similar to this: https://slow.pics/c/AbM7fpJV
Z2697
15th June 2025, 20:17
That's when you do it incorrectly
Kuler087
15th June 2025, 20:24
The only way to encode BL+EL+P7 correctly is by using official Dolby tools: DEE (https://professional.dolby.com/product/media-processing-and-delivery/dee--dolby-encoding-engine/).
Stereodude
15th June 2025, 20:58
That's when you do it incorrectly
How would I do it correctly then (like you're doing it)?
Stereodude
15th June 2025, 21:05
You can't mux the original P7 EL/RPU into a re-encoded BL, the output would be incorrect. You have to bake the EL into the BL and convert the RPU to P8. All of this is automated in DS Workflow 8-2-1...
Can I use AVIsynth in Workflow 8-2-1 to add additional processing steps the video before it's encoded?
Stereodude
15th June 2025, 21:06
Technically you can. The output is technically incorrectly (or less accurate) but it doesn't matter, at least by my standards.
But how do you play dual layer DV.
With a Ugoos AM6B+ running the appropriate version of CoreELEC.
Kuler087
15th June 2025, 21:12
Can I use AVIsynth in Workflow 8-2-1 to add additional processing steps the video before it's encoded?
You can use DS 8-2-1 to create the AviSynth+ script. When the encoding starts, cancel it, go to the TEMP folder, open the script and add anything you wish to the script.
Then, encode the modified script via CLI with x265.exe or load it in a GUI like StaxRip.
Stereodude
15th June 2025, 21:25
You can use DS 8-2-1 to create the AviSynth+ script. When the encoding starts, cancel it, go to the TEMP folder, open the script and add anything you wish to the script.
Then, encode the modified script via CLI with x265.exe or load it in a GUI like StaxRip.
Thanks for clarifying. Is the output is Profile 8.4 so HDR10 compatible if the playback device can't do DV, or is it DV only?
Kuler087
15th June 2025, 21:55
Thanks for clarifying. Is the output is Profile 8.4 so HDR10 compatible if the playback device can't do DV, or is it DV only?
The output is DV 8.1 with HDR10 fallback.
Stereodude
15th June 2025, 22:27
The output is DV 8.1 with HDR10 fallback.
Okay, thanks for your help. :thanks:
I will give it a try.
Z2697
15th June 2025, 23:34
How would I do it correctly then (like you're doing it)?
You'll need to match the frame type... which is not easy to do.
Sorry if it sounds like I'm doing it or recommending it, I'm not.
Stereodude
16th June 2025, 00:48
You'll need to match the frame type... which is not easy to do.
Sorry if it sounds like I'm doing it or recommending it, I'm not.
Okay, thanks. I'm trying what Kuler087 suggested. Seems to be working. I was able to modify the .avs script to add what I wanted. I have some questions about the encoding options though.
The output is DV 8.1 with HDR10 fallback.
I noticed your tools/script do not set a --keyint in the x265 command line you're using. I normally use 120 (for 24/1.001 movie content) when encoding. Can I set this in my x265 command line for encoding, or does DV require something special that is otherwise handled or are you simply using the default of 250?
Kuler087
16th June 2025, 01:09
Yes, I think you can use whatever keyint you prefer.
Stereodude
16th June 2025, 01:51
Yes, I think you can use whatever keyint you prefer.
Great! My quick test shows that the modifications to the AVIsynth script are working as expected. Thanks for making such a useful set of tools / scripts! :thanks:
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.