[Libav-user] How to add a skip frame to a MKV file?

Seungyong Kwon sykwon66 at gmail.com
Thu Apr 25 10:46:54 EEST 2019


I'm writing a program which writes a MKV file.
For some reason writing a packet to a file is done by calling
av_write_frame instread of av_interleaved_write_frame which
inserts skip frames automatically.

For an AVI file an AVPacket having size 0 and data NULL is a skip
frame and I tried same method to my program. However doing so for
a MKV file caused error. So I changed to write an AVPacket having
size 4 and data of simple byte sequence like 0x0, 0x0, 0x0, 0x1.
However files created that way cannot be played by VLC or WMP
although players like PotPlayer could play.
It seemed to me that filling such skip packets were not valid.

If so what is a valid way of inserting skip frames to MKV files
when using av_write_packet?

Thanks in advance,

More information about the Libav-user mailing list