A simple test to detect if it's a valid movie or not
Brought to you by:
tkirby
I have installed ffmpeg-php and it's so usefull, but I'm very sad that you have not implemented a function like :
isValidMovie()
Because if I upload a file who is not a movie I have a php error like :
Warning: Can't open movie file /tmp/phphHgnoV in /var/www/htdocs_dev/classes/ctrl.video.class.php on line 164
Note that the file exists but it's not a movie.
Thank you very much
David
Logged In: YES
user_id=1796159
Originator: NO
use this code:
if(!$mov = new ffmpeg_movie($myfile)) {
exit("supplied file is not a video");
}
if you want to suppress the warning message insert
error_reporting(0);
before the snippet.