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)
Register FAQ Calendar Today's Posts Search

Reply
 
Thread Tools Search this Thread Display Modes
Old 6th August 2022, 08:49   #241  |  Link
GodzilaAvenger
Registered User
 
GodzilaAvenger's Avatar
 
Join Date: Jul 2022
Posts: 123
Quote:
Originally Posted by von Suppé View Post
Adding FEL to recoded BL won't work. EL frame-types and order must exactly match those of BL. Recoding BL will destroy that.
Thanks, I'm still learning about DV so could you please explain why the EL frame type and order must match the BL? My understanding is that when playing back a dual-layer track (BL+EL+RPU) separate HEVC decoders are launched for BL and EL, so if a re-encoded BL decodes to something nearly identical to what the original BL would decode to, shouldn't the new BL work with the EL? Is there any other way to re-encode the original file and keep the EL?

I saw this post over at the MakeMKV forum and got curious about whether DDVT can be used to achieve the same result, or if a more involved process is needed.

Last edited by GodzilaAvenger; 6th August 2022 at 10:09.
GodzilaAvenger is offline   Reply With Quote
Old 6th August 2022, 10:27   #242  |  Link
von Suppé
Registered User
 
von Suppé's Avatar
 
Join Date: Dec 2013
Posts: 631
Yeah, learning about DV seems endless. I can't tell you why the frametypes must match. Other than that, I also remember MakeMKV popping up a huge amount of sync errors. I don't know if the two issues are related or should be assessed separately.
Reading your link
Quote:
You have to edit the FEL (has the nal unit) in the Rpu to reflect the hevc bl encode and that’s it.
sounds promisng, but I wouldn't know what's meant here. Maybe quietvoid cares to comment.
von Suppé is offline   Reply With Quote
Old 6th August 2022, 23:08   #243  |  Link
AgentXXL
Registered User
 
Join Date: Jul 2022
Posts: 14
Quote:
Originally Posted by von Suppé View Post
Other than having the same framecount, have you checked in all cases that they also have the same framerate? I don't know what exactly you're crossmuxing but audio and video from different framerate sources will go out of sync. Possibly subs too.

About MKVToolNix GUI. Should you run Windows 8.1 or lower, don't use latest version https://forum.doom9.org/showthread.php?t=184092
So far using the 'Mux stream in mkv' option of injector has worked for every title I've tried. If the content has a Blu-ray release with DTS-HD or TrueHD, I try muxing their audio (and subtitles).

I've been successful doing that when the hybrid DV-HDR and the Blu-ray have the same runtime. If they are different runtimes, I use the delay options in MKVToolnix and have been successful so far.

I mainly use MKVToolnix from Linux, but also have it on my Win11 Pro system, the only Windows box I use. I primarily use Windows for gaming and HTPC, but occasionally for video editing when the tools/scripts are only made for it (like these scripts). It would be preferable to use scripts on Linux but converting these so they would work is beyond my skill level at the moment.

I note that injector uses MKVToolnix (mkvmerge) when asked to 'mux stream in mkv'. I'd like to learn more of the advanced functions available so I could do it manually on Linux if needed. I'll have to take a look through the injector script and see if I can decipher the mkvmerge options that it uses.

Regardless, thanks for the feedback.
AgentXXL is offline   Reply With Quote
Old 6th August 2022, 23:57   #244  |  Link
GodzilaAvenger
Registered User
 
GodzilaAvenger's Avatar
 
Join Date: Jul 2022
Posts: 123
Quote:
Originally Posted by von Suppé View Post
Yeah, learning about DV seems endless. I can't tell you why the frametypes must match. Other than that, I also remember MakeMKV popping up a huge amount of sync errors. I don't know if the two issues are related or should be assessed separately.
Reading your link

sounds promisng, but I wouldn't know what's meant here. Maybe quietvoid cares to comment.
I went ahead and tried it out on one of my disks using DDVT, demuxing the FEL and injecting it into a re-encoded BL. My player apparently doesn't playback DV from a file (falls back on HDR10 which seems ok) so if anyone has a proper setup please use the sample below and let me know if this frankenstein's monster works, or if you see weird image artifacts or flashing.

Sample
GodzilaAvenger is offline   Reply With Quote
Old 7th August 2022, 03:39   #245  |  Link
NeverExists
Registered User
 
Join Date: Jul 2022
Posts: 19
Quote:
Originally Posted by von Suppé View Post
Maybe it's easier to just load the two videos in another player.
For identifying same frames and determining difference in framecount, I often use two simultaneous instances of Virtualdub. Works like a charm.
Also, I just realized that a lot of the movies I want to do a hybrid of have the Bluray video start a few seconds before the Web video file. I don't know how to go about merging them for a hybrid. Do I first trim the Bluray video so they match? If so how would I do that?
NeverExists is offline   Reply With Quote
Old 7th August 2022, 05:34   #246  |  Link
GodzilaAvenger
Registered User
 
GodzilaAvenger's Avatar
 
Join Date: Jul 2022
Posts: 123
Quote:
Originally Posted by NeverExists View Post
Also, I just realized that a lot of the movies I want to do a hybrid of have the Bluray video start a few seconds before the Web video file. I don't know how to go about merging them for a hybrid. Do I first trim the Bluray video so they match? If so how would I do that?
Do you want to get the RPU from a WEB-DL source and inject it into a BluRay? If that's what you want to do I'd recommend using djv, which can show a video frame-by-frame. What I do is open one file in djv, find a scene transition and note the frame number, then open the other file and find the corresponding frame number. This gives me the delay, which I then use in the DDVT injector tool.
GodzilaAvenger is offline   Reply With Quote
Old 7th August 2022, 10:35   #247  |  Link
von Suppé
Registered User
 
von Suppé's Avatar
 
Join Date: Dec 2013
Posts: 631
@AgentXXL

Did you read & try this?
Quote:
Originally Posted by von Suppé View Post
@AgentXXL, @fkid

Don't know anymore where I've read it, but when muxing DV elementary streams with MKVToolNix GUI, I've learned to always set "Default duration/FPS" with proper value. Hope this is of any help.
von Suppé is offline   Reply With Quote
Old 7th August 2022, 11:57   #248  |  Link
von Suppé
Registered User
 
von Suppé's Avatar
 
Join Date: Dec 2013
Posts: 631
Quote:
Originally Posted by GodzilaAvenger View Post
I went ahead and tried it out on one of my disks using DDVT, demuxing the FEL and injecting it into a re-encoded BL. My player apparently doesn't playback DV from a file (falls back on HDR10 which seems ok) so if anyone has a proper setup please use the sample below and let me know if this frankenstein's monster works, or if you see weird image artifacts or flashing.

Sample
Not sure what you mean with "inject a FEL into recoded BL". I'd guess you mean interleaving BL and FEL+RPU into one videostream with dovitool's mux option (something like "dovi_tool mux --bl BL.hevc --el FEL.hevc")?
It's basically what MakeMKV does too. Please inform me if you did something else.

As for your sample, it does not trigger DV on my player either. HDR10 is all I got. No flickering though, playback is okay.
But I'm somewhat confused about the mkv. Is combining a recoded BL with native FEL+RPU all you did?
Reason I ask is I found something odd. First thing obviously is BL being cropped where native FEL is not. I doubt that cropped BL with uncropped FEL (and RPU, for that matter) would be possible for proper DV playback in the first place. Recoding BL doesn't mean you have to crop it.

Also, I demuxed your mkv into the elementary videostream, which still contains BL, FEL and RPU. With dovitool I extracted RPU.
Using dovitool, I then demuxed the demuxed elementary stream into BL and FEL. Extracted RPU from FEL. Did a hasnumbercheck on both RPU's. They don't match, where they usually do. I'm curious if/what you did with the RPU?

Last edited by von Suppé; 7th August 2022 at 12:16.
von Suppé is offline   Reply With Quote
Old 7th August 2022, 19:08   #249  |  Link
GodzilaAvenger
Registered User
 
GodzilaAvenger's Avatar
 
Join Date: Jul 2022
Posts: 123
Quote:
Originally Posted by von Suppé View Post
Not sure what you mean with "inject a FEL into recoded BL". I'd guess you mean interleaving BL and FEL+RPU into one videostream with dovitool's mux option (something like "dovi_tool mux --bl BL.hevc --el FEL.hevc")?
It's basically what MakeMKV does too. Please inform me if you did something else.

As for your sample, it does not trigger DV on my player either. HDR10 is all I got. No flickering though, playback is okay.
But I'm somewhat confused about the mkv. Is combining a recoded BL with native FEL+RPU all you did?
Reason I ask is I found something odd. First thing obviously is BL being cropped where native FEL is not. I doubt that cropped BL with uncropped FEL (and RPU, for that matter) would be possible for proper DV playback in the first place. Recoding BL doesn't mean you have to crop it.

Also, I demuxed your mkv into the elementary videostream, which still contains BL, FEL and RPU. With dovitool I extracted RPU.
Using dovitool, I then demuxed the demuxed elementary stream into BL and FEL. Extracted RPU from FEL. Did a hasnumbercheck on both RPU's. They don't match, where they usually do. I'm curious if/what you did with the RPU?
That's quite interesting, thanks for the feedback.

Here's what I did: I used DDVT_DEMUXER with the remux mkv, and used it to only extract the EL (option 2), but not the BL or the RPU, and I got a EL.hevc file. I then used DDVT_INJECTOR to add that EL.hevc to the re-encoded mkv, which I think is the same as what you said (interleaving BL and EL+RPU and then muxing into an mkv, for muxing the options where Standard and MakeMKV, I wasn't sure what the difference was so I went with Standard). I didn't do anything directly to the RPU, DDVT may have changed some things in the process because of the cropped BL.

I wonder if the cropped BL is the reason DV is not triggered on your player. Following @-QfG-'s directions in the next post, I took the following steps using one of my uncropped re-encodes:

1. Used DDVT_DEMUXER to extract EL.hevc (1920x1080) from the remux mkv, then put it next to BL.hevc (3840x2160).
2. Gave DDVT_INJECTOR the BL.hevc file as input, which then recognized the EL.
3. Started the injecting (interleaving of EL and RPU NALUs) process, which resulted in a BL_[BL+EL+RPU].hevc file. Finally, used MKVToolNix to create a mkv.

The file below contains a sample of both the source (remux) and re-encode files. Please let me know if either triggers DV on your player, thanks!

Source&Encode

Last edited by GodzilaAvenger; 8th August 2022 at 03:11.
GodzilaAvenger is offline   Reply With Quote
Old 7th August 2022, 19:08   #250  |  Link
-QfG-
QfG Group Germany
 
-QfG-'s Avatar
 
Join Date: Oct 2018
Location: Germany
Posts: 245
Steps for Building a Profile 7 Single Layer MKV:

1. Extract with Extractor the Enhanced Layer. Copy the hevc file nearly the Base Layer File (Base Layer WITHOUT DoVi RPU or EL Stream!) and save this File as EL.hevc.
2. Open Base Layer file/Container with the Injector. If the Injector found the EL.hevc file you have a new option to mux the MEL/FEL Layer into your Base Layer Stream.

Differences between Standard and makeMKV:

--eos-before-el Write the EOS/EOB NALUs before the EL. Defaults to false.
This flag enables the same behaviour as MakeMKV and yusesope's mux script.
Enabling this therefore results in identical output using dovi_tool.

Last edited by -QfG-; 7th August 2022 at 19:15.
-QfG- is offline   Reply With Quote
Old 7th August 2022, 20:52   #251  |  Link
AgentXXL
Registered User
 
Join Date: Jul 2022
Posts: 14
Quote:
Originally Posted by von Suppé View Post
@AgentXXL

Did you read & try this?
No, so far almost all titles I've tried have worked using the 'mux stream to mkv' option of Injector. I have encountered one title where the RPU.bin was extracted but Injector wouldn't recognize it. It also reported that there was a max luminance value over 10000 - when that happens I've read to try using the 'change L6 metadata to match q=with video' in Injector.

Alas that doesn't work as Injector doesn't recognize the RPU.bin file:

== RPU INPUT ===========================================================================================================

Filename = [RPU.bin]
RPU Info = [DV Profile = n.a.] [CM Version = n.a.] [Frames = n.a.]

I'll give the manual method a try using the Default duration/FPS setting at some point. Right now I'm working on a backlog of titles where I currently have both a HDR and DV copy of each title in my media folders. Trying to convert as many as possible so I can free up some storage space.

Thanks for the assistance - I'll let you know if I'm successful when I try the manual method again.
AgentXXL is offline   Reply With Quote
Old 8th August 2022, 00:12   #252  |  Link
Balling
Registered User
 
Join Date: Feb 2020
Posts: 541
Quote:
Originally Posted by von Suppé View Post
First off, I did not mention conversion. It's simply possible to have same program from two different framerate sources.



Even when changing 23.976 <--> 24 framerate, I don't understand why framedropping would come into play. Where would they be dropped? Just rewriting timestamps would keep native frames and same framecount.
Framedropping as I understand it, is skipping certain SMPTE timecodes to keep up with time. Since they merely refer to frames, skipping them will not skip the frames themselves.

But maybe I'm hugely misinterpreting your post and/or missing something.
You are thinking about drop-frame timecode (DF), no one uses it anymore, because it is inaccurate and accumulates one frame every 9 hours 15 minutes. Not quite like 41 seconds, but still, so timecodes are not the only thing being dropped. https://en.wikipedia.org/wiki/SMPTE_timecode It happens because it assumes 29.97 instead of 30/1.001.

"why framedropping would come into play" you need to drop actual video frames because there is no simple way to convert between /1.001 and not without a GPU farm. Imagine a display that is 24.000/1.001 and your display 24.000 on it. In fact it was a crazy problem in Apple 4K TV (that was fixed, every display supports both, it is mandated). You can read about it here: https://en.wikipedia.org/wiki/24p

"Just rewriting timestamps would keep native frames and same framecount"

That would desync audio and subtitles that is why it is not done. Hollywood converts by using smearing on 10 frames. Also, as I said there is still only one true framerate (24.000) that is synced to real clock out there. Imagine a video scene with a ticking clock. Haha.

Last edited by Balling; 8th August 2022 at 00:21.
Balling is offline   Reply With Quote
Old 8th August 2022, 04:20   #253  |  Link
NeverExists
Registered User
 
Join Date: Jul 2022
Posts: 19
Quote:
Originally Posted by GodzilaAvenger View Post
Do you want to get the RPU from a WEB-DL source and inject it into a BluRay? If that's what you want to do I'd recommend using djv, which can show a video frame-by-frame. What I do is open one file in djv, find a scene transition and note the frame number, then open the other file and find the corresponding frame number. This gives me the delay, which I then use in the DDVT injector tool.
DJV is?
NeverExists is offline   Reply With Quote
Old 8th August 2022, 05:04   #254  |  Link
GodzilaAvenger
Registered User
 
GodzilaAvenger's Avatar
 
Join Date: Jul 2022
Posts: 123
DJV
GodzilaAvenger is offline   Reply With Quote
Old 8th August 2022, 09:42   #255  |  Link
von Suppé
Registered User
 
von Suppé's Avatar
 
Join Date: Dec 2013
Posts: 631
@GodzilaAvenger

Clear. Thanks for explaining.

Quote:
Originally Posted by GodzilaAvenger View Post
The file below contains a sample of both the source (remux) and re-encode files. Please let me know if either triggers DV on your player, thanks!
Will do and let you know. Thanks.
von Suppé is offline   Reply With Quote
Old 8th August 2022, 10:05   #256  |  Link
von Suppé
Registered User
 
von Suppé's Avatar
 
Join Date: Dec 2013
Posts: 631
@Balling

I think you're missing the point. Note what my initial question was: is cross-using 23.976 RPU for 24 fps video and vice versa possible? Answer: RPU works with framenumbers, so yes. So no need to change framerate.

