Name is required.
Email address is required.
Invalid email address
Answer is required.
Exceeding max length of 5KB

HLS not working


Hello guys,

I have an Iphone application that uploads small chunks of mp4 videos that I treat individually using ffmpeg
(ffmpeg -i inputFile.mp4 -vcodec libx264 -acodec libfaac -ab 128k -ar 44100 -intra -b 2000k -minrate 2000k -maxrate 2000k outputFile.ts)

and upon each submit l update the m3u8 playlist in order to have a live streaming playlist.
I have purchased JWPlayer yesterday now I am trying to setup the player using this code :

jwplayer('my-video').setup({
file: 'http://localhost/HLS/123123.m3u8',
width: '640',
height: '360',
skin: 'modieus'
});

The player periodically refreshes the playlist and the files are pulled from the server but they are not played and the player is stuck on the loading icon ...

How can I detect why the chunks aren't played ?

Thanks in advance.

31 Community Answers

JW Player

User  
0 rated :

A sample playlist file : http://files.elsawt.com/HLS/LIVE/77/77.m3u8

JW Player

User  
0 rated :

Update: the player freezes on the loading image when the inspect element network tab shows that the player is pulling the newly added files :(

JW Player

User  
1 rated :

Hello,

I would suggest first using something like VLC to check that the playlist is working correctly.

Also, from what I've learned, you need to put this on your site for HLS:

<script>jwplayer.key=""</script><!-- You need to get your own key to put here -->

And, here is a snipped of code I use with JW6 to play HLS:

jwplayer("player").setup({
autostart: 'true',
sources: [{
file: "http://184.107.183.106:1937/flavaworks/def/camera.stream/playlist.m3u8"
}],
});

lee

JW Player

User  
0 rated :

I just tried this link with VLC: http://files.elsawt.com/HLS/LIVE/77/77.m3u8


it did not work. So I think that is where you should begin your search for an answer.

lee

Ethan Feldman

JW Player Support Agent  
0 rated :

I would also like to see where you are running the player with this, but if there is an issue with VLC then that is an issue with the stream itself.

JW Player

User  
0 rated :

Thanks a lot Lee for your help :)

The problem was that nginx was caching the playlist file : http://blog.quadranet.com/?p=505

I am still facing some video encoding issues and according to vlc :

bc.. main warning: picture is too late to be displayed


and the video hangs
Any help is much appreciated ...

Thanks in advance

JW Player

User  
0 rated :

Another thing that I noticed is that if I refresh the page or stop/start VLC the first chunks in the playlist are well played then on fetching new ones the hanging and glitching starts ...

Is it maybe related ti I-frames inside a chunk ?
can anyone recommend a ffmpeg command to convert small MP4 (h264/aac) videos into HLS compatible .ts files ?

Thanks again ...

JW Player

User  
0 rated :

Glad it helped toward a solution. Unfortunately, I don't know enough about encoding to help with the other issue.

lee

Ethan Feldman

JW Player Support Agent  
0 rated :

Nice. Yeah, I don’t know about FFMPEG either I’m afraid.

JW Player

User  
0 rated :

Hello,

Can't IOS play MP4 files directly without conversion?

If you want playlists, JWP6 has Playlist support outside of the m3u8 format: http://www.longtailvideo.com/support/jw-player/28842/working-with-playlists/

I believe this technique would support all players, not just IOS.

lee

JW Player

User  
0 rated :

When i try to play the MP4 files directly without conversion I get this error :

bc.. Error: Could not parse TS file: sync byte not found.


So I have to figure out a way to produce compatible chunks.

JW Player

User  
0 rated :

Hello,

Well, in the error, it says you are trying to read a TS file. Are you sure the uploaded chunks are MP4?

lee

JW Player

User  
0 rated :

Hello Lee,
Thank you for following this issue with me.

ffmpeg returns this info about the uploaded chunks:

bc.. Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '218_1.ts.tmp':
Metadata:
major_brand : mp42
minor_version : 1
compatible_brands: mp41mp42isom
creation_time : 2013-05-08 14:20:42
Duration: 00:00:01.95, start: 0.000000, bitrate: 142 kb/s
Stream #0:0(und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 60 kb/s
Metadata:
creation_time : 2013-05-08 14:20:42
handler_name : Core Media Audio
Stream #0:1(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 192x144, 72 kb/s, 15 fps, 15 tbr, 600 tbn, 1200 tbc
Metadata:
creation_time : 2013-05-08 14:20:42
handler_name : Core Media Video



JW Player

User  
0 rated :

Hello,

Why don't you send one of the chunks to me at kleelof@y!.

