Created
February 10, 2019 07:27
-
-
Save ugeugeHigh/5c1737947790a292065e74ceff0cb53a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
ini_set('display_errors', 1); | |
$file = $_FILES['gif']; | |
$ext = substr($file['name'], -4); | |
$tempfile = $file['tmp_name'];//一時ファイルの名前を取得 | |
//HTTP POST でアップロードされたファイルかどうか調べる | |
if(is_uploaded_file($tempfile)) { | |
if($ext=='.mov'||$ext=='MOV'||$ext=='mp4'||$ext=='MP4') { | |
$filePath = 'tmp/' .$file['name']; | |
move_uploaded_file($file['tmp_name'], $filePath); | |
//print('<img src="'.$filePath.'" />'); | |
exec('/usr/local/bin/ffmpeg -i '. $filePath .' tmp/new.gif'); | |
print('<img src=tmp/new.gif>'); | |
} else { | |
print("error"); | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment