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

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.

Related

using ffmpeg and automate it to create video

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

Large file upload through Browser (100 GB)

Is there any way to upload large files (more than 80 Gb) through a web browser? Previously I have been uploading files (img, png, jpg) using plupload but it seems not to be working for larger files. I would also like to know how to implement a web page where users could upload like Mega.co.nz or Drive.google.com.
If it is impossible to do it using web development tools, can anyone guide me about how I can divide & upload a file in segments?
Thanks.
You can use the JavaScript Blob object to slice large files into smaller chunks and transfer these to the server to be merged together. This has the added benefit of being able to pause/resume downloads and indicate progress.
If you don't fancy doing it yourself there are existing solutions that use this approach. One example is HTML5 Uploader by Filkor.
If I was you I would use something like FTP to accomplish this. If you can use ASP.NET there are already good libraries that exist for file transfer.
Here is a post that shows an example of uploading a file: Upload file to ftp using c#
The catch is you will need a server. I suggest Filezilla. https://filezilla-project.org/

how does youtube convert videos to mp4/flv when uploading the video

Hi i'm making a site in wordpress using a theme called wptube2 and it has all the Youtube look and stuff but what I need is that when I upload some video it just uploads I want it to be able to change it format to like MP4 and be published in my own player like jwplayer but I don't know where to start any suggestions would be greatly appreciated I just want to upload any video format and it should automatically be converted it to MP4 and published with jwplayer
here is a screen shot where i publish my videos from!
I used ffmpeg to do all my conversions.
You could make your uploaded video files all go to one central folder. Have a batch file that runs ffmpeg on those files and then move it to the another folder once it is processed.
You could upload your file in whatever format, give it a fake .mp4 file name and just have a message that says "file being processed" in the meantime.
File conversion takes time, and a lot of processing power, be sure to try it locally before even considering making your server do all the work.

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

PHP upload filename

I'd like to have my PHP script upload a file with a certain filename in a directory of my choosing. However, the catch is that I need it to exist there immediately upon upload so I can moniter it on my server. I don't want to use a PHP extension or something - this should be very easy to transfer to any PHP setup.
So basically: Is there a way to guarantee that, from the very beginning of the file upload process, the file has a certain name and location on the server?
Not that I'm aware of.
PHP will use the php.ini-defined tmp folder to store uploads until you copy them to their correct location with move_uploaded_file(). So it's very easy to know its location, but the file name is random and I don't think you can define it.
If you're not going to have multiple concurrent uploads (for example if only you are going to upload files and you know you won't upload 2 files at the same time), you could check the most recent upload file in the tmp directory.
The common solution for monitoring uploads is apc.rfc1867
I know of three options:
RFC1867 (as mentioned by others) which allows you to poll upload progress using ajax
Flash-based uploaders like SWFUpload which allow you to poll upload progress using JavaScript
Create a PHP command line daemon listening on port 80 that accepts file uploads, and used shared memory (or some other mechanism) to communicate upload progress. Wish I could find the link, but I read a great article about a site that allowed users to upload their iTunes library XML file, and it was processed live by the server as it was being uploaded. Very cool, but obviously more involved than the previous options.
I have had decent luck with SWFUpload in the past.
I don't think you can configure the name, as it will be a random name in the temporary folder. You should be able to change the directory, but I can't seem to find the answer on Google (check out php.ini).
As far as I know, this isn't possible with PHP, as a file upload request submits the entire file to the system in one request. So there is no way for the PHP server to know what is happening until it receives the whole request.
There is not a way to monitor file upload progress using PHP only, as PHP does not dispatch progress events during the upload. This is possible to do using a Flash uploader even if Flash is uploading via a PHP script. Flash polls the temporary file on the server during the upload to dispatch progress events. Some of the javascript frameworks like YUI use a SWF to manage uploads. Check out YUI's Uploader widget.
http://developer.yahoo.com/yui/uploader/

Categories