Answer the question
In order to leave comments, you need to log in
M3u8 does not start at the beginning of the playlist?
I am writing a channel through FFmpeg (in HLS format) cutting, a playlist is automatically created there, the question is, how can I play not from the beginning of the playlist, but for example from a certain moment?
#EXTM3U
#EXT-X-VERSION:3
#EXT-X-MEDIA-SEQUENCE:0
#EXT-X-ALLOW-CACHE:YES
#EXT-X-TARGETDURATION:11
#EXTINF:10.652922,
live000.ts
#EXTINF:9.480000 ,
live001.ts
#EXTINF:10.440000,
live002.ts
#EXTINF:9.480000,
live003.ts
#EXTINF:9.480000,
live004.ts
#EXTINF:10.440000,
live005.ts
#EXTINF:9.480000,
live006.ts
#EXTINF:10.440000,
live007 .ts
#EXTINF:9.480000,
live008.ts
#EXTINF:9.480000,
live009.ts
#EXTINF:10.440000,
live010.ts
#EXTINF:9.480000,
live011.ts
#EXTINF:10.440000,
live012.ts
#EXTINF:9.480000,
live013.ts
#EXTINF:10.440000,
live014.ts
Answer the question
In order to leave comments, you need to log in
The problem was solved, on that day, I will unsubscribe now here.
#EXTM3U
#EXT-X-TARGETDURATION:61
#EXT-X-PLAYLIST-TYPE:VOD
#EXTINF:60,
live000.ts
#EXTINF:60,
live001.ts
****
тут чанки ваши прописываем.
****
#EXTINF:60,
live005.ts
#EXT-X-ENDLIST
$file = "record.m3u8";
//если файла нету... тогда
if( !file_exists($file)) {
$fp = fopen($file, "w"); // ("r" - считывать "w" - создавать "a" - добовлять к тексту), мы создаем файл
fwrite($fp, "#EXTM3U\n #EXT-X-TARGETDURATION:10\n #EXT-X-PLAYLIST-TYPE:VOD\n");
for($i = 0; $i < 6; ++$i){
fwrite($fp, sprintf("#EXTINF:60,\nlive%03d.ts\n", $i));
}
fwrite($fp,"#EXT-X-ENDLIST");
fclose ($fp);
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question