Good morning, I created I am testing HLS streaming and I created a simple playlist and segment of a video using the command ffmpeg -i C:\Users\funny\Desktop\uscita\out.mp4 -vcodec libx264 -g 24 -hls_time 10 -hls_playlist_type vod -vsync 1 index1.m3u8.

The source video opens with no problems and ffmpeg encodes it with no problems into index1, that is the playlist file, and index10 index11 index12 being the 3 .ts (video is only 26 secs long). I installed VLC cause I know it opens playlist files, so I could test my .m3u8, but when I open it with VLC, program starts running but it doesn't play anything. For reference here it is the playlist too :

  • Try playback with ffplay. – Ipor Sircer Nov 29 '18 at 10:11
  • which input url should I put into ffplay command? can I input the .m3u8 file directly? – Vincent Bavaro Nov 29 '18 at 10:30
  • @VincentBavaro: Yes, you can. Incidentally, why not just try it before asking? – sleske Nov 29 '18 at 11:07
  • done. it shows me the video without problems. Thanks. Any clue how it doesn't play with vlc tho? – Vincent Bavaro Nov 29 '18 at 11:11

tl;dr: This looks like a bug with VLC. Use a different player.

I can reproduce this problem with a set of HLS video file, created by ffmpeg as indicated in the question. That is with ffmpeg 4.0.2 and VLC 3.0.4


Opening the .m3u8 file with VLC, I get the error message:

adaptive demux error: Failed to create demuxer (nil) TLS

The debug logs indicate that VLC actually successfully reads the playlist, and finds the TS files, but then something goes wrong.

However, I can successfully play the files with both ffplay and MPlayer, so it looks like the fault is with VLC.

The VLC bugtracker has some similar-looking bug reports, but most are quite old and supposedly fixed. I did manage to play an HLS stream over HTTP, by opening the URL of the .m3u8 file, so the bug seems to only apply to downloaded HLS streams. Maybe playing of locally downloaded .m3u8 files is not a high priority for VLC, so just use a different player.

  • Okay. Actually with a closer look after vlc opens it, I can briefly see the video duration blinking to 26 secs before it goes back to 0, so I supposed as well that my vlc was able to read the files anyways. I will also try to upload the stream using an apache webserver and seeeing if vlc will do the same problem with the url. – Vincent Bavaro Nov 29 '18 at 11:30

VLC can't seem to process a m3u8 file with those 'EXT-X' directives in it. Presumably this is a VLC bug (as noted elsewhere) which has yet to be resolved even upto today.

Your best choices are:

  1. Edit the .m3u8 file and delete the EXT-X lines (but do keep those EXTINF lines). You should then be able to play the playlist with VLC, or
  2. Use a different application to play the .m3u8 file as is. ffplay is one that will play it, for example.

Just in case anyone still needs some information on it.

Check "content-type" header of your mpegts chunk. It should be "video/mp2t".

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.