using ffmpeg and automate it to create video - php

I want to create a video from images on the server. I have a css animation on the webpage. I've already written a code that takes screenshots (with dataURL base64) and save them in a folder on my server (using html2canvas/ajax/php). All the images are also created as "image001.png, image002.png etc". Once I have all the files in my folder I would like to use ffmpeg to grab all the images and convert in a video. But I want this step automated and I am not sure how to do it. Using a php code with condition (example if all the files are in the folder) with a shell_exec() ? I am a bit confused on how to mix javascript php ffmpeg.
Thanks

Related

Using wget to download images directed by thumbnails

I have the URL of a gallery. This gallery is structured like www.url.com/folder/image01.php
Here, www.url.com/folder shows the thumbnails, and clicking on each thumbnail redirects to the php page as mentioned.
I wish to download FULL size images, ie. the image from php page, rather than thumnails folder.
I use the following line: wget -r -L -A .jpg www.url.com/folder
However, this only downloads the thumbnails (each thumbnail points to a larger image, and i want to go to each of this image and download them, rather than the images in thumbnail directory)
I've been stuck with this problem for quite a while, is there a solution for this?
Not much experienced with wget but my understanding is that the command you are using will recursively download all .jpg files in the relative url's appearing in the provided web page.
It would help to know what web page you are trying to access and analyse how full sized images are accessed, but my guess is that only thumbnail images are directly accessible through relative links from the webpage.
You should probably check if any javascript is used to provide the access to the full size image. If so, wget will not be helpful since (as far as I am aware) it will only work on plain HTML text of the initial web page and is not capable of figuring out links created dynamically through Javascript.

Bulk image compression on server via php

I am developing a content management kind of thing where user can upload their content with images and other stuff on php
Some user have uploaded image larger size may be a 1MB image for logo of page.
I want to compress all the images present in the folder containing images of all users recursively.
So how that can be done using php or any server site scripting.
Note : I dont have a shell access to server to run any script. The only way to do it using something in php

Upload video and extract thumbnail using Amazon s3

i have been working in a video website [platform: php] where i need to upload videos in Amazon S3 server and extract thumbnail.
I have created a bucket and uploaded video file successfully in that bucket. But i don't know how to extract the thumbnail from that uploaded video. So, that's where i stuck.
Any help will be appreciated. Thanks in advance!
Here you've got some options.
First - you can "extract" a thumbnail from the video before you upload it to AWS. Something like: upload video to your server, convert it to appropriate format if needed, take a thumbnail (or thumbnails), save them somewhere (e.g. on S3 or your local server) and then upload the video to S3. The disatvantage of this method is that your local server will have to do a lot of extra work, instead of serving your web visitors.
Second - you can use Amazon EC2 computing service for that: upload video to S3, trigger EC2 (e.g. with cron jobs) to take the video from S3, convert it, take thumbnails and upload the final result (converted video + thumbnails) back to S3. Disatvantages are: it's not very easy to implement this "communication" (you'll have to solve a lot of problems, like ensuring stable converts, creating job queues etc.), plus you'll have to use one more AWS service along with S3.
What's about video converting and getting thumbnails? There are many tools and programs for that. I like using ffmpeg for video converting (also there's PHP wrapper for using it's functionality with php - php-ffmpeg, but using ffmpeg itself (e.g. using php's exec() function) will give you more flexibility and features, please read documentation for more details). FFMpeg can extract thumbnails from videos as well, but it takes some time (there are lots of discussions about how to do it effectively), but I'd suggest you to use ffmpegthumbnailer for this purpose. It has simpler usage and is optimized especially for getting thumbnails from video files.
You should do this on the machine you are using for the upload. Here you have direct file-system access to the file. Once it is in S3 it is accessible via HTTP only.
The tool ffmpeg can be used to create a thumbnail of many video formats.
Example:
ffmpeg -i "video.flv" -ss 00:00:10 -f image2 "thumbnail.jpg"
Would create a thumbnail at video second 10 and save it as thumbnail.jpg
When using PHP you can use system to execute

Insert image in PDF file

I need to insert an image in a PDF file on a certain page, in a specific location. How could I do that in a way that would work on a server. I'm looking for a command-line application, windows if possible. Any ideas?
Thanks

how to generate screenshot/thumbnail (take photo) on swf files

I'm writing arcade game script. i want to take a photo for thumbnail on swf files.
have php got function for this?
Or How difficult?
Upload a swf file
Take a photo uploaded file
Move directory
Add to mysql
That's not possible with PHP alone. The best solution in my eyes is to use a browser screenshot tool on a page that embeds the flash.

Categories