webm opus
This commit is contained in:
parent
10a001d01c
commit
9d782dc963
3 changed files with 14 additions and 5 deletions
6
ogv.html
6
ogv.html
|
@ -75,7 +75,7 @@
|
||||||
if (typeof MediaSource == 'function') {
|
if (typeof MediaSource == 'function') {
|
||||||
let codecs = [
|
let codecs = [
|
||||||
['VP9-in-MP4', 'video/mp4; codecs="vp09.00.10.08"'],
|
['VP9-in-MP4', 'video/mp4; codecs="vp09.00.10.08"'],
|
||||||
['Opus-in-MP4', 'audio/mp4; codecs="opus"'],
|
['Opus-in-WebM', 'audio/webm; codecs="opus"'],
|
||||||
['MP3', 'audio/mp3'],
|
['MP3', 'audio/mp3'],
|
||||||
];
|
];
|
||||||
let yes = [];
|
let yes = [];
|
||||||
|
@ -115,7 +115,7 @@
|
||||||
</script>
|
</script>
|
||||||
<script src=ogvjs-1.8.4/ogv.js></script>
|
<script src=ogvjs-1.8.4/ogv.js></script>
|
||||||
<script src=video-js/alt/video.core.js></script>
|
<script src=video-js/alt/video.core.js></script>
|
||||||
<script src=videojs-http-streaming.es.js></script>
|
<script src=videojs-http-streaming.js></script>
|
||||||
<script src=videojs-ogvjs.js></script>
|
<script src=videojs-ogvjs.js></script>
|
||||||
<script>
|
<script>
|
||||||
var playerConfig = {
|
var playerConfig = {
|
||||||
|
@ -134,7 +134,7 @@
|
||||||
return (typeof MediaSource == 'function') && MediaSource.isTypeSupported(mime);
|
return (typeof MediaSource == 'function') && MediaSource.isTypeSupported(mime);
|
||||||
}
|
}
|
||||||
var vp9 = can('video/mp4; codecs="vp09.00.10.08"');
|
var vp9 = can('video/mp4; codecs="vp09.00.10.08"');
|
||||||
var opus = can('audio/mp4; codecs="opus"');
|
var opus = can('audio/webm; codecs="opus"');
|
||||||
var aac = can('audio/mp4; codecs="mp4a.40.02');
|
var aac = can('audio/mp4; codecs="mp4a.40.02');
|
||||||
var mp3 = can('audio/mp3');
|
var mp3 = can('audio/mp3');
|
||||||
//var mp3 = can('audio/mp4; codecs="mp4a.40.34"');
|
//var mp3 = can('audio/mp4; codecs="mp4a.40.34"');
|
||||||
|
|
|
@ -32,7 +32,7 @@ class Audio {
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
'opus' => [
|
'opus' => [
|
||||||
'container' => 'mp4',
|
'container' => 'webm',
|
||||||
'options' => [
|
'options' => [
|
||||||
'-acodec', 'libopus',
|
'-acodec', 'libopus',
|
||||||
'-ar', 48000,
|
'-ar', 48000,
|
||||||
|
@ -231,6 +231,13 @@ class Transcoder {
|
||||||
'-segment_list', $playlist,
|
'-segment_list', $playlist,
|
||||||
'-y', $segment
|
'-y', $segment
|
||||||
];
|
];
|
||||||
|
} elseif ( $container == 'webm' ) {
|
||||||
|
$segmentOptions = [
|
||||||
|
'-f', 'segment',
|
||||||
|
'-segment_time', '10',
|
||||||
|
'-segment_list', $playlist,
|
||||||
|
'-y', $segment
|
||||||
|
];
|
||||||
} else {
|
} else {
|
||||||
die( 'missing container in config' );
|
die( 'missing container in config' );
|
||||||
}
|
}
|
||||||
|
@ -304,6 +311,7 @@ foreach ( $infiles as $filename ) {
|
||||||
$source = new SourceFile( $filename );
|
$source = new SourceFile( $filename );
|
||||||
$codec = new Transcoder( $source );
|
$codec = new Transcoder( $source );
|
||||||
$codec->audio('opus');
|
$codec->audio('opus');
|
||||||
|
/*
|
||||||
$codec->audio('mp3');
|
$codec->audio('mp3');
|
||||||
$codec->audio('aac');
|
$codec->audio('aac');
|
||||||
foreach ( Video::FORMATS['vp9']['resolutions'] as $res => $format ) {
|
foreach ( Video::FORMATS['vp9']['resolutions'] as $res => $format ) {
|
||||||
|
@ -317,4 +325,5 @@ foreach ( $infiles as $filename ) {
|
||||||
$codec->video('vp9', $res, 'pass2');
|
$codec->video('vp9', $res, 'pass2');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
(cd ~/src/media/http-streaming && npm ci) && cp ~/src/media/http-streaming/dist/videojs-http-streaming.es.js .
|
(cd ~/src/media/http-streaming && npm ci) && cp ~/src/media/http-streaming/dist/videojs-http-streaming.js .
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue