Skip to content

Commit

Permalink
Make Mp4Box support AV3A format.
Browse files Browse the repository at this point in the history
  • Loading branch information
rabbitknight committed Nov 6, 2024
1 parent 44dd585 commit 63252c0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,9 @@ public abstract class Mp4Box {
@SuppressWarnings("ConstantCaseForConstants")
public static final int TYPE_apco = 0x6170636f;

@SuppressWarnings("ConstantCaseForConstants")
public static final int TYPE_av3a = 0x61763361;


public final int type;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1043,7 +1043,8 @@ private static StsdData parseStsd(
|| childAtomType == Mp4Box.TYPE_ulaw
|| childAtomType == Mp4Box.TYPE_Opus
|| childAtomType == Mp4Box.TYPE_fLaC
|| childAtomType == Mp4Box.TYPE_iamf) {
|| childAtomType == Mp4Box.TYPE_iamf
|| childAtomType == Mp4Box.TYPE_av3a) {
parseAudioSampleEntry(
stsd,
childAtomType,
Expand Down Expand Up @@ -1840,6 +1841,8 @@ private static void parseAudioSampleEntry(
mimeType = MimeTypes.AUDIO_TRUEHD;
} else if (atomType == Mp4Box.TYPE_iamf) {
mimeType = MimeTypes.AUDIO_IAMF;
} else if (atomType == Mp4Box.TYPE_av3a) {
mimeType = MimeTypes.AUDIO_AV3A;
}

@Nullable List<byte[]> initializationData = null;
Expand Down

10 comments on commit 63252c0

@FongMi
Copy link

@FongMi FongMi commented on 63252c0 Nov 11, 2024

Choose a reason for hiding this comment

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

大佬,有空可以跟进这个修正吗?
androidx#1843
感谢

@rabbitknight
Copy link
Owner Author

Choose a reason for hiding this comment

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

大佬,有空可以跟进这个修正吗? androidx#1843 感谢

不好意思 最近可能有点忙,我会关注这个的

@FongMi
Copy link

@FongMi FongMi commented on 63252c0 Dec 4, 2024

Choose a reason for hiding this comment

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

大神您好,我有個群友說使用這個版本後,音軌 MP2 格式沒有聲音,他設備是投影機,請問這有可能是什麼問題?
他使用 "沒有 av3a 的版本" 就有聲音。

測試地址
http://175.146.122.104:8888/udp/232.0.0.27:1234,1.03

@FongMi
Copy link

@FongMi FongMi commented on 63252c0 Dec 17, 2024

Choose a reason for hiding this comment

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

大老您好,這個地址好像會出現 ffmpeg 解碼錯誤,再請您有空看看。
http://125.69.183.125:666/udp/239.132.1.87:5000

@rabbitknight
Copy link
Owner Author

Choose a reason for hiding this comment

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

大老您好,這個地址好像會出現 ffmpeg 解碼錯誤,再請您有空看看。 http://125.69.183.125:666/udp/239.132.1.87:5000

Image
看起来是 这个音轨的 init 数据提取问题。和 ffmpeg、mediacodec 本身行文无关。

Image

@rabbitknight
Copy link
Owner Author

Choose a reason for hiding this comment

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

大神您好,我有個群友說使用這個版本後,音軌 MP2 格式沒有聲音,他設備是投影機,請問這有可能是什麼問題? 他使用 "沒有 av3a 的版本" 就有聲音。

測試地址 http://175.146.122.104:8888/udp/232.0.0.27:1234,1.03

这个测试地址 已经无效了。
另外估计和之前使用的是主干版本。av3a 是基于 1.14.1版本有关。

@FongMi
Copy link

@FongMi FongMi commented on 63252c0 Dec 18, 2024

Choose a reason for hiding this comment

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

@rabbitknight
Copy link
Owner Author

Choose a reason for hiding this comment

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

@FongMi ffmpeg 解码错误的问题,看起来与 androidx#695 有关。
并且 有 PR 对其进行修复:https://github.com/androidx/media/pull/722。

@rabbitknight
Copy link
Owner Author

Choose a reason for hiding this comment

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

Image http://125.69.183.125:666/udp/239.132.1.87:5000 我這邊連播都不能播

不能播是正常的。
我在截图的位置 把 audioSpecificConfig 手动指定了一下,才可以的 O.O

@FongMi
Copy link

@FongMi FongMi commented on 63252c0 Dec 18, 2024

Choose a reason for hiding this comment

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

原來如此,感謝大佬花時間排查。

Please sign in to comment.