Bug#753528: libav-tools: Floating point exception is raised when recording vom video4linux2
Bernhard Übelacker
bernhardu at vr-web.de
Wed Jul 2 19:13:20 UTC 2014
Package: libav-tools
Version: 6:10.2-1
Severity: minor
Tags: patch
Dear Maintainer,
tried to record some old analog tapes from tv card to DVD compatible files.
In avconv_opt.c:opt_target it is tried to determine the norm.
For this the streams are evaluated.
This leads in my case to this exception.
A Workaround is to specify the norm as prefix to the target (instead "-target
dvd" use "-target pal-dvd").
Attached patch avoids the exception so avconv can print the message that the
user have to specify manualle the norm.
Console output:
$ export LANG=C
$ avconv -f alsa -i hw:0,0 -f video4linux2 -channel 2 -i /dev/video0 -qscale 8
-target dvd out.mpeg
avconv version 10.2-6:10.2-1, Copyright (c) 2000-2014 the Libav developers
built on Jun 28 2014 13:45:13 with gcc 4.9 (Debian 4.9.0-9)
[alsa @ 0x20f5900] Estimating duration from bitrate, this may be inaccurate
Guessed Channel Layout for Input Stream #0.0 : stereo
Input #0, alsa, from 'hw:0,0':
Duration: N/A, start: 90.295177, bitrate: N/A
Stream #0.0: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
[video4linux2 @ 0x2106720] Estimating duration from bitrate, this may be
inaccurate
Input #1, video4linux2, from '/dev/video0':
Duration: N/A, start: 90.796022, bitrate: 124416 kb/s
Stream #1.0: Video: rawvideo, yuv420p, 720x576, 124416 kb/s, 25 fps, 1000k
tbn
Floating point exception
$ gdb --args avconv -f alsa -i hw:0,0 -f video4linux2 -channel 2 -i /dev/video0
-qscale 8 -target dvd out.mpeg
(gdb) run
....
Program received signal SIGFPE, Arithmetic exception.
0x000000000040c4bb in opt_target (optctx=0x7fffffffda90, opt=<optimized out>,
arg=<optimized out>) at /build/libav-KCSjC9/libav-10.2/avconv_opt.c:1731
1731 /build/libav-KCSjC9/libav-10.2/avconv_opt.c: No such file or directory.
(gdb) bt
#0 0x000000000040c4bb in opt_target (optctx=0x7fffffffda90, opt=<optimized
out>, arg=<optimized out>) at /build/libav-KCSjC9/libav-10.2/avconv_opt.c:1731
#1 0x0000000000409f07 in write_option (arg=0x7fffffffe49f "dvd",
opt=<optimized out>, po=0x6212c0 <options+1600>, optctx=0x7fffffffda90) at
/build/libav-KCSjC9/libav-10.2/cmdutils.c:287
#2 parse_optgroup (optctx=0x7fffffffda90, g=0x6ba350) at /build/libav-
KCSjC9/libav-10.2/cmdutils.c:387
#3 0x0000000000410088 in open_files (l=<optimized out>, l=<optimized out>,
open_file=<optimized out>, inout=<optimized out>) at /build/libav-
KCSjC9/libav-10.2/avconv_opt.c:2083
#4 avconv_parse_options (argc=0, argv=0x0) at /build/libav-
KCSjC9/libav-10.2/avconv_opt.c:2135
#5 0x0000000000405785 in main (argc=16, argv=0x7fffffffe0d8) at /build/libav-
KCSjC9/libav-10.2/avconv.c:2455
(gdb) info locals
c = 0x6d1b40
i = <optimized out>
j = <optimized out>
fr = <optimized out>
o = 0x7fffffffda90
norm = UNKNOWN
frame_rates = {0x41a5de "25", 0x41a977 "30000/1001", 0x41a982 "24000/1001"}
(gdb) display c->time_base
1: c->time_base = {num = 0, den = 1}
Patch:
--- libav-10.2.orig/avconv_opt.c
+++ libav-10.2/avconv_opt.c
@@ -1728,6 +1728,8 @@ static int opt_target(void *optctx, cons
AVCodecContext *c =
input_files[j]->ctx->streams[i]->codec;
if (c->codec_type != AVMEDIA_TYPE_VIDEO)
continue;
+ if (!c->time_base.num)
+ continue;
fr = c->time_base.den * 1000 / c->time_base.num;
if (fr == 25000) {
norm = PAL;
-- System Information:
Debian Release: jessie/sid
APT prefers testing-updates
APT policy: (990, 'testing-updates'), (990, 'testing'), (500, 'testing-proposed-updates')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Kernel: Linux 3.14-1-amd64 (SMP w/2 CPU cores)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Versions of packages libav-tools depends on:
ii dpkg 1.17.10
ii libavcodec55 6:10.2-1
ii libavdevice54 6:10.2-1
ii libavfilter4 6:10.2-1
ii libavformat55 6:10.2-1
ii libavresample1 6:10.2-1
ii libavutil53 6:10.2-1
ii libc6 2.19-4
ii libsdl1.2debian 1.2.15-9
ii libswscale2 6:10.2-1
ii libvdpau1 0.7-2
ii libx11-6 2:1.6.2-2
libav-tools recommends no packages.
Versions of packages libav-tools suggests:
ii frei0r-plugins 1.4-3
-- no debconf information
More information about the pkg-multimedia-maintainers
mailing list