Reputation: 9871
does anyone know how i can retrieve the frame dimension of a mpeg4 video (non h264, i.e. Mpeg4 Part 2) from the raw video bitstream? i´m currently writing a custom media source for windows media foundation, i have to provide a mediatype which needs the frame size. it doesn´t work without it. any ideas? thanks
Upvotes: 2
Views: 1894
Reputation: 11343
I am not getting you. Are you trying to know the width and the height of the video being streamed? If so (and I guess that it is the "dimension" you are looking for) heres how:
000001B0
(hex) its always the first thing you get streamed. If not, see the SDP of the stream (if you have any, and search for config=
field, and there it is... only now it is a Base16 string!000001B6
(hex)000001B0F5000001B5891300000100000001200086C40FA28 A021E0A2
A021E0A2
)In pseudo code:
WIDTH = readBitsUnsigned(array, 8) * 4;
readBitsUnsigned(array, 7);
HEIGHT = readBitsUnsigned(array, 9);
There you go... width and height. (:
Upvotes: 3