Bug#718805: /usr/bin/avconv: avconv cannot grab video4linux2 device

Reinhard Tartler siretart at gmail.com
Sun Jan 19 16:24:57 UTC 2014


On Sun, Jan 19, 2014 at 2:08 AM, Nikolay Shaplov <dhyan at nataraj.su> wrote:
>> Sorry for taking so long to get back to this bug.
> Please do not keep us waiting again, it is really does not work, and as I can understand
> it does not work on wide range of devices, because it failed with two web cam I have both
> on Debian Stable and Testing.
>
>> > Package: libav-tools
>> > Version: 6:0.8.6-1~bpo60+1
>> > Severity: important
>> > File: /usr/bin/avconv
>> >
>> > avconv -f video4linux2 -i /dev/video1
>> > get this error :
>> > avconv version 0.8.6-6:0.8.6-1~bpo60+1, Copyright (c) 2000-2013 the Libav
>> > developers> >
>> >   built on Jul 23 2013 15:28:31 with gcc 4.4.5
>> >
>> > avconv: /build/libav-_lRc_4/libav-0.8.6/libavutil/mathematics.c:79:
>> > av_rescale_rnd: Assertion `c > 0' failed. Abort
>>
>> I am unable to reproduce this issue with Libav version 0.8.9, and
>> therefore need to see a full backtrace. Please see
>> https://wiki.debian.org/HowToGetABacktrace for more details.
>
> (gdb) r avconv -f video4linux2 -i /dev/video1
> Starting program: /usr/bin/avconv avconv -f video4linux2 -i /dev/video1
> warning: Could not load shared library symbols for linux-gate.so.1.
> Do you need "set solib-search-path" or "set sysroot"?
> [Thread debugging using libthread_db enabled]
> Using host libthread_db library "/lib/i386-linux-gnu/i686/cmov/libthread_db.so.1".
> avconv version 9.10-6:9.10-2, Copyright (c) 2000-2013 the Libav developers
>   built on Jan  4 2014 15:41:46 with gcc 4.8 (Debian 4.8.2-10)
> avconv: /build/libav-ToBmxA/libav-9.10/libavutil/mathematics.c:61: av_rescale_rnd: Assertion `c > 0' failed.
>
> Program received signal SIGABRT, Aborted.
> 0xb7fde424 in __kernel_vsyscall ()
> (gdb) bt
> #0  0xb7fde424 in __kernel_vsyscall ()
> #1  0xb701381f in __GI_raise (sig=sig at entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
> #2  0xb7016cd3 in __GI_abort () at abort.c:90
> #3  0xb700c717 in __assert_fail_base (fmt=0xb714f914 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion at entry=0xb7211f37 "c > 0",
>     file=file at entry=0xb7211f00 "/build/libav-ToBmxA/libav-9.10/libavutil/mathematics.c", line=line at entry=61, function=function at entry=0xb7211f60 <__PRETTY_FUNCTION__.2410> "av_rescale_rnd")
>     at assert.c:92
> #4  0xb700c7c7 in __GI___assert_fail (assertion=assertion at entry=0xb7211f37 "c > 0", file=file at entry=0xb7211f00 "/build/libav-ToBmxA/libav-9.10/libavutil/mathematics.c", line=line at entry=61,
>     function=function at entry=0xb7211f60 <__PRETTY_FUNCTION__.2410> "av_rescale_rnd") at assert.c:101
> #5  0xb7204d19 in av_rescale_rnd (a=1, b=0, c=0, rnd=rnd at entry=AV_ROUND_NEAR_INF) at /build/libav-ToBmxA/libav-9.10/libavutil/mathematics.c:61
> #6  0xb7204e8f in av_rescale_q_rnd (rnd=AV_ROUND_NEAR_INF, cq=..., bq=..., a=1) at /build/libav-ToBmxA/libav-9.10/libavutil/mathematics.c:120
> #7  av_rescale_q (a=1, bq=..., cq=...) at /build/libav-ToBmxA/libav-9.10/libavutil/mathematics.c:125
> #8  0xb7fa8c10 in v4l2_set_parameters (s1=0x8099b40) at /build/libav-ToBmxA/libav-9.10/libavdevice/v4l2.c:641
> #9  v4l2_read_header (s1=0x8099b40) at /build/libav-ToBmxA/libav-9.10/libavdevice/v4l2.c:768
> #10 0xb7f13d6b in avformat_open_input (ps=ps at entry=0xbfffee30, filename=filename at entry=0xbffff4d9 "/dev/video1", fmt=fmt at entry=0xb7fb0540 <ff_v4l2_demuxer>, options=0x808ba9c)
>     at /build/libav-ToBmxA/libav-9.10/libavformat/utils.c:530
> #11 0x0804fab1 in open_input_file (o=o at entry=0xbfffef4c, filename=<optimized out>) at /build/libav-ToBmxA/libav-9.10/avconv_opt.c:612
> #12 0x08052edb in open_files (inout=0x80615d0 "input", open_file=0x804f910 <open_input_file>, l=<optimized out>, l=<optimized out>) at /build/libav-ToBmxA/libav-9.10/avconv_opt.c:1885
> #13 avconv_parse_options (argc=argc at entry=6, argv=argv at entry=0xbffff2f4) at /build/libav-ToBmxA/libav-9.10/avconv_opt.c:1922
> #14 0x0804bd71 in main (argc=6, argv=0xbffff2f4) at /build/libav-ToBmxA/libav-9.10/avconv.c:2369
>

Thanks for the backtrace. From this information, I see that we
basically have a division by zero here. At least the AVRational code
in avutil would do that, but we already bail out. Something seems to
get the framerate wrong, but I'm not sure what's happening here.

Can you also give me the output of "avconv -loglevel debug -f
video4linux2 -i /dev/video1"? I see a number of debugging print
statements in the code that might indicate where would be a good place
to add further checks.

When looking at the upstream commits, can you please apply this patch
to your tree, and tell me if it makes the segfault go away?

http://git.libav.org/?p=libav.git;a=commitdiff;h=838b849e70f11dc242399da8d19c5795fe90913b


Also, if this still persists, please also check the avconv binary
I''ve uploaded yesterday to debian/experimental. It is pretty close to
current libav/master right now.

-- 
regards,
    Reinhard



More information about the pkg-multimedia-maintainers mailing list