Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Video Encoding > High Efficiency Video Coding (HEVC)

Reply
 
Thread Tools Search this Thread Display Modes
Old 24th July 2023, 17:09   #681  |  Link
puremind
Registered User
 
Join Date: Jul 2023
Posts: 5
Quote:
Originally Posted by -QfG- View Post
i have created 2 little Batch scripts, one Demuxer and one Injector. With this scripts you can simply:

- Change DoVi Profile 7,5 to Profile 8
- Adding Delays (useful for Hybrid Releases)
- Convert HDR10+ Metadata to DoVi Profile 8 Metadata
- Delete HDR10+ Metadata from Videostream

https://workupload.com/file/GWpvx2dzvcs

quietvoid many thanks for this awesome tools.
Hello

In order to accelerate conversions from MKV to MP4 I customized your script so that you can pass a folder instead of a file path to allow for batch conversion of files.
MP4all.rar

Changes include:
  • The script will now convert all files in the specified folder (C:\folder and C:\folder\ both work).
  • It will ask for the audio codec selection only for the first file and then apply those settings to all further files
  • It will summarize the output file name, FPS and audio codec while it is converting, not only the source characteristics
  • The converted files will go to the source folder instead of a custom folder for each conversion.
    This allows the user to replace all of their MKV's with the MP4's without having to pull for multiple subfolders.
    It will keep the MKV's until you have been able to check the files (user should delete the MKV's manually)
  • it will check if there is already an MP4 file with the output file name and skip the mkv conversion if there is
  • it will also convert any subfolder files, so be careful if you convert at root level, you may convert your entire mkv library at once

NOTE:
  • Only convert files that have the same characteristics using this script.
  • If you want to convert heterogeneous files, the loop would need to be tweaked so that each source file is analyzed (:CHECK is always performed) and only skipping the audio codec selection part.

I created this because I often have multiple files in one folder all waiting to be converted and it can be very tedious to do it one by one.

You should feel free to add this script to your rar release, either as a replacement of the DDVT_MKVTOMP4 script or as a separate command.

One thing that I wanted to ask you about. As you know, right now conversion fails if there is an image based subtitle track in the MKV. Should we just strip the subtitles when this is detected? It seems to me we could use something like this in the script so that no conversion would fail?
Code:
# remove all subtitles (copy none)
mkvmerge -o output.mkv --no-subtitles input.mkv
If you think it makes sense, I would appreciate if you could include in future versions of your scripts.
Attached Images
 

Last edited by puremind; 26th July 2023 at 08:13.
puremind is offline   Reply With Quote
Old 27th July 2023, 21:51   #682  |  Link
-QfG-
QfG Group Germany
 
-QfG-'s Avatar
 
Join Date: Oct 2018
Location: Germany
Posts: 275
-v0.60 Online
*Minor Bugfixes
*Updated mkvtoolnix to v 78.0.0.0.
-QfG- is offline   Reply With Quote
Old 30th July 2023, 16:20   #683  |  Link
Boss 14
Registered User
 
Join Date: May 2023
Posts: 2
-v0.60 Online

A new version, but DDVT INJECTOR is still v0.59beta - is that right?
Thank you.
Boss 14 is offline   Reply With Quote
Old 30th July 2023, 17:23   #684  |  Link
-QfG-
QfG Group Germany
 
-QfG-'s Avatar
 
Join Date: Oct 2018
Location: Germany
Posts: 275
Yes, changes only on the Hybrid script. Forget to change version in this script.
-QfG- is offline   Reply With Quote
Old 30th July 2023, 19:47   #685  |  Link
hidef_rec
Registered User
 
hidef_rec's Avatar
 
Join Date: Jul 2007
Posts: 38
With "Change DoVi Profile 7,5 to Profile 8"... I used Demuxer on a Profile 5 MKV & and now have a RPU. How do I use it to convert the MKV to a Profile 8? Or, is this not what the script was intended to do? Thanks.
hidef_rec is offline   Reply With Quote
Old 31st July 2023, 15:56   #686  |  Link
TomDoom
Registered User
 
Join Date: Jul 2023
Posts: 1
Hi -QfG-

thanks for those nice scripts

