Jump to content

Choose supported audio codec by default


TurkeyMan

Recommended Posts

TurkeyMan

I have an LG CX, I have a lot of media which includes a DTS-HD MA stream, it is almost always the first stream, and LG devices can't play it.

Many of these videos have several streams, often including an AC3 stream of some variety, and I have to manually choose the proper stream before playing.

Transcoding DTS-HD MA into AC3 is pretty stupid when there's already an AC3 stream present, and it causes other problems too, for instance, mismatching audio in conjunction with subtitles seems to have the effect of prompting subtitle burn-in for reasons I don't understand...

TL;DR: if a surround-sound audio stream in a format that's supported by the device exists (and is the same language), choose that one by default instead of transcoding DTS-HD MA or other unsupported formats. It probably should still transcode in the event the next supported stream is only stereo...

Try and explain what audio stream should be manually selected to the wife and kids... ;)

Link to comment
Share on other sites

Happy2Play

Dev may need to comment more but that is the entire purpose of embedded track flags as Emby is honoring the Default audio flag.  But have you looked at playback audio settings?  Not a LG user so I don't know the options of the client.

As the web client has "Play default audio track regardless of language".

Link to comment
Share on other sites

TurkeyMan

> As the web client has "Play default audio track regardless of language".

Yeah, I think that option is actually not positioned correctly... The behaviour I detail above is what's wanted, and the option you mention is not actually about choosing a particular audio codec, it's about choosing a particular LANGUAGE (the default one), regardless of your configured spoken language.

Like, it should just be "play default language"; that is, choose the language that is associated with the default audio stream (which I personally do always want). Foreign movies should be in their language with subtitles 100%... but I still want the rules above to apply. If the default language is not English, and there is a lossless stream and an AC3 stream in that language, it should choose the AC3 stream that my TV can play. It should not choose a separate English stream, it must play the default language as I requested in that option that you refer to.

Edited by TurkeyMan
Link to comment
Share on other sites

One thing to be aware of is that the first AC3 audio track might actually be a commentary track, so it's not enought just to check the type and language. For this reason, defaulting to the first audio track might not be a good solution

Edited by SamES
Link to comment
Share on other sites

TurkeyMan

I don't think I've ever seen a film where the first/default track was a commentary track...

It would be truly glorious if media had a touch more metadata about audio streams; it attributes the language, but there really should be a distinction between main and supplementary audio streams in the container metadata.

Link to comment
Share on other sites

Happy2Play
10 minutes ago, TurkeyMan said:

It would be truly glorious if media had a touch more metadata about audio streams; it attributes the language, but there really should be a distinction between main and supplementary audio streams in the container metadata.

I don't follow as your media tells Emby which track is default, and which are not per the embedded header on the track.

image.png.ea5c4090c0d44a2258ad6c3f71d327f8.png

Link to comment
Share on other sites

TurkeyMan

Oh is there a media tag which says the default? I didn't realise, I thought it was just the first one.

Either way, whether it's the first one, or whether it's the one with this tag, the principles above still apply. That file you show, you clearly don't want to play the default one, you want to play the second one, because it will actually play on your TV without transcoding, and it has matching language to the default.

This arrangement you show here is EXTREMELY common, almost all movies I find are like this, so it would be really good if the LG app would do something sensible rather than transcoding everything.

Link to comment
Share on other sites

TurkeyMan

I was just browsing through some media to check out that "Default" tag you noted; I found a bunch of media with no default tag specified... all streams were default=no. Which is used as default in that case? Just the first one?

I also noted that in addition to the language, in most media with commentary it had : "Embedded Title: Commentary", so there is a clear and mostly consistent marker identifying commentary tracks, which can appropriately exclude that track from any logic like I describe in OP.
Link to comment
Share on other sites

Happy2Play

You would have to use something like mkvtoolnix to adjust the header flags if they are mkv files.  But Emby honors the set Default track and there is normally only one Default track.

Remux

image.thumb.png.5e59ca733d4f6f9f648271f76ab70482.png

or Change header

image.thumb.png.085bfa216f2b292d6390d529009cffa9.png

Link to comment
Share on other sites

TurkeyMan

I'm sure there's a fallback if there is no track marked default; I bet it just chooses the first one.

That's a handy tool. Thanks for the tip.

In most cases though, I'm not happy to molest my media because then I can't seed it anymore. I don't think this issue calls for it either; a trivial piece of logic can resolve the matter very nicely, and resolve the situation for all other non-technical users too.

Link to comment
Share on other sites

43 minutes ago, TurkeyMan said:

I don't think I've ever seen a film where the first/default track was a commentary track...

It would be truly glorious if media had a touch more metadata about audio streams; it attributes the language, but there really should be a distinction between main and supplementary audio streams in the container metadata.

What I'm suggesting is that if the first and/or default track is DTS or TrueHD and we know it is not supported, it wouldn't be safe to assume the first AC3 track is a valid audio track (it could be a commentary track)

Link to comment
Share on other sites

Emby for LG TV's 1.0.37 has been released. Stay tuned to the blog for the release announcement.

Can you please try out the new update and let us know how it compares? Thanks !

Link to comment
Share on other sites

TurkeyMan

I just installed 1.0.37 and tried it out with the challenging material referred in this thread.

Can you give us a hint what we should be looking for?

From a quick spin, I can tell you that the release works normally. I can't discern any changes.

To test the issues mentioned in this thread, I tested 2 good examples, both had bad outcomes:

1: Crouching Tiger Hidden Dragon - MKV

Video - 4K HEVC HDR10

Audio: Chinese TrueHD, Chinese AC3, English TrueHD, English AC3, plus a commentary track (Chinese is default language)

Subs: VOBSUB in MKV

By default, playing this media chooses the Chinese TRUE-HD track which transcodes to AC3 (despite AC3 in same language already present in the mux). Also, the VIDEO is transcoded; the HDR is tone-mapped to SDR, subtitles burned in, and the resulting stream that is played in SDR with transcoded audio and video. This is the worst possible result.

If I manually change the Audio track to Chinese AC3, the audio does direct-play, but for some reason, the video is still transcode + tone-mapped + burn-in the subtitles. I've read in other places that unnecessarily transcoding audio causes the video to burn-in subtitles, but when I correct the audio in this case, the subtitles burn-in anyway, transcode and degrade to SDR... I consider the film completely un-watchable.

If I disable subtitles, and choose the AC3 audio stream, the movie direct-plays, HDR comes back, but obviously, there are no subtitles so it's not watchable.

 

2. Ghose in the Shell - MKV

Video: 4K HEVC HDR10

Audio: Japanese TrueHD, Japanese DTS-HD MA, Japanese AC3, English TrueHD, English DTS-HD MA, English AC3 (Japanese is default language)

Subtitles: SRT in MKV

By default, playing this media chooses the Japanese TrueHD track, which transcodes audio to AC3 (despite AC3 in same language already present in the mux). Also, the VIDEO is transcoded; HDR is tone-mapped to SDR, subtitles burned in, and the resulting stream that is played in SDR with transcoded audio and video. This is the worst possible result.

If I manually change the Audio track to Japanese AC3, the WHOLE MEDIA swaps to direct play and HDR kicks back in. Changing audio to AC3 causes the video to NOT transcode and tone-map down to SDR, despite subtitles present which now direct-play.

I don't know why this one behaves differently than the other one, which won't direct play unless I also disable subtitles.

 

Obviously, given how bad it is to select the wrong audio stream, the LG app should make best-effort to select the AC3 stream by default. In many cases it will cause it to not completely ruin the video stream. I would consider this a rather high priority bug in the LG app; a wrong-choice of audio stream causes the video to be transcoded and lose HDR; not an acceptable result.

I'm not sure why the first one transcoded when the audio and video can both direct-play by the television; I guess the TV can't show VOBSUB? What caused the server to perform the burn-in? Did the LG client make the burn-in request to the server?

It's completely terminal for the image to burn-in subtitles... if the problem is that VOBSUB can't be rendered by the TV, is it instead possible to transcode the subtitles to SRT and just remux without transcoding the audio/video? That's gotta be a million times easier and faster than transcoding and wrecking a huge 4K HDR video stream.

One oddity about the second test case, was that it seems the subtitles CAN direct-play as it did when selecting the right audio track... so why did they get burned-in when transcoding the audio? I don't understand why audio transcoding caused a transcode of the video? Why did the audio stream affect the video/subtitles? I think resolving that issue would soften the severity of the issue described in this thread... if audio transcode didn't cause unnecessary video transcode, then it wouldn't be so bad to select the wrong audio track, although I'd still prefer the proper mastered track present in the steam than a realtime transcoded one in the same format, obviously.

 

Anyway, please advise what you'd like me to test. My tests of interest were unsuccessful on the new release.

Cheers

- Manu

Edited by TurkeyMan
Link to comment
Share on other sites

On first playback, the app will always try and play either the audio track marked as default, or the first audio track.  If these are not supported by your TV (ie: TrueHD or DTS) then this will cause audio conversion.  Even if there are other AC3 tracks, they will not automatically be selected as it’s not possible to know what they are, for example, they could be a commentary track.  You need to manually select an alternate track, which is best to do before you start playback

Selecting any graphical subtitles (ie: PGS, DVDSUB, etc) will require burning in the subtitles which requires transcoding.  For now, your best option is to use the subtitle download feature and download text based subtitles.  You second example has srt subtitles which are text based, this is why they work with DirectPlay as they don’t require burn in

Your really need to make sure you select audio and subtitle tracks that are supported by your tv without any conversion or burn in, if you can ensure it DirectPlays then you should have no issues with HDR

I’m not sure which issues you are suggesting are a bug that needs fixing  

 

Link to comment
Share on other sites

TurkeyMan

I just researched and realised that VOBSUB is a bitmap subtitle format... I thought old-school DVD subtitles were always text. I thought it was just bluray PGS that were bitmap. So that explains the first case transcoding the video.

It doesn't explain why the second case decided to transcode the video when the audio format was incorrect, but happily direct-playing the SRT subtitles when the audio format was selected correctly.

  • Like 1
Link to comment
Share on other sites

I don’t think srt subs are ever burnt in. Can you attach the ffmpeg log for the second case where you selected the ac3 track and it caused it to transcode? 

Link to comment
Share on other sites

TurkeyMan
Quote

On first playback, the app will always try and play either the audio track marked as default, or the first audio track.  If these are not supported by your TV (ie: TrueHD or DTS) then this will cause audio conversion.  Even if there are other AC3 tracks, they will not automatically be selected as it’s not possible to know what they are, for example, they could be a commentary track.  You need to manually select an alternate track, which is best to do before you start playback

Everyone repeats this again and again. It's just intellectually lazy and I'm bored if hearing it. There are plenty of tell-tales that can suggest the presence or probability that a track is a commentary track and make a better guess.

For instance, I've never once seen a commentary track that's not stereo. So if there is a TrueHD and AC3 5.1 present, and they are the same language, I think it's a very good guess that it's not a commentary track. A good protective rule is to never choose a stereo track. And in most cases, they are labelled "Commentary", which is also pretty easy to detect and exclude from the selection! So, valid tracks are surround sound tracks that are also not labelled "Commentary"... I challenge you to go through your media collection and find a single instance where that rule would fail? There may be other tell-tales that can be incorporated into an exclusion rule.

If the selection logic does fail in some rare case, the user is presented with a commentary track, and they just select the non-commentary track. This is a 1-in-100 situation, which is much better than the current 1-in-2 situation where it plays the wrong track. Also, if it plays a commentary track incorrectly, you know it. If it plays the wrong format incorrectly, you don't know it unless you specifically check. The error case is easier for a user to detect and correct with a rule like I describe in place, particularly an un-skilled user.

 

Quote

I’m not sure which issues you are suggesting are a bug that needs fixing  

1. It plays the wrong audio track by default.

2. As demonstrated by the second case, it transcoded the video when it shouldn't have. Selecting the wrong audio stream (reliably selected by default; see #1) caused transcode and complete destruction of the video... that's obviously an issue that needs fixing.

