Skip to content

APV: Initial support#2458

Open
cjee21 wants to merge 2 commits intoMediaArea:masterfrom
cjee21:apv
Open

APV: Initial support#2458
cjee21 wants to merge 2 commits intoMediaArea:masterfrom
cjee21:apv

Conversation

@cjee21
Copy link
Contributor

@cjee21 cjee21 commented Oct 13, 2025

Specification and samples: https://github.com/AcademySoftwareFoundation/openapv
More info: https://developer.android.com/about/versions/16/features#apv

Samples in MP4 can be generated with FFmpeg:

ffmpeg -f lavfi -i testsrc=d=10:s=3840x2160:r=60 -pix_fmt yuv422p10le -c:v liboapv -preset slow

or for color_description_present_flag = 1:

ffmpeg -f lavfi -i testsrc=d=10:s=3840x2160:r=60 -pix_fmt yuv422p10le -vf "setparams=color_primaries=bt709:color_trc=bt709:colorspace=bt709" -c:v liboapv -preset slow

@cjee21
Copy link
Contributor Author

cjee21 commented Dec 6, 2025

Samples in MP4 from Android CTS: https://dl.google.com/android/xts/cts/tests/media/CtsMediaV2TestCases-5.11.zip

This PR should be enough for showing important info for APV in MP4 that will be produced from 2026 Android phones.

@cjee21 cjee21 changed the title MP4: Identify APV MP4: Initial APV support Dec 6, 2025
@JeromeMartinez
Copy link
Member

I would prefer to have a dedicated source file for APV, similar to AV2, and to put apvC parsing code in it (similar to e.g. hvcC parsing).

bool color_description_present_flag, full_range_flag;
Skip_B1( "configurationVersion");
Get_B1 (number_of_configuration_entry, "number_of_configuration_entry");
for (int8u i = 0; i < number_of_configuration_entry; ++i) {
Copy link
Member

Choose a reason for hiding this comment

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

Generaly speaking, remove the [i] and [i][j] stuff, ad "Element_Begin1("configuration_entry")" and "Element_Begin1("frame_info")" and the corresponding "Element_End0()" instead, for a nicer trace.

@cjee21
Copy link
Contributor Author

cjee21 commented Feb 8, 2026

I would prefer to have a dedicated source file for APV, similar to AV2, and to put apvC parsing code in it (similar to e.g. hvcC parsing).

Since it is likely that 2026 Android devices that support APV will use APV in MP4 and the information from apvC seems enough, I did not plan to add a APV parser or parse the raw APV files so I just put it here like some of the other codecs in order to not have to add more files and modify many files.

@cjee21 cjee21 changed the title MP4: Initial APV support APV: Initial support Feb 12, 2026
@cjee21
Copy link
Contributor Author

cjee21 commented Feb 12, 2026

I would prefer to have a dedicated source file for APV, similar to AV2, and to put apvC parsing code in it (similar to e.g. hvcC parsing).

Now I split it into separate parser and started adding support for raw bitstreams. Still expanding the parsing.

@cjee21 cjee21 force-pushed the apv branch 4 times, most recently from f2e8f86 to 7fc44ac Compare February 12, 2026 16:05
@cjee21
Copy link
Contributor Author

cjee21 commented Feb 12, 2026

@JeromeMartinez parsing can be considered done.

The following remains:

  • Filling Y/YUV/RGB. I am not sure about this.
  • Handling finishing (right now does not stop parsing). You may be able to do this better.
  • Handling case where stream has more than one group/pbu_type with different characteristics. You may have better idea on how to handle as well.
  • Using ITU T35 parser (again) to handle the HDR10+ metadata. Right now does not detect HDR10+ in a test sample.

@JeromeMartinez
Copy link
Member

Filling Y/YUV/RGB. I am not sure about this.

Could you provide a couple of samples?

Using ITU T35 parser (again) to handle the HDR10+ metadata.

they put it everywhere!
I split the T35 parser soon.

@cjee21
Copy link
Contributor Author

cjee21 commented Feb 12, 2026

All samples are from links in post 1 and 2 above. Other samples can be made using FFmpeg which can encode APV.

PS actually AV2 has subsampling position as well but I also do not really know about that so did not fill to prevent filling wrong info.

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.

2 participants