Problem with swf files and ffmpeg .. plz urgent help

hello ,

plz i have problem …
i use now ffmpeg to take snaphot image of swf file using php ,
but there is a problem that ffmpeg can’t deal with swf file , and it’s give me this error message :


Warning: Can't open movie file /home/**/public_html/1.swf

but when i tried ffmpeg with .flv file , it’s did successfully

i use this php code:


$mov = new ffmpeg_movie(dirname(__FILE__)."/1.swf"); 
$ff_frame = $mov->getFrame(30); 
$gd_image = $ff_frame->toGDImage();     
imagepng($gd_image, 'mythumbnail.png'); 
imagedestroy($gd_image);

so what’s the problem and how to solve it ?

10x

SWF is not a movie file format. It’s only going to work if the SWF is just a thin container for a FLV movie, AFAIK. You can’t use this to make thumbnails of arbitrary Flash files.

oooh , so is there any method to convert swf file to flv file ? or what ?

No, you can’t convert what’s essentially an application into a movie.

If you must have screenshots then do what the browser screenshots sites do – script the launching of a real web browser (or Flash executable), run the SWF for a few seconds so it has time to load, take a screen capture of the entire window, and save it to a file.

It’s a lot more complicated than writing a couple lines of PHP, though.

mmmmmmmmm i thought that ffmpeg deal with swf files :frowning:

so plz can u explain more abour ur idea ?

there aren’t any solutions to do this ?

You said you have .flv files. Use them instead.

no i said that if there is any linux command line application to convert swf file to flv file , and then use ffmpeg to get snapshot of it . i found python tool but also it’s didn’t work fine :frowning: !

i found this tool , but it’s flv output don’t work !!

If you read the tools instructions:
“WARNING: This does not work on any old SWF! It has to be a video/audio-dominated SWF. Don’t be surprised if it fails to extract content from some arbitrary SWF you built or download. In particular, it does not handle vector animation.

It’s possible to do this in a convoluted way on a server using an AIR app that loads the swf and then plays back frame by frame saving a bitmap to disk each frame, but it won’t work with any scripted animation

yeah , ok soory i have another question :blush:

now if i used windows server … it there available softwares can help me easily to do this ?

thanks alot,

any help ?

Please do not bump your thread. If someone knew an easy answer I’m sure they would have shared it with you. I don’t think this is an easy problem, you may not find help in a general PHP programming forum. And you might have to simply develop it yourself. That’s what makes a lot of the websites you use great – they’ve developed something complicated, something you can’t just get someone to copy and paste in a forum.

Try to use Flash to Video Encoder PRO.
:slight_smile: