hls-test/HLS/rewrite-mp3.php

21 lines
511 B
PHP
Raw Permalink Normal View History

2023-04-04 16:57:12 +00:00
<?php
require( __DIR__ . '/StreamReader.php' );
require( __DIR__ . '/OwningStreamReader.php' );
require( __DIR__ . '/Segmenter.php' );
require( __DIR__ . '/MP3Segmenter.php' );
use MediaWiki\TimedMediaHandler\HLS\MP3Segmenter;
$argv = $_SERVER['argv'];
$self = array_shift( $argv );
$filename = array_shift( $argv );
$target = 10;
$segmenter = new MP3Segmenter( $filename );
$segmenter->consolidate( $target );
$segmenter->rewrite();
$m3u8 = $segmenter->playlist( $target, $filename );
print $m3u8 . "\n";