Replies: 1 comment
-
A demuxer should always yield complete packets as they are muxed. In this case, it sounds like the IMA4 codec always produces/consumes 64 frame packets. Therefore, 64 frame packets should've been muxed into the file, thus, when demuxing you should yield packets containing those 64 frames. Now, duration is a trickier because here the concept of gapless playback comes in. Yes, the encoded duration is always 64 frames, however, the container may signal that not all of those 64 frames are valid. In your example, the container indicated that only 5 are valid. This is where the Gapless playback in Symphonia can be enabled or disabled, so there's a fork in how a demuxer populates packet based on that option. If gapless playback is not enabled:
If gapless playback is enabled:
Note that in both cases all 3 fields sum to the total encoded duration of 64. For the demuxers and decoders that support gapless playback, this is the current behaviour. In regards to the next part: If you encounter an end-of-file (EOF) condition before you finish reading a complete packet, then the expectation is to return an Hope this helps! |
Beta Was this translation helpful? Give feedback.
-
I have a CAF file with the IMA4 codec, which is currently not supported.
I have some questions about how the demuxer should handle incomplete packets.
The IMA4 codec has a fixed number of 64 frames per packet. For mono audio, each frame is 4 bits, and the packet size is 34 bytes: 2 bytes for the preamble and 32 bytes for frame data.
The CAF file format can specify the total number of valid frames. For example, consider a file with a single 34-byte packet where the metadata indicates that only 5 frames are valid.
How should this packet be returned? Here are the options:
Now, imagine it’s a stream, and the demuxer has only managed to read 3 bytes. Should the demuxer:
Should this behaviour be consistent across demuxers which support incomplete packets?
Beta Was this translation helpful? Give feedback.
All reactions