Skip to content

Avc1Box ignore non-AvcC boxes#105

Open
algesten wants to merge 2 commits intoalfg:masterfrom
algesten:fix/avc1-pasp
Open

Avc1Box ignore non-AvcC boxes#105
algesten wants to merge 2 commits intoalfg:masterfrom
algesten:fix/avc1-pasp

Conversation

@algesten
Copy link
Copy Markdown

Hi! Thanks for making this library!

When using an mp4-file encoded by AWS Transcoder, we get an error reading it avcc not found. The problem is that Avc1Box expects the first child to be the AvcC box, and it isn't.

Using exiftool -v2 we see there is a pasp box first:

  | | | | + [SampleTable directory]
  | | | | | VideoSampleDesc (SubDirectory) -->
  | | | | | - Tag 'stsd' (192 bytes)
  | | | | | + [BinaryData directory, 94 bytes]
  | | | | | | CompressorID = avc1
  | | | | | | - Tag 0x0002 (4 bytes, string[4])
  | | | | | | VendorID = 
  | | | | | | - Tag 0x000a (4 bytes, string[4])
  | | | | | | SourceImageWidth = 1920
  | | | | | | - Tag 0x0010 (2 bytes, int16u[1])
  | | | | | | SourceImageHeight = 1080
  | | | | | | - Tag 0x0011 (2 bytes, int16u[1])
  | | | | | | XResolution = 72
  | | | | | | - Tag 0x0012 (4 bytes, fixed32u[1])
  | | | | | | YResolution = 72
  | | | | | | - Tag 0x0014 (4 bytes, fixed32u[1])
  | | | | | | CompressorName = .Elemental H.264
  | | | | | | - Tag 0x0019 (32 bytes, string[32])
  | | | | | | BitDepth = 24
  | | | | | | - Tag 0x0029 (2 bytes, int16u[1])
  | | | | | + [VideoSampleDesc directory]
  | | | | | | PixelAspectRatio = ..
  | | | | | | - Tag 'pasp' (8 bytes)
  | | | | | | AVCConfiguration = .B.2..''B.2.....?.. } .L..U....U.p...d...(.. 
  | | | | | | - Tag 'avcC' (54 bytes)

This PR makes it so Avc1Box loops children and skips any that isn't the AvcC box.

@algesten
Copy link
Copy Markdown
Author

The lint error doesn't relate the PR I think.

@sabuty
Copy link
Copy Markdown

sabuty commented Nov 18, 2023

The state of the PR is confusing to me. Somehow, the PR's commits have not ended up in the master branch and are not part of version 0.14.0 of this create. Can you please check this?

Update: Somehow a different fix for this issue already is in the master branch, just not yet released towards crates.io.

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.

3 participants