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

Tobias Rapp t.rapp at noa-archive.com
Thu Apr 25 11:20:45 EEST 2019


On 25.04.2019 09:46, Seungyong Kwon wrote:
> Hello,
> 
> 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?

Have you tried just sending the next packet with an increased PTS? As 
far as I remember Matroska stores the timestamp for each packet (in 
microseconds) while AVI does not. So dummy fill packets should not be 
necessary for Matroska.

Regards,
Tobias



More information about the Libav-user mailing list