I googled around a bit and I think I have all the information that's available for this. There's a gobsmackingly obscure plugin for Avisynth from like 2010, called SWFSource, that allows one to load SWF files that way.
When the SWF loads into VDub, there are a couple of anomalies. The first is that it's upside-down.
The second is that instead of each frame being animated, as it is when loading the SWF in a player, they are instead static -- duplicates of the first frame. Exporting an AVI just gives me a clip of X seconds that's a static image of the first frame.
Is there some kind of syntax or something I need to put in to jump-start VDub or the SWFSource plugin? Again, the SWF does indeed play an animation with no input from the user.
+ Reply to Thread
Results 1 to 24 of 24
There are different types of swf . Some of them are complex with multiple timed elements and overlays . For those you might need a dedicated swf decompiler, or perform a screen capture (the latter is what many of the commercial "SWF to whatever" conversion software do)
You can try ffmpeg, which has rudimentary swf support (only the simple swf will decode properly, you might be missing some elements) . Or you can try directshowsource() in avisynth , or record from a media player (e.g. kmplayer or potplayer , maybe vlc I think could do this for SWF, export a video - basically a screencapture) , or use dedicated screen recording tools
I'll try the other two.
got a sample on such a swf file for others to look at?users currently on my ignore list: deadrats, Stears555
VLC chokes on it; VDub only produces a single, inverted frame.
Aside from using something like "Macromedia Flash 8" you best bet converting such a file is to do a screen capture.
Also converting an swf which loops forever will cause problems unless you stop your screen capture at some point,...users currently on my ignore list: deadrats, Stears555
Animate CC (also trial) evidently needs that missing bit because whatever Sothink spits out isn't adding up to anything visible in Animate.
Potplayer plays the SWF. About as well as Swiff Player -- that is to say, it is fussy about whether or not it's willing to give me the intended 60fps. Still, I figured I could just make multiple recordings and splice together the bits that actually managed to be 60fps. However, when I tried recording the SWF that Potplayer was successfully playing, it told me:
"It is not possible to perform capture operation since there is no video and audio in the file."
I guess I now turn to external capture apps and cross my fingers.
Seems pretty hopeless. At any resolution over, say, 600p, no player can play the SWF without recognizably dropping frames. Potplayer, Firefox, Swiff Player... those are the ones that can play them. At 1080p+, the framerate goes down the toilet and I wouldn't be able to reasonably make use of the footage without hand-splicing everything on a frame-by-frame basis. I think if I could just get Potplayer to recognize that it's actually playing something, so it could then record its own output, maybe that would bypass the fact that it's not actually rendering each frame reliably. Or if the SWF loader for Avisynth were to function correctly... that would be ideal.
Playback in Ifanview with the Flash Plugin and capturing through the GeForce Experience Desktop Capture functionality works fine here,... see attachment (2072x1560).users currently on my ignore list: deadrats, Stears555
Best option would be to use Macromedia Flash 8 or similar to open the swf and export it to avi using a lossless codec and then convert it to the target format you aim for,...users currently on my ignore list: deadrats, Stears555
Unless I find the magic combo, this seems to be the wrong idea.
The app called "Swivel" seems to be the closest I may come to something that works. The problem I'm running into is that Swivel is recognizing all of my desires SWFs as having one frame, and manual playback at this point gives only a black screen. From the FAQ:
"if possible, edit the source FLA to extend the frame count of the main timeline."
In other words, unless there is a hex edit that can be performed on the SWF to achieve a higher frame count than the "1" it's set at, this is a dead end, because I sure as heck don't have access to the FLA sources, and I've already mentioned my failures to convert the SWFs back to FLA.
Which swf ? "dffdgdfdgf.swf" ?
This one isn't that complex ...
If you decompile it, you will get 23 sprite shapes meant to be played back at 30FPS . It's essentially a png image sequence looped. Larger than 800x600. It's rasterized at 883x681 - you have to crop it to 800x600 to get what you see in a swf player, or potplayer
This is a like a looped video with audio . You can use ImageSource to load the images (but you might have to rename the images to have the proper placeholder digits; instead of 1.png you need 01.png etc...), FFAudioSource or something to load the mp3
A higher FPS doesn't give you more smoothness. It just give you duplicate frames. e.g if you have a 24.0p blu-ray, but you record at 60.0fps - you end up with 3:2 duplicates. If you "record" at UHD, but the source is 1920x1080, it's pretty pointless too...I hope you get the idea . This SWF is 800x600 @ 30.0 FPS looped
Some swf's decompile with vector elements. This is better because you can re-create it at any resolution without quality loss (vectors can scale without quality loss if you use proper software)
Complex swf's can be very tricky - they have composited elements, transparency, overlay layers, timed elements, user interaction...
The script is included in the zip. I renamed 1-9 with the proper placeholder digits
You need ffms2 for this script, but you can load audio with any appropriate source filter (it's mp3)
I did not crop this , I left it at the native resolution
You can play the .avs with mpchc, vdub etc...
vid=ImageSource("%02d.png", 01,23,fps=30).loop(32) aud=ffaudiosource("5.mp3") audiodub(vid,aud)
this render on Youtube, it is easy to see that the circles expand at a reliable pace with no anomalous gaps from frame to frame, and even when watching said video in 480p (for a 30fps presentation), the spacing from frame to frame is consistent, but in the captured WMV, the frame by frame shows inconsistencies. It's an easy guess that this is a consequence of relying upon the capture of realtime rendering, which I have grown most distrustful of at this point.
VLC? I am using 3.0.6 Vetinari, which VLC claims to be the latest, yet it simply chokes on this and similar SWFs. (Of course, Potplayer plays the SWF just fine, yet it fails to recognize that it's playing it, so there's every reason to anticipate VLC having the same issue if I elect to try exporting a video from it.)
the swf was played by adobe flash player 11.4 and captured with faststone capture 9
Yes, Ghost.swf is more complex . And it will take a LONG time to decompile it; partly because of the length , because it's 9792 frames, but also the layer elements alpha chanel, and the BG canvas is 11210 x 6072 (!) . Large crop or viewing area . That also contributes to the poor playback performance . But it will work, and you will get every frame, not duplicates, no drops. Huge PITA, but OTOH, access to the individual elemetns gives you more control, for example, you could decide not to include the text overlay (which is a separate element)
And this still begs the question: How is some random Youtube bloke able to just whip out a rock solid 60fps of this like it was practically automated?
And then a different fellow does the same exact thing, only in 4K60 this time.
You and I both know that these were no realtime captures. Quite impossible. All they had was that SWF. I am comfortable in concluding that these two didn't both jump through some time-sapping hand-decompiling just for the sake of a quick Youtube video. Some critical ingredient must be missing here that would make this as straightforward as Swivel / Avisynth were supposed to make it.
Last edited by Asterra; 14th Apr 2019 at 21:43.
To decompile it you just check mark the boxes for the elements that you want decompiled. It does it all at once, you just wait, it's not done by "hand". In this one it's the DefineSprite_766 folder , which has 9792 frames for the main render . Each frame takes quite a while because of the size. But there are some other elements that you need to add in . For example the text is separate, but the outlines look different, thinner, lighter. It almost looks like an alpha channel interpretation issue, but it could also be a ffdec issue or settings issue, or other layered elements that you require (other folders with images that you need to composite) .
I don't know how the youtube video was done but it looks right, proper 60fps. But I think it's upscaled to 1920x1080. But the framecount doesn't match the swf framecount (9821 vs 9792) . So maybe there are a few duplicates somewhere , and maybe it was a a screencap, or maybe encoding issue, or youtube encoding issue. Or maybe the decompiler isn't accurate
That said, I decided to try tackling one of the alternate SWFs that does not have all the elements visibly categorized, here:
Everything is tucked away into a single binary file. Extracting this binary and renaming to SWF results in a file that can then be re-loaded into FFDec, and this time there are actual multiple frames visible in the frames category. That said, exporting one of these frames reveals two problems. First, the export resolution seems pre-defined to 720p and I can't say I'm sure this can be modified anywhere. Second, as you seem to suggest, this export has accuracy issues. They are woeful. Everything looks like it was rendered without antialiasing (missing alpha?) and the edges of the dancers bleed in colors from the background in a disconcerting way. Objects (the largish elements on the sides, for example) are rendered at the wrong scale. It's clear this is no way to generate an export of this animation.
And it's a little frustrating because when you click on an individual frame from within FFDec, although it is partly animated, you can see that it has the right idea. Certainly moreso than what it exports.
4K iteration uploaded later, too.
I think they used Swivel for Ghost.SWF but I'm at a dead end for the alternate version linked above. In any event, thanks for your patience with this. Now I have to figure out what exactly Swivel is outputting as "Uncompressed AVI", which I'll do in a separate thread.