Jump to content

Keep Dolby Vision when converting mkv file to mp4


staeff

Recommended Posts

staeff

Since LG TVs don't support Dolby Vision through mkv files, but only through mp4 files I currently need to manually convert/mux my files with this ffmpeg command:

ffmpeg -map 0:v -c copy -map 0:a -c copy -strict unofficial myfile.mp4 -i myfile.mkv

Ideally I would want to be able to use the built in convert feature of emby but when converting a mkv file with the following settings to mp4, then Dolby Vision will be removed in the resulting file.

image.thumb.png.4727dd17ef05a335df51662addccd2eb.png

Edited by staeff
  • Disagree 1
Link to comment
Share on other sites

RanmaCanada
2 hours ago, staeff said:

@RanmaCanadaI would appreciate if you would at least give an explanation why you downvoted this feature request.

DolbyVision is proprietary.  Emby can't include the tools for this in their software without paying a dev fee (there are free tools to do this, but they take time).  It is not Emby's responsibiltiy to ensure your pirated materials will work with your devices.  If you are ripping your own materials, it is YOUR responsibility to ensure it works with your hardware.  As it's obvious you are pirating stuff, it's not their job to make your pirated materials work with your TV.  If you're going to pirate or rip your own materials, get/rip them in the format your device supports.

But if anything, the amount of people not understanding this and demanding that the devs cater to their laziness and ignorance is starting to get out of hand.  This is a YOU problem, not an Emby problem.

Link to comment
Share on other sites

staeff
Posted (edited)

@RanmaCanadaI would kindly ask you to be less condescending. I have read through your post history and you come of as a really unpleasant person.

That said I'm not asking to manipulate the codec in any way but just to change the container format and keep the encoded stream as is. Which is separate from decoding and re-encoding a Dolby Vision stream, for which I recognize that licensing issues might arise.

Edited by staeff
Link to comment
Share on other sites

RanmaCanada
3 minutes ago, staeff said:

@RanmaCanadaI would kindly ask you to be less condescending. I have read through your post history and you come of as a really unpleasant person.

That said I'm not asking to manipulate the codec in any way but just to change the container format and keep the encoded stream as is. Which is separate from decoding and re-encoding a Dolby Vision stream, for which I recognize that licensing issues might arise.

If I come across as unpleasant it is because I am sick and tired of people not understanding the technical aspects of their questions/statements.  You can't just change the container without going through and processing the video and audio to ensure it is compliant with the container you want to use.  If you could, it would be as simple as changing the file extention from .mkv to .mp4.  Which it is not.  You still need to have the video and audio tracks processed to ensure they are compliant with the proper headers and other information.

And again, DolbyVision is 100% proprietary and Emby doesn't have the legal ability to manipulate streams (which is what remuxing to an mp4 container is), hence it is a YOU problem.  Just because there are "free" tools available doesn't mean that they can be used by a company legally.  If they could, I am sure they would love to include the ability to encode streams to DTS as afterall, there are "free" tools available to convert ac3 5.1 into DTS.

DolbyVision is a monster of a legal mess.  And the faster people realize it, the quicker these types of requests will vanish.

Link to comment
Share on other sites

staeff

As far as I can tell you are neither an employee of Emby nor a moderator on this forum, therefore I don't get why you go out of your way to berate newcomers seeking help and constructive input.

I'm not sure what happened in your life that you feel the need to be rude to strangers on the internet, whatever it is I feel truly sorry for you. But to use the only rethorical device you seem to recognize: whatever problem in life made you turn out this way it's a YOU problem.

Link to comment
Share on other sites

RanmaCanada

I haven't been rude to you at all in this correspondance.  If you feel I have, please feel fine to report it to the admins.  At no point did I berate you.  If my using the emphasis of caps on YOU makes you feel uneasy, understand that this is a text based medium and it is very difficult to get the importance of certain topics across to users without certain means.  I am not personally attacking you.

  • Agree 1
Link to comment
Share on other sites

Hi.  So you would want the Convert feature to have the option to just do a container swap without any actual conversion of the streams?

If so, I think that is already possible...

 

Link to comment
Share on other sites

staeff
Posted (edited)

@ebrthanks for your answer, yes that basically would be the idea. I don't have any insight in what Emby is doing behind the scenes, but I assume it's using ffmpeg? If yes, then I think the issue might be that remuxing of Dolby Vision from my tests only works with the `-strict unofficial` option (and a fairly recent version of ffmpeg). Personally I would be happy enough with some advanced setting to provide custom arguments, to not enforce unofficial for everyone.

With the current Emby convert feature and the following settings and the following source file video information: 

Profile: Custom
Container: mp4
Video codec: hevc, h264
Audio codec: aac, mp3, ac3
Quality: Original quality

 

Title: 4k Dolby Vision HEVC
Codec: HEVC
Dolby Profile: Profile 8.1 (HDR10 compatilbe)
Profile: Main 10
Level: 150
Resolution 3840x1604
Interlaced: No
Bitrate: 25mbps
Video Range: DolbyVision
Color Primaries: bt2020
Color Space bt2020nc
Color Transfer smpte2084
Bit Depth: 10 bit
Pixel Format: yuv420p10le

I get the following output:

Title: 4K HDR 10 HEVC
Codec: HEVC
Codec Tag: hvc1
Profile: Main 10
Resolution: 3840x1604
Interlaced: No
Bitrate: 24mbps
Video Range: HDR 10
Color Primaries: bt2020
Color Space: bt2020nc
Color Transfer: smpte2084
Bit Depth: 10 bit
Pixel Format: yuv420p10le

In contrast, if I use the ffmpeg command I described initially I get exactly the same output as I had for the input.

Edited by staeff
Link to comment
Share on other sites

rbjtech
1 hour ago, staeff said:

@ebrthanks for your answer, yes that basically would be the idea. I don't have any insight in what Emby is doing behind the scenes, but I assume it's using ffmpeg? If yes, then I think the issue might be that remuxing of Dolby Vision from my tests only works with the `-strict unofficial` option (and a fairly recent version of ffmpeg). Personally I would be happy enough with some advanced setting to provide custom arguments, to not enforce unofficial for everyone.

With the current Emby convert feature and the following settings and the following source file video information: 

Profile: Custom
Container: mp4
Video codec: hevc, h264
Audio codec: aac, mp3, ac3
Quality: Original quality

 

Title: 4k Dolby Vision HEVC
Codec: HEVC
Dolby Profile: Profile 8.1 (HDR10 compatilbe)
Profile: Main 10
Level: 150
Resolution 3840x1604
Interlaced: No
Bitrate: 25mbps
Video Range: DolbyVision
Color Primaries: bt2020
Color Space bt2020nc
Color Transfer smpte2084
Bit Depth: 10 bit
Pixel Format: yuv420p10le

I get the following output:

Title: 4K HDR 10 HEVC
Codec: HEVC
Codec Tag: hvc1
Profile: Main 10
Resolution: 3840x1604
Interlaced: No
Bitrate: 24mbps
Video Range: HDR 10
Color Primaries: bt2020
Color Space: bt2020nc
Color Transfer: smpte2084
Bit Depth: 10 bit
Pixel Format: yuv420p10le

In contrast, if I use the ffmpeg command I described initially I get exactly the same output as I had for the input.

If you use the actual emby ffmpeg (located in the 'system' folder within emby) - does that have the necessary function ?    Emby use a custom ffmpeg - so it may not have the -strict unofficial functionality.   Then there is the case of support - if they opt to use the above syntax, then how does that impact the 'official' way of doing it .. ;)  (pretty sure they just do a -c:a copy -c:v copy today).   

Adding a 'custom' option will bring many support questions - and probably not something emby would want to do - and frankly, if you know ffmpeg syntax - then writing a quick script as part of a pre or post processing of your files will likely be a better solution ?

btw - have you tried saving as a TS file (transport stream) in the Emby Convert function - from memory, this container supports DV on the LG (but may also need the -strict, I'm not sure ..;))

Edited by rbjtech
  • Like 1
Link to comment
Share on other sites

staeff
Posted (edited)
22 minutes ago, rbjtech said:

If you use the actual emby ffmpeg (located in the 'system' folder within emby) - does that have the necessary function ?    Emby use a custom ffmpeg - so it may not have the -strict unofficial functionality.   Then there is the case of support - if they opt to use the above syntax, then how does that impact the 'official' way of doing it .. ;)  (pretty sure they just do a -c:a copy -c:v copy today).   

Thanks for the idea! Just tried it out and it seems that the ffmpeg version emby is using when called with the same parameter then the resulting file still contains the Dolby Vision stream.
To be honest I'm not 100% sure what impact of the unofficial flag is besides this, since the ffmpeg documentation also only really says the following: "allow unofficial extensions". That's why I would kind of want this to be a feature flag / setting, even though it probably should not have any impact.
FFmpeg Codecs Documentation

I will try out the TS file conversion later to see if that works, but ideally I like my files to be in a more widely used format, but also a very good hint!

Next step would be to set up some file watcher or regular job to run my command, but since Emby already has a built in functionality to convert new files I kind of would like to use it.

Edited by staeff
  • Like 1
Link to comment
Share on other sites

rbjtech
2 minutes ago, staeff said:

Thanks for the idea! Just tried it out and it seems that the ffmpeg version emby is using works like expected when I use the same parameters and the resulting file still contains the Dolby Vision stream. To be honest I'm not 100% sure what impact of the unofficial flag is besides this, since the ffmpeg documentation also only really says the following: "allow unofficial extensions". That's why I would kind of want this to be a feature flag / setting, even though it probably should not have any impact.
FFmpeg Codecs Documentation

I will try out the TS file conversion later to see if that works, but ideally I like my files to be in a more widely used format, but also a very good hint!

Next step would be to set up some file watcher or regular job to run my command, but since Emby already has a built in functionality to convert new files I kind of would like to use it.

Cool - so if the emby ffmpeg already has it - then I don't personally see any issues with adding an option to use -strict unofficial to retain any proprietary metadata in the remuxing process .. over to the Dev's I guess. :)

Link to comment
Share on other sites

staeff

@ebrwould adding the `-strict unoffical` option be feasible for Emby (wether directly or through some setting)?

Link to comment
Share on other sites

On 3/20/2024 at 8:29 AM, staeff said:

@ebrwould adding the `-strict unoffical` option be feasible for Emby (wether directly or through some setting)?

It's possible, yes, but what happened with the mp4 that wasn't encoded that way?

Link to comment
Share on other sites

staeff
5 minutes ago, Luke said:

It's possible, yes, but what happened with the mp4 that wasn't encoded that way?

The last code section in this comment I made above shows the output I got with the current convert feature

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...