ffmpeg wmv to flv encoding produces segmentation fault

Bug #530186 reported by heinzkeinz
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
FFmpeg
Fix Released
Undecided
Unassigned
ffmpeg (Ubuntu)
Fix Released
Low
Unassigned

Bug Description

Hi there,

when I try to en code a wmv file to flv with ffmpeg I get reproducible segmentation faults:
The file I use is a file which comes with Windows Media Encoder 9:
C:\Program Files\Windows Media Components\Encoder\intermission.wmv

This happens on Karmic
2.6.31-19-server #56-Ubuntu SMP Thu Jan 28 03:40:48 UTC 2010 x86_64 GNU/Linux

command:
 `which ffmpeg` -i "/home/heinz/videos/intermission.8287176493597819.wmv" -b 400k -f flv -acodec libmp3lame -ar 22050 -ab 64k -ac 2 -async 4 -s 320x240 "/home/heinz/videos//intermission.8287176493597819.flv"

FFmpeg version SVN-r19352-4:0.5+svn20090706-2ubuntu2, Copyright (c) 2000-2009 Fabrice Bellard, et al.
  configuration: --extra-version=4:0.5+svn20090706-2ubuntu2 --prefix=/usr --enable-avfilter --enable-avfilter-lavf --enable-vdpau --enable-bzlib --enable-libgsm --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-pthreads --enable-zlib --disable-stripping --disable-vhook --enable-gpl --enable-postproc --enable-swscale --enable-x11grab --enable-libdc1394 --extra-cflags=-I/build/buildd/ffmpeg-0.5+svn20090706/debian/include --enable-shared --disable-static
  libavutil 49.15. 0 / 49.15. 0
  libavcodec 52.20. 0 / 52.20. 0
  libavformat 52.31. 0 / 52.31. 0
  libavdevice 52. 1. 0 / 52. 1. 0
  libavfilter 0. 4. 0 / 0. 4. 0
  libswscale 0. 7. 1 / 0. 7. 1
  libpostproc 51. 2. 0 / 51. 2. 0
  built on Oct 13 2009 22:35:00, gcc: 4.4.1

Seems stream 1 codec frame rate differs from container frame rate: 1000.00 (1000/1) -> 30.00 (30/1)
Input #0, asf, from '/home/heinz/videos/intermission.8287176493597819.wmv':
  Duration: 00:00:39.94, start: 20.000000, bitrate: 229 kb/s
    Stream #0.0: Audio: wmav2, 48000 Hz, stereo, s16, 64 kb/s
    Stream #0.1: Video: wmv3, yuv420p, 320x240, 300 kb/s, 30 tbr, 1k tbn, 1k tbc
Output #0, flv, to '/home/heinz/videos/intermission.8387767988976978.flv':
    Stream #0.0: Video: flv, yuv420p, 320x240, q=2-31, 400 kb/s, 90k tbn, 30 tbc
    Stream #0.1: Audio: libmp3lame, 22050 Hz, stereo, s16, 64 kb/s
Stream mapping:
  Stream #0.1 -> #0.0
  Stream #0.0 -> #0.1
Press [q] to stop encoding
Segmentation fault
[swscaler @ 0x1d28d60]No accelerated colorspace conversion found.
[swscaler @ 0x24d0d60]No accelerated colorspace conversion found.

dmesg says:
[941811.816492] ffmpeg[31511]: segfault at 7fe01c78bf20 ip 00007fe01c1377f6 sp 00007fff65cdcd08 error 7 in libavcodec.so.52.20.0[7fe01c056000+530000]

The same happens on Jaunty:
2.6.28-18-server #59-Ubuntu SMP Thu Jan 28 02:25:03 UTC 2010 x86_64 GNU/Linux

command:
`which ffmpeg` -i "/home/heinz/intermission.wmv" -b 400k -f flv -acodec libmp3lame -ar 22050 -ab 64k -ac 2 -async 4 -s 320x240 "/home/heinz/intermission.wmv"

