[Ffmpeg-devel] [BUG] MPEG 2 Division By Zero

Brian Brice bbrice
Tue Oct 31 23:30:57 CET 2006


Michael Niedermayer wrote:
> Hi
> 
> On Tue, Oct 31, 2006 at 01:52:48PM -0600, Brian Brice wrote:
>> M?ns Rullg?rd wrote:
>>> Brian Brice <bbrice at newtek.com> writes:
>>>
>>>> Brian Brice wrote:
>>>>> M?ns Rullg?rd wrote:
>>>>>> Brian Brice <bbrice at newtek.com> writes:
>>>>>>
>>>>>>> Hello.
>>>>>>>
>>>>>>> Something quite strange is happening when I'm encoding MPEG 2.  I'm
>>>>>>> encoding clips that are just noise and I get "division by 0" crashes.
>>>>>>> Unforunately, I can't produce a call stack (using DLLs in Windows from
>>>>>>> VC++), but I did narrow down where the division is occurring:
>>>>>> Upload a sample and tell us an FFmpeg command line that reproduces the
>>>>>> error.
>>>>>>
>>>>> Unfortunately I'm not using the command line. :-(
>>>>> I am linking to the DLLs produced by mingw/gcc from within Visual
>>>>> Studio.  And I know it's not a VS problem (so don't bash, please?),
>>>>> because this stuff has worked before.  I am programmatically generating
>>>>> frames of noise and throwing them at the encoder.  I set only certain
>>>>> members of AVCodecContext (as mentioned in the first email), and leave
>>>>> the rest to default.
>>>>>
>>>> Sorry, I spoke too soon.  Right after I sent that message, I tried
>>>> making an uncompressed AVI with this noise then using ffmpeg on the
>>>> command line to reproduce.
>>>>
>>>> I uploaded a sample to /MPlayer/incoming/VictoriasNoise
>>>>
>>>> Here is a log of the execution:
>>> Does it crash?
>>>
>> Yes.  Unfortunately mingw/gdb doesn't give a good backtrace.  GDB:
>> (fyi, my ffmpeg binary isn't stripped)
>>
>> pollux:~> gdb ./ffmpeg
>> GNU gdb 6.3
>> Copyright 2004 Free Software Foundation, Inc.
>> GDB is free software, covered by the GNU General Public License, and you are
>> welcome to change it and/or distribute copies of it under certain 
>> conditions.
>> Type "show copying" to see the conditions.
>> There is absolutely no warranty for GDB.  Type "show warranty" for details.
>> This GDB was configured as "i686-pc-mingw32"...
>> (gdb) run -i VictoriasNoise.avi -f mpeg2video -vcodec mpeg2video -b 
>> 18300k -minrate 18300k -maxrate 18300k -bufsize 448K -bf 2 -an out.m2v
>> FFmpeg version SVN-r6847, Copyright (c) 2000-2006 Fabrice Bellard, et al.
>>   libavutil version: 49.0.2
>>   libavcodec version: 51.23.0
>>   libavformat version: 50.6.0
>>   built on Oct 30 2006 23:12:04, gcc: 3.4.2 (mingw-special)
>> Input #0, avi, from 'VictoriasNoise.avi':
>>   Duration: 00:00:00.3, start: 0.000000, bitrate: 667437 kb/s
>>   Stream #0.0: Video: rawvideo, bgr24, 1280x720, 29.97 fps(r)
>>   Stream #0.1: Audio: pcm_s16le, 48000 Hz, stereo, 1536 kb/s
>> Output #0, mpeg2video, to 'out.m2v':
>>   Stream #0.0: Video: mpeg2video, yuv420p, 1280x720, q=2-31, 18300 
>> kb/s, 29.97 fps(c)
>> Stream mapping:
>>   Stream #0.0 -> #0.0
>> [mpeg2video @ 0076A000]rc buffer underflow
>> [mpeg2video @ 0076A000]rc buffer underflow
>> gdb: Target exception STATUS_INTEGER_DIVIDE_BY_ZERO at 0x0057b2d5
>>
>> Program received signal SIGFPE, Arithmetic exception.
>> 0x0057b2d5 in ff_set_mpeg4_time (s=0x0, picture_number=1) at h263.c:565
>> 565             s->direct_scale_mv[0][i] = 
>> (i-tab_bias)*s->pb_time/s->pp_time;
>> (gdb) bt
>> #0  0x0057b2d5 in ff_set_mpeg4_time (s=0x0, picture_number=1) at h263.c:565
> 
> duplicate of "[Ffmpeg-devel] [BUG] floating point exception during mpeg2video encoding"
> and fixed
> 
> [...]

Cool.  I didn't even notice.  Thanks.

-- 
Brian Brice




More information about the ffmpeg-devel mailing list