mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-04 17:44:38 +09:00
Fix #1552 error in Windows if ffmpeg path contains spaces
This commit is contained in:
parent
790434ad32
commit
0c1c388331
1 changed files with 4 additions and 11 deletions
|
|
@ -1136,14 +1136,7 @@ class fileController extends file
|
||||||
$adjusted['height'] -= $adjusted['height'] % 2;
|
$adjusted['height'] -= $adjusted['height'] % 2;
|
||||||
|
|
||||||
// Convert using ffmpeg
|
// Convert using ffmpeg
|
||||||
if (RX_WINDOWS)
|
$command = \RX_WINDOWS ? escapeshellarg($config->ffmpeg_command) : $config->ffmpeg_command;
|
||||||
{
|
|
||||||
$command = escapeshellarg($config->ffmpeg_command);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$command = $config->ffmpeg_command;
|
|
||||||
}
|
|
||||||
$command .= ' -nostdin -i ' . escapeshellarg($file_info['tmp_name']);
|
$command .= ' -nostdin -i ' . escapeshellarg($file_info['tmp_name']);
|
||||||
$command .= ' -movflags +faststart -pix_fmt yuv420p -c:v libx264 -crf 23';
|
$command .= ' -movflags +faststart -pix_fmt yuv420p -c:v libx264 -crf 23';
|
||||||
$command .= sprintf(' -vf "scale=%d:%d"', $adjusted['width'], $adjusted['height']);
|
$command .= sprintf(' -vf "scale=%d:%d"', $adjusted['width'], $adjusted['height']);
|
||||||
|
|
@ -1193,7 +1186,7 @@ class fileController extends file
|
||||||
}
|
}
|
||||||
|
|
||||||
// Analyze video file
|
// Analyze video file
|
||||||
$command = $config->ffprobe_command;
|
$command = \RX_WINDOWS ? escapeshellarg($config->ffprobe_command) : $config->ffprobe_command;
|
||||||
$command .= ' -v quiet -print_format json -show_streams';
|
$command .= ' -v quiet -print_format json -show_streams';
|
||||||
$command .= ' ' . escapeshellarg($file_info['tmp_name']);
|
$command .= ' ' . escapeshellarg($file_info['tmp_name']);
|
||||||
@exec($command, $output, $return_var);
|
@exec($command, $output, $return_var);
|
||||||
|
|
@ -1232,9 +1225,9 @@ class fileController extends file
|
||||||
if ($config->video_thumbnail)
|
if ($config->video_thumbnail)
|
||||||
{
|
{
|
||||||
$thumbnail_name = $file_info['tmp_name'] . '.thumbnail.jpeg';
|
$thumbnail_name = $file_info['tmp_name'] . '.thumbnail.jpeg';
|
||||||
$command = $config->ffmpeg_command;
|
$command = \RX_WINDOWS ? escapeshellarg($config->ffmpeg_command) : $config->ffmpeg_command;
|
||||||
$command .= sprintf(' -ss 00:00:00.%d -i %s -vframes 1', mt_rand(0, 99), escapeshellarg($file_info['tmp_name']));
|
$command .= sprintf(' -ss 00:00:00.%d -i %s -vframes 1', mt_rand(0, 99), escapeshellarg($file_info['tmp_name']));
|
||||||
$command .= ' ' . escapeshellarg($thumbnail_name);
|
$command .= ' -nostdin -i ' . escapeshellarg($thumbnail_name);
|
||||||
@exec($command, $output, $return_var);
|
@exec($command, $output, $return_var);
|
||||||
if ($return_var === 0)
|
if ($return_var === 0)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue