[Libav-user] Packet containing different content than expected when using DV container

Info || Non-Lethal Applications info at non-lethal-applications.com
Wed Oct 22 11:53:13 CEST 2014


I’m having problems with my own movie player I wrote using the FFmpeg libraries.
The problem appears with a test DV clip created by Apple’s Compressor. It’s a generated clip, so I can upload it if it helps.

Let me quickly outline what I’m doing:

- I read video frames into a frame queue which is used as a source for playback
- I read audio samples into a ring buffer which is used as a source for playback

To not risk audio dropouts, I’m reading about 200 ms audio samples more than I would need to display the respective video frames.
While reading audio samples, I’m storing all video packets that come along in a video packet queue.
When the next video frame is requested, I’m searching the queue first and read from the file only when the queue is empty.
This procedure worked fine for all other formats I’ve been working with so far (mostly MOV and MXF).

I’ve been analyzing the issue for a couple of hours now and it seems to me that the packets that I put to the queue contain different content when I decode them later on.
Actually, it seems that all packets in the queue decode to the frame that would be next in line when reading from the file.

Is there anything I could do to prevent this from happening?
As I said I would be happy to upload the file. It’s 2 minutes of DV PAL, about 430 MB in size. I could make it smaller.

Thanks in advance!

Best,

Flo


More information about the Libav-user mailing list