forked from leftypol/leftypol
Compare commits
1 commit
config
...
ffmpeg-fix
Author | SHA1 | Date | |
---|---|---|---|
![]() |
6ae47061cd |
1 changed files with 22 additions and 7 deletions
|
@ -84,14 +84,29 @@ function is_valid_webm($ffprobe_out) {
|
|||
}
|
||||
} elseif ($extension === 'mp4' || stristr($ffprobe_out['format']['format_name'], 'mp4')) {
|
||||
// If the video is not h264 or (there is audio but it's not aac).
|
||||
if (($ffprobe_out['streams'][$videoidx]['codec_name'] != 'h264') || ((count($trackmap['audioat']) > 0) && ($ffprobe_out['streams'][$trackmap['audioat'][0]]['codec_name'] != 'aac'))) {
|
||||
if ($ffprobe_out['streams'][$videoidx]['codec_name'] != 'h264') {
|
||||
if (!isset($ffprobe_out['streams'][0]['codec_name'])) {
|
||||
return [
|
||||
'error' => [
|
||||
'code' => 2,
|
||||
'msg' => $config['error']['invalidwebm'] . ' [h264/aac check]'
|
||||
'msg' => $config['error']['invalidwebm']
|
||||
]
|
||||
];
|
||||
}
|
||||
|
||||
$video_codec = $ffprobe_out['streams'][0]['codec_name'];
|
||||
|
||||
$audio_codec = $ffprobe_out['streams'][1]['codec_name'] ?? null;
|
||||
|
||||
if ($video_codec !== 'h264' || ($audio_codec && $audio_codec !== 'aac')) {
|
||||
return [
|
||||
'error' => [
|
||||
'code' => 2,
|
||||
'msg' => $config['error']['invalidwebm']
|
||||
]
|
||||
];
|
||||
}
|
||||
}
|
||||
} else {
|
||||
return [
|
||||
'error' => [
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue