VideoHelp Forum
+ Reply to Thread
Results 1 to 24 of 24
Thread
  1. Member
    Join Date
    May 2009
    Location
    United States
    Search Comp PM
    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.
    Quote Quote  
  2. 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
    Quote Quote  
  3. Member
    Join Date
    May 2009
    Location
    United States
    Search Comp PM
    Originally Posted by poisondeathray View Post
    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,
    Oh this one is definitely up there as far as typical SWF complexity goes. Not sure what would qualify here as a dedicated swf decompiler.

    Originally Posted by poisondeathray View Post
    or perform a screen capture (the latter is what many of the commercial "SWF to whatever" conversion software do)
    I feel like this wouldn't work well. I grabbed a player called Swiff Player to see the SWF in action. While it plays the thing, I guess the SWF is a little more complicated than the player was designed for, or the player simply has some fundamental limitations, because on my PC, at least, I can't get a reliable 60fps from it. (i7-9700K @5GHz with 1080TI.) Sometimes it's locked in, sometimes it seems to just lose sync and default to 30. Because the framerate can't be counted on, I have doubts about any solution that would rely upon realtime rendering.

    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)
    VLC chokes on this SWF. Treats it like a video with no streams -- infinite loop of replaying nothing.

    I'll try the other two.
    Quote Quote  
  4. got a sample on such a swf file for others to look at?
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  5. Member
    Join Date
    May 2009
    Location
    United States
    Search Comp PM
    Originally Posted by Selur View Post
    got a sample on such a swf file for others to look at?
    Okay. This isn't the exact SWF I'm interested in, but it's another specimen from the same author, and I found it exhibits the same issues. Plays in Swiff Player, albeit at an unreliable framerate; VLC chokes on it; VDub only produces a single, inverted frame.

    http://eye.swfchan.com/flash.asp?id=206285&n=dffdgdfdgf.swf
    Quote Quote  
  6. 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
    Quote Quote  
  7. Member
    Join Date
    May 2009
    Location
    United States
    Search Comp PM
    Originally Posted by poisondeathray View Post
    dedicated swf decompiler
    I grabbed Sothink SWF Decompiler. It loads the SWF fine, but refuses to export the "Action Script" since it's a trial version, and Adobe Animate CC (also trial) evidently needs that missing bit because whatever Sothink spits out isn't adding up to anything visible in Animate.

    Originally Posted by poisondeathray View Post
    potplayer
    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.
    Quote Quote  
  8. Member
    Join Date
    May 2009
    Location
    United States
    Search Comp PM
    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.
    Quote Quote  
  9. Playback in Ifanview with the Flash Plugin and capturing through the GeForce Experience Desktop Capture functionality works fine here,... see attachment (2072x1560).
    Image Attached Files
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  10. Member
    Join Date
    May 2009
    Location
    United States
    Search Comp PM
    Originally Posted by Selur View Post
    Playback in Ifanview with the Flash Plugin and capturing through the GeForce Experience Desktop Capture functionality works fine here,... see attachment (2072x1560).
    This is a good example of my dilemma. That given SWF (not one of the SWFs I want to convert, but still a good case in point) is meant to play back at a mere 30fps. It's a far less visually involved animation at half the framerate. Yet your own capture at that resolution was 9 fps, some of which were duplicates (probably owing to the incompatibility of that framerate with the original 30fps). It really seems clear that the eventual solution is not going to involve some means of secondary capture.
    Quote Quote  
  11. 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
    Quote Quote  
  12. Member
    Join Date
    May 2009
    Location
    United States
    Search Comp PM
    Originally Posted by Selur View Post
    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,...
    Macromedia Flash today is Adobe Animate. The app can't open a SWF. It needs a FLA. There are apps designed to "decompile" a SWF and convert it to FLA, but I have discovered that this is a terribly unreliable process. In particular, none of the decompilers I've tried (three so far) have successfully created a valid FLA from any of the SWFs I've thrown at them. I did once find an unrelated SWF that was able to be converted into a FLA, but when I loaded this into Adobe Animate, half of the visual elements were missing.
    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.
    Quote Quote  
  13. 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...
    Quote Quote  
  14. 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...
    Code:
    vid=ImageSource("%02d.png", 01,23,fps=30).loop(32)
    aud=ffaudiosource("5.mp3")
    
    audiodub(vid,aud)
    Image Attached Files
    Quote Quote  
  15. And BTW , a free / open source swf decompiler is ffdec . But unfortunately, it requires java . It should work on most types of .swf, except the complex ones it might have troubles with

    https://github.com/jindrapetrik/jpexs-decompiler
    Quote Quote  
  16. Member
    Join Date
    May 2009
    Location
    United States
    Search Comp PM
    Originally Posted by poisondeathray View Post
    Which swf ? "dffdgdfdgf.swf" ?
    That was just one I offered up as an example of a SWF I was having similar difficulties with (smaller and less complicated). Fair enough. Here's one of the ones I'm specifically looking to convert. It has all of the problems that are making converters choke:

    http://eye.swfchan.com/flash.asp?id=203878&n=Ghost.swf

    Originally Posted by poisondeathray View Post
    A higher FPS doesn't give you more smoothness.
    ...
    Some swf's decompile with vector elements.
    Sorry for the confusion. I tried to be clear about the difference between my example SWF and the actual (60fps) SWFs that are the subjects of my predicament. The thing all the players seem to be tripping up on is the fact that the SWFs are formatted in a way that makes it look like they have only a single frame. The business end of the data is all tucked away in a "binary" that seems to be a SWF inside the SWF (although extracting this binary and attempting to load it as a SWF results in a lot of very nasty crashes). I don't know enough about these things to be able to tweak whatever needs tweaking to make, say, Swivel interpret the SWF correctly. That's what I'd need, really, to proceed with this project: info on achieving that. There are several other SWFs besides that one. If I need to tinker with each one by one, I'm willing, but it's not something anyone else should have to do for me.

    Originally Posted by poisondeathray View Post
    And BTW , a free / open source swf decompiler is ffdec . But unfortunately, it requires java . It should work on most types of .swf, except the complex ones it might have troubles with
    Already been using it. Seems to be the rough equivalent of Sothink. It also shares the latter's inability to render a usable FLA from these SWFs. As usual, it plays the thing just fine.
    Quote Quote  
  17. aBigMeanie aedipuss's Avatar
    Join Date
    Oct 2005
    Location
    666th portal
    Search Comp PM
    a screen recorder seems to capture the video ok at 30fps(it's limit). audio you'd need to capture with audacity separately and then encode together.

    edit - it plays fine in vlc
    Image Attached Files
    --
    "a lot of people are better dead" - prisoner KSC2-303
    Quote Quote  
  18. Member
    Join Date
    May 2009
    Location
    United States
    Search Comp PM
    Originally Posted by aedipuss View Post
    a screen recorder seems to capture the video ok at 30fps(it's limit).
    I can get 30fps fairly reliably at 720p, less so at 1080p, but of course the SWF is a 60fps animation and that's the goal. (Full disclosure: My real goal with all of this was to take these animations and apply motion blur from within a Flash editor. But since there doesn't seem to be any way of returning these SWFs to an editable state, I've pretty much abandoned that idea.) Having truncating the framerate to 30, I note that the 30 frames that were captured are not temporally consistent. You can recognize this if, for example, you scrutinize the faint expanding blue circles. In a 60fps presentation, such as 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.

    Originally Posted by aedipuss View Post
    edit - it plays fine in vlc
    Do you mind sharing which version of 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.)
    Quote Quote  
  19. aBigMeanie aedipuss's Avatar
    Join Date
    Oct 2005
    Location
    666th portal
    Search Comp PM
    i used the latest same vlc as you (3.0.6) to play the wmf file without any issues. the swf was played by adobe flash player 11.4 and captured with faststone capture 9
    --
    "a lot of people are better dead" - prisoner KSC2-303
    Quote Quote  
  20. Member
    Join Date
    May 2009
    Location
    United States
    Search Comp PM
    Originally Posted by aedipuss View Post
    i used the latest same vlc as you (3.0.6) to play the wmf file without any issues.
    Ah, okay, my bad. I thought you were saying the SWF played fine in VLC.

    the swf was played by adobe flash player 11.4 and captured with faststone capture 9
    At this point, I'm pretty well convinced that my own PC is not some anomalous fluke and that yes indeed there are no SWF players out there that can actually play that particular SWF, or any other SWF of its given complexity, at 1080p+ and a reliable 60fps. Sort of boggles the mind to imagine that some simple vector animation could prove too much for even a modern PC, so I suspect the real culprit is a simple lack of focus on optimization and consistent frame delivery on the part of the format and its corresponding players. After all, nobody really complains about Flash animation framerates, so it's not surprising to discover that the final iteration of the technology is bizarrely inefficient.
    Quote Quote  
  21. 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)
    Quote Quote  
  22. Member
    Join Date
    May 2009
    Location
    United States
    Search Comp PM
    Originally Posted by poisondeathray View Post
    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)
    Okay, but I mean what steps does one take to decompile it? I assume you say it would take a long time because it has to be done by hand, but is there some kind of guide for this sort of thing? That's the important factor because this is really just one of at least half a dozen SWFs I intend to work on, each of which have pretty much the same exact problem that causes apps to choke on them. And I mentioned this to someone else earlier, but in a perfect world, what I really wanted to do was add motion blur (from within Adobe Animate or whatever passes for a Flash editor) because I think it could be made to look rather better with it. Either with a motion blur plug in (which exists) or by reiterating the entire animation at a higher framerate and then taking advantage of the added temporal resolution to generate the blur.

    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?

    https://www.youtube.com/watch?v=PyqS9YkzS_I

    And then a different fellow does the same exact thing, only in 4K60 this time.

    https://www.youtube.com/watch?v=i8RwIizQOpg

    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.
    Quote Quote  
  23. 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
    Quote Quote  
  24. Member
    Join Date
    May 2009
    Location
    United States
    Search Comp PM
    Originally Posted by poisondeathray View Post
    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 .
    I investigated this option. Well, this is going to take some describing. Starting point seems to be the simple fact that attempts to export those apparently complete (if visibly inaccurate, and half-missing) frames found in DefineSprite_766 generates actually nothing. No files. Just the DefineSprite_766 directory. Both when attempting to export individual frames, and the entire "sprites" category. The latter does produce the individual graphical elements used during the course of the animation, at least.

    That said, I decided to try tackling one of the alternate SWFs that does not have all the elements visibly categorized, here:

    http://eye.swfchan.com/flash.asp?id=204390

    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.

    Originally Posted by poisondeathray View Post
    But I think it's upscaled to 1920x1080.
    The text and other elements are too sharply-defined for this to be possible, in my opinion. Don't forget there was a 4K iteration uploaded later, too.

    Originally Posted by poisondeathray View Post
    But the framecount doesn't match the swf framecount (9821 vs 9792) .
    The Youtube video lasts a split second longer than a single loop of the animation

    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.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!