Edited by TurkeyMan
Link to comment
Share on other sites

For now, that’s not the logic that any client apps apply as far as I’m aware

Please attach the ffmpeg log for the second case

Link to comment
Share on other sites

TurkeyMan
13 minutes ago, SamES said:

I don’t think srt subs are ever burnt in. Can you attach the ffmpeg log for the second case where you selected the ac3 track and it caused it to transcode? 

No, the second case did direct play when choosing AC3. As I was pointing out, selecting the TrueHD track (improper default selection) which caused audio transcoding ALSO caused video transcoding + burn-in by surprise. Selecting the AC3 stream caused the whole thing to direct-play correctly.

Edited by TurkeyMan
Link to comment
Share on other sites

TurkeyMan
4 minutes ago, SamES said:

For now, that’s not the logic that any client apps apply as far as I’m aware

Please attach the ffmpeg log for the second case

This in the emby server:  (note the improper video transcode)

Quote

 

Emby for LG 1.0.37
LG Smart TV (OLED77CXPUA)
103.165.18.32 http/1.1
Stream
MKV (33 mbps)
HLS (60 mbps 62 fps)
Converting audio to compatible codec
Video
4K HEVC HDR10
Transcode (H264 60 mbps)
Tone Mapping (Hable)
Audio
Japanese TRUEHD 7.1 (Default)
Transcode (AC3 384 kbps)

 

 
How do I get the ffmpeg log you want?
Link to comment
Share on other sites

Grab the ffmpeg log from the logs section in the server management page. It might be best to test that case again ‘TrueHD causing video transcoding ‘ then you can just grab the most recent ffmpeg log that matches the time of the test 

Link to comment
Share on other sites

TurkeyMan

Found it:
Again, note that it decided to transcode the video for some reason.

Quote
2022-12-27 03:24:35.250
Operating System: Linux version 5.10.142+truenas (root@tnsbuilds01.tn.ixsystems.net) (gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2) #1
OS/Process: x64/x64
Emby Server version: 4.7.10.0
Operating system: Unix 5.10.142.0
Command Line: /system/EmbyServer.dll -programdata /config -ffdetect /bin/ffdetect -ffmpeg /bin/ffmpeg -ffprobe /bin/ffprobe -restartexitcode 3

App: Emby for LG 1.0.37
LG Smart TV (OLED77CXPUA)

http://103.165.18.4:8096/emby/videos/2939/main.m3u8?DeviceId=380c0da4-9cf6-4b79-a112-61a45ff00440&MediaSourceId=e3ba95769901b506bc73ce9784ba6712&PlaySessionId=bf1c0d76f2a2439c88c1e44d71c8e357&api_key=11dc5d0698874b3aa622f559b974e704&VideoCodec=h264&AudioCodec=ac3,eac3,aac,mp3,opus&VideoBitrate=59616000&AudioBitrate=384000&AudioStreamIndex=1&TranscodingMaxAudioChannels=6&SegmentContainer=ts&MinSegments=1&BreakOnNonKeyFrames=False&h264-profile=high,main,baseline,constrainedbaseline&h264-level=51&TranscodeReasons=AudioCodecNotSupported

http://103.165.18.4:8096/emby/videos/2939/hls1/main/0.ts?PlaySessionId=bf1c0d76f2a2439c88c1e44d71c8e357

{"Protocol":"File","Id":"e3ba95769901b506bc73ce9784ba6712","Path":"/mnt/Media/Movies/Ghost.in.the.Shell.1995.JAPANESE.2160p.US.UHD.BluRay.x265.10bit.HDR.DTS-HD.MA.TrueHD.7.1.Atmos-SWTYBLZ.mkv","Type":"Default","Container":"mkv","Size":20618382515,"Name":"Ghost.in.the.Shell.1995.JAPANESE.2160p.US.UHD.BluRay.x265.10bit.HDR.DTS-HD.MA.TrueHD.7.1.Atmos-SWTYBLZ","IsRemote":false,"RunTimeTicks":49589760000,"SupportsTranscoding":true,"SupportsDirectStream":true,"SupportsDirectPlay":true,"IsInfiniteStream":false,"RequiresOpening":false,"RequiresClosing":false,"RequiresLooping":false,"SupportsProbing":false,"MediaStreams":[{"Codec":"hevc","ColorTransfer":"smpte2084","ColorPrimaries":"bt2020","ColorSpace":"bt2020nc","TimeBase":"1/1000","Title":"Ghost.in.the.Shell.1995.JAPANESE.2160p.US.UHD.BluRay.x265.10bit.HDR.DTS-HD.MA.TrueHD.7.1.Atmos-SWTYBLZ","VideoRange":"HDR10","DisplayTitle":"4K HEVC HDR10","IsInterlaced":false,"BitRate":33262322,"BitDepth":10,"RefFrames":1,"IsDefault":true,"IsForced":false,"Height":2074,"Width":3840,"AverageFrameRate":23.976025,"RealFrameRate":23.976025,"Profile":"Main 10","Type":"Video","AspectRatio":"1920:1037","Index":0,"IsExternal":false,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"Protocol":"File","PixelFormat":"yuv420p10le","Level":153,"IsAnamorphic":false,"AttachmentSize":0},{"Codec":"truehd","Language":"jpn","TimeBase":"1/1000","Title":"Ghost.in.the.Shell.1995.JAPANESE.2160p.US.UHD.BluRay.x265.10bit.HDR.DTS-HD.MA.TrueHD.7.1.Atmos-SWTYBLZ","DisplayTitle":"Japanese TRUEHD 7.1 (Default)","DisplayLanguage":"Japanese","IsInterlaced":false,"ChannelLayout":"7.1","BitDepth":24,"Channels":8,"SampleRate":48000,"IsDefault":true,"IsForced":false,"Type":"Audio","Index":1,"IsExternal":false,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"Protocol":"File","AttachmentSize":0},{"Codec":"dts","Language":"jpn","TimeBase":"1/1000","Title":"Ghost.in.the.Shell.1995.JAPANESE.2160p.US.UHD.BluRay.x265.10bit.HDR.DTS-HD.MA.TrueHD.7.1.Atmos-SWTYBLZ","DisplayTitle":"Japanese DTS-HD MA 7.1","DisplayLanguage":"Japanese","IsInterlaced":false,"ChannelLayout":"7.1","BitDepth":24,"Channels":8,"SampleRate":48000,"IsDefault":false,"IsForced":false,"Profile":"DTS-HD MA","Type":"Audio","Index":2,"IsExternal":false,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"Protocol":"File","AttachmentSize":0},{"Codec":"ac3","Language":"jpn","TimeBase":"1/1000","Title":"Ghost.in.the.Shell.1995.JAPANESE.2160p.US.UHD.BluRay.x265.10bit.HDR.DTS-HD.MA.TrueHD.7.1.Atmos-SWTYBLZ","DisplayTitle":"Japanese AC3 5.1","DisplayLanguage":"Japanese","IsInterlaced":false,"ChannelLayout":"5.1","BitRate":640000,"Channels":6,"SampleRate":48000,"IsDefault":false,"IsForced":false,"Type":"Audio","Index":3,"IsExternal":false,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"Protocol":"File","AttachmentSize":0},{"Codec":"truehd","Language":"eng","TimeBase":"1/1000","Title":"Ghost.in.the.Shell.1995.JAPANESE.2160p.US.UHD.BluRay.x265.10bit.HDR.DTS-HD.MA.TrueHD.7.1.Atmos-SWTYBLZ","DisplayTitle":"English TRUEHD 7.1","DisplayLanguage":"English","IsInterlaced":false,"ChannelLayout":"7.1","BitDepth":24,"Channels":8,"SampleRate":48000,"IsDefault":false,"IsForced":false,"Type":"Audio","Index":4,"IsExternal":false,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"Protocol":"File","AttachmentSize":0},{"Codec":"dts","Language":"eng","TimeBase":"1/1000","Title":"Ghost.in.the.Shell.1995.JAPANESE.2160p.US.UHD.BluRay.x265.10bit.HDR.DTS-HD.MA.TrueHD.7.1.Atmos-SWTYBLZ","DisplayTitle":"English DTS-HD MA 7.1","DisplayLanguage":"English","IsInterlaced":false,"ChannelLayout":"7.1","BitDepth":24,"Channels":8,"SampleRate":48000,"IsDefault":false,"IsForced":false,"Profile":"DTS-HD MA","Type":"Audio","Index":5,"IsExternal":false,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"Protocol":"File","AttachmentSize":0},{"Codec":"ac3","Language":"eng","TimeBase":"1/1000","Title":"Ghost.in.the.Shell.1995.JAPANESE.2160p.US.UHD.BluRay.x265.10bit.HDR.DTS-HD.MA.TrueHD.7.1.Atmos-SWTYBLZ","DisplayTitle":"English AC3 5.1","DisplayLanguage":"English","IsInterlaced":false,"ChannelLayout":"5.1","BitRate":640000,"Channels":6,"SampleRate":48000,"IsDefault":false,"IsForced":false,"Type":"Audio","Index":6,"IsExternal":false,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"Protocol":"File","AttachmentSize":0},{"Codec":"subrip","Language":"eng","TimeBase":"1/1000","Title":"English-SRT","DisplayTitle":"English (Default SUBRIP)","DisplayLanguage":"English","IsInterlaced":false,"IsDefault":true,"IsForced":false,"Type":"Subtitle","Index":7,"IsExternal":false,"IsTextSubtitleStream":true,"SupportsExternalStream":true,"Protocol":"File","AttachmentSize":0,"SubtitleLocationType":"InternalStream"},{"Codec":"subrip","Language":"eng","TimeBase":"1/1000","Title":"English-FORCED-SRT","DisplayTitle":"English (SUBRIP)","DisplayLanguage":"English","IsInterlaced":false,"IsDefault":false,"IsForced":false,"Type":"Subtitle","Index":8,"IsExternal":false,"IsTextSubtitleStream":true,"SupportsExternalStream":true,"Protocol":"File","AttachmentSize":0,"SubtitleLocationType":"InternalStream"},{"Codec":"PGSSUB","Language":"eng","TimeBase":"1/1000","Title":"English-PGS","DisplayTitle":"English (PGSSUB)","DisplayLanguage":"English","IsInterlaced":false,"IsDefault":false,"IsForced":false,"Height":1080,"Width":1920,"Type":"Subtitle","Index":9,"IsExternal":false,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"Protocol":"File","AttachmentSize":0,"SubtitleLocationType":"InternalStream"},{"Codec":"PGSSUB","Language":"eng","TimeBase":"1/1000","Title":"English-FORCED-PGS","DisplayTitle":"English (PGSSUB)","DisplayLanguage":"English","IsInterlaced":false,"IsDefault":false,"IsForced":false,"Height":1080,"Width":1920,"Type":"Subtitle","Index":10,"IsExternal":false,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"Protocol":"File","AttachmentSize":0,"SubtitleLocationType":"InternalStream"},{"Codec":"PGSSUB","Language":"spa","TimeBase":"1/1000","Title":"Spanish-PGS","DisplayTitle":"Spanish (PGSSUB)","DisplayLanguage":"Spanish","IsInterlaced":false,"IsDefault":false,"IsForced":false,"Height":1080,"Width":1920,"Type":"Subtitle","Index":11,"IsExternal":false,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"Protocol":"File","AttachmentSize":0,"SubtitleLocationType":"InternalStream"},{"Codec":"PGSSUB","Language":"spa","TimeBase":"1/1000","Title":"Spanish-PGS","DisplayTitle":"Spanish (PGSSUB)","DisplayLanguage":"Spanish","IsInterlaced":false,"IsDefault":false,"IsForced":false,"Height":1080,"Width":1920,"Type":"Subtitle","Index":12,"IsExternal":false,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"Protocol":"File","AttachmentSize":0,"SubtitleLocationType":"InternalStream"},{"Codec":"PGSSUB","Language":"eng","TimeBase":"1/1000","Title":"English-PGS","DisplayTitle":"English (PGSSUB)","DisplayLanguage":"English","IsInterlaced":false,"IsDefault":false,"IsForced":false,"Height":1080,"Width":1920,"Type":"Subtitle","Index":13,"IsExternal":false,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"Protocol":"File","AttachmentSize":0,"SubtitleLocationType":"InternalStream"},{"Codec":"PGSSUB","Language":"eng","TimeBase":"1/1000","Title":"English-FORCED-PGS","DisplayTitle":"English (PGSSUB)","DisplayLanguage":"English","IsInterlaced":false,"IsDefault":false,"IsForced":false,"Height":1080,"Width":1920,"Type":"Subtitle","Index":14,"IsExternal":false,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"Protocol":"File","AttachmentSize":0,"SubtitleLocationType":"InternalStream"},{"Codec":"mjpeg","ColorSpace":"bt470bg","TimeBase":"1/90000","IsInterlaced":false,"BitDepth":8,"RefFrames":1,"IsDefault":false,"IsForced":false,"Height":176,"Width":120,"RealFrameRate":90000,"Profile":"Baseline","Type":"EmbeddedImage","AspectRatio":"15:22","Index":15,"IsExternal":false,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"Protocol":"File","PixelFormat":"yuvj444p","Level":-99,"AttachmentSize":0},{"Codec":"mjpeg","ColorSpace":"bt470bg","TimeBase":"1/90000","IsInterlaced":false,"BitDepth":8,"RefFrames":1,"IsDefault":false,"IsForced":false,"Height":120,"Width":213,"RealFrameRate":90000,"Profile":"Baseline","Type":"EmbeddedImage","AspectRatio":"71:40","Index":16,"IsExternal":false,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"Protocol":"File","PixelFormat":"yuvj444p","Level":-99,"AttachmentSize":0},{"Codec":"mjpeg","ColorSpace":"bt470bg","TimeBase":"1/90000","IsInterlaced":false,"BitDepth":8,"RefFrames":1,"IsDefault":false,"IsForced":false,"Height":882,"Width":600,"RealFrameRate":90000,"Profile":"Baseline","Type":"EmbeddedImage","AspectRatio":"100:147","Index":17,"IsExternal":false,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"Protocol":"File","PixelFormat":"yuvj444p","Level":-99,"AttachmentSize":0},{"Codec":"mjpeg","ColorSpace":"bt470bg","TimeBase":"1/90000","IsInterlaced":false,"BitDepth":8,"RefFrames":1,"IsDefault":false,"IsForced":false,"Height":600,"Width":1067,"RealFrameRate":90000,"Profile":"Baseline","Type":"EmbeddedImage","AspectRatio":"1067:600","Index":18,"IsExternal":false,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"Protocol":"File","PixelFormat":"yuvj444p","Level":-99,"AttachmentSize":0}],"Formats":[],"Bitrate":33262322,"RequiredHttpHeaders":{},"ReadAtNativeFramerate":false}

>>>>>>  User policy for Manu
        Enable Playback Remuxing: True
        Enable Video Playback Transcoding: True
        Enable Audio Playback Transcoding: True

>>>>>>  Selected Codecs
Decoder Automatic software decoder


Encoder x264 Software Encoder
        Max Bitrate: 781 Mbit/s
        Color Formats: YUV420P, YUVJ420P, YUV422P, YUVJ422P, YUV444P, YUVJ444P, NV12, NV16, NV21, YUV420P10, YUV422P10, YUV444P10, NV20, GRAY8, GRAY10 - Bit Depths: 8, 10, 12, 14
        Profiles: Baseline Profile (Level 6.2), Main Profile (Level 6.2), High Profile (Level 6.2), High 10 Profile (Level 6.2), High 4:2:2 Profile (Level 6.2), High 4:4:4 Predictive Profile (Level 6.2)


>>>>>>  FindVideoEncoder - MediaType: h264, UseHardwareCodecs: True, HWA-Mode: Automatic
Info    Checking: 'x264 Software Encoder'
Info    Check successful - selecting 'x264 Software Encoder'

>>>>>>  FindVideoDecoder - MediaType: hevc, UseHardwareCodecs: True, HWA-Mode: Automatic
Info    Checking: 'Automatic software decoder'
Info    Check successful - selecting 'Automatic software decoder'

>>>>>>  Processing Plan
        Name                                        CanDoInHW  WillDoInHW  Reason                                                 
        Automatic software decoder               >> False      False       Software Codec                                          
        VideoInput                               >> False      False       Not a hardware decoder                                  
        ToneMapping (when possible)              >> False      False                                                               
        VideoOutput                              >> False      False       Not a hardware encoder                                  
        x264 Software Encoder                    >> False      False       Software Codec                                          

>>>>>>  Video Processing Steps for [0:0]: H.265 (HEVC)
        Step                    HW-Context   Format       SW-Format           Size   Next
        HEVC                 >> -            yuv420p10    yuv420p10      3840x2074 >> format
        format               >> -            p010         p010           3840x2074 >> supertonemap
        supertonemap         >> -            p010         p010           3840x2074 >> format
        format               >> -            yuv420p      yuv420p        3840x2074 >> 

/bin/ffmpeg -loglevel +timing -y -print_graphs_file "/config/logs/ffmpeg-transcode-9e407980-74ba-40a1-8ebd-1c8a7a46b4b2_1graph.txt" -copyts -start_at_zero -f matroska,webm -c:v:0 hevc -c:v:1 mjpeg -c:v:2 mjpeg -c:v:3 mjpeg -c:v:4 mjpeg -i "/mnt/Media/Movies/Ghost.in.the.Shell.1995.JAPANESE.2160p.US.UHD.BluRay.x265.10bit.HDR.DTS-HD.MA.TrueHD.7.1.Atmos-SWTYBLZ.mkv" -filter_complex "[0:0]format@f1=pix_fmts=p010,supertonemap@f2=tonemap=hable,format@f3=pix_fmts=yuv420p[f3_out0]" -map [f3_out0] -map 0:1 -sn -c:v:0 libx264 -g:v:0 72 -maxrate:v:0 59616000 -bufsize:v:0 119232000 -sc_threshold:v:0 0 -keyint_min:v:0 72 -r:v:0 23.976024627685547 -pix_fmt:v:0 yuv420p -preset:v:0 veryfast -profile:v:0 high -level:v:0 5.1 -x264opts:v:0 "subme=0:me_range=4:rc_lookahead=10:partitions=none" -crf:v:0 23 -c:a:0 ac3 -ab:a:0 384000 -ar:a:0 48000 -ac:a:0 6 -metadata:s:a:0 language=jpn -disposition:a:0 default -max_delay 5000000 -avoid_negative_ts disabled -f segment -map_metadata -1 -map_chapters -1 -segment_format mpegts -segment_list "/config/transcoding-temp/1D3D92/1D3D92.m3u8" -segment_list_type m3u8 -segment_time 00:00:03.000 -segment_start_number 0 -individual_header_trailer 0 -write_header_trailer 0 -segment_write_temp 1 "/config/transcoding-temp/1D3D92/1D3D92_%d.ts"

