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

Implement AC-4 audio format #1985

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
Open

Implement AC-4 audio format #1985

wants to merge 13 commits into from

Conversation

valib
Copy link
Contributor

@valib valib commented Apr 23, 2020

No description provided.

@valib valib added the awaiting dependency fix This can't be merged until one of our dependencies fixes something label Apr 23, 2020
@valib valib added this to In progress in Universal Media Server May 28, 2020
@valib valib moved this from In progress to To do in Universal Media Server May 28, 2020
@valib valib moved this from To do to In progress in Universal Media Server May 28, 2020
@valib valib requested a review from SubJunk April 27, 2022 20:27
@@ -231,6 +231,11 @@ public void testContainerProperties() throws Exception {
"Container: MKV, Size: 7799945, Overall Bitrate: 10372267, Video Tracks: 1, Video Codec: h265, Duration: 0:00:06.016, Video Resolution: 1920 x 1080, Display Aspect Ratio: 16:9, Frame Rate: 59.940, Frame Rate Mode: CFR (CFR), Frame Rate Mode Raw: CFR, Matrix Coefficients: BT.2020 non-constant, Video Bit Depth: 10, Audio Tracks: 1 [Audio Codec: Enhanced AC-3, Bitrate: 640000, Channels: 6, Sample Frequency: 48000 Hz], Mime Type: video/x-matroska"
);
break;
case 24:
assertThat(mediaInfo.toString()).isEqualTo(
"Container: MP4, Size: 23449234, Overall Bitrate: 2608913, Video Tracks: 1, Video Codec: h264, Duration: 0:01:11.905, Video Resolution: 1280 x 720, Display Aspect Ratio: 16:9, Scan Type: Progressive, Frame Rate: 29.970, Frame Rate Mode: CFR (CFR), Frame Rate Mode Raw: CFR, Reference Frame Count: 2, AVC Level: 4, AVC Profile: main, Audio Tracks: 1 [Audio Codec: ac4, Bitrate: 128000, Channels: 2, Sample Frequency: 48000 Hz], Mime Type: video/mp4"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This shows that we are incorrectly detecting it as 2 channels. I can see in MediaInfo that it correctly detects 5.1 channels so this is our bug

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SubJunk I checked the code and it seems to me that this is a MediaInfo bug not ours. For this particular media it is not returning channels number only channel mode (5.1) and channel layout. When the MediaInfo returns an empty string for "Channel(s)" the UMS sets the default number to 2. When I introduced this PR the test was working because there was a previous MediaInfo version

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@valib I did a bit of reading online and I think that is the way AC-4 works. It can have "substreams" so I think one audio track can have different channels. I'm not exactly sure of the details. There are some more samples here but I don't think they have multiple substreams either https://trac.ffmpeg.org/ticket/8349
Maybe we should parse that "channel mode" instead for this

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SubJunk it seems to me that there is not such parameter to get this value. It works for audio but there is not parameter for substreams. Tested and it returns empty string.

Universal Media Server automation moved this from In progress to Review in progress Apr 28, 2022
@valib
Copy link
Contributor Author

valib commented May 6, 2024

Latest MediaInfo detects audio channels correctly. It also detects substreams but we don't use it. I have no idea how to offer it to renderers.

@valib valib removed awaiting dependency fix This can't be merged until one of our dependencies fixes something conflicting labels May 6, 2024
@SubJunk
Copy link
Member

SubJunk commented May 7, 2024

@valib what is the goal of this PR? To support renderer configs having "ac4" in the "supported" lines?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Universal Media Server
  
Review in progress
Development

Successfully merging this pull request may close these issues.

None yet

3 participants