[FFmpeg-user] Detecting I-frames inside a transport stream!!

Stefano Sabatini stefasab at gmail.com
Thu Sep 12 09:35:34 CEST 2013

On date Monday 2013-09-09 03:56:57 -0700, tadar wrote:
> Greetings,
> I am working on Transport Stream. I am writing a C program that breaks the
> payload data(making the bits '0') of the transport stream packets(packets of
> 188 bytes) by the percentage given by the user. But I need to find the bytes
> that belongs to I-frames so that I do not break them.
> Can anyone please tell me(in detail please), how can I find the I-frame's
> inside an MPEG-4 transport stream file, or is it not possible?

Tentative approach: you read all packets, select key packets and check
the pos field. Something you can do with ffprobe -show_packets.

Note that you could make use of a bitstream filter, make sure to post
the code for inclusion in case you get something generically useful.

More information about the ffmpeg-user mailing list