I mostly use the MKV2MP4 Convert to have DV play on my LG TV. However, the MP4 File has the wrong audio language tag. Every track will become tagged as ENGLISH, unfortunately.
That even happens If you don't change/convert the audio track.

MKV:

Quote:
Audio #1
ID : 2
[...]
Title : German
Language : German

After MP4 conversion:

Quote:
Audio #1
ID : 2
[...]
Title : German
Language : English
Maybe you can fix that (or anyone else knows what's going wrong here and tell me what tou change)? That's happening since loooong time and I think you heard of it already.

Thanks!
Tom
TomDoom is offline   Reply With Quote
Old 3rd August 2023, 04:15   #687  |  Link
chipsteps
Registered User
 
Join Date: Mar 2020
Posts: 13
I have a problem like this, I convert from P7 to P8 with the original video file, but after importing in the encodec file it says "CHECK RPU..."

And after "CHECK RPU..." it got like this, I don't know where did I go wrong? help me!
chipsteps is offline   Reply With Quote
Old 3rd August 2023, 15:19   #688  |  Link
sagor
Registered User
 
Join Date: Nov 2020
Posts: 1
Excellent tools.Thanx for your hard work.
Anyone know here how to fix forwarding/rewarding issue on dolby vision video file.
When i merge audio or subtitle using with mkvmerge video won't forward or reward, it pause the video on Nova Video Player streaming via Jellyfin.
Also why the after crop factor issue video file size doesn't match with the original file?
sagor is offline   Reply With Quote
Old 5th August 2023, 16:07   #689  |  Link
Boss 14
Registered User
 
Join Date: May 2023
Posts: 2
Quote:
Originally Posted by chipsteps View Post
I have a problem like this, I convert from P7 to P8 with the original video file, but after importing in the encodec file it says "CHECK RPU..."

And after "CHECK RPU..." it got like this, I don't know where did I go wrong? help me!
I also have this problem and do not know what to do?
Boss 14 is offline   Reply With Quote
Old 8th August 2023, 09:57   #690  |  Link
von Suppé
Registered User
 
von Suppé's Avatar
 
Join Date: Dec 2013
Posts: 646
Why don't you set check by typing C and then start checking cropping values by typing S ? See what happens.
Maybe RPU from 4K is used for HD? You can also manually check border values by opening a screenshot in an image editor.

Last edited by von Suppé; 8th August 2023 at 10:01.
von Suppé is offline   Reply With Quote
Old 29th August 2023, 02:57   #691  |  Link
chipsteps
Registered User
 
Join Date: Mar 2020
Posts: 13
Quote:
Originally Posted by von Suppé View Post
Why don't you set check by typing C and then start checking cropping values by typing S ? See what happens.
Maybe RPU from 4K is used for HD? You can also manually check border values by opening a screenshot in an image editor.
-Now I want to load the RPU from the 4K version into the 2K Encodec with 2 contours cut, how will the order process work? Can you help me?
-With Encodec version from 4K 3840x2160 to 2K 1920x1012. Right now I have no way to match the RPU with the Video file, maybe because I don't understand the working process of the App
-Thank you very much!
chipsteps is offline   Reply With Quote
Old 31st August 2023, 11:26   #692  |  Link
von Suppé
Registered User
 
von Suppé's Avatar
 
Join Date: Dec 2013
Posts: 646
I have no experience with crossinjecting P7 RPU into 2K encodes. I do wonder why one would do such. Perhaps it's because of your playback device/software capabilities. In case of a resize & HDR encode, I imagine P7 RPU can be used - probably with some adaptation.
If you need to convert to 2K SDR, a tonemap from HDR to SDR has to be applied prior to resizing & encoding. I guess then P7 metadata has no use whatsoever. But I can be dead wrong here and totally missing something.

In your 3rd screenshot at MOVIE INPUT, I don't know why the tool returns with "Failed px". Don't know what it would mean; maybe it can't determine the borders properly. I ALWAYS do this manually. By taking a screenshot whilst playing the file and have a look in an image editor.
Your target resolution being 1920x1012 I assume that you already determined the black bars and that they are cropped out in the encode. Then you have to "crop" RPU, which resets the L5 values to zero. L5 values represent the number of source-pixels of the widths/heights of surrounding black borders (which in your case are all zero, if my assumption is correct).

It may help when you'd explain why you want to do this.
von Suppé is offline   Reply With Quote
Old 1st September 2023, 09:48   #693  |  Link
chipsteps
Registered User
 
Join Date: Mar 2020
Posts: 13
Quote:
Originally Posted by von Suppé View Post
I have no experience with crossinjecting P7 RPU into 2K encodes. I do wonder why one would do such. Perhaps it's because of your playback device/software capabilities. In case of a resize & HDR encode, I imagine P7 RPU can be used - probably with some adaptation.
If you need to convert to 2K SDR, a tonemap from HDR to SDR has to be applied prior to resizing & encoding. I guess then P7 metadata has no use whatsoever. But I can be dead wrong here and totally missing something.

In your 3rd screenshot at MOVIE INPUT, I don't know why the tool returns with "Failed px". Don't know what it would mean; maybe it can't determine the borders properly. I ALWAYS do this manually. By taking a screenshot whilst playing the file and have a look in an image editor.
Your target resolution being 1920x1012 I assume that you already determined the black bars and that they are cropped out in the encode. Then you have to "crop" RPU, which resets the L5 values to zero. L5 values represent the number of source-pixels of the widths/heights of surrounding black borders (which in your case are all zero, if my assumption is correct).

It may help when you'd explain why you want to do this.
-Thank you for answering my question! Somehow, for movies without black lines, I just need to extract the RPU from 4K and load it into the 2K Encodec version!
-But for movies with 2 black bands on the top and bottom, cutting the RPU in DEMUXER or INJECTOR does not match. The movie has removed the border
chipsteps is offline   Reply With Quote
Old 1st September 2023, 15:01   #694  |  Link
Boulder
Pig on the wing
 
Boulder's Avatar
 
Join Date: Mar 2002
Location: Finland
Posts: 5,817
Quote:
Originally Posted by von Suppé View Post
I have no experience with crossinjecting P7 RPU into 2K encodes. I do wonder why one would do such. Perhaps it's because of your playback device/software capabilities. In case of a resize & HDR encode, I imagine P7 RPU can be used - probably with some adaptation.
Since it's all just metadata, wouldn't it be okay to just crop the borders and downscale and then inject the RPU which is also marked as cropped? Of course, the metadata is not 100% correct due to the changes the downscales causes in the video, but the same applies to regular HDR10 as well.
__________________
And if the band you're in starts playing different tunes
I'll see you on the dark side of the Moon...
Boulder is offline   Reply With Quote
Old 2nd September 2023, 10:27   #695  |  Link
von Suppé
Registered User
 
von Suppé's Avatar
 
Join Date: Dec 2013
Posts: 646
Quote:
Originally Posted by Boulder View Post
Since it's all just metadata, wouldn't it be okay to just crop the borders and downscale and then inject the RPU which is also marked as cropped? Of course, the metadata is not 100% correct due to the changes the downscales causes in the video, but the same applies to regular HDR10 as well.
My idea also.

What's tickling me is why the downscale. I know DV can be 2K and can have HDR10/HLG/SDR fallback.
I am wondering if there'd be DV compatible players/displays that would be limited to 2K. Or maybe OP just wants to save harddrive space?
von Suppé is offline   Reply With Quote
Old 2nd September 2023, 10:43   #696  |  Link
Boulder
Pig on the wing
 
Boulder's Avatar
 
Join Date: Mar 2002
Location: Finland
Posts: 5,817
Quote:
Originally Posted by von Suppé View Post
My idea also.

What's tickling me is why the downscale. I know DV can be 2K and can have HDR10/HLG/SDR fallback.
I am wondering if there'd be DV compatible players/displays that would be limited to 2K. Or maybe OP just wants to save harddrive space?
I think the idea is just to save space, I do the same all the time with both HD and UHD sources.
__________________
And if the band you're in starts playing different tunes
I'll see you on the dark side of the Moon...
Boulder is offline   Reply With Quote
Old 3rd September 2023, 03:43   #697  |  Link
puremind
Registered User
 
Join Date: Jul 2023
Posts: 5
Quote:
Originally Posted by puremind View Post
Hello

In order to accelerate conversions from MKV to MP4 I customized your script so that you can pass a folder instead of a file path to allow for batch conversion of files.
Attachment 18452

Changes include:
  • The script will now convert all files in the specified folder (C:\folder and C:\folder\ both work).
  • It will ask for the audio codec selection only for the first file and then apply those settings to all further files
  • It will summarize the output file name, FPS and audio codec while it is converting, not only the source characteristics
  • The converted files will go to the source folder instead of a custom folder for each conversion.
    This allows the user to replace all of their MKV's with the MP4's without having to pull for multiple subfolders.
    It will keep the MKV's until you have been able to check the files (user should delete the MKV's manually)
  • it will check if there is already an MP4 file with the output file name and skip the mkv conversion if there is
  • it will also convert any subfolder files, so be careful if you convert at root level, you may convert your entire mkv library at once

