google-code-export / ffmpegthumbnailer

Automatically exported from code.google.com/p/ffmpegthumbnailer
GNU General Public License v2.0
1 stars 1 forks source link

segmentation fault everytime I run program correctly. Centos 5.2 x86_64 #21

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Having a bit of a problem with ffmpegthumbnailer in 64bit Centos 5.2.  I
have tried to use it two ways,

1) Using yum to install ffmpeg/ffmpeg-devel and then compile
ffmpegthumbnail using the latest svn copy (1.4 I believe).

2) Compiling both ffmpeg and ffmpegthumbnailer from source gotten from svn
repo.

In both cases I have compiled the application successfully, but running it
is a problem.  I get the same error no matter which method was used to
build it.

EXAMPLE:

[root@vm-flashdev small]# ffmpegthumbnailer -i ../CC017-04.flv -o ./test.jpg
Segmentation fault
[root@vm-flashdev small]# tail -1 /var/log/messages
Jan 23 00:07:28 vm-flashdev kernel: ffmpegthumbnail[30472] general
protection rip:2b537046b0c0 rsp:7fff3a643c50 error:0

I can use the exact same source file on a different machine that I have
used ffmpegthumbnail on in the past and it works correctly.

Other information,

[root@vm-flashdev small]# strace -f ffmpegthumbnailer -i ../CC017-04.flv -o
./test.jpg

<- snip ->

read(4,
"\274\354b\307\35\220\245\322}^\230\341i\215\270z\301d[\300l\305f#\250\306\r\177
B\305\231\212"...,
32768) = 32768
munmap(0x2aac78b3e000, 348160)          = 0
lseek(4, 0, 0x10000 /* SEEK_??? */)     = -1 EINVAL (Invalid argument)
lseek(4, -1, SEEK_END)                  = 111722202
lseek(4, 98304, SEEK_SET)               = 98304
--- SIGSEGV (Segmentation fault) @ 0 (0) ---
+++ killed by SIGSEGV +++
[root@vm-flashdev small]# 

[root@vm-flashdev small]# ldd /usr/local/bin/ffmpegthumbnailer 
        libffmpegthumbnailer.so.2 =>
/usr/local/lib/libffmpegthumbnailer.so.2 (0x00002ab9c7672000)
        libavformat.so.51 => /usr/lib64/libavformat.so.51 (0x00002ab9c788b000)
        libavcodec.so.51 => /usr/lib64/libavcodec.so.51 (0x00002ab9c7b14000)
        libz.so.1 => /usr/lib64/libz.so.1 (0x000000352de00000)
        liba52.so.0 => /usr/lib64/liba52.so.0 (0x000000352ca00000)
        libgsm.so.1 => /usr/lib64/libgsm.so.1 (0x000000346d200000)
        libmp3lame.so.0 => /usr/lib64/libmp3lame.so.0 (0x000000346da00000)
        libxvidcore.so.4 => /usr/lib64/libxvidcore.so.4 (0x000000346be00000)
        libx264.so.55 => /usr/lib64/libx264.so.55 (0x000000346e600000)
        libfaac.so.0 => /usr/lib64/libfaac.so.0 (0x000000346d600000)
        libfaad.so.0 => /usr/lib64/libfaad.so.0 (0x000000346ea00000)
        libdl.so.2 => /lib64/libdl.so.2 (0x00002ab9c81e7000)
        libtheora.so.0 => /usr/lib64/libtheora.so.0 (0x000000346f200000)
        libvorbisenc.so.2 => /usr/lib64/libvorbisenc.so.2 (0x000000346c600000)
        libavutil.so.49 => /usr/lib64/libavutil.so.49 (0x00002ab9c83ec000)
        libvorbis.so.0 => /usr/lib64/libvorbis.so.0 (0x000000346c200000)
        libogg.so.0 => /usr/lib64/libogg.so.0 (0x000000346ca00000)
        libpng12.so.0 => /usr/lib64/libpng12.so.0 (0x0000003533c00000)
        libjpeg.so.62 => /usr/lib64/libjpeg.so.62 (0x00002ab9c85f6000)
        libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x000000352f200000)
        libm.so.6 => /lib64/libm.so.6 (0x000000352ce00000)
        libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x000000352ee00000)
        libc.so.6 => /lib64/libc.so.6 (0x000000352c600000)
        libpthread.so.0 => /lib64/libpthread.so.0 (0x000000352d200000)
        /lib64/ld-linux-x86-64.so.2 (0x000000352c200000)

