[Libav-user] AVPacket->data mystery

Sampsa Riikonen sampsa.riikonen at iki.fi
Tue Nov 15 21:57:10 EET 2016


Hi,

I am reading AVPacket's from

(1) "video.h264" raw H264 video file
(2) "video.mkv" matroska video file

In case (1), AVPacket->data looks like this:
0 0 0 1 103 66 128 ...
0 0 0 1 65 154 0 ...
etc. i.e. they look like legitimate H264 slices/frames

In case (2), AVPacket->data looks weird/corrupted:
0 0 0 20 103 66 128 ..
0 0 52 80 65 154 0 ..
i.e. the first four bytes, that should be "0 0 0 1", are something else..

What is going on?

When trying to decode such AVPacket's I get:

[h264 @ 0x1596ae0] No start code is found.
[h264 @ 0x1596ae0] Error splitting the input into NAL units.


Regards,

Sampsa



More information about the Libav-user mailing list