Library to create videos from pictures and text? - php

Is there some library to generate a video from pictures and text? Something like animoto.com does but much simplier.
I basically want to set one picture, and fade in and out text over that picture and make a video out of that.
I am looking for something to run from php or python, video format is not so important.

Would you consider an animated GIF to be a video? If so use imagemagick!

There is a pyffmpeg module at http://code.google.com/p/pyffmpeg/ which ought to be able to do this; I'll see if I can bash together an example.
Edit: ok, I take it back. It doesn't look like pyffmpeg is being actively maintained, and I've just about had an aneurysm trying to get the son-of-a-gun to build on Windows (there's a binary download for 2.6, but none for 2.7). Apparently the preferred method is to cross-compile it from Ubuntu (?!) It may be fine if you're on Linux, but on Windows I'm throwing in the towel.

Related

Getting PDF color in PHP

I am trying to make project of a web app that will check the colour of the PDF document. My preferred language is PHP.
At the begining I've been thinking about GD, but this only refer to images (jpg, png, gif). Nothing for PDF. For images I am going to use some method similar to this: Get image color.
So does anyone know some method, library (opensource), or something else to make such app? I can't find any examples on the web.
You'll probably be best off converting the PDF into an image, and then using the same method you're using for images. In addition to being easy to do, that will also guarantee consistent results.
However, converting a PDF file to an image is not something that PHP alone is well-equipped to do. The best way to go is the ImageMagick based approach as described in this question. It gives a number of alternatives, too.

SWF to image (jpg, png, ...) with PHP

I would like to know if it could be possible to convert an swf file, with his flashvars to a bitmap image. But all that in PHP, is it possible ? I precise that I would like to do it several times, and that the .swf file is not mine (is not on my site, I take it from a other site).
I allready thank you for your answers ! :)
I think the closest you will get is with SWFTOOLS: http://www.swftools.org/
It can extract bitmaps and flashvars. There are windows and linux binaries available so you'll have to run it from the commandline, that should not be a problem. The main problem of converting an swf to jpeg is that a lot of flash files require execution of ActionsScript in order to show something usefull, and then still you have to have the right frame, so it might not be so straightforward.
So my answer would be: Yes, it might be possible if the movie is very simple and only consists of simple bitmaps. But also no: for most swf's it will be very difficult without a flash client and screenshot capabilities if you really need the output of the movie.

How can I create image from html using PHP?

something like painty but with advanced options having div, font, fontsize, style... etc....
I would like to have a coupon design in html and output it as an image.. preferably JPG..
but painty is not supporting those.
you can find here.. http://www.rabuser.info/painty.php the painty code i am using right now.
Thanks and waiting for the reply.
Creating this with pure php is bad idea, this will be slow as hell.
As far as I know in production this is achieved with external screenshot app and standard browser run by exec() or similar function.
There's khtml2png, which renders the whole page and takes a screenshot; however, it's a standalone executable (and it needs an X server or xvfb), so you need to be able to run it on your server (so probably not on a shared hosting). This may be a bit of an overkill, but it gives you complete control over the final appearance.
You could also use some of the HTML to PDF convertors and then use ImageMagick to convert the PDF to JPEG.

How to save webpage as a image file using PHP?

I want to save webpage as image file or i want to take snapshot of an webpage using PHP. Just like firefox extension Fireshot doing.
Check out http://browsershots.org/ and Webkit2Png
You'll need to render the page with something. If you really want to only use php, i suggest you HTMLTOPS, wich render the page and output it in a ps file (ghostscript), then, convert it in a .jpg, .png, .pdf.. can be little slower with complex pages (and dont support all the CSS).
Else, you can use wkhtmltopdf to output a html page in pdf, jpg, whaterver.. Accept CSS2.0, use the webkit (safari's wrapper) to render the page.. so should be fine. You have to install it on your server, as well..
Source: Website screenshots using PHP
Like others have said, it would be difficult to do in PHP alone. However, there is an easy-to-use cross-platform tool called CutyCapt that does exactly what you need. The best part about this tool is that it's stand-alone and doesn't depend on anything else.
You cannot do this with pure PHP, try forking a browser like Mozilla with headless mode and let it handles taking snapshot of the page.

How can I make a snapshot image of a web page in php?

I am using php and I want to take a snapshot of my web page using php. Something similar to this
http://www.moneycontrol.com/gd/mail_indices.php
How can i do that?
To take Snapshots of a website, and not as proposed generate an image with text in it, you can use either
http://iecapt.sourceforge.net/ for snapshots using IE's rendering engine or
http://cutycapt.sourceforge.net/ for Webkit (Safari/Chrome) snapshots
I strongly recommend the latter.
The fastest and surest way in PHP to create images is to look at the GD Library. They have tons of functions to help you create your image easily.
Should you need a font that is available in Windows Font but not in PHP font, you can use this tool to convert it: http://www.wedwick.com/wftopf.exe
You can use Imagemagick.
Theres is a comprehensive summary of image creation option in Php here. The other option not already mentioned is Cairo.

Categories