NOTE:
  • Only convert files that have the same characteristics using this script.
  • If you want to convert heterogeneous files, the loop would need to be tweaked so that each source file is analyzed (:CHECK is always performed) and only skipping the audio codec selection part.

I created this because I often have multiple files in one folder all waiting to be converted and it can be very tedious to do it one by one.

You should feel free to add this script to your rar release, either as a replacement of the DDVT_MKVTOMP4 script or as a separate command.

One thing that I wanted to ask you about. As you know, right now conversion fails if there is an image based subtitle track in the MKV. Should we just strip the subtitles when this is detected? It seems to me we could use something like this in the script so that no conversion would fail?
Code:
# remove all subtitles (copy none)
mkvmerge -o output.mkv --no-subtitles input.mkv
If you think it makes sense, I would appreciate if you could include in future versions of your scripts.
@-QfG-

I found we can use mkvextract:
mkvextract file.mkv tracks [tracknumber] file.srt

I think your script already saves key information using media info, so all you would have to do is store information about on which track each language is found, then ask the user which subtitles they want to extract and do the extraction command on the tracks that the user selected and put them in the same folder as the source folder.

This would allow srt subtitles to be preserved on all episodes of a same video within MP4all.cmd.

Is there a way to extrac them in a different format and then add them to an MP4 container?
puremind is offline   Reply With Quote
Old 6th September 2023, 20:15   #698  |  Link
benwaggoner
Moderator
 
