dirkvdb / ffmpegthumbnailer

Lightweight video thumbnailer that can be used by file managers to create thumbnails for video files
GNU General Public License v2.0
524 stars 72 forks source link

ffmpegthumbnailer gives Segmentation fault on avi files #146

Closed MrDini123 closed 7 years ago

MrDini123 commented 7 years ago

Hi,

I have an ARMv5 NAS, and I decided to compile this nice tool to it. Because I am working on a script which generates thumbs automagically for every video files.

But, because I have old 2.1.8 FFmpeg version installed, the latest release of ffthumbnailer miss the libavutil/display.h header file. So, finally, I compiled the ffmpegthumbnailer 2.1.1 and packaged that. And it works like a charm with mkvs, but with avi files, it gives this:

[mp3 @ 0x17f70] Header missing
Segmentation fault

Or this:

[mpeg4 @ 0x1d120] Video uses a non-standard and wasteful way to store B-frames ('packed B-frames'). Consider using a tool like VirtualDub or avidemux to fix it.
Aborted

Or simply a segfault:

Segmentation fault (Core dumped)

Okay, for the details of the segfault, I called the help of the GNU debugger, and it said this:

(gdb) run -i ./test.avi -o /tmp/test.jpg
Starting program: /usr/local/zy-pkgs/ffproot/ffp/bin/ffmpegthumbnailer -i ./test.avi -o /tmp/test.jpg
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/ffp/lib/libthread_db.so.1".

Program received signal SIGSEGV, Segmentation fault.
0x4116d1ac in free () from /ffp/lib/libc.so.0

And a backtrace:

(gdb) bt
#0  0x4116d1ac in free () from /ffp/lib/libc.so.0
#1  0x40eb723c in av_freep () from /ffp/lib/libavutil.so.52
#2  0x40ea73f0 in av_buffer_unref () from /ffp/lib/libavutil.so.52
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

"Too" informative, isn't it? :D

What Can I do?

Many thanks!

dirkvdb commented 7 years ago

Does it work when you create a thumbnail using regular ffmpeg? ffmpeg -i test.avi -ss 00:00:10 -vframes 1 /tmp/test.jpg

MrDini123 commented 7 years ago

Yes, it is.

dirkvdb commented 7 years ago

Can you provide me the video file then so I can analyse it?

MrDini123 commented 7 years ago

Thanks for the quick reply!

Unfortunately, all avi files, that I tested gave a segfault or Aborted text.

For example this video gave me segfault:

http://download.blender.org/peach/bigbuckbunny_movies/big_buck_bunny_480p_stereo.avi

dirkvdb commented 7 years ago

I can't reproduce the crash. I just compiled version 2.1.0 on an armv7 bit it works correctly. I do have a much newer ffmpeg (3.2.2)

MrDini123 commented 7 years ago

Wow, thanks for the tip. I just tried to compile and install the ffthumbnailer 2.1.0 and it works very well! :) Maybe the 2.1.1 buggy on my system...