ffmpeghttp-live-streamingvlc

Only first segment is played on m3u8 playlist


I generate the .ts files by capturing small 3-second video chunks using the MediaRecorder API and sending them to the server. Then, I convert these chunks to .ts files using the FFmpeg library on the Rails backend. After that, I store all the videos on AWS and generate the playlist using the video durations applied to the segment names. However, all HLS players only play the first segment and then stop. Only this https://hlsjs.video-dev.org player plays it successfully. I don't know what the problem is. Can someone help me?

#EXTM3U
#EXT-X-VERSION:3
#EXT-X-TARGETDURATION:4
#EXT-X-MEDIA-SEQUENCE:1
#EXT-X-PLAYLIST-TYPE:VOD
#EXTINF:2.0,
video_recording_001_2.0.ts
#EXTINF:2.866667,
video_recording_002_2.866667.ts
#EXTINF:2.866667,
video_recording_003_2.866667.ts
#EXTINF:2.9,
video_recording_004_2.9.ts
#EXTINF:2.833333,
video_recording_005_2.833333.ts
#EXTINF:2.866667,
video_recording_006_2.866667.ts
#EXTINF:2.9,
video_recording_007_2.9.ts
#EXTINF:2.9,
video_recording_008_2.9.ts
#EXTINF:2.9,
video_recording_009_2.9.ts
#EXTINF:2.9,
video_recording_010_2.9.ts
#EXTINF:2.866667,
video_recording_011_2.866667.ts
#EXTINF:2.833333,
video_recording_012_2.833333.ts
#EXT-X-ENDLIST

Solution

  • Got it the video segments were discontinued so i added #EXT-X-DISCONTINUITY for all and it worked

    #EXTM3U
    #EXT-X-VERSION:3
    #EXT-X-TARGETDURATION:4
    #EXT-X-MEDIA-SEQUENCE:1
    #EXT-X-PLAYLIST-TYPE:VOD
    #EXTINF:2.0,
    video_recording_001_2.0.ts
    #EXT-X-DISCONTINUITY
    #EXTINF:2.866667,
    video_recording_002_2.866667.ts
    #EXT-X-DISCONTINUITY
    #EXTINF:2.866667,
    video_recording_003_2.866667.ts
    #EXT-X-DISCONTINUITY
    #EXTINF:2.9,
    video_recording_004_2.9.ts
    #EXTINF:2.833333,
    video_recording_005_2.833333.ts
    #EXTINF:2.866667,
    video_recording_006_2.866667.ts
    #EXTINF:2.9,
    video_recording_007_2.9.ts
    #EXTINF:2.9,
    video_recording_008_2.9.ts
    #EXTINF:2.9,
    video_recording_009_2.9.ts
    #EXTINF:2.9,
    video_recording_010_2.9.ts
    #EXTINF:2.866667,
    video_recording_011_2.866667.ts
    #EXTINF:2.833333,
    video_recording_012_2.833333.ts
    #EXT-X-ENDLIST