As for your introduction to conversion and the framedropping:
Quote:
Originally Posted by Balling View Post
"why framedropping would come into play" you need to drop actual video frames
I disagree, it isn't needed at all. Eventhough dropping/doubling videoframes can be applied to change framerate, it is not necessary in many cases.
And in the light of my initial question, this way would even defy its own purpose; RPU and video would grow out of sync.

Quote:
Originally Posted by Balling View Post
because there is no simple way to convert between /1.001
Yes, there is: rewriting timestamps

Quote:
Originally Posted by Balling View Post
"Just rewriting timestamps would keep native frames and same framecount"

That would desync audio and subtitles that is why it is not done.
Actually, "sync" is the exact reason why it is done. A lot of people convert video 24 <--> 23.976 by rewriting timestamps. Not to get out of sync with its native audio, but to get in sync with other.
As an example, imagine having a TrueHD + Atmos track from a 24 fps source and a desired videotrack from a 23.976 source. No way you can speed-down Atmos while keeping Atmos format (with freeware, that is). But if you'd instead speed-up the video by rewriting timestamps, it can sync to the native Atmos track.
As for subs, that's a no-brainer. They can be resynced in the blink of an eye.

If you introduce framerate conversion; for RPU there's no need. You might have considered the reason why anybody would do such anyway.

Last edited by von Suppé; 8th August 2022 at 16:55.
von Suppé is offline   Reply With Quote
Old 8th August 2022, 10:14   #257  |  Link
von Suppé
Registered User
 
von Suppé's Avatar
 
Join Date: Dec 2013
Posts: 631
Quote:
Originally Posted by -QfG- View Post
Open Base Layer file/Container with the Injector. If the Injector found the EL.hevc file you have a new option to mux the MEL/FEL Layer into your Base Layer Stream.
Didn't know this. New to me. Interleaving BL and EL I always did manually with dovitool cli. Thanks for the heads-up.

Quote:
Originally Posted by -QfG- View Post
Differences between Standard and makeMKV:

--eos-before-el Write the EOS/EOB NALUs before the EL. Defaults to false.
This flag enables the same behaviour as MakeMKV and yusesope's mux script.
Enabling this therefore results in identical output using dovi_tool.
What would be a specific reason to use either of the two? Can you give an example?

Last edited by von Suppé; 8th August 2022 at 10:25.
von Suppé is offline   Reply With Quote
Old 8th August 2022, 11:18   #258  |  Link
von Suppé
Registered User
 
von Suppé's Avatar
 
Join Date: Dec 2013
Posts: 631
Quote:
Originally Posted by GodzilaAvenger View Post
The file below contains a sample of both the source (remux) and re-encode files. Please let me know if either triggers DV on your player, thanks!
Both files don't trigger DV playback. Playback is jerky and displays dropouts.
MediaInfo shows variable framerate and weird framerate number. Maybe something went wrong?
von Suppé is offline   Reply With Quote
Old 8th August 2022, 14:33   #259  |  Link
GodzilaAvenger
Registered User
 
GodzilaAvenger's Avatar
 
Join Date: Jul 2022
Posts: 123
Quote:
Originally Posted by von Suppé View Post
Both files don't trigger DV playback. Playback is jerky and displays dropouts.
MediaInfo shows variable framerate and weird framerate number. Maybe something went wrong?
Thanks for checking them out. You are absolutely right, MediaInfo does show the frame rate for both variable and at 2000+. The original files (remux and encode) have constant 23.976 frame rate so I think this has something to do with LosslessCut that I used for making the clips.

Either way, I uploaded the entire encoded file below (remux was way too big), so check it out if you like, and thanks!

Encode
GodzilaAvenger is offline   Reply With Quote
Old 8th August 2022, 21:10   #260  |  Link
von Suppé
Registered User
 
von Suppé's Avatar
 
Join Date: Dec 2013
Posts: 631
Your file does not trigger DV on my player. It falls back to HDR10, which playback is fine.
MediaInfo looks okay though. Weird.
von Suppé is offline   Reply With Quote
Reply


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 06:07.


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