jellyfin / jellyfin-ffmpeg

FFmpeg for Jellyfin
https://jellyfin.org
Other
477 stars 127 forks source link

avcodec: add ac-4 decoder #387

Closed gnattu closed 2 months ago

gnattu commented 5 months ago

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

nyanmisaka commented 5 months ago

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

gnattu commented 5 months ago

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?

nyanmisaka commented 5 months ago

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

gnattu commented 5 months ago

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 commented 2 months ago

I think this is ready for merge now.

Gauvino commented 2 months ago

The documentation needs to ne update too no ?

williamthrilliam commented 2 months ago

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

gnattu commented 2 months ago

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