MediaArea / MediaInfoLib

Convenient unified display of the most relevant technical and tag data for video and audio files.
https://mediaarea.net/MediaInfo
BSD 2-Clause "Simplified" License
638 stars 177 forks source link

Identify AVC Intra vs XAVC #2124

Closed joe-sciame-wm closed 1 month ago

joe-sciame-wm commented 1 month ago

We were looking at mapping MediaInfo data to our own internal data model. We have an issue where we need to identify AVC Intra vs XAVC. When looking at exports from one application (Adobe Media Encoder) for each codec, I could not readily tell the difference between the files in terms of identifying one as AVC Intra and the other as XAVC.

Do you know if there is a reliable way to differentiate? On our end, our downsteam encoder can process AVC Intra (Panasonic) correctly but has trouble with XAVC (Sony).

I'll send files over to you out of band.

JeromeMartinez commented 1 month ago

For AVC-Intra, we try to detect that and we show "AVC-Intra xx" (xx = 50 or 100) in Format_Commercial_IfAny when we catch it.

About XAVC, I find only marketing blabla, no real technical limitations beside max level / max bitrate, so can be same as Panasonic AVC-Intra.

Checking https://en.wikipedia.org/wiki/AVC-Intra after few years, I see that there is an update in the Panasonic constraints: "CAVLC entropy coding only." for AVC-Intra 100. We have it (Format_Settings_CABAC is "No") but not in the AVC-Intra check, we'll add it. "Panasonic's implementation of AVC-Intra codec has following limitations: 8 × 8 transform only, 8 × 8 intra prediction only, 10 slices per picture, MBAFF for interlace material, custom quantization matrices for each class and each resolution" Here we have Format_Settings_SliceCount in the output. We already parse transform_8x8_mode_flag & quantization matrices & MBAFF, we could add a check there and flag as Panasonic AVC-Intra only if quantization matrices are the Panasonic ones, small dev. 8 × 8 intra prediction hint seems deeper in the bitstream, more complicated (so more expensive).

JeromeMartinez commented 1 month ago

From the files you provided, I currently see:

custom quantization matrices are same. I didn't check intra prediction (too far in the bitstream, I don't see it).

So for the moment the only diff which could impact is the slices count.

I will update MediaInfo for showing AVC-Intra in the commercial name field when there are 10 slices (it was expected to be the case already but current code works only with Clip MXF, not Frame MXF).

JeromeMartinez commented 1 month ago

Snapshots have this PR.

joe-sciame-wm commented 3 weeks ago

Thanks Jerome! Confirmed in latest snapshots. Do you have any cases where you display the commercial name as XAVC?

Commercial name : AVC-Intra 100 Commercial name : AVC-Intra 100 Format profile : High 4:2:2 Intra@L4.1

JeromeMartinez commented 3 weeks ago

Do you have any cases where you display the commercial name as XAVC?

There is currently no display of XAVC commercial name as we didn't find any technical limitation permitting to narrow to XAVC limitations. But in the meantime with found SMPTE RDD 32 "XAVC MXF Mapping and Operating Points" which has some tips about AVC constraints in addition to the MXF ones.

For example:

Questions:

joe-sciame-wm commented 2 weeks ago

Hi Jerome, Yes, we'd be interested in this. We want to be able to tag content with the appropriate tag internally so if you have a way to distinguish and show the correct commercial name then we'd be open to it.