Version 2: encoding separate

This commit is contained in:
pepa65 committed 2022-08-28 20:34:38 +07:00
1 parent 08a25f62af
commit eeeb46dd07
5 files changed
+46 -34

No files matched your search

+1 -1
View File
@@ -13,7 +13,7 @@ function respond(){
<tr><td colspan=2 align=center><h1>Video Upload Page</h1></td></tr>
<tr>
<td>Streamkey:</td>
<td><input type="text" name="streamkey" id="streamkey" required title="re_ followed by a string of 0-9, a-f or underscore characters (20 or longer)" pattern="re_[a-f0-9_]{20,}"></td></tr>
<td><input type="text" name="streamkey" id="streamkey" required title="string of 0-9, a-z or underscore characters" pattern="[a-z0-9_]+"></td></tr>
<tr>
<td>Date:</td>
<td><input type="date" name="date" id="date" required></td></tr>
+3 -11
View File
@@ -21,9 +21,9 @@ $upload=htmlspecialchars(basename($_FILES['fileToUpload']['name']));
$key=$_POST['streamkey'];
$date=$_POST['date'];
$time=$_POST['time'];
$dir='uploads/';
$dir='streams/';
$name=$key.'.'.$date.'_'.$time;
$file=$dir.$name;
$file=$dir.$name.'.upload';
print('<!DOCTYPE html>
<meta charset="utf-8">
<title>Uploading</title>
@@ -46,14 +46,6 @@ if(!move_uploaded_file($_FILES['fileToUpload']['tmp_name'], $file)){
back('Error moving the file');
}
$res=exec('../prep '.$name, $output, $ret);
if($ret==1){
back('Not a video file, but of type: '.$res);
}
if($ret==2){
back('Error with the encoding');
}
print('File uploaded as "'.$name.'"<br>
back('File is now being encoded to "'.$name.'.mp4"<br>
Scheduled for '.$date.' at '.$time);
?>