# flvtool2 EOFError and FFmpeg Segmentation Error

**URL:** https://community.wowza.com/t/flvtool2-eoferror-and-ffmpeg-segmentation-error/354
**Category:** Wowza Streaming Engine
**Created:** [June 3, 2008, 6:06pm UTC](https://community.wowza.com/t/flvtool2-eoferror-and-ffmpeg-segmentation-error/354 "2008-06-03T18:06:44Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![system](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/system/32/447_2.png) [@system](https://community.wowza.com/u/system)
#### Post date: [June 3, 2008, 6:06pm UTC](https://community.wowza.com/t/flvtool2-eoferror-and-ffmpeg-segmentation-error/354/1 "2008-06-03T18:06:44Z")

</div>

Ok, so I’ve been generating thumbnails from FLVs using ffmpeg. About 80% of the time, it works without any issues.

But sometime, some FLV’s appear to be faulty and they cause error in FFmpeg which says ‘Segmentation Fault’ or ‘Segmentation Error’.

When this happens, I process these faulty FLV files through FLVTool2, and inject metadata into them which fixes about 80% of the time also. But the remaing 20% is a huge problem because FLVtool2 outputs a 0 byte sized FLV file.

The problem I believe is the same as from this thread below but it was reportedly fixed in wowza version 1.0 and we’re using 1.5, so I’m not sure what to do…

[https://www.wowza.com/forums/showthread.php?p=896](https://www.wowza.com/forums/showthread.php?p=896)

This is the output from my FLVTool2:

ERROR: EOFError

ERROR: /usr/lib/ruby/site\_ruby/1.8/flv/amf\_string\_buffer.rb:37:in `read’

ERROR: /usr/lib/ruby/site\_ruby/1.8/flv/amf\_string\_buffer.rb:243:in `read\_\_STRING’

ERROR: /usr/lib/ruby/site\_ruby/1.8/flv/audio\_tag.rb:56:in `read\_header’

ERROR: /usr/lib/ruby/site\_ruby/1.8/flv/audio\_tag.rb:47:in `after\_initialize’

ERROR: /usr/lib/ruby/site\_ruby/1.8/flv/tag.rb:56:in `initialize’

ERROR: /usr/lib/ruby/site\_ruby/1.8/flv/stream.rb:447:in `new’

ERROR: /usr/lib/ruby/site\_ruby/1.8/flv/stream.rb:447:in `read\_tags’

ERROR: /usr/lib/ruby/site\_ruby/1.8/flv/stream.rb:58:in `initialize’

ERROR: /usr/lib/ruby/site\_ruby/1.8/flvtool2/base.rb:272:in `new’

ERROR: /usr/lib/ruby/site\_ruby/1.8/flvtool2/base.rb:272:in `open\_stream’

ERROR: /usr/lib/ruby/site\_ruby/1.8/flvtool2/base.rb:238:in `process\_files’

ERROR: /usr/lib/ruby/site\_ruby/1.8/flvtool2/base.rb:225:in `each’

ERROR: /usr/lib/ruby/site\_ruby/1.8/flvtool2/base.rb:225:in `process\_files’

ERROR: /usr/lib/ruby/site\_ruby/1.8/flvtool2/base.rb:44:in `execute!’

ERROR: /usr/lib/ruby/site\_ruby/1.8/flvtool2.rb:168:in `execute!’

ERROR: /usr/lib/ruby/site\_ruby/1.8/flvtool2.rb:228

ERROR: /usr/bin/flvtool2:2:in `require’

ERROR: /usr/bin/flvtool2:2

Skipping file /usr/local/WowzaMediaServerPro/content/test.flv

Any help would be appreciated, thanks

---

<div class="post-metadata">

### Author: ![Charlie\_Good](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/charlie_good/32/383_2.png) [@Charlie\_Good](https://community.wowza.com/u/Charlie_Good)
#### Post date: [June 3, 2008, 10:12am UTC](https://community.wowza.com/t/flvtool2-eoferror-and-ffmpeg-segmentation-error/354/2 "2008-06-03T10:12:57Z")

</div>

We put the fix in then took it back out because it was flvtool2 that actually had the problem. Try following the instructios in this forum post to fix flvtool2:

[http://community.wowza.com/t/-/36](http://community.wowza.com/t/-/36)

Charlie

---

<div class="post-metadata">

### Author: ![louie\_choy](https://avatars.discourse-cdn.com/v4/letter/l/c68b51/32.png) [@louie\_choy](https://community.wowza.com/u/louie_choy)
#### Post date: [June 3, 2008, 7:26pm UTC](https://community.wowza.com/t/flvtool2-eoferror-and-ffmpeg-segmentation-error/354/3 "2008-06-03T19:26:25Z")

</div>

Thanks for the quick reply, I’ll try that fix and let you know what happens.

---

<div class="post-metadata">

### Author: ![louie\_choy](https://avatars.discourse-cdn.com/v4/letter/l/c68b51/32.png) [@louie\_choy](https://community.wowza.com/u/louie_choy)
#### Post date: [July 6, 2008, 10:54pm UTC](https://community.wowza.com/t/flvtool2-eoferror-and-ffmpeg-segmentation-error/354/4 "2008-07-06T22:54:39Z")

</div>

Yup the solution worked great.

---

<div class="post-metadata">

### Author: ![a\_b](https://avatars.discourse-cdn.com/v4/letter/a/c67d28/32.png) [@a\_b](https://community.wowza.com/u/a_b)
#### Post date: [July 8, 2009, 1:45pm UTC](https://community.wowza.com/t/flvtool2-eoferror-and-ffmpeg-segmentation-error/354/5 "2009-07-08T13:45:53Z")

</div>

For anyone getting the EOF error in flvtool2, you can try [yamdi](http://yamdi.sourceforge.net/) instead of flvtool2. It does the same job but doesn’t error out on some encoded FLV files.

I was having the error when trying to inject metadata into FLVs encoded with Adobe Media Encoder CS4.

The alternative was encoding with f4v however that’s not fully supported since most people do not have Flash 9.115 or whatever version is needed at the moment :o
