Log in

View Full Version : Gop Structure


Dave1024
11th January 2013, 17:30
Hi,

I need to validate the size of GOP in a MPEG-2 video. For the same i
used I frame as a boundary. But i observed that each GOP structure had a unique time stamp(starting to ending). For eg:
Frame 1(10:00:00:00) Frame 12 (10:00:00:11) for GOP structure 1,
Again this is repeated.{13818-2 picture header had timing info}

My doubts are,
1. Will i can use time stamp for detecting the size of GOP structure.?
2. AFAIK time stamp in a stream is a unique identifier for frame, if so why a reset of time happen in the GOP boundary.?
3. Is there any specification available with respect to this ?

Please discuss.

Thanks
Dave

Guest
11th January 2013, 19:47
Picture headers do not have a time code. Only the GOP header has a time code.

You could subtract successive GOP timecodes and then multiply by the frame rate to get the number of frames in the GOP. The problem with this is that GOP headers are optional. Why don't you just count the frames directly?

What are you trying to do? There are tools available to show GOP structure.

Manao
11th January 2013, 20:13
You could subtract successive GOP timecodes and then multiply by the frame rate to get the number of frames in the GOPNot quite. When the timecode is present in the GOP header, it represents the time code of the earliest (temporal order) frame that is after (coding order) the gop header.

So, if you have, in temporal order I0 B1 B2 P3 B4 B5 I6 P7 P8 I9, then in coding order you get I0 P3 B1 B2 I6 B4 B5 P7 P8 I9. The timecode GOP header before I0 will be 0. For the GOP header before I6, it will be 4 (because B4 is after I6 in coding order). For the GOP header before I9, it will be 9.

More generally, it not simple to count frames in a GOP. How many frames would you say the GOP that starts at I0 has ? 6 (temporal order), or 4 (coding order) ?

Dave1024
12th January 2013, 06:50
Hi,

Manao,

I agree . But still few of my doubts need more clarity.

?) Is the timecode attached with group of picture header is continuous or not ?{assume 0x000001b8 gop header is there}

?)What i am trying to achieve is i have mpeg-2 stream which had timecode in gop header but it resetted in start of every I frame of every gop header. This is a desired behavior or not ?

Thanks
Dave