[vlc-devel] Re: MPEG-2 decode problem

Michel LESPINASSE walken at zoy.org
Wed Feb 5 12:00:45 CET 2003

On Mon, Feb 03, 2003 at 06:58:07PM -0800, Michel LESPINASSE wrote:
> On Mon, Feb 03, 2003 at 11:10:09PM +0100, Sam Hocevar wrote:
>> On Mon, Feb 03, 2003, Johnny Turpin wrote:

>>> [progressive/Slice-I streams]

>>> As we have I live DVB feed of MPEG-2 transport streams featuring
>>> this type of video, I would gladly offer sample streams to anyone
>>> who is interested in fixing the VLC decoder.

>> We have one sample stream, but it might be helpful having a few
>> others. You can upload anything to ftp://ftp.videolan.org/incoming.

I looked at Johnny's streams and libmpeg2 can decode them. They seem
to use intra slice refresh, i.e. instead of using periodical I
pictures to enable random access, they use P pictures with a few
slices where each macroblock is forced to be intra. The slices change
over time so the whole picture gets refreshed eventually.

This is easy to decode, as long as you do not try to be smart and try
to wait for the next I picture (it is perfectly legal for a stream to
contain one I picture at the start and then only P pictures, you want
to be able to seek into such a stream so don't wait for the next I

A few more notes from the standard:
* The picture following a GOP shall always be an I picture
* The picture following a sequence header shall always be an I or P picture
* There is a bit at the start of each slice that tells if it is an
  intra slice. This is not strictly used for decoding, as the syntax
  of that slice is still the same wether the bit is set or
  not. Libmpeg2 ignores that bit. I have not double checked if it was
  actually set in Johnny's sequences.

In practice, the sequence header is almost always followed by a GOP
and an I picture, so a stream that insteads puts a P picture after the
sequence header has a high probability of using intra slice refresh
instead of I pictures. You might want to use that as an hint for
seeking if you insist on doing it the 'smart' way.

Hope this helps,

Michel "Walken" LESPINASSE
Is this the best that god can do ? Then I'm not impressed.
This is the vlc-devel mailing-list, see http://www.videolan.org/vlc/
To unsubscribe, please read http://developers.videolan.org/lists.html
If you are in trouble, please contact <postmaster at videolan.org>

More information about the vlc-devel mailing list