BUG: MPEG-4 AVI drops frames

For questions and discussion that is NOT (I repeat NOT) specific to a certain Operating System.
sdhays-neon
Blank Cone
Blank Cone
Posts: 15
Joined: 14 Sep 2005 03:30

BUG: MPEG-4 AVI drops frames

Postby sdhays-neon » 14 Sep 2005 03:48

I will upload a file named pr-cif-384k.avi to the ftp sample server when it's working again (traceroute takes me all the way to gw-bbvideolan.via.ecp.fr (138.195.134.250) and then I get the dreaded * * * until timeout). For now, I've placed the file on our webserver at:
http://www.neon.com.tw/download/pr-cif-384k.avi
http://www.neon.com.tw/download/pr-cif-384k.txt
(a copy of this post).

This file contains MPEG-4 video encoded with the Pr818s MPEG-4 hardware encoder. When playing, VLC 0.8.2 on Linux outputs lots of

[mpeg4 @ 0x843e5c4]header damaged

messages. VLC 0.8.2 on Mac OS X outputs:

ffmpeg warning: cannot decode one frame (* bytes)

where the "*" is a number between 10 and 20. MPlayer and FFmpeg both play this file without any problems. VLC doesn't play RTP streams of this encoding properly either, but MPlayer playback is flawless, so I'm wondering if the ffmpeg MPEG-4 decoder isn't getting initialized properly.

Thanks,
Scott Hays
Scott Hays
R & D Engineer
Neon Advanced Technology Co., Ltd.

The DJ
Cone Master
Cone Master
Posts: 5987
Joined: 22 Nov 2003 21:52
VLC version: git
Operating System: Mac OS X
Location: Enschede, Holland
Contact:

Postby The DJ » 14 Sep 2005 14:22

This was a problem in older version of VLC. Current development builds play the sample just fine.

H.264 support was still extremely experimental during the time of the 0.8.2 release.
Don't use PMs for support questions.

sdhays-neon
Blank Cone
Blank Cone
Posts: 15
Joined: 14 Sep 2005 03:30

Postby sdhays-neon » 15 Sep 2005 05:20

Thanks for your response. This file is encoded with MPEG-4 ASP, not H.264. I first tried vlc-trunk from svn, but bootstrap fails with:

configure.ac:226: error: possibly undefined macro: AC_DEFINE
If this token and others are legitimate, please use m4_pattern_allow.
See the Autoconf documentation.
configure.ac:719: error: possibly undefined macro: AC_MSG_WARN

Trying the last nightly snapshot (8/25, which I realize is already rather old) with --vvv, I still get:
[00000242] ffmpeg decoder warning: header damaged
(mpeg4@0x850f9d0)
[00000242] ffmpeg decoder warning: cannot decode one frame (14 bytes)

So the current development build doesn't have these errors for you? The AVI looks okay when playing despite the errors, but it should be more noticeable with lower bitrates/larger dimesions.

Scott
Scott Hays
R & D Engineer
Neon Advanced Technology Co., Ltd.

The DJ
Cone Master
Cone Master
Posts: 5987
Joined: 22 Nov 2003 21:52
VLC version: git
Operating System: Mac OS X
Location: Enschede, Holland
Contact:

Postby The DJ » 16 Sep 2005 17:13

On 2nd look. i get the skipped frames also. Hardly noticeable though.
I trust FFMPEG a lot it this. MPEG-4 support is HEAVILY tested. If ffmpeg says the frame is broken, then most likely it is.

You can mail ffmpeg-users or ffmpeg-devel mailinglist if you want this investigated to the bit of course. I'm sure someone would like to take a look for you.
Don't use PMs for support questions.

sdhays-neon
Blank Cone
Blank Cone
Posts: 15
Joined: 14 Sep 2005 03:30

Postby sdhays-neon » 21 Sep 2005 04:01

I agree that FFMPEG has great MPEG-4 support. However, ffplay and MPlayer don't give me these errors, even with -lavdopts turned on, so VLC seems to have an issue here. What I really want to do is make sure VLC can receive RTP streams of this data and when playing over RTP, these decoding problems are VERY noticeable. MPlayer doesn't have any trouble playing it.

Scott
Scott Hays
R & D Engineer
Neon Advanced Technology Co., Ltd.

The DJ
Cone Master
Cone Master
Posts: 5987
Joined: 22 Nov 2003 21:52
VLC version: git
Operating System: Mac OS X
Location: Enschede, Holland
Contact:

Postby The DJ » 21 Sep 2005 17:02

Ok, I did some more deep investigation.
The actual framerate in the movie is 30fps

However the framerate in the avi header file is reported as 29.96fps (a default mpeg framerate). This confuses the decoder which is missing 1 frame every 100 or so decoded frames... So you are not actually missing any frames, the decoder just believes he is missing frames and this might screw up the timebase in VLC.

I'll try to fix this in VLC (not sure if it's possible), but using ffmpeg to remux your file in a new avi with the proper header should work as a circumvention.
Don't use PMs for support questions.

sdhays-neon
Blank Cone
Blank Cone
Posts: 15
Joined: 14 Sep 2005 03:30

Postby sdhays-neon » 03 Oct 2005 12:01

Thanks for the analysis. Just curious, how did you determine the movie's actual framerate? I guess you looked at the VOL to get the VOP time increment resolution and then looked at the actual increments in the VOP headers; is that right?

What I still don't understand is if the problem is with the AVI header, why does the problem exist and even get worse when I stream an elementary stream file to VLC using this MPEG-4 codec? The only timing information that VLC should get is from the video stream itself and the livedotcom demuxer, right?

I've posted an elementary stream file at:
http://www.neon.com.tw/download/sep.ih.1_5.vbr.demo.m4v

I've been using the Live555 (LIVE.COM) library's testMPEG4VideoStreamer to stream it. You'll notice that this also has more serious errors than the AVI was producing: frames actually do get dropped sometimes:
[00000247] main video output warning: late picture skipped (12069)

and visual quality is noticeably affected.

Thanks again for your help!
Scott
Scott Hays
R & D Engineer
Neon Advanced Technology Co., Ltd.

The DJ
Cone Master
Cone Master
Posts: 5987
Joined: 22 Nov 2003 21:52
VLC version: git
Operating System: Mac OS X
Location: Enschede, Holland
Contact:

Postby The DJ » 03 Oct 2005 16:48

If i feed this stream into VLC, it doesn't even recognize it as a MPEG4 Video Elementry Stream, so i't more then likely that there is something wrong with your input.
Don't use PMs for support questions.

sdhays-neon
Blank Cone
Blank Cone
Posts: 15
Joined: 14 Sep 2005 03:30

Postby sdhays-neon » 04 Oct 2005 04:06

In the m4v demuxer's Open function, there is this check:

Code: Select all

if( p_peek[0] != 0x00 || p_peek[1] != 0x00 || p_peek[2] != 0x01 || p_peek[3] > 0x2f ) { if( !b_forced ) { msg_Warn( p_demux, "m4v module discarded (no startcode)" ); return VLC_EGENERIC; } msg_Warn( p_demux, "this doesn't look like an MPEG-4 ES stream, continuing anyway" ); }
This is too restrictive. MPEG4-ES streams can also have Visual Sequence (0x000001B0) and Visual Object (0x000001B5) headers before the VOL. This should be what's causing the demuxer to not recognize my stream as an MPEG4-ES stream.

Playing the elementary stream file results in the same issues as I described when streaming using RTP. I'm certainly open to the idea that my stream isn't perfect (and if that is the problem, I am anxious to fix it), but MPlayer and FFplay play back this stream without complaining, so the problem, whether it's because VLC is less forgiving than those two programs or VLC has a bug, is VLC specific.

Thanks again for continuing to look at this with me.
Scott
Scott Hays
R & D Engineer
Neon Advanced Technology Co., Ltd.

The DJ
Cone Master
Cone Master
Posts: 5987
Joined: 22 Nov 2003 21:52
VLC version: git
Operating System: Mac OS X
Location: Enschede, Holland
Contact:

Postby The DJ » 04 Oct 2005 14:53

This can't be the problem, because VLC just ignores this test if it is being forced.
Don't use PMs for support questions.

sdhays-neon
Blank Cone
Blank Cone
Posts: 15
Joined: 14 Sep 2005 03:30

Postby sdhays-neon » 04 Oct 2005 15:07

So the file I posted doesn't play for you in VLC at all? It plays for me in VLC 0.8.2, but with the aforementioned error messages. VLC 0.8.1 hangs after creating the window. I thought that this error message is what you meant by "if I feed this stream into VLC, it doesn't even recognize it as a MPEG4 Video Elementary Stream". That was what I answered about; this message by itself doesn't indicate that the stream is wrong. The problems with decoding are certainly deeper.

Scott
Scott Hays
R & D Engineer
Neon Advanced Technology Co., Ltd.

sdhays-neon
Blank Cone
Blank Cone
Posts: 15
Joined: 14 Sep 2005 03:30

Postby sdhays-neon » 05 Oct 2005 08:23

I may have found the problem. VLC doesn't seem to handle MPEG-4 ES streams with B-frames well. I get the same playback problems when playing FFMpeg encoded ES files containing B-frames.

http://www.neon.com.tw/download/capote.m4v
Here is an MPEG-4 ES file transcoded from a movie trailer on Apple's trailer website using the ffmpeg command:
ffmpeg -r 24 -i capote_m480.mov -an -r 30 -vcodec mpeg4 -g 30 capote.m4v
This file has no B-frames and VLC has no trouble playing it.

http://www.neon.com.tw/download/capote.2bf.m4v
This file is the same trailer transcoded using the command:
ffmpeg -r 24 -i capote_m480.mov -an -r 30 -vcodec mpeg4 -g 30 -bf 1 capote.1bf.m4v
It has 1 B-frame between every I/P-frame. You can see how the playback becomes jumpy.

http://www.neon.com.tw/download/capote.5bf.m4v
This file is the same trailer transcoded using the command:
ffmpeg -r 24 -i capote_m480.mov -an -r 30 -vcodec mpeg4 -g 30 -bf 5 capote.5bf.m4v
It file has 5 B-frames between every I/P frame. VLC produces error messages like:

Code: Select all

[00000263] main video output warning: late picture skipped (20672)
as well as having playback problems just as with the stream with 2 B-frames between every I/P-frame.

The odd thing is that going to the maximum allowed B-frames on my ffmpeg ( 8 ), I get the "late picture skipped" error messages, but playback seems fine.
ffmpeg -r 24 -i capote_m480.mov -an -r 30 -vcodec mpeg4 -g 30 -bf 8 capote.8bf.m4v
http://www.neon.com.tw/download/capote.8bf.m4v

I'm using ffmpeg 0.4.9-pre1 to do the transcoding.

Scott
Scott Hays
R & D Engineer
Neon Advanced Technology Co., Ltd.

sdhays-neon
Blank Cone
Blank Cone
Posts: 15
Joined: 14 Sep 2005 03:30

Postby sdhays-neon » 11 Oct 2005 04:01

Is there any update on this? Has anyone else confirmed this issue? If there's anything I can do to help resolve this, I'd very much like to know.

Thanks,
Scott
Scott Hays
R & D Engineer
Neon Advanced Technology Co., Ltd.

faleloncio

Playing Nero Digital (MP4 - AVC Standar profile coded)

Postby faleloncio » 11 Oct 2005 23:20

Hi

I think I can say more about problems playing MP4 video format. Exactly with Nero Digital (MP4) videos. I play my Nero Digital videos without problems with Media Player Classic, but with VLC, appears a lot of squares and it seems to be dropping frames continuosly. However, sound it's ok.

Video is coded using Standard AVC profile.

Thank you.


Return to “General VLC media player Troubleshooting”

Who is online

Users browsing this forum: No registered users and 8 guests