Skip to content

Commit

Permalink
Fix typos.
Browse files Browse the repository at this point in the history
  • Loading branch information
Maikuolan committed Aug 4, 2024
1 parent 5df7f65 commit 64022ee
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 42 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ In order for you to be able to run AVideo, there are certain tools that need to
# What is new on this version?
Since version 4.x+ we separate the streamer website from the encoder website, so that we can distribute the application on different servers.
- The Streamer site, is the main front end and has as main function to attend the visitors of the site, through a layout based on the youtube experience, you can host the streamer site in any common internet host can host it (Windows or Linux).
- The Encoder site, will be better than the original encoder, the new encoder will be in charge of managing a media encoding queue. You can Donwload the encoder here: https://github.com/WWBN/AVideo-Encoder. but to install it you will need ssh access to your server, usually only VPS servers give you that kind of access, that code uses commands that use the Linux shell and consume more CPU.
- The Encoder site, will be better than the original encoder, the new encoder will be in charge of managing a media encoding queue. You can download the encoder here: https://github.com/WWBN/AVideo-Encoder. but to install it you will need ssh access to your server, usually only VPS servers give you that kind of access, that code uses commands that use the Linux shell and consume more CPU.
- I will have to install the encoder and the streamer?
No. We will be providing a public encoder, we will build the encoder in such a way that several streamers can use the same encoder. We are also providing source code for this, so you can install it internally and manage your own encoding priority.

Expand Down
2 changes: 1 addition & 1 deletion index.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
<div>
<h2>Error. Oops you've encountered an error</h2>
<p>
It appears that either something went wrong or the mod rewrite configration is not correct.<br />
It appears that either something went wrong or the mod rewrite configuration is not correct.<br />
</p>
<p>We need to allow Apache to read .htaccess files located under the <?php echo getcwd(); ?> directory.

Expand Down
14 changes: 7 additions & 7 deletions objects/ServerMonitor.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public static function getMemoryLinux($obj)
$obj->command = "free";
exec($obj->command . " 2>&1", $output, $return_val);
if ($return_val !== 0) {
$obj->error = "Get Memmory ERROR** " . print_r($output, true);
$obj->error = "Get Memory ERROR** " . print_r($output, true);
} else {
$obj->output = $output;

Expand All @@ -16,7 +16,7 @@ public static function getMemoryLinux($obj)
$obj->memUsedBytes = $match[2]*1024;
$obj->memFreeBytes = $match[3]*1024;
} else {
$obj->error = "Get Memmory ERROR** " . print_r($output, true);
$obj->error = "Get Memory ERROR** " . print_r($output, true);
}
}
return $obj;
Expand All @@ -27,17 +27,17 @@ public static function getMemoryNetBSD($obj)
$obj->command = "/sbin/sysctl hw.pagesize; /usr/bin/vmstat -t";
exec($obj->command . " 2>&1", $output, $return_val);
if ($return_val !== 0) {
$obj->error = "Get Memmory ERROR** (".$obj->command." failed)";
$obj->error = "Get Memory ERROR** (".$obj->command." failed)";
} else {
$obj->output = $output;

$parts = explode(" = ", $output[0]);
if ($parts[0] != "hw.pagesize") {
$obj->error = "Get Memmory ERROR** (unknown page size)";
$obj->error = "Get Memory ERROR** (unknown page size)";
} elseif (($match = preg_split("/ +/", trim($output[3]))) === false) {
$obj->error = "Get Memmory ERROR** (unepxected vmstat output)";
$obj->error = "Get Memory ERROR** (unepxected vmstat output)";
} elseif (!is_numeric($match[4]) || !is_numeric($match[5]) || !is_numeric($match[11])) {
$obj->error = "Get Memmory ERROR** (non numeric memory size?)";
$obj->error = "Get Memory ERROR** (non numeric memory size?)";
} else {
$page_size = $parts[1];
$obj->memTotalBytes = $match[4] * $page_size;
Expand All @@ -60,7 +60,7 @@ public static function getMemory()
$getMemoryOsFunction = "getMemory" . $os;

if (!method_exists("ServerMonitor", $getMemoryOsFunction)) {
$obj->error = "Get Memmory error: ".$os." not supported";
$obj->error = "Get Memory error: ".$os." not supported";
} else {
$obj = ServerMonitor::$getMemoryOsFunction($obj);
}
Expand Down
20 changes: 10 additions & 10 deletions objects/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ function get_ffmpeg($ignoreGPU = false)
return $ffmpeg . $complement;
}

function getFFmpegScaleToForceOriginalAspectRatio($width, $heigth)
function getFFmpegScaleToForceOriginalAspectRatio($width, $height)
{
return "scale={$width}:{$heigth}:force_original_aspect_ratio=decrease,pad={$width}:{$heigth}:-1:-1:color=black";
return "scale={$width}:{$height}:force_original_aspect_ratio=decrease,pad={$width}:{$height}:-1:-1:color=black";
}

function replaceFFMPEG($cmd)
Expand Down Expand Up @@ -330,32 +330,32 @@ function getURLToApplication()
function check_max_execution_time()
{
$max_size = ini_get('max_execution_time');
$recomended_size = 7200;
return !($recomended_size > $max_size);
$recommended_size = 7200;
return !($recommended_size > $max_size);
}

//post_max_size = 100M
function check_post_max_size()
{
$max_size = parse_size(ini_get('post_max_size'));
$recomended_size = parse_size('100M');
return !($recomended_size > $max_size);
$recommended_size = parse_size('100M');
return !($recommended_size > $max_size);
}

//upload_max_filesize = 100M
function check_upload_max_filesize()
{
$max_size = parse_size(ini_get('upload_max_filesize'));
$recomended_size = parse_size('100M');
return !($recomended_size > $max_size);
$recommended_size = parse_size('100M');
return !($recommended_size > $max_size);
}

//memory_limit = 100M
function check_memory_limit()
{
$max_size = parse_size(ini_get('memory_limit'));
$recomended_size = parse_size('512M');
return !($recomended_size > $max_size);
$recommended_size = parse_size('512M');
return !($recommended_size > $max_size);
}

function check_mysqlnd()
Expand Down
4 changes: 2 additions & 2 deletions view/jquery-file-upload/server/php/UploadHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -1477,7 +1477,7 @@ public function delete($print_response = true) {
}

protected function basename($filepath, $suffix = '') {
$splited = preg_split('/\//', rtrim ($filepath, '/ '));
return substr(basename('X'.$splited[count($splited)-1], $suffix), 1);
$split = preg_split('/\//', rtrim ($filepath, '/ '));
return substr(basename('X' . $split[count($split) - 1], $suffix), 1);
}
}
32 changes: 16 additions & 16 deletions view/releaseDate.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,50 +21,50 @@
<option value="<?php echo date('Y-m-d H:i'); ?>"><?php echo __('Now'); ?> (<?php echo date('Y-m-d H:i'); ?>)</option>
<optgroup label="<?php echo __('Hours'); ?>">
<?php
$relaseOptions = array();
$relaseOptions[] = '1 ' . __('Hour');
$releaseOptions = array();
$releaseOptions[] = '1 ' . __('Hour');
for ($i = 2; $i < 24; $i++) {
$relaseOptions[] = "{$i} " . __('Hours');
$releaseOptions[] = "{$i} " . __('Hours');
}
foreach ($relaseOptions as $value) {
foreach ($releaseOptions as $value) {
echo "<option value='" . date('Y-m-d H:i', strtotime('+'.$value)) . "'>" . __($value) . "</option>";
}
?>
</optgroup>
<optgroup label="<?php echo __('Days'); ?>">
<?php
$relaseOptions = array();
$relaseOptions[] = array('1 ' . __('Day'), '+1 Day');
$releaseOptions = array();
$releaseOptions[] = array('1 ' . __('Day'), '+1 Day');
for ($i = 2; $i < 31; $i++) {
$relaseOptions[] = array("{$i} " . __('Days'), "+$i Day");
$releaseOptions[] = array("{$i} " . __('Days'), "+$i Day");
}
foreach ($relaseOptions as $value) {
foreach ($releaseOptions as $value) {
echo "<option value='" . date('Y-m-d H:i', strtotime($value[1])) . "'>" . __($value[0]) . "</option>";
}
?>
</optgroup>
<optgroup label="<?php echo __('Months'); ?>">
<?php
$relaseOptions = array();
$relaseOptions[] = array('1 ' . __('Month'), '+1 Month');
$releaseOptions = array();
$releaseOptions[] = array('1 ' . __('Month'), '+1 Month');
for ($i = 2; $i < 12; $i++) {
$relaseOptions[] = array("{$i} " . __('Months'), "+$i Months");
$releaseOptions[] = array("{$i} " . __('Months'), "+$i Months");
}

foreach ($relaseOptions as $value) {
foreach ($releaseOptions as $value) {
echo "<option value='" . date('Y-m-d H:i', strtotime($value[1])) . "'>" . __($value[0]) . "</option>";
}
?>
</optgroup>
<optgroup label="<?php echo __('Years'); ?>">
<?php
$relaseOptions = array();
$relaseOptions[] = array('1 ' . __('Year'), '+1 Year');
$releaseOptions = array();
$releaseOptions[] = array('1 ' . __('Year'), '+1 Year');
for ($i = 2; $i < 10; $i++) {
$relaseOptions[] = array("{$i} " . __('Years'), "+{$i} Years");
$releaseOptions[] = array("{$i} " . __('Years'), "+{$i} Years");
}

foreach ($relaseOptions as $value) {
foreach ($releaseOptions as $value) {
echo "<option value='" . date('Y-m-d H:i', strtotime($value[1])) . "'>" . __($value[0]) . "</option>";
}
?>
Expand Down
10 changes: 5 additions & 5 deletions view/watermark.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
$watermark_color = "yellow";
$watermark_opacity = 0.5;
$hls_time = 10;
$skippFirstSegments = 30; // 5 min
$skipFirstSegments = 30; // 5 min
$max_process_at_the_same_time = 5;
$encrypt = false; // if enable encryption it fails to play, probably an error on .ts timestamp
//$downloadCodec = " -c:v libx264 -acodec copy ";
Expand Down Expand Up @@ -679,10 +679,10 @@ function getAllTSFilesInDir($dir) {
}

function getRandomSymlinkTSFileArray($dir, $total) {
global $skippFirstSegments;
global $skipFirstSegments;
$totalTSFiles = getTotalTSFilesInDir($dir);
error_log("getRandomSymlinkTSFileArray: ($totalTSFiles) ($total) {$dir}");
$firstfile = sprintf('%03d.ts', $skippFirstSegments);
$firstfile = sprintf('%03d.ts', $skipFirstSegments);
if (!file_exists("{$dir}/{$firstfile}")) {
$firstfile = "000.ts";
}
Expand All @@ -706,8 +706,8 @@ function getRandomSymlinkTSFileArray($dir, $total) {
}

function createFirstSegment() {
global $skippFirstSegments, $outputPath, $localFileDownloadDir;
$firstfile = sprintf('%03d.ts', $skippFirstSegments);
global $skipFirstSegments, $outputPath, $localFileDownloadDir;
$firstfile = sprintf('%03d.ts', $skipFirstSegments);
$inputHLS_ts = "{$localFileDownloadDir}/{$firstfile}";
if (!file_exists($inputHLS_ts)) {
$firstfile = "000.ts";
Expand Down

0 comments on commit 64022ee

Please sign in to comment.