R
R
rusrich2018-12-12 15:17:43
fmpeg
rusrich, 2018-12-12 15:17:43

Why are the last 5 fragments of teesok (TS) recorded when converting video to HLS to an M3U8 file?

Hello.
I have a problem when converting videos longer than 15 seconds.
The conversion to HLS is fine and there are enough fragments to play the video.
But only the last 5 video fragments are indicated in the index.m3u8 file. It looks like this:

#EXTM3U
#EXT-X-VERSION:3
#EXT-X-TARGETDURATION:6
#EXT-X-MEDIA-SEQUENCE:682
#EXTINF:5.800000,
1-360-682.ts
#EXTINF:3.560000,
1-360-683.ts
#EXTINF:1.800000,
1-360-684.ts
#EXTINF:3.800000,
1-360-685.ts
#EXTINF:3.840000,
1-360-686.ts
#EXT-X-ENDLIST

The command with which I start the conversion process:
system("ffmpeg -i #{@file.path} 
-map 0:v:0 -map 0:a:0 
-vcodec libx264 -pix_fmt yuv420p -vsync 1 -async 1 -color_primaries 1 -color_trc 1 -colorspace 1 -s 640x360 -crf 20 
-preset medium -profile:v high -level 3.1 -maxrate 800k -bufsize 1200k -ab 128k 
-movflags +faststart -hls_time 2 -strict -2 
#{store_dir}#{@model.id}-360-.m3u8")

Tell me where to dig?
Can you suggest a solution?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Moskus, 2018-12-12
@rusrich

You forgot the parameter -hls_list_size 0. The default value is 5, so that's how it goes.
"Dig", as always, here: https://ffmpeg.org/ffmpeg-formats.html#hls-1

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question