FFmpeg version 0.5-svn17737+3:0.svn20090303-1ubuntu6, Copyright (c) 2000-2009 Fabrice Bellard, et al.
  configuration: --enable-gpl --enable-postproc --enable-swscale --enable-x11grab --extra-version=svn17737+3:0.svn20090303-1ubuntu6 --prefix=/usr --enable-avfilter --enable-avfilter-lavf --enable-libgsm --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-pthreads --disable-stripping --disable-vhook --enable-libdc1394 --enable-shared --disable-static
  libavutil 49.15. 0 / 49.15. 0
  libavcodec 52.20. 0 / 52.20. 0
  libavformat 52.31. 0 / 52.31. 0
  libavdevice 52. 1. 0 / 52. 1. 0
  libavfilter 0. 4. 0 / 0. 4. 0
  libswscale 0. 7. 1 / 0. 7. 1
  libpostproc 51. 2. 0 / 51. 2. 0
  built on Apr 10 2009 23:20:33, gcc: 4.3.3

Seems stream 1 codec frame rate differs from container frame rate: 1000.00 (1000/1) -> 30.00 (30/1)
Input #0, asf, from '/home/robert/intermission.wmv':
  Duration: 00:00:39.94, start: 20.000000, bitrate: 229 kb/s
    Stream #0.0: Audio: wmav2, 48000 Hz, stereo, s16, 64 kb/s
    Stream #0.1: Video: wmv3, yuv420p, 320x240, 300 kb/s, 30 tbr, 1k tbn, 1k tbc
Output #0, flv, to 'intermission.flv':
    Stream #0.0: Video: flv, yuv420p, 320x240, q=2-31, 400 kb/s, 90k tbn, 30 tbc
    Stream #0.1: Audio: libmp3lame, 22050 Hz, stereo, s16, 64 kb/s
Stream mapping:
  Stream #0.1 -> #0.0
  Stream #0.0 -> #0.1
Press [q] to stop encoding
Segmentation fault2 q=2.0 size= 0kB time=16.53 bitrate= 0.1kbits/s

dmesg says:

[1154416.757786] ffmpeg[26557]: segfault at 7f277e555020 ip 00007f277df45cf7 sp 00007fff3e7d5ca8 error 7 in libavcodec.so.52.20.0[7f277debb000+494000]

Any Ideas?

Salu2

Heinz

Revision history for this message
Reinhard Tartler (siretart) wrote : Re: [Bug 530186] [NEW] ffmpeg wmv to flv encoding produces segmentation fault

TBH, I supect that this particular wmv file uses a non-implemented
colorspace. Does this also occur with ffmpeg trunk?

also, can you please attach the sample to this bug? If it doesn't occur
with trunk, it could be useful for bisecting the change that fixes this
segfault.

Revision history for this message
llogan (loul) wrote :

This does not occur in FFmpeg SVN for me, but using the above command I get a seg fault on a wmv2 and a wmv3 file. This seems to occur when -async is >= 2 in Karmic. The seg fault did not give the swscaler error. Changing the output format did not prevent a seg fault. There was no seg fault using two other input formats: DV and H.264.

Revision history for this message
Reinhard Tartler (siretart) wrote :

in this case this report needs forwarding upstream. See http://ffmpeg.org/bugreports.html for instructions how to do that

Revision history for this message
Reinhard Tartler (siretart) wrote :

setting to incomplete as the bug does not have a sample file attached

affects: ffmpeg-extra (Ubuntu) → ffmpeg (Ubuntu)
Changed in ffmpeg (Ubuntu):
importance: Undecided → Low
status: New → Incomplete
Revision history for this message
heinzkeinz (heinzkeinz) wrote :

Hi I attach this wmv file.
It is one that comes with Microsoft Windows Media Encoder 9, so it should be rather a standard one

Revision history for this message
heinzkeinz (heinzkeinz) wrote :

@LouL
__________________
You are right. using async > 2 does not give segmentation faults, neither in Jaunty, nor in Karmic, this workaround should work for me, thanks

@Reinhard Tartler
__________________
I use the "default" installation
in Karmic:
ffmpeg 4:0.5+svn20090706-2ubuntu2
libavcodec-extra-52 4:0.5+svn20090706-2ubuntu3
ubuntu-restricted-extras 36

and Jaunty:
ffmpeg 3:0.svn20090303-1ubuntu6
libavcodec-unstripped-52 3:0.svn20090303-1ubuntu2+unstripped1
ubuntu-restricted-extras 31

I would have to compile ffmpeg trunk on both to test, but as these are production servers I don't really dare.
The problems seems to be libavcodec, no?
If I find some time this afternoon I 'll compile trunk on clean Karmic, if it encoding produces segfault I'll report upstream bug.
In any case I'll let you know.

