forked from leftypol/leftypol
ffmpeg.php: fix track location and aac check
This commit is contained in:
parent
03114fef38
commit
9b093cdec8
1 changed files with 8 additions and 7 deletions
|
|
@ -112,10 +112,10 @@ function is_valid_webm(array $ffprobe_out) {
|
||||||
}
|
}
|
||||||
} elseif ($extension === 'mp4' || stristr($ffprobe_out['format']['format_name'], 'mp4')) {
|
} elseif ($extension === 'mp4' || stristr($ffprobe_out['format']['format_name'], 'mp4')) {
|
||||||
$any_h26x = false;
|
$any_h26x = false;
|
||||||
for ($i = 0; $i < count($trackmap['videoat']); $i++) {
|
foreach ($trackmap['videoat'] as $track_idx) {
|
||||||
$video_codec = $ffprobe_out['streams'][$i]['codec_name'];
|
$video_codec = $ffprobe_out['streams'][$track_idx]['codec_name'];
|
||||||
if ($video_codec == 'h264' || $video_codec == 'h265') {
|
if ($video_codec === 'h264' || $video_codec === 'h265') {
|
||||||
$video_idx = $i;
|
$video_idx = $track_idx;
|
||||||
$any_h26x = true;
|
$any_h26x = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
@ -123,9 +123,10 @@ function is_valid_webm(array $ffprobe_out) {
|
||||||
|
|
||||||
$any_aac = false;
|
$any_aac = false;
|
||||||
if ($audio_idx !== null) {
|
if ($audio_idx !== null) {
|
||||||
for ($i = 0; $i < count($trackmap['audioat']); $i++) {
|
foreach ($trackmap['audioat'] as $track_idx) {
|
||||||
if ($ffprobe_out['streams'][$i]['codec_name'] == 'acc') {
|
$audio_codec = $ffprobe_out['streams'][$track_idx]['codec_name'];
|
||||||
$audio_idx = $i;
|
if ($audio_codec === 'aac') {
|
||||||
|
$audio_idx = $track_idx;
|
||||||
$any_aac = true;
|
$any_aac = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue