Skip to content

Commit

Permalink
https://github.com/WWBN/AVideo/issues/9817#issuecomment-2599133126
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Neto committed Jan 20, 2025
1 parent 5833c2d commit 0c3c227
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions objects/MP4Processor.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,14 @@ public static function createMP4MaxResolutionFromQueueId($pathFileName, $encoder
if($inputResolution> $maxResolution){
$inputResolution = $maxResolution;
}
$destinationFile = Encoder::getTmpFileName($encoder_queue_id, 'mp4', $inputResolution);
return self::createMP4($pathFileName, $destinationFile, $encoder_queue_id, $inputResolution);
// Get allowed resolutions from Format::ENCODING_SETTINGS
$allowedResolutions = array_keys(Format::ENCODING_SETTINGS);
// Determine the target resolution
$targetResolution = self::getClosestResolution($inputResolution, $allowedResolutions);

$destinationFile = Encoder::getTmpFileName($encoder_queue_id, 'mp4', $targetResolution);
_error_log("MP4Processor::createMP4MaxResolutionFromQueueId [$pathFileName, $encoder_queue_id, $maxResolution ] [{$inputResolution}p] => [{$targetResolution}p] $destinationFile");
return self::createMP4($pathFileName, $destinationFile, $encoder_queue_id, $targetResolution);
}

public static function createMP4MaxResolution($pathFileName, $destinationFile, $maxResolution = 1080){
Expand Down

0 comments on commit 0c3c227

Please # to comment.