03:24:35.254 ffmpeg version 5.0.0-emby_2022_05_27-u1 Copyright (c) 2000-2022 the FFmpeg developers and softworkz for Emby LLC
03:24:35.254   built with gcc 8.3.0 (crosstool-NG 1.24.0)
03:24:35.254 Execution Date: 2022-12-27 03:24:35
03:24:35.265 Input #0, matroska,webm, from '/mnt/Media/Movies/Ghost.in.the.Shell.1995.JAPANESE.2160p.US.UHD.BluRay.x265.10bit.HDR.DTS-HD.MA.TrueHD.7.1.Atmos-SWTYBLZ.mkv':
03:24:35.265   Metadata:
03:24:35.265     title           : Ghost.in.the.Shell.1995.JAPANESE.2160p.US.UHD.BluRay.x265.10bit.HDR.DTS-HD.MA.TrueHD.7.1.Atmos-SWTYBLZ
03:24:35.265     encoder         : libebml v1.4.0 + libmatroska v1.6.1
03:24:35.265     creation_time   : 2020-09-27T01:21:35.000000Z
03:24:35.265   Duration: 01:22:38.98, start: 0.000000, bitrate: 33262 kb/s
03:24:35.265   Stream #0:0: Video: hevc (Main 10), yuv420p10le(tv, bt2020nc/bt2020/smpte2084), 3840x2074 [SAR 1:1 DAR 1920:1037], Level 153, 23.98 fps, 23.98 tbr, 1k tbn (default)
03:24:35.265     Metadata:
03:24:35.265       title           : Ghost.in.the.Shell.1995.JAPANESE.2160p.US.UHD.BluRay.x265.10bit.HDR.DTS-HD.MA.TrueHD.7.1.Atmos-SWTYBLZ
03:24:35.265       BPS-eng         : 14482131
03:24:35.265       DURATION-eng    : 01:22:38.954000000
03:24:35.265       NUMBER_OF_FRAMES-eng: 118896
03:24:35.265       NUMBER_OF_BYTES-eng: 8977028266
03:24:35.265   Stream #0:1(jpn): Audio: truehd, 48000 Hz, 7.1, s32 (24 bit) (default)
03:24:35.265     Metadata:
03:24:35.265       title           : Ghost.in.the.Shell.1995.JAPANESE.2160p.US.UHD.BluRay.x265.10bit.HDR.DTS-HD.MA.TrueHD.7.1.Atmos-SWTYBLZ
03:24:35.265       BPS-eng         : 4155846
03:24:35.265       DURATION-eng    : 01:22:38.954000000
03:24:35.265       NUMBER_OF_FRAMES-eng: 5950744
03:24:35.265       NUMBER_OF_BYTES-eng: 2576081592
03:24:35.265       SOURCE_ID-eng   : 001101
03:24:35.265   Stream #0:2(jpn): Audio: dts (DTS-HD MA), 48000 Hz, 7.1, s32p (24 bit)
03:24:35.265     Metadata:
03:24:35.265       title           : Ghost.in.the.Shell.1995.JAPANESE.2160p.US.UHD.BluRay.x265.10bit.HDR.DTS-HD.MA.TrueHD.7.1.Atmos-SWTYBLZ
03:24:35.265       BPS-eng         : 4443462
03:24:35.265       DURATION-eng    : 01:22:38.976000000
03:24:35.265       NUMBER_OF_FRAMES-eng: 464904
03:24:35.265       NUMBER_OF_BYTES-eng: 2754377696
03:24:35.265   Stream #0:3(jpn): Audio: ac3, 48000 Hz, 5.1(side), fltp, 640 kb/s
03:24:35.265     Metadata:
03:24:35.265       title           : Ghost.in.the.Shell.1995.JAPANESE.2160p.US.UHD.BluRay.x265.10bit.HDR.DTS-HD.MA.TrueHD.7.1.Atmos-SWTYBLZ
03:24:35.265       BPS-eng         : 640000
03:24:35.265       DURATION-eng    : 01:22:38.976000000
03:24:35.265       NUMBER_OF_FRAMES-eng: 154968
03:24:35.265       NUMBER_OF_BYTES-eng: 396718080
03:24:35.265       SOURCE_ID-eng   : 001101
03:24:35.265   Stream #0:4(eng): Audio: truehd, 48000 Hz, 7.1, s32 (24 bit)
03:24:35.265     Metadata:
03:24:35.265       title           : Ghost.in.the.Shell.1995.JAPANESE.2160p.US.UHD.BluRay.x265.10bit.HDR.DTS-HD.MA.TrueHD.7.1.Atmos-SWTYBLZ
03:24:35.265       BPS-eng         : 4431572
03:24:35.265       DURATION-eng    : 01:22:38.954000000
03:24:35.265       NUMBER_OF_FRAMES-eng: 5950744
03:24:35.265       NUMBER_OF_BYTES-eng: 2746995336
03:24:35.265       SOURCE_ID-eng   : 001100
03:24:35.265   Stream #0:5(eng): Audio: dts (DTS-HD MA), 48000 Hz, 7.1, s32p (24 bit)
03:24:35.265     Metadata:
03:24:35.265       title           : Ghost.in.the.Shell.1995.JAPANESE.2160p.US.UHD.BluRay.x265.10bit.HDR.DTS-HD.MA.TrueHD.7.1.Atmos-SWTYBLZ
03:24:35.265       BPS-eng         : 4261798
03:24:35.265       DURATION-eng    : 01:22:38.976000000
03:24:35.265       NUMBER_OF_FRAMES-eng: 464904
03:24:35.265       NUMBER_OF_BYTES-eng: 2641769804
03:24:35.265   Stream #0:6(eng): Audio: ac3, 48000 Hz, 5.1(side), fltp, 640 kb/s
03:24:35.265     Metadata:
03:24:35.265       title           : Ghost.in.the.Shell.1995.JAPANESE.2160p.US.UHD.BluRay.x265.10bit.HDR.DTS-HD.MA.TrueHD.7.1.Atmos-SWTYBLZ
03:24:35.265       BPS-eng         : 640000
03:24:35.265       DURATION-eng    : 01:22:38.976000000
03:24:35.265       NUMBER_OF_FRAMES-eng: 154968
03:24:35.265       NUMBER_OF_BYTES-eng: 396718080
03:24:35.265       SOURCE_ID-eng   : 001100
03:24:35.265   Stream #0:7(eng): Subtitle: subrip, Start-Time 1.376s (default)
03:24:35.265     Metadata:
03:24:35.265       title           : English-SRT
03:24:35.265       BPS-eng         : 69
03:24:35.265       DURATION-eng    : 01:17:24.178000000
03:24:35.265       NUMBER_OF_FRAMES-eng: 880
03:24:35.265       NUMBER_OF_BYTES-eng: 40235
03:24:35.265   Stream #0:8(eng): Subtitle: subrip, Start-Time 1.376s
03:24:35.265     Metadata:
03:24:35.265       title           : English-FORCED-SRT
03:24:35.265       BPS-eng         : 108
03:24:35.265       DURATION-eng    : 00:00:14.462000000
03:24:35.265       NUMBER_OF_FRAMES-eng: 4
03:24:35.265       NUMBER_OF_BYTES-eng: 196
03:24:35.265   Stream #0:9(eng): Subtitle: hdmv_pgs_subtitle, 1920x1080, Start-Time 1.376s
03:24:35.265     Metadata:
03:24:35.265       title           : English-PGS
03:24:35.265       BPS-eng         : 43220
03:24:35.265       DURATION-eng    : 01:17:24.182000000
03:24:35.265       NUMBER_OF_FRAMES-eng: 1766
03:24:35.265       NUMBER_OF_BYTES-eng: 25090692
03:24:35.265       SOURCE_ID-eng   : 0012A0
03:24:35.265   Stream #0:10(eng): Subtitle: hdmv_pgs_subtitle, 1920x1080, Start-Time 1.376s
03:24:35.265     Metadata:
03:24:35.265       title           : English-FORCED-PGS
03:24:35.265       BPS-eng         : 66360
03:24:35.265       DURATION-eng    : 00:00:14.473000000
03:24:35.265       NUMBER_OF_FRAMES-eng: 8
03:24:35.265       NUMBER_OF_BYTES-eng: 120055
03:24:35.265       SOURCE_ID-eng   : 0012A0
03:24:35.265   Stream #0:11(spa): Subtitle: hdmv_pgs_subtitle, 1920x1080, Start-Time 1.376s
03:24:35.265     Metadata:
03:24:35.265       title           : Spanish-PGS
03:24:35.265       BPS-eng         : 41180
03:24:35.265       DURATION-eng    : 01:17:24.182000000
03:24:35.265       NUMBER_OF_FRAMES-eng: 1738
03:24:35.265       NUMBER_OF_BYTES-eng: 23906261
03:24:35.265       SOURCE_ID-eng   : 0012A1
03:24:35.265   Stream #0:12(spa): Subtitle: hdmv_pgs_subtitle, 1920x1080, Start-Time 1.376s
03:24:35.265     Metadata:
03:24:35.265       title           : Spanish-PGS
03:24:35.265       BPS-eng         : 72150
03:24:35.265       DURATION-eng    : 00:00:14.473000000
03:24:35.265       NUMBER_OF_FRAMES-eng: 8
03:24:35.265       NUMBER_OF_BYTES-eng: 130530
03:24:35.265       SOURCE_ID-eng   : 0012A1
03:24:35.265   Stream #0:13(eng): Subtitle: hdmv_pgs_subtitle, 1920x1080, Start-Time 1.376s
03:24:35.265     Metadata:
03:24:35.265       title           : English-PGS
03:24:35.265       BPS-eng         : 48606
03:24:35.265       DURATION-eng    : 01:17:57.215000000
03:24:35.265       NUMBER_OF_FRAMES-eng: 2134
03:24:35.265       NUMBER_OF_BYTES-eng: 28417947
03:24:35.265       SOURCE_ID-eng   : 0012A2
03:24:35.265   Stream #0:14(eng): Subtitle: hdmv_pgs_subtitle, 1920x1080, Start-Time 1.376s
03:24:35.265     Metadata:
03:24:35.265       title           : English-FORCED-PGS
03:24:35.265       BPS-eng         : 66360
03:24:35.265       DURATION-eng    : 00:00:14.473000000
03:24:35.265       NUMBER_OF_FRAMES-eng: 8
03:24:35.265       NUMBER_OF_BYTES-eng: 120055
03:24:35.265       SOURCE_ID-eng   : 0012A2
03:24:35.265   Stream #0:15: Video: mjpeg (Baseline), yuvj444p(pc, bt470bg/unknown/unknown), 120x176, 90k tbr, 90k tbn (attached pic)
03:24:35.265     Metadata:
03:24:35.265       filename        : small_cover.jpg
03:24:35.265       mimetype        : image/jpeg
03:24:35.265   Stream #0:16: Video: mjpeg (Baseline), yuvj444p(pc, bt470bg/unknown/unknown), 213x120, 90k tbr, 90k tbn (attached pic)
03:24:35.265     Metadata:
03:24:35.265       filename        : small_cover_land.jpg
03:24:35.265       mimetype        : image/jpeg
03:24:35.265   Stream #0:17: Video: mjpeg (Baseline), yuvj444p(pc, bt470bg/unknown/unknown), 600x882, 90k tbr, 90k tbn (attached pic)
03:24:35.265     Metadata:
03:24:35.265       filename        : cover.jpg
03:24:35.265       mimetype        : image/jpeg
03:24:35.265   Stream #0:18: Video: mjpeg (Baseline), yuvj444p(pc, bt470bg/unknown/unknown), 1067x600, 90k tbr, 90k tbn (attached pic)
03:24:35.265     Metadata:
03:24:35.265       filename        : cover_land.jpg
03:24:35.265       mimetype        : image/jpeg
03:24:35.268 Stream mapping:
03:24:35.268   Stream #0:0 (hevc) -> format:default (graph 0)
03:24:35.268   format:default (graph 0) -> Stream #0:0 (libx264)
03:24:35.268   Stream #0:1 -> #0:1 (truehd (native) -> ac3 (native))
03:24:35.268 Press [q] to stop, [?] for help
03:24:35.422 [libx264 @ 0xb91340] using SAR=1/1
03:24:35.422 [libx264 @ 0xb91340] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
03:24:35.449 [libx264 @ 0xb91340] profile High, level 5.1, 4:2:0, 8-bit
03:24:35.449 [libx264 @ 0xb91340] 264 - core 163 r3060 5db6aa6 - H.264/MPEG-4 AVC codec - Copyleft 2003-2021 - http://www.videolan.org/x264.html - options: cabac=1 ref=1 deblock=1:0:0 analyse=0x3:0 me=hex subme=0 psy=1 psy_rd=1.00:0.00 mixed_ref=0 me_range=4 chroma_me=1 trellis=0 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=0 threads=48 lookahead_threads=8 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=1 keyint=72 keyint_min=37 scenecut=0 intra_refresh=0 rc_lookahead=10 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 vbv_maxrate=59616 vbv_bufsize=119232 crf_max=0.0 nal_hrd=none filler=0 ip_ratio=1.40 aq=1:1.00
03:24:35.449 Output #0, segment, to '/config/transcoding-temp/1D3D92/1D3D92_%d.ts':
03:24:35.449   Metadata:
03:24:35.449     encoder         : Lavf59.17.100
03:24:35.449   Stream #0:0: Video: h264, yuv420p(tv, bt709, progressive), 3840x2074 [SAR 1:1 DAR 1920:1037], q=2-31, 23.98 fps, 90k tbn
03:24:35.449     Metadata:
03:24:35.449       encoder         : Lavc59.21.100 libx264
03:24:35.449     Side data:
03:24:35.449       cpb: bitrate max/min/avg: 59616000/0/0 buffer size: 119232000 vbv_delay: N/A
03:24:35.449   Stream #0:1(jpn): Audio: ac3, 48000 Hz, 5.1, fltp, 384 kb/s (default)
03:24:35.449     Metadata:
03:24:35.449       encoder         : Lavc59.21.100 ac3
03:24:35.454 elapsed=00:00:00.10 frame=    1 fps=0.0 q=0.0 size=N/A time=00:00:00.00 bitrate=N/A throttle=off speed=   0x    
03:24:35.902 elapsed=00:00:00.61 frame=   29 fps=0.0 q=0.0 size=N/A time=00:00:01.15 bitrate=N/A throttle=off speed=1.86x    
03:24:36.387 elapsed=00:00:01.11 frame=   58 fps= 52 q=0.0 size=N/A time=00:00:02.39 bitrate=N/A throttle=off speed=2.14x    
03:24:36.908 elapsed=00:00:01.62 frame=   92 fps= 57 q=28.0 size=N/A time=00:00:03.84 bitrate=N/A throttle=off speed=2.36x    
03:24:37.396 elapsed=00:00:02.12 frame=  123 fps= 58 q=28.0 size=N/A time=00:00:05.05 bitrate=N/A throttle=off speed=2.38x    
03:24:37.594 [segment @ 0xb292c0] Opening '/config/transcoding-temp/1D3D92/1D3D92.m3u8.tmp' for writing
03:24:37.594 SegmentComplete=video:0 Index=0 Start=0.000000 End=3.003000 Duration=3.003000 offset_pts=0 start_pts=0 Frames=72 filename=1D3D92_0.ts

