Welcome to the new platform of Programmers Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use it's exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
MPEG1,2 - reading info from MPG
I need to find the *.MPG file, MPEG-1/2 information on the duration and number of frames by reading the file bytes.
My way is now:
Duration_mS = lastGOPTime_mS - firstGOPTime_mS + (I_FramesCnt/Framerate)
Frames = Duration_mS / 1000 * FrameRate
GOP = 0xB8010000 packet.
I_FramesCnt is 0x00010000 packets.
This method is quite satisfactory, but probably not very accurate.
I can use MCI-commands (on MS-Windows), but not want.
Any idea, principe ? May be in VB or C.