jellyfin-ffmpeg icon indicating copy to clipboard operation
jellyfin-ffmpeg copied to clipboard

avcodec: add ac-4 decoder

Open gnattu opened this issue 9 months ago • 4 comments

Changes

Added the AC-4 decoder for ATSC 3.0 audio. Experimental. Decoder only. Remuxing is limited to mpegts containers and in my opinion should not be used and always convert into a more compatible format for jellyfin use cases.

Should not be enabled until at least Jellyfin 10.10 in my opinion.

Tested with sample files provided on dolby's website: https://ott.dolby.com/OnDelKits/AC-4/Dolby_AC-4_Online_Delivery_Kit_1.5/help_files/topics/kit_wrapper_MP4_multiplexed_streams.html

Support currently limited to common channel configurations. Dolby Atmos features like 5.1.4 channel configuration (5.1 channel with additional overhead channels) and AC4-IMS is not supported.

Issues

Fixes #311 Closes #128

gnattu avatar May 02 '24 16:05 gnattu

Can this be easily ported to FFmpeg 7.0+? Will this cause existing fate tests to fail?

nyanmisaka avatar May 03 '24 01:05 nyanmisaka

Can this be easily ported to FFmpeg 7.0+? Will this cause existing fate tests to fail?

The demuxer and encoder is already in the 7.0, so the only thing need to be ported is the decoder itself. Is there even fate tests for AC4 yet?

gnattu avatar May 03 '24 01:05 gnattu

Can this be easily ported to FFmpeg 7.0+? Will this cause existing fate tests to fail?

The demuxer and encoder is already in the 7.0, so the only thing need to be ported is the decoder itself. Is there even fate tests for AC4 yet?

I think you mean de/muxer (libavformat). Then this should be easy enough to maintain for decoding purposes, hopefully there won't be more breaking changes.

Raw AC-4 muxer and demuxer

I would have thought there might be some tests in richardpl's fork. But due to some personal reasons, he deleted the repo.

https://github.com/richardpl/FFmpeg/tree/ac4

nyanmisaka avatar May 03 '24 02:05 nyanmisaka

I think you mean de/muxer (libavformat). Then this should be easy enough to maintain for decoding purposes, hopefully there won't be more breaking changes.

Yes, the libavformat one. I did not port the muxer because I just want to enable transcode to prevent all kinds of compatibility issues.

Also, I just finished the 7.0 port and I do have a ready-to-go working tree based on the release/7.0 branch.

I would have thought there might be some tests in richardpl's fork. But due to some personal reasons, he deleted the repo.

I checked on upstream ffmpeg, there is none in the 7.0 branch yet.

gnattu avatar May 03 '24 02:05 gnattu

I think this is ready for merge now.

gnattu avatar Jul 16 '24 08:07 gnattu

The documentation needs to ne update too no ?

Gauvino avatar Jul 16 '24 12:07 Gauvino

Holy crap! How do I get this? Has it been merged into the jellyfin-ffmpeg6 ppa?

williamthrilliam avatar Jul 20 '24 01:07 williamthrilliam

AC-4 audio might carry weird sample rate that most audio encoders will reject/works incorrectly so if you want to use it in CLI to convert audio you probably will want to resample it with a common sample rate like -ar 48000.

To get a deb for ffmpeg builds contains this change, you can download artifacts from here:

https://github.com/jellyfin/jellyfin-ffmpeg/actions/runs/9956706273

If you want to use this with jellyfin server then it is useless without the server changes, which has no published builds yet. It will come in this week's unstable build, where you can get from repo.jellyfin.org

gnattu avatar Jul 20 '24 02:07 gnattu