program.2008-12-10.21-03-03.initial.mpg Captured on a Avermedia AVerTV DVB-T PCI tuner. kernel: 2.6.27 ish Transport stream, a HD channel, with a single AC3 stream Issue is noted when using dvbcut's output to ffmpeg program stream capability, where a floating point error is raised: (with an augmented libavformat/utils.c) ===== $ ffmpeg -i cd /home/media/dvb/program/program.2008-12-10.21-03-03.mpg program.2008-12-10.21-03-03.mpg program.2008-12-10.21-03-03.mpg.idx bash-3.2$ ffmpeg -i /home/media/dvb/program/program.2008-12-10.21-03-03.mpg FFmpeg version SVN-r16176, Copyright (c) 2000-2008 Fabrice Bellard, et al. configuration: --prefix=/usr --incdir=/usr/include/ffmpeg --libdir=/usr/lib --mandir=/usr/share/man --arch=i386 --extra-cflags=-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables --enable-bzlib --enable-libdc1394 --enable-libfaac --enable-libfaad --enable-libgsm --enable-libmp3lame --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --enable-x11grab --enable-avfilter --enable-avfilter-lavf --enable-postproc --enable-swscale --enable-pthreads --disable-static --enable-shared --enable-gpl --disable-debug --disable-optimizations --disable-stripping --shlibdir=/usr/lib --cpu=i386 libavutil 49.12. 0 / 49.12. 0 libavcodec 52. 7. 0 / 52. 7. 0 libavformat 52.23. 1 / 52.23. 1 libavdevice 52. 1. 0 / 52. 1. 0 libavfilter 0. 1. 0 / 0. 1. 0 libswscale 0. 6. 1 / 0. 6. 1 libpostproc 51. 2. 0 / 51. 2. 0 built on Dec 22 2008 20:17:30, gcc: 4.3.0 20080428 (Red Hat 4.3.0-8) Input #0, mpegts, from '/home/media/dvb/program/program.2008-12-10.21-03-03.mpg': Duration: 00:32:03.39, start: 54401.052789, bitrate: 16979 kb/s Stream #0.0[0x2a0]: Audio: ac3, 48000 Hz, stereo, s16, 448 kb/s Stream #0.1[0x202]: Video: mpeg2video, yuv420p, 1920x1080 [PAR 1:1 DAR 16:9], 90000 kb/s, 25.00 tb(r) At least one output file must be specified --- Note the vi rate of 90,000kbits/sec. is that realistic (I think not). [compiled on F9] ===== augmented code at: uploaded incoming/timmsy/utils.c ===== $ gdb dvbcut GNU gdb Fedora (6.8-23.fc9) Copyright (C) 2008 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "i386-redhat-linux-gnu"... (gdb) r Starting program: /usr/bin/dvbcut [Thread debugging using libthread_db enabled] [New Thread 0xb7fc9790 (LWP 12496)] Analyzed transport stream, 0 bytes of initial data (IRC=-1) [ac3 @ 0x9f7e8c0]frame sync error Output #0, dvd, to '/home/media/dvb/program/program.2008-12-10.21-03-03_21.mpg': Stream #0.0: Video: mpeg2video, yuv420p, 1920x1080 [PAR 1:1 DAR 16:9], q=2-2, 9500 kb/s, 25.00 tb(c) Stream #0.1: Audio: ac3, 0 channels, s16, 64 kb/s [dvd @ 0xa04e010]sample rate not set av_interleaved_write_frame--B compute_pkt_fields2--B compute_pkt_fields2--C compute_pkt_fields2--D compute_pkt_fields2--E compute_pkt_fields2--F compute_pkt_fields2--G compute_pkt_fields2--H compute_pkt_fields2--J compute_pkt_fields2--K compute_pkt_fields2--O compute_pkt_fields2--U compute_pkt_fields2--W compute_pkt_fields2--Y 2--ZV1 frame:0|0|0| 2--ZV1 incr :90000 Program received signal SIGFPE, Arithmetic exception. 0x0018dd60 in __divdi3 () from /usr/lib/i686/libavformat.so.52 (gdb) (gdb) (gdb) (gdb) (gdb) bt #0 0x0018dd60 in __divdi3 () from /usr/lib/i686/libavformat.so.52 #1 0x00127b88 in av_frac_add (f=0x9f0a910, incr=) at /usr/src/debug/ffmpeg-20081217/libavformat/utils.c:91 #2 0x00128b86 in compute_pkt_fields2 (st=0x9f0a8f0, pkt=0xbf9f548c) at /usr/src/debug/ffmpeg-20081217/libavformat/utils.c:2626 #3 0x0012c9d5 in av_interleaved_write_frame (s=0xa04e010, pkt=0xbf9f548c) at /usr/src/debug/ffmpeg-20081217/libavformat/utils.c:2729 #4 0x08072ece in lavfmuxer::putpacket (this=0x9f89da8, str=32, data=0xadf7fe6c, len=148212, pts=3600, dts=0, flags=) at lavfmuxer.h:78 #5 0x0807d9ed in mpgfile::savempg (this=0x9fa9a68, mux=@0x9f89da8, start=8801, stop=9018, savedpics=0, savepics=217, log=0x9f8b7a4) at mpgfile.cpp:556 #6 0x0805ffff in dvbcut::fileExport (this=0x9ec9328) at dvbcut.cpp:722 #7 0x0808f79b in dvbcutbase::qt_invoke (this=0x9ec9328, _id=91, _o=0xbf9f5e74) at moc_dvbcutbase.cpp:212 #8 0x06495b5a in QObject::activate_signal (this=, clist=, o=) at kernel/qobject.cpp:2359 #9 0x0649766b in QObject::activate_signal (this=, signal=) at kernel/qobject.cpp:2328 #10 0x06853889 in QAction::activated (this=Could not find the frame base for "QAction::activated()". ) at .moc/release-shared-mt/moc_qaction.cpp:150 #11 0x065f7750 in QAction::internalActivation (this=) at widgets/qaction.cpp:982 #12 0x06853640 in QAction::qt_invoke (this=, _id=, _o=Could not find the frame base for "QAction::qt_invoke(int, QUObject*)". ) at .moc/release-shared-mt/moc_qaction.cpp:168 #13 0x06495b5a in QObject::activate_signal (this=, clist=, o=) at kernel/qobject.cpp:2359 #14 0x0682e59c in QSignal::signal (this=, t0=) at .moc/release-shared-mt/moc_qsignal.cpp:100 #15 0x064b570d in QSignal::activate (this=) at kernel/qsignal.cpp:215 #16 0x065ba6ec in QPopupMenu::mouseReleaseEvent (this=, e=) at widgets/qpopupmenu.cpp:1735 #17 0x064d2df1 in QWidget::event (this=, e=) at kernel/qwidget.cpp:4705 #18 0x0642cdbd in QApplication::internalNotify (this=, receiver=, e=) at kernel/qapplication.cpp:2638 #19 0x0642e13f in QApplication::notify (this=, receiver=, e=) at kernel/qapplication.cpp:2424 #20 0x063c46be in QApplication::sendSpontaneousEvent (receiver=Could not find the frame base for "QApplication::sendSpontaneousEvent(QObject*, QEvent*)". ) at kernel/qapplication.h:526 #21 0x063c443f in QETWidget::translateMouseEvent (this=, event=) at kernel/qapplication_x11.cpp:4281 #22 0x063c336a in QApplication::x11ProcessEvent (this=, ---Type to continue, or q to quit--- event=) at kernel/qapplication_x11.cpp:3516 #23 0x063d53bb in QEventLoop::processEvents (this=, flags=) at kernel/qeventloop_x11.cpp:195 #24 0x064474a0 in QEventLoop::enterLoop (this=) at kernel/qeventloop.cpp:201 #25 0x06447366 in QEventLoop::exec (this=Could not find the frame base for "QEventLoop::exec()". ) at kernel/qeventloop.cpp:148 #26 0x0642d49f in QApplication::exec (this=Could not find the frame base for "QApplication::exec()". ) at kernel/qapplication.cpp:2761 #27 0x08073f96 in main (argc=Cannot access memory at address 0x0 ) at main.cpp:272 (gdb) disass $pc-32 $pc+32 Dump of assembler code from 0x18dd40 to 0x18dd80: 0x0018dd40 <__divdi3+112>: neg %eax 0x0018dd42 <__divdi3+114>: adc $0x0,%edx 0x0018dd45 <__divdi3+117>: neg %edx 0x0018dd47 <__divdi3+119>: add $0x28,%esp 0x0018dd4a <__divdi3+122>: pop %esi 0x0018dd4b <__divdi3+123>: pop %edi 0x0018dd4c <__divdi3+124>: pop %ebp 0x0018dd4d <__divdi3+125>: ret 0x0018dd4e <__divdi3+126>: xchg %ax,%ax 0x0018dd50 <__divdi3+128>: mov -0x14(%ebp),%esi 0x0018dd53 <__divdi3+131>: test %esi,%esi 0x0018dd55 <__divdi3+133>: jne 0x18dd66 <__divdi3+150> 0x0018dd57 <__divdi3+135>: mov $0x1,%ecx 0x0018dd5c <__divdi3+140>: xor %edx,%edx 0x0018dd5e <__divdi3+142>: mov %ecx,%eax 0x0018dd60 <__divdi3+144>: divl -0x14(%ebp) 0x0018dd63 <__divdi3+147>: mov %eax,-0x14(%ebp) 0x0018dd66 <__divdi3+150>: mov -0x30(%ebp),%esi 0x0018dd69 <__divdi3+153>: xor %edx,%edx 0x0018dd6b <__divdi3+155>: mov -0x18(%ebp),%ecx 0x0018dd6e <__divdi3+158>: mov %esi,%eax 0x0018dd70 <__divdi3+160>: divl -0x14(%ebp) 0x0018dd73 <__divdi3+163>: mov %eax,%esi 0x0018dd75 <__divdi3+165>: mov %ecx,%eax 0x0018dd77 <__divdi3+167>: divl -0x14(%ebp) 0x0018dd7a <__divdi3+170>: mov %eax,%ecx 0x0018dd7c <__divdi3+172>: jmp 0x18dd35 <__divdi3+101> 0x0018dd7e <__divdi3+174>: xchg %ax,%ax End of assembler dump. (gdb) program.2008-12-10.21-03-03.initial.mpg Captured on a Avermedia AVerTV DVB-T PCI tuner. kernel: 2.6.27 ish Transport stream, a HD channel, with a single AC3 stream Issue is noted when using dvbcut's output to ffmpeg program stream capability, where a floating point error is raised: (with an augmented libavformat/utils.c) Basically, in avformat, it sets up a structure to hold a fractional number - whose init av_frac_init() is never called. Then av_frac_add() is used, which I think causes the crash. dvbcut is intended to take a dvb transport stream, and write out a program stream, without re-sampling frames etc, except for at the start / end of a clipped section. ===== $ ffmpeg -i cd /home/media/dvb/program/program.2008-12-10.21-03-03.mpg program.2008-12-10.21-03-03.mpg program.2008-12-10.21-03-03.mpg.idx bash-3.2$ ffmpeg -i /home/media/dvb/program/program.2008-12-10.21-03-03.mpg FFmpeg version SVN-r16176, Copyright (c) 2000-2008 Fabrice Bellard, et al. configuration: --prefix=/usr --incdir=/usr/include/ffmpeg --libdir=/usr/lib --mandir=/usr/share/man --arch=i386 --extra-cflags=-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables --enable-bzlib --enable-libdc1394 --enable-libfaac --enable-libfaad --enable-libgsm --enable-libmp3lame --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --enable-x11grab --enable-avfilter --enable-avfilter-lavf --enable-postproc --enable-swscale --enable-pthreads --disable-static --enable-shared --enable-gpl --disable-debug --disable-optimizations --disable-stripping --shlibdir=/usr/lib --cpu=i386 libavutil 49.12. 0 / 49.12. 0 libavcodec 52. 7. 0 / 52. 7. 0 libavformat 52.23. 1 / 52.23. 1 libavdevice 52. 1. 0 / 52. 1. 0 libavfilter 0. 1. 0 / 0. 1. 0 libswscale 0. 6. 1 / 0. 6. 1 libpostproc 51. 2. 0 / 51. 2. 0 built on Dec 22 2008 20:17:30, gcc: 4.3.0 20080428 (Red Hat 4.3.0-8) Input #0, mpegts, from '/home/media/dvb/program/program.2008-12-10.21-03-03.mpg': Duration: 00:32:03.39, start: 54401.052789, bitrate: 16979 kb/s Stream #0.0[0x2a0]: Audio: ac3, 48000 Hz, stereo, s16, 448 kb/s Stream #0.1[0x202]: Video: mpeg2video, yuv420p, 1920x1080 [PAR 1:1 DAR 16:9], 90000 kb/s, 25.00 tb(r) At least one output file must be specified --- Note the vi rate of 90,000kbits/sec. is that realistic (I think not). [compiled on F9] ===== augmented code at: uploaded incoming/timmsy/utils.c and patch that adds those printf's: ffmpeg-prints.patch ===== $ gdb dvbcut GNU gdb Fedora (6.8-23.fc9) Copyright (C) 2008 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "i386-redhat-linux-gnu"... (gdb) r Starting program: /usr/bin/dvbcut [Thread debugging using libthread_db enabled] [New Thread 0xb7fc9790 (LWP 12496)] Analyzed transport stream, 0 bytes of initial data (IRC=-1) [ac3 @ 0x9f7e8c0]frame sync error Output #0, dvd, to '/home/media/dvb/program/program.2008-12-10.21-03-03_21.mpg': Stream #0.0: Video: mpeg2video, yuv420p, 1920x1080 [PAR 1:1 DAR 16:9], q=2-2, 9500 kb/s, 25.00 tb(c) Stream #0.1: Audio: ac3, 0 channels, s16, 64 kb/s [dvd @ 0xa04e010]sample rate not set av_interleaved_write_frame--B compute_pkt_fields2--B compute_pkt_fields2--C compute_pkt_fields2--D compute_pkt_fields2--E compute_pkt_fields2--F compute_pkt_fields2--G compute_pkt_fields2--H compute_pkt_fields2--J compute_pkt_fields2--K compute_pkt_fields2--O compute_pkt_fields2--U compute_pkt_fields2--W compute_pkt_fields2--Y 2--ZV1 frame:0|0|0| 2--ZV1 incr :90000 Program received signal SIGFPE, Arithmetic exception. 0x0018dd60 in __divdi3 () from /usr/lib/i686/libavformat.so.52 (gdb) (gdb) (gdb) (gdb) (gdb) bt #0 0x0018dd60 in __divdi3 () from /usr/lib/i686/libavformat.so.52 #1 0x00127b88 in av_frac_add (f=0x9f0a910, incr=) at /usr/src/debug/ffmpeg-20081217/libavformat/utils.c:91 #2 0x00128b86 in compute_pkt_fields2 (st=0x9f0a8f0, pkt=0xbf9f548c) at /usr/src/debug/ffmpeg-20081217/libavformat/utils.c:2626 #3 0x0012c9d5 in av_interleaved_write_frame (s=0xa04e010, pkt=0xbf9f548c) at /usr/src/debug/ffmpeg-20081217/libavformat/utils.c:2729 #4 0x08072ece in lavfmuxer::putpacket (this=0x9f89da8, str=32, data=0xadf7fe6c, len=148212, pts=3600, dts=0, flags=) at lavfmuxer.h:78 #5 0x0807d9ed in mpgfile::savempg (this=0x9fa9a68, mux=@0x9f89da8, start=8801, stop=9018, savedpics=0, savepics=217, log=0x9f8b7a4) at mpgfile.cpp:556 #6 0x0805ffff in dvbcut::fileExport (this=0x9ec9328) at dvbcut.cpp:722 #7 0x0808f79b in dvbcutbase::qt_invoke (this=0x9ec9328, _id=91, _o=0xbf9f5e74) at moc_dvbcutbase.cpp:212 #8 0x06495b5a in QObject::activate_signal (this=, clist=, o=) at kernel/qobject.cpp:2359 #9 0x0649766b in QObject::activate_signal (this=, signal=) at kernel/qobject.cpp:2328 #10 0x06853889 in QAction::activated (this=Could not find the frame base for "QAction::activated()". ) at .moc/release-shared-mt/moc_qaction.cpp:150 #11 0x065f7750 in QAction::internalActivation (this=) at widgets/qaction.cpp:982 #12 0x06853640 in QAction::qt_invoke (this=, _id=, _o=Could not find the frame base for "QAction::qt_invoke(int, QUObject*)". ) at .moc/release-shared-mt/moc_qaction.cpp:168 #13 0x06495b5a in QObject::activate_signal (this=, clist=, o=) at kernel/qobject.cpp:2359 #14 0x0682e59c in QSignal::signal (this=, t0=) at .moc/release-shared-mt/moc_qsignal.cpp:100 #15 0x064b570d in QSignal::activate (this=) at kernel/qsignal.cpp:215 #16 0x065ba6ec in QPopupMenu::mouseReleaseEvent (this=, e=) at widgets/qpopupmenu.cpp:1735 #17 0x064d2df1 in QWidget::event (this=, e=) at kernel/qwidget.cpp:4705 #18 0x0642cdbd in QApplication::internalNotify (this=, receiver=, e=) at kernel/qapplication.cpp:2638 #19 0x0642e13f in QApplication::notify (this=, receiver=, e=) at kernel/qapplication.cpp:2424 #20 0x063c46be in QApplication::sendSpontaneousEvent (receiver=Could not find the frame base for "QApplication::sendSpontaneousEvent(QObject*, QEvent*)". ) at kernel/qapplication.h:526 #21 0x063c443f in QETWidget::translateMouseEvent (this=, event=) at kernel/qapplication_x11.cpp:4281 #22 0x063c336a in QApplication::x11ProcessEvent (this=, ---Type to continue, or q to quit--- event=) at kernel/qapplication_x11.cpp:3516 #23 0x063d53bb in QEventLoop::processEvents (this=, flags=) at kernel/qeventloop_x11.cpp:195 #24 0x064474a0 in QEventLoop::enterLoop (this=) at kernel/qeventloop.cpp:201 #25 0x06447366 in QEventLoop::exec (this=Could not find the frame base for "QEventLoop::exec()". ) at kernel/qeventloop.cpp:148 #26 0x0642d49f in QApplication::exec (this=Could not find the frame base for "QApplication::exec()". ) at kernel/qapplication.cpp:2761 #27 0x08073f96 in main (argc=Cannot access memory at address 0x0 ) at main.cpp:272 (gdb) disass $pc-32 $pc+32 Dump of assembler code from 0x18dd40 to 0x18dd80: 0x0018dd40 <__divdi3+112>: neg %eax 0x0018dd42 <__divdi3+114>: adc $0x0,%edx 0x0018dd45 <__divdi3+117>: neg %edx 0x0018dd47 <__divdi3+119>: add $0x28,%esp 0x0018dd4a <__divdi3+122>: pop %esi 0x0018dd4b <__divdi3+123>: pop %edi 0x0018dd4c <__divdi3+124>: pop %ebp 0x0018dd4d <__divdi3+125>: ret 0x0018dd4e <__divdi3+126>: xchg %ax,%ax 0x0018dd50 <__divdi3+128>: mov -0x14(%ebp),%esi 0x0018dd53 <__divdi3+131>: test %esi,%esi 0x0018dd55 <__divdi3+133>: jne 0x18dd66 <__divdi3+150> 0x0018dd57 <__divdi3+135>: mov $0x1,%ecx 0x0018dd5c <__divdi3+140>: xor %edx,%edx 0x0018dd5e <__divdi3+142>: mov %ecx,%eax 0x0018dd60 <__divdi3+144>: divl -0x14(%ebp) 0x0018dd63 <__divdi3+147>: mov %eax,-0x14(%ebp) 0x0018dd66 <__divdi3+150>: mov -0x30(%ebp),%esi 0x0018dd69 <__divdi3+153>: xor %edx,%edx 0x0018dd6b <__divdi3+155>: mov -0x18(%ebp),%ecx 0x0018dd6e <__divdi3+158>: mov %esi,%eax 0x0018dd70 <__divdi3+160>: divl -0x14(%ebp) 0x0018dd73 <__divdi3+163>: mov %eax,%esi 0x0018dd75 <__divdi3+165>: mov %ecx,%eax 0x0018dd77 <__divdi3+167>: divl -0x14(%ebp) 0x0018dd7a <__divdi3+170>: mov %eax,%ecx 0x0018dd7c <__divdi3+172>: jmp 0x18dd35 <__divdi3+101> 0x0018dd7e <__divdi3+174>: xchg %ax,%ax End of assembler dump. (gdb)