Skip to content

Commit 9929cb0

Browse files
author
Daniel Neto
committed
Enhance audio command for HLS processing with improved parameters and segment type
WWBN/AVideo#10195
1 parent 38ba546 commit 9929cb0

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

objects/HLSProcessor.php

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,11 @@ public static function createHLSWithAudioTracks($pathFileName, $destinationFile)
8282
$audioTsPattern = "{$destinationFile}audio_tracks/{$langDir}/audio_%03d.ts"; // Pattern for audio .ts segments
8383

8484
// Correctly map the audio track and add VOD parameters
85-
$audioCommand = get_ffmpeg() . " -i {$pathFileName} "
86-
. " -map 0:a:{$track->index} -c:a aac -b:a 128k "
87-
// Enforce identical segment time
88-
. " -movflags +faststart -f hls -hls_time 6 "
89-
. " -hls_flags independent_segments+split_by_time "
90-
. " -hls_playlist_type vod "
85+
$audioCommand = get_ffmpeg() . " -y -i {$pathFileName} "
86+
. " -vn -map 0:a:{$track->index} "
87+
. " -c:a aac -profile:a aac_low -ac 2 -ar 48000 -b:a 128k "
88+
. " -f hls -hls_time 6 -hls_flags independent_segments+split_by_time "
89+
. " -hls_playlist_type vod -hls_segment_type mpegts "
9190
. " -hls_segment_filename \"{$audioTsPattern}\" {$audioFile}";
9291

9392

0 commit comments

Comments
 (0)