...

 

Edited by TurkeyMan
Link to comment
Share on other sites

I’m not entirely sure why it is transcoding when it is only an audio issue. I’ll need to look at it in more detail when I’m back home. 

Link to comment
Share on other sites

TurkeyMan
9 minutes ago, SamES said:

I’m not entirely sure why it is transcoding when it is only an audio issue. I’ll need to look at it in more detail when I’m back home. 

Awesome, cheers. There are indeed many threads all over the internet noting this behaviour, so absolutely worth fixing in its own right.

Of course, that's a tangent, and doesn't dismiss the issue I'm trying to raise here in general. I'm certain a better default audio track selection can be made with an extremely low error rate. Media groups are very aware that LG TV's exist. I almost never see a mux with TrueHD as default and without AC3 next to it; presumably included because they understand that LG TV's exist. It needs to be selected correctly, improving audio quality, and reducing unnecessary burden on the server machine.

Edited by TurkeyMan
Link to comment
Share on other sites

1 hour ago, TurkeyMan said:

I'm certain a better default audio track selection can be made with an extremely low error rate. Media groups are very aware that LG TV's exist. I almost never see a mux with TrueHD as default and without AC3 next to it; presumably included because they understand that LG TV's exist. It needs to be selected correctly, improving audio quality, and reducing unnecessary burden on the server machine.

This is a design philosophy, which @Lukewould have to comment on. Samsung TVs have the same issues and limitations, and the track selection logic is the same as used in LG and all the other Emby clients. 

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...