View Full Version : how can I find the frametype of a video frame
fx
30th January 2006, 10:44
how can I difference a I-frame and B,P frame in a decoded MPEG video?
thanks:confused: :confused:
SeeMoreDigital
30th January 2006, 11:06
You have a problem too fx....
Have you read our forums rules? If you have, you must be aware of rule 9...
Doom9
30th January 2006, 11:09
use ffdshow for decoding, enable the OSD and make it display the frame type.
And yes, you do have a problem with the forum rules too. You should use a title that describes the content of your post. In this case, something like "how can I find the frametype of a video frame" would've been appropriate.
fx
30th January 2006, 18:35
use ffdshow for decoding, enable the OSD and make it display the frame type.
And yes, you do have a problem with the forum rules too. You should use a title that describes the content of your post. In this case, something like "how can I find the frametype of a video frame" would've been appropriate.
thanks a lot:) , I have used ffdshow OSD, but how can I read the frame type informations into a C++ program:confused: . (I write DirectShow filter to deal with Video sequence, which header data should I use, in order to find the frame type?).
some useful literature in MS:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/directshow/htm/directshowsystemoverview.asp
fx
30th January 2006, 18:38
You have a problem too fx....
Have you read our forums rules? If you have, you must be aware of rule 9...
oh.....I am wrong, very sorry!!:D
SeeMoreDigital
30th January 2006, 18:53
To analyse the frames types of an MPEG-4 source, you can load your file into MPEG4 Modifier. Click on the "Video Info" button and select "Write Frame List" ;)
Cheers
fx
30th January 2006, 20:25
To analyse the frames types of an MPEG-4 source, you can load your file into MPEG4 Modifier. Click on the "Video Info" button and select "Write Frame List" ;)
Cheers
but how does such software read the datum of an MPEG Source.
SeeMoreDigital
30th January 2006, 20:37
but how does such software read the datum of an MPEG Source.You will have to ask the developer about this. But here's an example of the frame list produced: - 0: I-VOP (0:00:00.000)
3: P-VOP (0:00:00.120)
B-VOP (0:00:00.040)
4: B-VOP (0:00:00.080)
5: N-VOP(D) (0:00:00.120)
6: P-VOP (0:00:00.240)
B-VOP (0:00:00.160)
7: B-VOP (0:00:00.200)
8: N-VOP(D) (0:00:00.240)
9: P-VOP (0:00:00.360)
B-VOP (0:00:00.280)
10: B-VOP (0:00:00.320)
11: N-VOP(D) (0:00:00.360)
12: P-VOP (0:00:00.480)
B-VOP (0:00:00.400)
13: B-VOP (0:00:00.440)
14: N-VOP(D) (0:00:00.480)
15: P-VOP (0:00:00.600)
B-VOP (0:00:00.520)
16: B-VOP (0:00:00.560)
17: N-VOP(D) (0:00:00.600)
18: P-VOP (0:00:00.720)
B-VOP (0:00:00.640)
19: B-VOP (0:00:00.680)
20: N-VOP(D) (0:00:00.720)
21: P-VOP (0:00:00.840)
B-VOP (0:00:00.760)
22: B-VOP (0:00:00.800)
23: N-VOP(D) (0:00:00.840)
24: P-VOP (0:00:00.960)
B-VOP (0:00:00.880)
25: B-VOP (0:00:00.920)
26: N-VOP(D) (0:00:00.960)
27: P-VOP (0:00:01.080)
B-VOP (0:00:01.000)
28: B-VOP (0:00:01.040)
29: N-VOP(D) (0:00:01.080)
30: P-VOP (0:00:01.200)
B-VOP (0:00:01.120)
31: B-VOP (0:00:01.160)
32: N-VOP(D) (0:00:01.200)
33: P-VOP (0:00:01.320)
B-VOP (0:00:01.240)
34: B-VOP (0:00:01.280)
35: N-VOP(D) (0:00:01.320)
36: P-VOP (0:00:01.440)
B-VOP (0:00:01.360)
37: B-VOP (0:00:01.400)
38: N-VOP(D) (0:00:01.440)
39: P-VOP (0:00:01.560)
B-VOP (0:00:01.480)
40: B-VOP (0:00:01.520)
41: N-VOP(D) (0:00:01.560)
42: P-VOP (0:00:01.680)
B-VOP (0:00:01.600)
43: B-VOP (0:00:01.639)
44: N-VOP(D) (0:00:01.680)
45: P-VOP (0:00:01.800)
B-VOP (0:00:01.720)
46: B-VOP (0:00:01.760)
47: N-VOP(D) (0:00:01.800)
48: P-VOP (0:00:01.920)
B-VOP (0:00:01.840)
49: B-VOP (0:00:01.880)
50: N-VOP(D) (0:00:01.920)
51: P-VOP (0:00:02.040)
B-VOP (0:00:01.960)
52: B-VOP (0:00:02.000)
53: N-VOP(D) (0:00:02.040)
54: P-VOP (0:00:02.160)
B-VOP (0:00:02.080)
55: B-VOP (0:00:02.120)
56: N-VOP(D) (0:00:02.160)
57: P-VOP (0:00:02.279)
B-VOP (0:00:02.200)
58: B-VOP (0:00:02.240)
59: N-VOP(D) (0:00:02.279)
60: P-VOP (0:00:02.400)
B-VOP (0:00:02.320)
61: B-VOP (0:00:02.360)
62: N-VOP(D) (0:00:02.400)
63: P-VOP (0:00:02.520)
B-VOP (0:00:02.440)
64: B-VOP (0:00:02.480)
65: N-VOP(D) (0:00:02.520)
66: P-VOP (0:00:02.640)
B-VOP (0:00:02.560)
67: B-VOP (0:00:02.600)
68: N-VOP(D) (0:00:02.640)
69: P-VOP (0:00:02.759)
B-VOP (0:00:02.680)
70: B-VOP (0:00:02.720)
71: N-VOP(D) (0:00:02.759)
72: P-VOP (0:00:02.880)
B-VOP (0:00:02.800)
73: B-VOP (0:00:02.840)
74: N-VOP(D) (0:00:02.880)
75: P-VOP (0:00:03.000)
B-VOP (0:00:02.920)
76: B-VOP (0:00:02.960)
77: N-VOP(D) (0:00:03.000)
78: P-VOP (0:00:03.120)
B-VOP (0:00:03.040)
79: B-VOP (0:00:03.080)
80: N-VOP(D) (0:00:03.120)
81: P-VOP (0:00:03.240)
B-VOP (0:00:03.160)
82: B-VOP (0:00:03.200)
83: N-VOP(D) (0:00:03.240)
84: P-VOP (0:00:03.360)
B-VOP (0:00:03.279)
85: B-VOP (0:00:03.320)
86: N-VOP(D) (0:00:03.360)
87: P-VOP (0:00:03.480)
B-VOP (0:00:03.400)
88: B-VOP (0:00:03.440)
89: N-VOP(D) (0:00:03.480)
90: P-VOP (0:00:03.600)
B-VOP (0:00:03.520)
91: B-VOP (0:00:03.560)
92: N-VOP(D) (0:00:03.600)
93: P-VOP (0:00:03.720)
B-VOP (0:00:03.640)
94: B-VOP (0:00:03.680)
95: N-VOP(D) (0:00:03.720)
96: P-VOP (0:00:03.840)
B-VOP (0:00:03.760)
97: B-VOP (0:00:03.800)
98: N-VOP(D) (0:00:03.840)
99: P-VOP (0:00:03.960)
B-VOP (0:00:03.880)
100: B-VOP (0:00:03.920)
101: N-VOP(D) (0:00:03.960)
102: P-VOP (0:00:04.080)
B-VOP (0:00:04.000)
103: B-VOP (0:00:04.040)
104: N-VOP(D) (0:00:04.080)
105: P-VOP (0:00:04.200)
B-VOP (0:00:04.120)
106: B-VOP (0:00:04.160)
107: N-VOP(D) (0:00:04.200)
108: P-VOP (0:00:04.320)
B-VOP (0:00:04.240)
109: B-VOP (0:00:04.280)
110: N-VOP(D) (0:00:04.320)
111: P-VOP (0:00:04.440)
B-VOP (0:00:04.360)
112: B-VOP (0:00:04.400)
113: N-VOP(D) (0:00:04.440)
114: P-VOP (0:00:04.559)
B-VOP (0:00:04.480)
115: B-VOP (0:00:04.519)
116: N-VOP(D) (0:00:04.559)
117: P-VOP (0:00:04.680)
B-VOP (0:00:04.600)
118: B-VOP (0:00:04.640)
119: N-VOP(D) (0:00:04.680)
120: P-VOP (0:00:04.800)
B-VOP (0:00:04.720)
121: B-VOP (0:00:04.760)
122: N-VOP(D) (0:00:04.800)
123: P-VOP (0:00:04.920)
B-VOP (0:00:04.840)
124: B-VOP (0:00:04.880)
125: N-VOP(D) (0:00:04.920)
126: P-VOP (0:00:05.040)
B-VOP (0:00:04.960)
127: B-VOP (0:00:05.000)
128: N-VOP(D) (0:00:05.040)
129: P-VOP (0:00:05.160)
B-VOP (0:00:05.080)
130: B-VOP (0:00:05.120)
131: N-VOP(D) (0:00:05.160)
132: P-VOP (0:00:05.280)
B-VOP (0:00:05.200)
133: B-VOP (0:00:05.240)
134: N-VOP(D) (0:00:05.280)
135: P-VOP (0:00:05.400)
B-VOP (0:00:05.320)
136: B-VOP (0:00:05.360)
137: N-VOP(D) (0:00:05.400)
138: P-VOP (0:00:05.519)
B-VOP (0:00:05.440)
139: B-VOP (0:00:05.480)
140: N-VOP(D) (0:00:05.519)
141: P-VOP (0:00:05.600)
B-VOP (0:00:05.559)
142: N-VOP(D) (0:00:05.600)
143: I-VOP (0:00:05.640)
144: P-VOP (0:00:05.760)
B-VOP (0:00:05.680)
145: B-VOP (0:00:05.720)
146: N-VOP(D) (0:00:05.760)
147: P-VOP (0:00:05.880)
B-VOP (0:00:05.800)
148: B-VOP (0:00:05.840)
149: N-VOP(D) (0:00:05.880)
150: P-VOP (0:00:06.000)
B-VOP (0:00:05.920)
151: B-VOP (0:00:05.960)
152: N-VOP(D) (0:00:06.000)
153: P-VOP (0:00:06.120)
B-VOP (0:00:06.040)
154: B-VOP (0:00:06.080)
155: N-VOP(D) (0:00:06.120)
156: P-VOP (0:00:06.240)
B-VOP (0:00:06.160)
157: B-VOP (0:00:06.200)
158: N-VOP(D) (0:00:06.240)
159: P-VOP (0:00:06.360)
B-VOP (0:00:06.280)
160: B-VOP (0:00:06.320)
161: N-VOP(D) (0:00:06.360)
162: P-VOP (0:00:06.480)
B-VOP (0:00:06.400)
163: B-VOP (0:00:06.440)
164: N-VOP(D) (0:00:06.480)
165: P-VOP (0:00:06.600)
B-VOP (0:00:06.519)
166: B-VOP (0:00:06.559)
167: N-VOP(D) (0:00:06.600)
168: P-VOP (0:00:06.720)
B-VOP (0:00:06.640)
169: B-VOP (0:00:06.680)
170: N-VOP(D) (0:00:06.720)
171: P-VOP (0:00:06.840)
B-VOP (0:00:06.760)
172: B-VOP (0:00:06.800)
173: N-VOP(D) (0:00:06.840)
174: P-VOP (0:00:06.960)
B-VOP (0:00:06.880)
175: B-VOP (0:00:06.920)
Cheers
celtic_druid
31st January 2006, 03:53
Both are opensource, so if you want to know how they do something, you can look at the source. MPEG-4Modifier is a much simpler app, so you might want to start there. C# though not C/C++.
squid_80
31st January 2006, 09:32
The start code of a frame is the hex sequence 00 00 01 B6. The next 2 bits (BITS, not BYTES) after that specify the type of frame:
00 = I frame
01 = P frame
10 = B frame
11 = S frame (P frame with GMC)
This is what I've learned from reading around; someone please correct me if it's wrong.
fx
31st January 2006, 15:20
The start code of a frame is the hex sequence 00 00 01 B6. The next 2 bits (BITS, not BYTES) after that specify the type of frame:
00 = I frame
01 = P frame
10 = B frame
11 = S frame (P frame with GMC)
This is what I've learned from reading around; someone please correct me if it's wrong.
yes, but how can I read the frame startsequence into a DirectShow Program.
my Code:
BYTE *pSourceBuffer;
long lSourceSize = pSample->GetActualDataLength();
pSample->GetPointer(&pSourceBuffer);
AM_MEDIA_TYPE *pTypeOut = &m_pOutput->CurrentMediaType();
VIDEOINFOHEADER *pVihOut = (VIDEOINFOHEADER *)pTypeOut->pbFormat;
int width = pVihOut->bmiHeader.biWidth;
int height = pVihOut->bmiHeader.biHeight;
int bytesPerPixel = pVihOut->bmiHeader.biBitCount / 8;
.......
I have not found such hex sequence 00 00 01 B6 in pSourceBuffer and m_pOutput.:confused:
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.