look i want to extract the I,P and B frames from the video(bit form) and i want to know how to discreminate between them , is there any bits or flags that i can use to discriminate the different types, i found a line code in ffmpeg that extract the I frames but as images(.jpg).
i want to use this information that are in the application layer to discriminate between frames while applying discarding policied in the device that works in the network layer. i know it is not feasable but i have to find a way to discriminate betwwen the video frame in the network layer. i need a code or something that finds the frame types and how can we modify the codecs to add flags to recognise the frames???????????? please help me

thank u very much, but look i am beginner in video encoding, i want an ffmpeg line that could give me the types beside extracting them, i will then use these info as an input to my project using Matlab, i dont know if Matlab can support ffmpeg line codes, but i will try to find that.
i downloaded FFdshow and i get two video encoder configuration and i saw the OSD that u mentioned, then how can apply this program on some video file?

my project is about proposing a new discarding policy when the buffer in the access point or the router overflow taking into consideration the video frame types, so
1- i want to extract them first from the video and i want these frames(images) to be as an input to the matlab.(help me in this, i found a line code that extract I frames only, i want them all, with 30fps)
2- as images if i use matlab to convert these images to numbers or matrices or something(i dont know what but i suppose matlab can read images), is there any numbers or flags that discriminate the diff types.
sorry if i have problems in telling u what i want

VirtualDub and VirtualDub Mod can save the frames as BMP, JPG, PNG, or TGA images. They can also show the frame type on the status line (at the bottom of the window). You'll have to keep track of the frame types manually though. You could use VirtualDub(mod) to save the image sequence then use ffdshow to save a list of frame types.

Do you realize you can't skip a P frame unless you skip all the way to the next I frame? And within the MPG file the frames will not be in display order.

thank u all, i will try them, but can u give me a simple ffmpeg instruction that extracts the frame type (all of them) because i only found the line that extracts the intra types, then i will try to disrimintate them

Once they've been decoded, and encoded to images - they are no longer I, B, P . They are no longer video, and probably not in the same colorspace either (Y'CbCr vs. RGB). I, B, P refers to the frametype while it's still in video format, under a certain compression scheme . Even if you take the output directly from the decoder (uncompressed YCbCr) , then I, B, P no longer applies

Take the list generated by selur's utility , or ffdshow osd to determine frametypes of what the original video was.

In the left pane select and enable the OSD filter. In the right pane enable Frame Type. If you want a text file with a list of frame types enable the Save To option and specify where you want the file.

While you're in this dialog I recommend you make sure ffdshow puts an icon in the System Tray when it's in use. In the left hand pane click on Tray, Dialog and Paths. In the right hand pane, in the Tray Icons section, make sure that Modern or Classic is selected. After doing this you will know when ffdshow is in use because an ffdshow icon will appear in the System Tray.

Now you need to make sure your video player will use ffdshow as the MPEG 2 (or whatever codec you are working with) decoder. At the top of the left hand pane select Codecs. Make sure MPEG2 is enabled (set to libavcodec).

After doing all that open your MPG file in a media player. Make sure that media player isn't using its own internal MPEG 2 decoder. Play the video. If ffdshow is in use you'll see the frame type at the top left corner of the windows. If you have file output enabled you'll see a text file that looks like:

please sir, i need ur help, please be patient with me, i have to get the frame, how, i dont know, because these frames are input to matlab code depend on them, please help me in ffdshow, maybe i can get use of the text file generating, but i prefer a command

ffmpeg can also pipe raw data into other programs , you might want to have a look at that. I don't know if matlab can accept it, but some other programs can . So you might pipe raw YUV instead of jpeg/png image sequences