UHD/4K HDR Users - How do you MP4?

Status
Not open for further replies.

nathank1989

Contributor
Joined
Aug 29, 2016
Messages
103
I have a simple question I cannot seem to get a straight answer.


I have an Xbox one X, and apparently the Xbox cannot play HDR MKVs with Dolby Atmos because Microsoft.
The files I have contain Dolby Atmos and cannot source ones that do not.

I specifically care about HDR over the audio, so AAC 5.1 is just fine for me.

All I want is to change the container from MKV to MP4 preserving HDR.
If I lose a little quality, fine that's expected, but I want to preserve HDR and rock with AAC5.1 and AAC Stereo
Don't even care about subtitle tracks since I can just grab an srt from anywhere.

I cant use FFMPEG because it cannot decode dolby atmos and errors out.
Code:
Could not find tag for codec truehd in stream #1, codec not currently supported in container
Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument

I've even tried mapping audio tracks to leave out but errors out before finishing the file
Code:
Assertion s->buf_ptr < s->buf_end failed at ./libavcodec/put_bits.h:108


I cant seem to use Handbrake because it doesn't support HDR video passthru (Or my preset isn't right) wasted 8 hours on a conversion with a H265 10-bit codec, quality set to 25, custom tracks and it plays and looks good, but no HDR. Apparently even the nightly builds are still reliant on an 8-bit pipeline thus not preserving HDR.

Surely someone out there is doing it, a simple container change and removal of dolby atmos and kept hdr, highest quality and acceptable export times using non-commercial software. I may have been out of the AV codec game for about 5 years but I don't remember it being this difficult.
 
Last edited:

pschatz100

Guru
Joined
Mar 30, 2014
Messages
1,184
I don't think this FreeNAS forum is the right place to find information about encoding video. You will have much better luck searching on the Plex forum or one of the video forums.

Good luck.
 

rknaub

Explorer
Joined
Jan 31, 2017
Messages
75
I have a simple question I cannot seem to get a straight answer.


I have an Xbox one X, and apparently the Xbox cannot play HDR MKVs with Dolby Atmos because Microsoft.
The files I have contain Dolby Atmos and cannot source ones that do not.

I specifically care about HDR over the audio, so AAC 5.1 is just fine for me.

All I want is to change the container from MKV to MP4 preserving HDR.
If I lose a little quality, fine that's expected, but I want to preserve HDR and rock with AAC5.1 and AAC Stereo
Don't even care about subtitle tracks since I can just grab an srt from anywhere.

I can't use FFMPEG because it cannot decode dolby atmos and errors out.
Code:
Could not find tag for codec truehd in stream #1, codec not currently supported in container
Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument

I've even tried mapping audio tracks to leave out but errors out before finishing the file
Code:
Assertion s->buf_ptr < s->buf_end failed at ./libavcodec/put_bits.h:108


I can't seem to use Handbrake because it doesn't support HDR video passthru (Or my preset isn't right) wasted 8 hours on a conversion with a H265 10-bit codec, quality set to 25, custom tracks and it plays and looks good, but no HDR. Apparently even the nightly builds are still reliant on an 8-bit pipeline thus not preserving HDR.

Surely someone out there is doing it, a simple container change and removal of dolby atmos and kept hdr, highest quality and acceptable export times using non-commercial software. I may have been out of the AV codec game for about 5 years but I don't remember it being this difficult.

I use popcorn audio converter to remux the DTS audio on my mkv’s to AC3, leaves video intact and plays fine for me. Use google or check avsforum.com, not sure if it works on Dolby Atmos, but I think it should. All of my movies with Atmos also have a standard DTS 7.1 track.
 

nathank1989

Contributor
Joined
Aug 29, 2016
Messages
103
So I don't have a 7.1 system so the Atmos is useless to me anyway.

I have to run another test to make sure, but I think I found a relatively simple solution.

I downloaded several HDR rips, and found some with Atmos, DTS, AAC, etc as their primary audio track.
Any that even CONTAINED truehd buffered, and transcoded after about 20 minutes of playback

Remuxing to MP4 had mixed results, and nearly unbearable buffering.

What I am about to attempt is to just rip out the truehd track and save back to mkv using ffmpeg
Code:
ffmpeg -i *.mkv -map 0 -map -0:a:0 -sn -vcodec copy -acodec copy "FILE.mkv"


This will:
map the video stream (-map 0)
remove the first audio stream, leaving all others intact (-map -0:a:0)
remove subtitles (-sn)
copy video and audio codecs respectively (-vcodec/-acodec)
 

rknaub

Explorer
Joined
Jan 31, 2017
Messages
75
So I don't have a 7.1 system so the Atmos is useless to me anyway.

I have to run another test to make sure, but I think I found a relatively simple solution.

I downloaded several HDR rips, and found some with Atmos, DTS, AAC, etc as their primary audio track.
Any that even CONTAINED truehd buffered, and transcoded after about 20 minutes of playback

Remuxing to MP4 had mixed results, and nearly unbearable buffering.

What I am about to attempt is to just rip out the truehd track and save back to mkv using ffmpeg
Code:
ffmpeg -i *.mkv -map 0 -map -0:a:0 -sn -vcodec copy -acodec copy "FILE.mkv"


This will:
map the video stream (-map 0)
remove the first audio stream, leaving all others intact (-map -0:a:0)
remove subtitles (-sn)
copy video and audio codecs respectively (-vcodec/-acodec)

I really think you can accomplish this in 5 min/video with my suggestion above. DTS and TrueHD is not direct playable on a lot of plex players, 2018 Samsung, ATV, and others. Popcorn makes AC3 the default audio track, and can preserve the DTS and other tracks in case you upgrade or change equipment in the future, the full audio is still there.
 

toliman

Cadet
Joined
Feb 9, 2014
Messages
7
I have a simple question I cannot seem to get a straight answer.

I have an Xbox one X, and apparently the Xbox cannot play HDR MKVs with Dolby Atmos because Microsoft.
The files I have contain Dolby Atmos and cannot source ones that do not.

...
Surely someone out there is doing it, a simple container change and removal of dolby atmos and kept hdr, highest quality and acceptable export times using non-commercial software. I may have been out of the AV codec game for about 5 years but I don't remember it being this difficult.

Not sure why you bring this up in FreeNAS,

but i'd guess it's a Plex/SMB issue... maybe.

It's always been difficult to get a simple one-stop box that could handle all things that wasn't a glorified PC. Codec support, takes time because nobody created or made the same standard container's work with future needs. nobody expected subtitles to be handled as bitmaps when they created AVI or MKV, and the containers aren't built for interleaving on odd framerates, etc.

HDR, despite being around since 2015 or so, is still new in terms of player/encoder support. X264 10-bit is not native, and x265 10-bit still has colorspace issues on some configs. They're still trying to get full-frame 1080p 3D encoding formats standardised, etc.

Xbox One is no exception. Not much has changed since the Xbox One enabled Atmos / HD audio passthrough.

Edit: I do have an Atmos speaker setup on the Xbox One S, but i will say that passthrough is glitchy. It works for movies, but you have to switch back for games/youtube/TV to work properly.

It's something you'd need to think about, if you have mkv files and ~30 UHD's, the Shield's effortless in comparison to actually getting Atmos working on the Xbox One S, despite it being an actual UHD movie player. It's just something about Microsoft, you can get a 4k movie playing on the shield in 25 seconds from Off to On. It takes like 4 minutes on the Xbox One from Off/Standby, into the movie.

and I bought the Shield TV on the black friday sales, 4k HEVC works without stuttering on the shield at 60mbps across the network, no problems.

Mostly because MSFT hasn't enabled bit-streaming/passthrough for UWP apps or games, perhaps due to HD audio DRM. HD audio (DTS-HD-MA, Atmos, etc.) will only go via HDMI, not Optical/Coax TOS-Link, and because of the DRM requirements for HDCP and HD Audio, they do not like enabling HDMI or bitstream access for 3rd party apps, perhaps due to the loophole possibilities. That's my theory anyway.

I assume the MP4 container is to get it working in Media Player. AFAIK, Kodi is the only player able to get DTS to work, VLC doesn't seem to recognise DTS, and it can struggle with high bitrate HEVC10 HDR files. you'd have to direct stream the video and use something other than FFMpeg to transcode DTS to AC3 for the proper MP4 support. Not really worth it.

Read the Kodi FAQ for the Xbox One https://forum.kodi.tv/showthread.php?tid=326228

Because UWP apps don't get those permissions unless they play nice (Netflix/Youtube/Hulu) with DRM support, Passthrough Bitstreaming is not easily possible on the Xbox One S/X systems. The optical drive for DVD/BR/UHD isn't accessible. SMB/NFS/FTP works.

People have since moved on and bought Nvidia Shield's for 4k HDR playback, despite it being a few years old, and came out before UHD or HDR was supported fully, it has similar internal hardware to the Nintendo Switch. If you don't want to get another device for 4k, try the Kodi player on Xbox One. It's not "perfect", due to the OS based audio mixer on the XBox One always upmixing to 7.1 internally. HDR HEVC playback will work on Kodi better than the media player.

You can get Plex & Kodi with PlexKodiConnect if you want.

It is a slight upgrade to the regular Plex client, as it won't be transcoding as much as the Plex client does.
 
Last edited:
Status
Not open for further replies.
Top