Go Back to Main Page
How To: Un-Corrupt Swf Files
Version 1.3
Created 2-19-2007
Modified 3-19-2007
============================================================
You will need the program below before starting be sure this is installed.
I have only used this method to successfully un-corrupt swf files created by vnc2swf http://www.unixuser.org/~euske/vnc2swf/ although this method should work for any swf you might have to modify the math to accommodate a different frame rate.
Freeware Hex Editor
XVI32
Home:http://www.chmaas.handshake.de/delphi/freeware/xvi32/xvi32.htm
I have only tested this guide with XVI32 I'm sure other Hex editors would work just as well however I have not tried any others. If have a hex editor you can try using it however the results may be different than mine.
1. Install XVI32
a. Install XVI32. The download is just a zip file so you can un-zip and use where ever you want.
2. Open your corrupted swf file in XVI32
a. Copy your corrupted swf file to same folder you Unzipped XVI32.
b. Open the Swf in XVI32.
c. The Values that we need to focus on in the Hex editor are 5, 13 and 1e (5 is the size of the swf file 13 and 1e are the same number, the “Total Frames”).
3. Do the Math
To un-corrupt the swf we need to fill in the values for Hex positions 5, 13 and 1e.
a. To get the value for Hex Position #5 take the size of the file in bytes and divide this by 256. Do not round the number up or down.
b. To get the “Total Frames” you need to know how long, or about how long, the video file was in Minutes.
“Recorded Length in Seconds” x “the frame rate” (vnc2swf defaults at 12) please note that this number will not be truly exact as 12 frames per second is the average target.
So if the recording was 2min 27 seconds that equals 147 seconds
147x12 = 1764 this would be the value for fields 13 and 1e
The formula to convert the “Total Frames” to min is:
(“Total Frames” / “Frames per Second (12)” = seconds) (“Seconds” / “60” = min)
1764 / 12 = 147 seconds.
147 seconds / 60 = 2 min 27 seconds.
If you don’t know how long the capture was the below chart can help you find your target.
| Total Frames | Length |
| 16000 | 22min 13sec |
| 12000 | 16min 40sec |
| 10000 | 13 min 53sec |
| 8000 | 11min 6sec |
| 6000 | 8min 20sec |
| 4000 | 5min 33sec |
| 2000 | 2min 46sec |
When using the hex editor choose tools then encode number Be sure to select (word 2bytes) and (overwrite at current address)
Also note that the 16000 frames is the max allowable size for a swf file, although you can have a swf larger than this it may not play back correctly and is at greater risk of corruption.
For good information on the swf format see: http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=tn_14437
If you need a swf to be larger than the 16000 frames I suggest recording several files 20min size and then converting those to another format like MPG or AVI and joining them with a video editor. There is free software called super http://www.erightsoft.com/SUPER.html that can convert swf to another format.
You might get some extra time out of the swf if you change the frame rate vnc2swf defaults at around 12 frames per sec if you lower this number the swf could be longer before it reaches the 160000 frame max but the quality will suffer.
Change log:
+++++++++++++++++++++++++++++++++
2-19-2007:
Created Document created on this date
3-19-2007:
Added Information about swf conversion