Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

avcodec: add ac-4 decoder #387

Draft
wants to merge 5 commits into
base: jellyfin
Choose a base branch
from
Draft

avcodec: add ac-4 decoder #387

wants to merge 5 commits into from

Conversation

gnattu
Copy link
Member

@gnattu gnattu commented May 2, 2024

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 gnattu requested a review from a team May 2, 2024 16:15
@nyanmisaka nyanmisaka marked this pull request as draft May 3, 2024 01:36
@nyanmisaka
Copy link
Member

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

@gnattu
Copy link
Member Author

gnattu commented May 3, 2024

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
Copy link
Member

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
Copy link
Member Author

gnattu commented May 3, 2024

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.

Experimental. Decoder only. Remuxing is limited to mpegts containers.
- avcodec/ac4dec_data: declare qwin aligned as required by vector_fmul
- avcodec/ac4dec: avoid division by zero
- avcodec/ac4dec: fix channel mapping for 5.1 decode w/ 2ch_mode
- avformat/ac4dec: fix order of operations
- avcodec/utils: add ac4 frame duration
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable To Decode ATSC 3.0 AC-4 Audio
3 participants