Portal Home > Knowledgebase > Articles Database > PHP script to convert Video files to Flash files


PHP script to convert Video files to Flash files




Posted by DelPierro, 01-28-2007, 03:32 AM
I am getting a blank white page when I attempt to upload a file, and no files is being uploaded, nor converted. The upload form: Thanks Disclaimer: I did not write this script, rather have modified it to server my needs. EDIT: I have FFMPEG installed on my box.

Posted by jamessampford, 01-28-2007, 06:08 AM
put several echo statements into the php code, and see if what your submitting is working in anyway for example, the first one you could do is the rest - look through the code to see where you should be getting values, if nothing, you might be able to trace why. if that makes you none the wiser - did it work in the first place, with little modications? If it had a different upload page, try use that instead, and see where you have gone wrong.

Posted by mitchlrm, 01-28-2007, 02:35 PM
Yea put some echos in put also look at the upload error message codes. See http://www.php.net/manual/en/feature...oad.errors.php php has a default upload size of 4mb which isn't that large for video. You may be running into that limit.

Posted by P-nut, 01-28-2007, 05:53 PM
Instead of using try using $_FILES is an array - similar to $_POST - and if you're getting an error with the $_FILES array I don't believe you'll be able to see the debugging info with an echo.

Posted by horizon, 01-28-2007, 10:13 PM
You could replace that by stating: Much shorter if statement this way.

Posted by xgoth3, 02-02-2007, 04:28 PM
Thak you horizon for letting us know that people learn here... you are the best example.. but come on... what you're suggesting is way too far from the reason of this thread.... Congratulations anyway, i would have put the file types on an array too. Now, returning to the subject: DelPierro, you have to place a hidden field on your form called "MAX_FILE_SIZE", this field MUST preceed the file input field (http://www.php.net/manual/en/features.file-upload.php) otherwise the file doesn't get uploaded on many PHP configurations.

Posted by horizon, 02-02-2007, 07:32 PM
My post above was only as a suggestion.

Posted by OpenInternet-Vince, 02-02-2010, 07:20 AM
echo $encode_cmd then try to run that cmd in shell and see what happen

Posted by mattle, 02-02-2010, 09:21 AM
Or, use exec()'s optional arguments (the extra bit here just routes STDERR to STDOUT so you trap error messages as well): The problem with running the command in the shell is that your user account will have a different environment than the web server, so you may not catch permission issues, etc.

Posted by mattle, 04-15-2010, 02:04 PM
nvrmind...can't believe I got duped into replying...

Posted by csparks, 02-01-2011, 12:40 AM
what does your form initialization string look like? (From the form you are uploading the file from). You need to ensure you have enctype="multipart/form-data", so for example

Posted by coderiser, 02-02-2011, 12:43 AM
dont try and use and entire script you found somewhere upload the file or select a file that is uploaded and then once thats covered just run your ffmpeg convert in the shell_exec function and your done shell_exec('ffmpeg convert goes here'); I would suggest you run the ffmpeg via command line before your place it in your script so you can verify you have that part right and you can try the following to make sure your shell_exec is functioning on your server correctly $output"; ?>

Posted by praveenkv1988, 02-02-2011, 03:22 AM
If you are getting blank page, it appears that the script was terminated before the upload is complete. Check your script execution time.



Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read
e-z-hosting.com status (Views: 652)
HTTPME Out? (Views: 700)
Virpus Down (Views: 681)
Mysql optimising. (Views: 611)

Language: