On Fri, May 10, 2013 at 11:48 PM, Yang Song <
heifr...@gmail.com> wrote:
> I drew the video stream from a webm file in order to simulate vp8 stream.
> And i put the stream i get from file in a new file called mystream.vp8. I
> want to decode mystream.vp8. Now i get stuck because i don't know how to do.
> Can't i get frame size just according to stream file(without container)?
No. The size is not encoded in the bitstream. Since you are creating a
custom "stream," you could put the size of each frame in the stream
yourself.
For example, we used to have "raw" files for testing which were
formatted as follows: 4 byte integer describing the size of the frame,
followed by the frame, followed by a 4 byte integer describing the
size of the next frame, followed by the next frame, etc.
Then your decoder would read the first 4 bytes of the stream and use
that to fill the buffer that it passes to libvpx.
Note that this still does not allow you to jump into the middle of the
stream and start decoding for a number of reasons. You need to marshal
the data somehow.