[vlc] Re: Mainconcept encode play error
Vaclav Koldus
vaclav.koldus at avpark.cz
Fri Mar 3 14:19:28 CET 2006
Måns Rullgård napsal(a):
>Vaclav Koldus <vaclav.koldus at avpark.cz> writes:
>
>
>
>>Måns Rullgård napsal(a):
>>
>>
>>
>>>Vaclav Koldus <vaclav.koldus at avpark.cz> writes:
>>>
>>>
>>>
>>>>>>Hi Pete!
>>>>>>
>>>>>>The problem with main concept H.264 encoded videos is indeed that
>>>>>>these are mpeg files. Vlc can't recognize if the .mpeg file contains
>>>>>>mpeg2 or h.264 stream. It just assumes it is a mpeg2 stream. Only
>>>>>>solution I came with is to give up playing mpeg2 and consider all
>>>>>>mpegs to be h264s. I don't know whether this stream can be decoded
>>>>>>with ffmpeg.
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>The H.264 video is decoded correctly by ffmpeg. The problem is
>>>>>identifying it as being H.264 in the first place. Normally a Program
>>>>>Stream Map is included in MPEG-PS streams with non-MPEG2 video for
>>>>>precisely this purpose.
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>Well, then there's only one thing to do. To patch ps/ts demuxer
>>>>modules to corretly identify h264 streams. When you look
>>>>into the source files ts.c and ps.c, you'll find out that this is
>>>>implemented well. It seems that MC signs the stream incorrectly
>>>>(or with their own id.) I'll have a look at it, it shouldn't be a big
>>>>prob.
>>>>
>>>>
>>>>
>>>>
>>>The PS demuxer parses the PSM to determine the codecs for each stream.
>>>If there is no PSM it defaults to MPEG video and audio. As I said,
>>>the file from Pete has no PSM.
>>>
>>>I haven't seen a sample from you, so I can't say what might be the
>>>problem there.
>>>
>>>
>>>
>>>
>>>
>>I see it now too. MC H264 mpegs has no PSM indeed. However, this can be
>>"hacked" like this:
>>
>> else if( (i_id&0xf0) == 0xe0 && i_type == 0x00 )
>> {
>> es_format_Init( &tk->fmt, VIDEO_ES,
>> VLC_FOURCC('h','2','6','4') );
>> }
>>
>>Obviously, this isn't clean, but it forces vlc to use H264 decoder for
>>these files.
>>
>>
>
>Yes, that would make it play files with H.264 video. Anything else,
>like the more common MPEG2 files, would become unplayable.
>
>
>
>>I'm affraid it can't be done cleanly, cause they have no PSM so
>>there isn't any way how to recognize h264 from mpeg2 without PSM.
>>This is arguable, because mpeg2 streams should have PSM, so it could
>>be safe to assume that the file is h264 when there's no PSM.
>>
>>
>
>Normally MPEG PS files without a PSM have MPEG2 video. Assuming
>anything else would probably cause more problems than it solved.
>
>
>
>>Anyway, there's another prob. ffmpeg fails decoding this stream like
>>this:
>>
>>[h264 @ 0xb7eae5b0]concealing 1620 DC, 1620 AC, 1620 MV errors
>>[h264 @ 0xb7eae5b0]left block unavailable for requested intra4x4 mode
>>-1
>>at 0 2
>>[h264 @ 0xb7eae5b0]error while decoding MB 0 2
>>[h264 @ 0xb7eae5b0]concealing 1579 DC, 1579 AC, 1579 MV errors
>>[h264 @ 0xb7eae5b0]left block unavailable for requested intra mode at 0 3
>>[h264 @ 0xb7eae5b0]error while decoding MB 0 3
>>[h264 @ 0xb7eae5b0]illegal short term buffer state detected
>>[h264 @ 0xb7eae5b0]concealing 1534 DC, 1534 AC, 1534 MV errors
>>vlc: h264.c:2584: mc_dir_part: Assertion `pic->data[0]' failed.
>>
>>I don't know anything about h264, so I can't see why is this happening.
>>Please someone has an idea??
>>
>>
>
>Is your file damaged in some way? Is it cut from a longer file? Can
>you provide a sample showing this problem?
>
>
>
>>Here comes the possibility to implement MC H.264 decoder (SDK). But this
>>one isn't free.
>>
>>
>
>FFmpeg should be able to decode almost all correct H.264 streams. If
>it fails, either ffmpeg or the file is broken.
>
>
>
I must admit you're right :) My file was really corrupted. I don't know
how
is it possible, I encoded it properly in MC encoder. Anyway, when I encoded
another file, everything went OK.
So the result for Pete: If you want to be able to play MC H.264 mpegs, you
need to recompile h.264 with this change and put up with fact that some
mpeg files (these without PSM) won't be played correctly.
One thing bothers me about this. When I tested it, I noticed ugly flickering
and jumping parts on the screen. Original cause of this could be low
bitrate of video or some problems with decoding im ffmpeg. I hope the
first's
true, but i'm afraid it could be the second. I'll be testing this further.
Anyway, many thanks for info & cooperation, Mans.
V.
PS: One simple idea. Could it be possible to remux the file again with
correct h264 PSM (type 0x1b?) Or just to add the PSM? And which tools
could be able to do this?? IMHO - This should be the right way to allow VLC
to play these files even without modyfiing the source code.
--
This is the vlc mailing-list, see http://www.videolan.org/vlc/
To unsubscribe, please read http://www.videolan.org/support/lists.html
More information about the vlc
mailing list