Kodi Community Forum

Full Version: Add support for identifying Atmos and DTS:X now that ffmpeg supports that.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
There have been three recent commits to ffmpeg, about three weeks after 6.0 final release:

TrueHD - https://git.ffmpeg.org/gitweb/ffmpeg.git...91450c4e60
DD+ - https://git.ffmpeg.org/gitweb/ffmpeg.git...575e5c32f2
DTS:X - https://git.ffmpeg.org/gitweb/ffmpeg.git...ab39b5214e

With these, ffmpeg and ffprobe should hopefully provide the info needed to properly add object-based codec info in the database, when scanning video content. I know that they identify the codecs correctly, I've tested it.
Can't be 100% sure that's what's needed for Kodi to do the same but logic would suggest so.

Now, reading Omega Alpha's release notes, I notice the following:

Use upstream FFmpeg. This is a big achievement and allows easier FFmpeg updates in the future.
Update to version 6.0


Since those three commits happened literally days after ffmpeg 6.0 final was released, I hope that importing them to Kodi's version could prove not too time-consuming.

And it would bring a feature that's been requested many times in the past.
Those ffmpeg git links are truncated so don't provide a real url.
You also mentioned you tested it, please explain how?

Once Kodi is at a version where the included ffmpeg supports detecting those, then I believe it would be relatively straightforward to add. Might be something I'd be willing to look at once the ffmpeg probe in the debug log shows these. I don't have great C++ skills but hopefully would be mostly a c&p job using the addition of other codec flags as a template.
Sorry for the truncated links, I've fixed them in the OP.

@jjd-uk when I say I tested it I meant I used ffprobe (from up to date ffmpeg builds, both on Linux and Windows) on files with appropriate content and now ffprobe correctly identifes the audio streams as (examples):

Stream #0:1(eng): Audio: truehd (Dolby TrueHD + Dolby Atmos), 48000 Hz, 7.1, s32 (24 bit)
Stream #0:1(eng): Audio: eac3 (Dolby Digital Plus + Dolby Atmos), 48000 Hz, 5.1(side), fltp, 768 kb/s
Stream #0:1(eng): Audio: dts (DTS-HD MA + DTS:X), 48000 Hz, 7.1, s32p (24 bit)

I referred to the "allowing easier ffmpeg updates" in the Omega alpha release description because, unfortunately, those three commits happened right after 6.0 was declared final. As such... it's... so close, yet so far. And I wondered whether they could be backported to Kodi's ffmpeg 6 used in Omega.
Asking too much? :-)
Nope no chance of any backport, but I would think a ffmpeg 6.1 would be available way before we start finalising v21 Omega.
(2023-06-10, 21:13)jjd-uk Wrote: [ -> ]Nope no chance of any backport

One day I will understand the ffmpeg/Kodi integration process. During the years it always appeared to me as super-inflexible. I hoped that the Omega Alpha announcement pointed to a change for this.
But as I said, I simply do not understand it, it's not that I deem it unreasonable. It's plain ignorance on my part. :-)
 
(2023-06-10, 21:13)jjd-uk Wrote: [ -> ]I would think a ffmpeg 6.1 would be available way before we start finalising v21 Omega
Crossing all fingers!
Well as we're in alpha no will go to the trouble yet if doing any ffmpeg backports yet, as ffmpeg can updated all the way up to last Beta, so there los of opportunity for any ffmpeg 6.1, 6.2 etc, or perhaps even an ffmpeg 7.0 depending on how long we take to get to the last beta. It's normal that ffmpeg gets updated multiple times during a release cycle. Ffmpeg backports will only be considered for anything vital once we gets towards RC.
We're at Beta 1 for Kodi 21 and FFMPEG is still at 6.0.

I am checking daily on their webpage to see whether they've released 6.1 or something... Big Grin
Well if they tag a new release before we get to RC there's a good chance we'll bump, as ogg files are broken by ffmpeg 6.0 and there's a fix that is currently only in ffmpeg master.
What I was wondering: They've implemented methods to detect and report Atmos based on DD+ as well as TrueHD and DTS:X based on DTS-HD MA (usually called DTS:X Master). But there's a fourth format missing here: DTS:X based on DTS-HD HRA.

Not to forget: Where is AURO-3D? While it's a great thing to finally get actual file based 3D audio detection, it's a little disappointing that certain formats are missing...
(2023-11-30, 12:41)Chillbo Wrote: [ -> ]What I was wondering: They've implemented methods to detect and report Atmos based on DD+ as well as TrueHD and DTS:X based on DTS-HD MA (usually called DTS:X Master). But there's a fourth format missing here: DTS:X based on DTS-HD HRA.

Not to forget: Where is AURO-3D? While it's a great thing to finally get actual file based 3D audio detection, it's a little disappointing that certain formats are missing...
Yes they have. there seperate profiles for EAC3 Atmos and TrueHD Atmos see https://github.com/FFmpeg/FFmpeg/blob/ma...1631-L1633

We can only report what ffmpeg supports, and Auro-3D has not been added yet.
Quick update, ffmpeg recently released 2 new versions. a 6.0.1 which is a maintenance release (bug fixes only) and a 6.1 feature release (both feature updates and bug fixes), and the neccessary code in ffmpeg is only in the 6.1 feature release. However as we are so close to getting v21 Omega released, the decision was taken to only take the 6.0.1 maintenance release which means this can't be done for for v21 Omega.

If anyone can build ffmpeg for themselves then I have the Kodi code partly done, it may or may not work as it's been coded blind as I'm not able to test, see https://github.com/jjd-uk/xbmc/commit/b2...ffa3448f9b Note the flags in Estuary have not been added yet, so on it's own it will only mean you may get the correct audio type reported in the log and maybe in player process.
(2023-11-30, 14:47)jjd-uk Wrote: [ -> ]Yes they have. there seperate profiles for EAC3 Atmos and TrueHD Atmos see https://github.com/FFmpeg/FFmpeg/blob/ma...1631-L1633

We can only report what ffmpeg supports, and Auro-3D has not been added yet.

As mentioned, I'm aware they're differentiating the types of Atmos there are. But they're not differentiating the types of DTS:X... There are also two types of that.

The comment was merely about the ffmpeg changes or the lack of changes regarding some 3D audio formats. Obviously, Kodi relies on what ffmpeg supports.
When it comes to DTS:X, ffmpeg identifies DTS_HD_MA_X and DTS_HD_MA_X_IMAX and those are the only 2 versions I've personally seen, do you have something in your possesion with DTS-X based on DTS-HD HRA?
Pages: 1 2 3