VideoHelp Forum
+ Reply to Thread
Results 1 to 2 of 2
Thread
  1. Hi,

    I have a video recorded for H.264 codec and a c program that extracts the details such as Video track, video duration, video frames,fps, video bytes,video bit rate etc. Now I want to include a switch statement that checks for an IDR frame of a GOP frame. It should keep on counting the number of p frames and b frames that appear until the next i frame is encountered and display the total count of p frames and b frames found when the next i frame is encountered.

    Can anyone let me know how can I extract the p frames and b frames from a recorded video.

    Thanks in Advance,
    Pavithra
    Quote Quote  
  2. Member
    Join Date
    May 2001
    Location
    United States
    Search Comp PM
    The "p" and "b" frames of a MPEG video don't stand alone, so there is no "extracting" them.

    If all you want to do is count the frame types, then bits 3,4 and 5 of byte number 5 (zero based) in the "PICTURE HEADER" contains the frame type.

    "001" is type I
    "010" is type P
    "011" is type B
    "100" is type D (not sure what this is, but it is not used by DVDs)

    This data is found by parsing your MPEG file for HEX "00 00 01 00" then examining the next 10 bits (which is the temporal sequence number), then the next three bits (which is the frame type).

    If you don't know how to find the PICTURE HEADER and parse data bits, then maybe you are in way over your head.
    ICBM target coordinates:
    26° 14' 10.16"N -- 80° 16' 0.91"W
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!