Thanks in advance!

Original issue reported on code.google.com by jzehn...@gmail.com on 23 Jan 2009 at 8:10

GoogleCodeExporter commented 9 years ago
can you play the file withh ffplay?

Original comment by dirk.vdb on 23 Jan 2009 at 8:20

GoogleCodeExporter commented 9 years ago
I can if I move the file to my workstation at home and try.  Unfortunately the
location I need it to work in is a server and has no video card so I get errors 
such as,

[root@vm-flashdev small]# ffplay -nodisp -vn ../CC017-04.flv 
Could not initialize SDL - No available video device

Original comment by jzehn...@gmail.com on 23 Jan 2009 at 9:19

GoogleCodeExporter commented 9 years ago
One big thing I failed to mention, this is also a VMWare ESX 3.5 virtual 
machine.  I
do not know if that plays any part in the error but I forgot to list the 
information
above.

Original comment by jzehn...@gmail.com on 23 Jan 2009 at 9:20

GoogleCodeExporter commented 9 years ago
Try to transcode the file on the target machine using the ffmpeg binary and see 
if
that works. I just want to know if something essential is wrong with your ffmpeg
installation or if is the way I invoke ffmpeg. Since the crash is occurring 
inside
ffmpeg library.

Original comment by dirk.vdb on 23 Jan 2009 at 9:25

GoogleCodeExporter commented 9 years ago
this is where i get lost as I do not normally use this program.  I am a sys 
admin
trying to get this working for someone else.  :)  I will paste what I tried in
response to your request but I am guessing it is not what you are wanting to 
see.  At
any rate I will point a developer at this thread tomorrow and get you a more 
rational
response than what is listed below.

[root@vm-flashdev small]# ffmpeg -i test1.flv -f avi test1.avi
FFmpeg version SVN-rUNKNOWN, Copyright (c) 2000-2007 Fabrice Bellard, et al.
  configuration: --prefix=/usr --libdir=/usr/lib64 --mandir=/usr/share/man
--incdir=/usr/include/ffmpeg --extra-cflags=-fPIC --enable-libmp3lame 
--enable-libogg
--enable-libvorbis --enable-libogg --enable-libtheora --enable-libfaad
--enable-libfaac --enable-libgsm --enable-xvid --enable-x264 --enable-liba52
--enable-liba52bin --enable-pp --enable-shared --enable-pthreads --enable-gpl
--disable-strip
  libavutil version: 49.4.0
  libavcodec version: 51.40.4
  libavformat version: 51.12.1
  built on Jun  4 2007 10:46:34, gcc: 4.1.1 20070105 (Red Hat 4.1.1-52)

Seems stream 0 codec frame rate differs from container frame rate: 1000.00 
(1000/1)
-> 1.00 (1/1)
Input #0, flv, from 'test1.flv':
  Duration: 00:22:10.0, start: 0.000000, bitrate: N/A
  Stream #0.0: Video: flv, yuv420p, 160x120,  1.00 fps(r)
Output #0, avi, to 'test1.avi':
  Stream #0.0: Video: mpeg4, yuv420p, 160x120, q=2-31, 200 kb/s,  1.00 fps(c)
Stream mapping:
  Stream #0.0 -> #0.0
Press [q] to stop encoding
frame= 1325 fps=  0 q=2.0 Lsize=    1688kB time=1325.0 bitrate=  10.4kbits/s    
video:119kB audio:0kB global headers:0kB muxing overhead 1315.094401%

and 

[root@vm-flashdev small]# ffmpeg -i test1.flv test2.flv
FFmpeg version SVN-rUNKNOWN, Copyright (c) 2000-2007 Fabrice Bellard, et al.
  configuration: --prefix=/usr --libdir=/usr/lib64 --mandir=/usr/share/man
--incdir=/usr/include/ffmpeg --extra-cflags=-fPIC --enable-libmp3lame 
--enable-libogg
--enable-libvorbis --enable-libogg --enable-libtheora --enable-libfaad
--enable-libfaac --enable-libgsm --enable-xvid --enable-x264 --enable-liba52
--enable-liba52bin --enable-pp --enable-shared --enable-pthreads --enable-gpl
--disable-strip
  libavutil version: 49.4.0
  libavcodec version: 51.40.4
  libavformat version: 51.12.1
  built on Jun  4 2007 10:46:34, gcc: 4.1.1 20070105 (Red Hat 4.1.1-52)

Seems stream 0 codec frame rate differs from container frame rate: 1000.00 
(1000/1)
-> 1.00 (1/1)
Input #0, flv, from 'test1.flv':
  Duration: 00:22:10.0, start: 0.000000, bitrate: N/A
  Stream #0.0: Video: flv, yuv420p, 160x120,  1.00 fps(r)
Output #0, flv, to 'test2.flv':
  Stream #0.0: Video: flv, yuv420p, 160x120, q=2-31, 200 kb/s,  1.00 fps(c)
Stream mapping:
  Stream #0.0 -> #0.0
Press [q] to stop encoding
frame= 1325 fps=  0 q=2.0 Lsize=    1882kB time=1325.0 bitrate=  11.6kbits/s    
video:145kB audio:0kB global headers:0kB muxing overhead 1198.598760%

Original comment by jzehn...@gmail.com on 23 Jan 2009 at 9:43

GoogleCodeExporter commented 9 years ago
Well, transcoding the file seems to work like a charm. Unfortunately that 
doesn't
help me solve the problem :-) It is really hard debugging crashes in ffmpeg, and
impossible if I can't reproduce it...

Original comment by dirk.vdb on 23 Jan 2009 at 9:59

GoogleCodeExporter commented 9 years ago
I would definitely need a gdb backtrace of the crash to get a better idea of the
location of the crash. 

Original comment by dirk.vdb on 23 Jan 2009 at 10:01

GoogleCodeExporter commented 9 years ago
Hope this helps..

[root@vm-flashdev small]# gdb /usr/local/bin/ffmpegthumbnailer 
GNU gdb Red Hat Linux (6.5-37.el5_2.2rh)
Copyright (C) 2006 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 "x86_64-redhat-linux-gnu"...Using host libthread_db
library "/lib64/libthread_db.so.1".

(gdb) run -i../CC017-04.flv -otest.jpg
Starting program: /usr/local/bin/ffmpegthumbnailer -i../CC017-04.flv -otest.jpg
[Thread debugging using libthread_db enabled]
[New Thread 47057714993616 (LWP 3975)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 47057714993616 (LWP 3975)]
0x00002acc7948b0c0 in MovieDecoder::initializeVideo (this=0x7fff31625d10) at
moviedecoder.cpp:114
114             if (m_pFormatContext->streams[i]->codec->codec_type == 
CODEC_TYPE_VIDEO)
(gdb) backtrace
#0  0x00002acc7948b0c0 in MovieDecoder::initializeVideo (this=0x7fff31625d10) at
moviedecoder.cpp:114
#1  0x00002acc7948b444 in MovieDecoder::initialize (this=0x7fff31625d10,
filename=@0x7fff31625ed0) at moviedecoder.cpp:68
#2  0x00002acc7948e97d in VideoThumbnailer::generateThumbnail 
(this=0x7fff31625e70,
videoFile=@0x139e49b0, 
    imageWriter=@0x139db0a0, pavContext=0x0) at videothumbnailer.cpp:118
#3  0x00002acc7948eed9 in VideoThumbnailer::generateThumbnail 
(this=0x7fff31625e70,
videoFile=@0x7fff31625ed0, 
    type=<value optimized out>, outputFile=@0x7fff31625eb0, pavContext=0x0) at
videothumbnailer.cpp:157
#4  0x00000000004018df in main (argc=<value optimized out>, argv=<value 
optimized
out>) at main.cpp:107

Original comment by jzehn...@gmail.com on 23 Jan 2009 at 10:12

GoogleCodeExporter commented 9 years ago
Interesting the crash happens on initialization, not in the ffmpeg lib as I 
wrongly
assumed. But I would need to know the values of all the variables in this 
expression
(m_pFormatContext->streams[i]->codec->codec_type) to identify the issue.

Original comment by dirk.vdb on 23 Jan 2009 at 10:43

GoogleCodeExporter commented 9 years ago
thanks for your help, i finally gave up and found an old pre-compiled copy of 
1.3 and
that is not working on the same box.  i will just go with this until someone 
graces
us with centos yum package.  :)

Original comment by jzehn...@gmail.com on 24 Jan 2009 at 12:30

GoogleCodeExporter commented 9 years ago

Original comment by dirk.vdb on 12 May 2009 at 8:38