lee

JW Player

User  
0 rated :

I have tried with the big buck bunny video :
- segmented it using ffmpeg
- wrote a script that uploads these segments periodically to the same playlist writer script
- when I play the video using VLC it plays smoothly
- when I try the same playlist in JWPlayer it freezes after each chunk :(
- if I pause the video then play it again it resumes successfully then freezes on the next chunk.

All these tests are performed on local machines so there is no upload/download delay.

JW Player

User  
0 rated :

Hello,

Good detective work.

So, now you are playing the MP4 chunks without transcoding?

Perhaps you can post your current code for playing the videos.

lee

JW Player

User  
0 rated :

I have sent to you a couple of chunks I just hope the email address is right "kleelof@yahoo.com".

JW Player

User  
0 rated :

The JWPlayer code is the same a simple html page on my local PC.

bc.. <head>
<script src='https://ssl.jwpsrv.com/library/xxxxxxxxxxxxxxxxxxxxxxxx.js'></script>
</head>
<body>
<div id='my-video'></div>
<script type='text/javascript'>
jwplayer('my-video').setup({
file: 'http://files.elsawt.com/HLS/LIVE/77/77.m3u8',
width: '640',
height: '360',
skin: 'modieus'
});
</script>
</body>

JW Player

User  
0 rated :

Update : the stream is now playable in the VLC player normally but still it still stops on JWplayer when the first chunk ends and the second begins.

here's a sample playlist : http://files.elsawt.com/HLS/LIVE/1109172/1109172.m3u8

I am very tight on schedule please JWplayer support take a look at this issue so we can solve it as soon as possible.

Ethan Feldman

JW Player Support Agent  
0 rated :

Where are you running this file in the JW Player?

JW Player

User  
0 rated :

This script is not yet deployed on the online website it is still on testing pages.

Ethan Feldman

JW Player Support Agent  
0 rated :

Can you put up a public link that we can look at?

JW Player

User  
0 rated :

The playlist links previously posted are public and accessible from the web but they are not updated If you need a public html page with the player's code I will setup a page asap.

On the other hand I am willing to consider using JWPlayer's playlists and I am willing also to drop playing the Live Stream play on iOS.

Can i update the JWplayer dynamically on the fly in order to have a Live effect and does the JWPlayer refresh the playlist periodically or does it read the playlist once the player is loaded ?

Ethan Feldman

JW Player Support Agent  
0 rated :

Yes, that is what I wanted to see, a public link that I could pass to our engineers, as well as debug myself.

You could use our API to reload the player via links on a page, for sure – http://www.longtailvideo.com/support/jw-player/28851/javascript-api-reference

JW Player

User  
0 rated :

Hello Ethan,

Please take a look at this page http://files.elsawt.com/jw.html

In parallel I am trying to create something very similar to m3u8 using JWplayer's playlists and JavaScript API any help you can provide me is much appreciated in both issues the m3u8 playlist and the JWPlayer's playlist.

Thanks in advance

Ethan Feldman

JW Player Support Agent  
0 rated :

All of your .ts segments are returning 404 not found errors:

http://files.elsawt.com/HLS/LIVE/1157250/1157250_14.ts

JW Player

User  
0 rated :

Hello Ethan,

Sorry about mistakenly deleting the files.
I have restored the directory and now you can access both the playlist files and the .ts segments successfully from the server.

Ethan Feldman

JW Player Support Agent  
0 rated :

Now this stream just fine, no issues to report any more.

JW Player

User  
0 rated :

Hello Ethan,

Thank you so much for the help you have provided so far, but sadly I am still facing some issues with the LIVE HLS.

I have deployed the enterprise edition on the website elsawt.com and it looks great so now I have to get back to resolving this issue.

In order to better find the glitch in the process I have transformed the previous playlist to a video on demand playlist with an ENDLIST tag, the video player plays each segment normally but freezes when passing from one chunk to another, if I move the seek the video resumes then freezes on the beginning of the next chunk.

I am not saying that the problem is in JWPlayer most probably it's an encoding or segmenting issue but THE STREAM PLAYS FINE IN VLC.

I just need help in figuring out what I am doing wrong.

Is it maybe related to http://developer.longtailvideo.com/trac/ticket/1224 though I am not using any of these segmenters.

Thanks in advance

George

Link : http://files.elsawt.com/jw.html

JW Player

User  
0 rated :

I keep getting this error when I enable logging to the console:

LOG (Discarding unassignable TS packets with id 17)

Ethan Feldman

JW Player Support Agent  
0 rated :

This stream works for me? I see a computer monitor.

This question has received the maximum number of answers.