Revision history for this message
Reinhard Tartler (siretart) wrote :

with the provided sample I was able to reproduce the crash with ffmpeg 0.5.1. See the attached stack trace.

Revision history for this message
Reinhard Tartler (siretart) wrote :
Revision history for this message
Reinhard Tartler (siretart) wrote :

this does not occur in ffmpeg trunk, only in 0.5.1

Changed in ffmpeg:
status: New → Fix Released
Revision history for this message
heinzkeinz (heinzkeinz) wrote :

@Reinhard Tartler
_______________________
No segmentation fault on ffmpeg trunk as of today Mar 2 2010
built on clean Karmic install

Hope this info is useful,
if you need any further info let me know ..

`which ffmpeg` -i "intermission.wmv" -b 400k -f flv -acodec libmp3lame -ar 22050 -ab 64k -ac 2 -async 4 -s 320x240 "intermission.flv"
FFmpeg version SVN-r22144, Copyright (c) 2000-2010 the FFmpeg developers
  built on Mar 2 2010 13:44:04 with gcc 4.4.1
  configuration: --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-pthreads --enable-libfaac --enable-libfaad --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libx264 --enable-libxvid --enable-x11grab
  libavutil 50. 9. 0 / 50. 9. 0
  libavcodec 52.55. 0 / 52.55. 0
  libavformat 52.54. 0 / 52.54. 0
  libavdevice 52. 2. 0 / 52. 2. 0
  libswscale 0.10. 0 / 0.10. 0
  libpostproc 51. 2. 0 / 51. 2. 0

Seems stream 1 codec frame rate differs from container frame rate: 1000.00 (1000/1) -> 30.00 (30/1)
Input #0, asf, from 'intermission.wmv':
  Metadata:
    WMFSDKVersion : 9.00.00.2925
    WMFSDKNeeded : 0.0.0.0000
    IsVBR : 0
  Duration: 00:00:39.99, start: 20.000000, bitrate: 229 kb/s
    Stream #0.0(eng): Audio: wmav2, 48000 Hz, 2 channels, s16, 64 kb/s
    Stream #0.1(eng): Video: wmv3, yuv420p, 320x240, 300 kb/s, 30 tbr, 1k tbn, 1k tbc
Output #0, flv, to 'intermission.flv':
  Metadata:
    encoder : Lavf52.54.0
    Stream #0.0(eng): Video: flv, yuv420p, 320x240, q=2-31, 400 kb/s, 1k tbn, 30 tbc
    Stream #0.1(eng): Audio: libmp3lame, 22050 Hz, 2 channels, s16, 64 kb/s
Stream mapping:
  Stream #0.1 -> #0.0
  Stream #0.0 -> #0.1
Press [q] to stop encoding
frame= 1199 fps=1044 q=2.0 Lsize= 1574kB time=40.00 bitrate= 322.4kbits/s
video:1217kB audio:314kB global headers:0kB muxing overhead 2.812108%

Changed in ffmpeg (Ubuntu):
status: Incomplete → Triaged
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ffmpeg - 4:0.6~svn20100505-1ubuntu1

---------------
ffmpeg (4:0.6~svn20100505-1ubuntu1) maverick; urgency=low

  * merge from debian/experimental. remaining changes:
    - don't disable encoders
    - don't build against libfaad, libdirac and libopenjpeg (all in universe)

ffmpeg (4:0.6~svn20100505-1) experimental; urgency=low

  * update to new upstream. Closes: #569727
    - fixes various segfaults and other minor feature improvements
      Closes: #374931, #522449, #501891, #559712, #420231, #369127, #538082,
              #298095, #294422, #561553, #525385, #495274, #420230
      LP: #305286, #457106, #529200, #301723, #305315, #336479, #420230,
          #412063, #428912, #432181, #440591, #453732, #453732, #453732,
      #514259, #515243, #521472, #530186, #530186, #197842, #483317,
     #483317, #539407, #280098, #331255, #566107, #569823, #570305,
     #573190
  * Fixup lintian overrides for new upstream snapshot
  * Bump Standards-Version to 3.8.4
  * Many upstream changes, see upstream Changelog for details
 -- Reinhard Tartler <email address hidden> Wed, 26 May 2010 00:01:17 +0200

Changed in ffmpeg (Ubuntu):
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.