Join Date: Jan 2006
Location: Portland, OR
Posts: 4,997
Quote:
Originally Posted by Boulder View Post
Since it's all just metadata, wouldn't it be okay to just crop the borders and downscale and then inject the RPU which is also marked as cropped? Of course, the metadata is not 100% correct due to the changes the downscales causes in the video, but the same applies to regular HDR10 as well.
Yeah, that should work in general. All HDR metadata explicitly ignores the letterboxing, so cropping it out shouldn't change anything.

Downscaling doesn't have a huge impact, but the low-pass filter nature of downscaling can reduce a frame's peak brightness quite a bit if it is coming from single points, like stars.

Worst case would be white single pixels on a black background. If they were 1000 nits at 4K, they'd only be 250 nits at 2K, as each white pixel would be averaged out with three black pixels.
__________________
Ben Waggoner
Principal Video Specialist, Amazon Prime Video

My Compression Book
benwaggoner is offline   Reply With Quote
Old 8th September 2023, 11:32   #699  |  Link
Atlantis
Registered User
 
Join Date: Feb 2002
Posts: 776
Is there an up-to-date step by step guide on how to re-encode a Dolby Vision file?

Update: well that was easier than I thought. Didn't even need to learn anything! All I did was extract RPU, encode normally like an HDR file and inject RPU and it worked! Maybe it helped that the original was a hybrid!

Question, I tried both cropped RPU and no crop RPU and made 2 files, both look the same to my eyes. Is cropping RPU really make a huge difference?

Last edited by Atlantis; 8th September 2023 at 21:12.
Atlantis is offline   Reply With Quote
Old 9th September 2023, 07:52   #700  |  Link
GodzilaAvenger
Registered User
 
GodzilaAvenger's Avatar
 
Join Date: Jul 2022
Posts: 152
This may help.
GodzilaAvenger is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 14:47.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.