This commit is contained in:
Brooke Vibber 2022-06-26 14:17:53 -07:00
commit cde10f5bf7
8 changed files with 126 additions and 52 deletions

View file

@ -40,6 +40,13 @@ class Audio {
'-b:a', '96k',
],
],
'vorbis.webm' => [
'container' => 'webm',
'options' => [
'-acodec', 'libvorbis',
'-b:a', '112k',
],
],
// with the added id3 timestamps this work great with iOS HLS
// but mac safari doesn't seem happy with anything i do with them
'mp3' => [
@ -275,6 +282,14 @@ class Transcoder {
'-hls_segment_filename', $segment,
'-y', $playlist,
];
} elseif ( $container == 'webm' ) {
$segment = "$outfile.%04d.$container";
$segmentOptions = [
'-f', 'segment',
'-segment_time', '10',
'-segment_list', $playlist,
'-y', $segment
];
} elseif ( $container == 'mov' ) {
// For MJPEG, MP4 doesn't work in Apple HLS for some reason
// but QuickTime is sortof ok for one segment?
@ -372,8 +387,10 @@ $infiles = [
foreach ( $infiles as $filename ) {
$source = new SourceFile( $filename );
$codec = new Transcoder( $source );
$codec->audio('aac');
$codec->audio('opus');
//$codec->audio('aac');
//$codec->audio('opus');
$codec->audio('vorbis.webm');
/*
$codec->audio('mp3');
$codec->audio('mp3.ts');
$codec->audio('mp3.mp4');
@ -391,4 +408,5 @@ foreach ( $infiles as $filename ) {
$codec->video('vp9', $res, 'pass2');
}
}
*/
}