Fix decoding Xvid stream problem
Hi,everyone I use libavcodec to decode Xvid encoded stream, but sometime error, output as: [mpeg4 @ 0x8bae990]hmm, seems the headers are not complete, trying to guess time_increment_bits [mpeg4 @ 0x8bae990]my guess is 1 bits ;) [mpeg4 @ 0x8bae990]looks like this file was encoded with (divx4/(old)xvid/opendivx) -> forcing low_delay flag but when output "my guess is 5 bits", it can be rightly decoded, so I modified the code as follows: --- h263dec_ref.c 2009-03-02 13:18:33.000000000 +0800 +++ h263dec.c 2009-12-04 12:10:39.000000000 +0800 @@ -62,7 +62,7 @@ break; case CODEC_ID_MPEG4: s->decode_mb= ff_mpeg4_decode_mb; - s->time_increment_bits = 4; /* default value for broken headers */ + s->time_increment_bits = 5; /* default value for broken headers */ s->h263_pred = 1; s->low_delay = 0; //default, might be overriden in the vol header during header parsing break; --- h263_ref.c 2009-02-25 00:12:47.000000000 +0800 +++ h263.c 2009-12-04 12:19:23.000000000 +0800 @@ -5878,7 +5878,7 @@ time_incr++; check_marker(gb, "before time_increment"); - +/* if(s->time_increment_bits==0 || !(show_bits(gb, s->time_increment_bits+1)&1)){ av_log(s->avctx, AV_LOG_ERROR, "hmm, seems the headers are not complete, trying to guess time_increment_bits\n"); @@ -5888,7 +5888,7 @@ av_log(s->avctx, AV_LOG_ERROR, "my guess is %d bits ;)\n",s->time_increment_bits); } - +*/ if(IS_3IV1) time_increment= get_bits1(gb); //FIXME investigate further else time_increment= get_bits(gb, s->time_increment_bits); Are there any other better advices ?
On Fri, Dec 04, 2009 at 12:22:38PM +0800, Xwen.Kong wrote: [...]
Are there any other better advices ?
read bugreports.html and submit a bureport with a sample video [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Dictatorship naturally arises out of democracy, and the most aggravated form of tyranny and slavery out of the most extreme liberty. -- Plato
participants (2)
-
konsunwin@gmail.com -
michaelni@gmx.at