Jump to content


Photo

Grab screenshot from swf.


  • Please log in to reply
4 replies to this topic

#1 Pr0oF

Pr0oF

    Young Padawan

  • Members
  • Pip
  • 19 posts

Posted 24 December 2008 - 08:07 AM

Hi there.
I was wondering is there a way to get a screenshot from swf file with php?

I was looking for a solution with ffmpeg, but there is option only for .flv file.
I'm open for any suggestions.

#2 dotbart

dotbart

    Young Padawan

  • Members
  • Pip
  • 141 posts
  • Gender:Male
  • Location:Diepenbeek
  • Interests:Webdesign, Webdeveloppement, DJ, ...

Posted 24 December 2008 - 08:11 AM

Hey!

I'd have to guess on No since Flash runs Client-Side. PHP is server-side.
I also can't think of a any great solution to do this automatically besides PHP. Stick to manual for now.
Sry mate



B

#3 Pr0oF

Pr0oF

    Young Padawan

  • Members
  • Pip
  • 19 posts

Posted 24 December 2008 - 10:55 AM

Thanks for the reply, but do you honestly believe that most of the biggest sites for flash games(that's on my mind as well) have a couple of peoples sitting and making a screenshots of every uploaded flash game :) (no offence).

There is a special functions for swf in php, but most of them are using to create swf with php.

http://bg.php.net/swf

Edited by Pr0oF, 24 December 2008 - 10:56 AM.


#4 dotbart

dotbart

    Young Padawan

  • Members
  • Pip
  • 141 posts
  • Gender:Male
  • Location:Diepenbeek
  • Interests:Webdesign, Webdeveloppement, DJ, ...

Posted 24 December 2008 - 06:43 PM

Well you may have a point there. But also, Flash is visually very dynamic.
Consider a Flash game website where a Mario game is hosted, next to it, there's a screenshot of Mario jumping over a turtle (as he does)

Then consider using PHP, do you think:
1. there's a PHP script that has such a long execution time to wait until Mario jumps over a turtle
2. PHP waits for an intro in a Flash animation
3. there's a PHP script that dynamic it finds its way around a Menu, figures out how to play every game, and then take a screenshot in it's brightest moment

This actually has me convinced that: yes, there are people taking screenshots all the time :-)
It wouldn't happen automatically, bigger websites also wouldn't publish a flash game straight away when a user uploads it, it get moderated first by some employee. And whilst he's at it, he takes a small screenshot.


You might find a desktop programming language solution for it, there you might be able to set a 10s delay time before taking a screenshot of some sort. But PHP is quite impossible as I see it.


Hope it helps!




B

#5 Pr0oF

Pr0oF

    Young Padawan

  • Members
  • Pip
  • 19 posts

Posted 25 December 2008 - 06:05 AM

Thanks for reply again, and yes - you have a point here as well.
But:

1. there's a PHP script that has such a long execution time to wait until Mario jumps over a turtle


I thought that there must be some way... may be I was wrong.
For example I'll show you a command line that ffmpeg offers(for flv ofcourse :/ ):

ffmpeg -i "<file path>" -f image2 -s Width[x]Height -ss 00:00:50 -vframes 1 -an "image path.jpg"
So here I can take image from my file and skip the first 50 seconds. :)
May be this is the moment when mario jumps on the turtle :)

This actually has me convinced that: yes, there are people taking screenshots all the time :-)
It wouldn't happen automatically, bigger websites also wouldn't publish a flash game straight away when a user uploads it, it get moderated first by some employee. And whilst he's at it, he takes a small screenshot.

May be this is the truth.

All right then, skip my jokes :) and have a nice day.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users