Skip to content

Commit

Permalink
https://github.com/WWBN/AVideo/issues/9419
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Neto committed Sep 20, 2024
1 parent 618cc19 commit 26ade27
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion objects/Encoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -2122,7 +2122,7 @@ public static function sendToStreamer($target, $postFields, $return_vars = false
$time_end = microtime(true);
$execution_time = number_format($time_end - $time_start, 3);
$error = "sendToStreamer {$url} in {$execution_time} seconds ";
_error_log($error . json_encode($obj).json_encode(debug_backtrace()));
_error_log($error . json_encode($obj).' debug_backtrace='.json_encode(debug_backtrace()));

$newObj = $obj;
unset($newObj->postFields);
Expand Down
16 changes: 11 additions & 5 deletions objects/Format.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

require_once __DIR__.'/HLSProcessor.php';
require_once __DIR__ . '/HLSProcessor.php';

if (!class_exists('Format')) {
if (!class_exists('ObjectYPT')) {
Expand Down Expand Up @@ -886,10 +886,10 @@ private static function exec($format_id, $pathFileName, $destinationFile, $encod
_error_log("AVideo-Encoder Format::exec [$format_id, $pathFileName, $destinationFile, $encoder_queue_id] code=({$fc})");
if ($format_id == 29 || $format_id == 30) { // it is HLS
if (empty($fc) || $format_id == 30) {
if(empty($global['disableHLSAudioMultitrack'])){
if (empty($global['disableHLSAudioMultitrack'])) {
_error_log("AVideo-Encoder Format::exec use HLSProcessor");
$dynamic = HLSProcessor::createHLSWithAudioTracks($pathFileName, $destinationFile);
}else{
} else {
_error_log("AVideo-Encoder Format::exec disableHLSAudioMultitrack");
$dynamic = self::preProcessDynamicHLS($pathFileName, $destinationFile);
}
Expand Down Expand Up @@ -1001,8 +1001,13 @@ public static function videoFileHasErrors($filename, $allowed_extensions = true)

$errorLogFile = tempnam(sys_get_temp_dir(), 'video_error_log');

// Check if the file extension is compatible with -allowed_extensions ALL
$compatibleExtensions = ['m3u8', 'mpd']; // Add any other compatible extensions here
$fileExtension = strtolower(pathinfo($filename, PATHINFO_EXTENSION));
$isCompatible = in_array($fileExtension, $compatibleExtensions);

$complement = '';
if ($allowed_extensions) {
if ($allowed_extensions && $isCompatible) {
$complement = '-allowed_extensions ALL';
}

Expand Down Expand Up @@ -1032,7 +1037,7 @@ public static function videoFileHasErrors($filename, $allowed_extensions = true)
unlink($errorLogFile);

if (!empty($content)) {
if ($allowed_extensions) {
if ($allowed_extensions && $isCompatible) {
return self::videoFileHasErrors($filename, false);
}
_error_log("videoFileHasErrors: errors found on video file {$filename} " . PHP_EOL . $content);
Expand All @@ -1042,6 +1047,7 @@ public static function videoFileHasErrors($filename, $allowed_extensions = true)
}
}


private static function execOrder($format_order, $pathFileName, $destinationFile, $encoder_queue_id)
{
if (empty($destinationFile)) {
Expand Down

0 comments on commit 26ade27

Please sign in to comment.