Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: AV_PES format - How can I detect frames?



David Podeur wrote:
> 
> > > In order to do this I have written a small program (see attachment)
> > > that detects the data blocks in an AV_PES data stream and lists the
> > > first few bytes of every block to stdout. The headers of these AV_PES
> > > data blocks, however, don't appear to contain any information
> > > on whether a new frame starts in this block, and wether that is
> > > an 'I', 'P' or 'B' frame (being able to identify 'I' frames would
> > > do for my purpose). So that information must be stored in the data
> > > contained within the AV_PES blocks.
> 
> > so what you REALLY want to do is: find thestart of a GOP (group
> > of pictures)
> 
> > 1) skip AV_PES header
> > 2) skip PES header
> > 3) if data==0x000001b3 -> GOP found
> 
> In attachment, a small piece of code i once wrote to check the nature of
> mpeg1 streams. It seems to give good results with AV_PES as well. Let me
> know if it helps...

Thanks, David, this apparently works quite well.

I added this to my little test program and got some 29,000 hits
for a recording that is 33 minutes long when replayed. Since I
was assuming that each hit corresponds to one "frame", and there
are 25 frames per second, I would have expected to get 33x60x25
(49500) hits. Am I missing something here? Is there a 1:1 relationship
between the 'I', 'P' and 'B' frames and the actual 25 frames displayed
within one second?

Thanks for your input
Klaus
-- 
_______________________________________________________________

Klaus Schmidinger                       Phone: +49-8635-6989-10
CadSoft Computer GmbH                   Fax:   +49-8635-6989-40
Hofmark 2                               Email:   kls@cadsoft.de
D-84568 Pleiskirchen, Germany           URL:     www.cadsoft.de
_______________________________________________________________


Home | Main Index | Thread Index