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

ffmpeg hls doesn't works on iOs devices.


I use the ffmpeg tool to generate the m3u8 file from the mp4 video, and it generates segments files and the playlist.

---
Here is the string to generate:
ffmpeg -i input.mp4 -pix_fmt yuv420p -vcodec libx264 -r 25 -profile:v baseline -b:v 1500k -maxrate 2000k -force_key_frames 10 -map 0 -flags -global_header -f segment -segment_list playlist.m3u8 -segment_time 10 -segment_format mpeg_ts -segment_list_type m3u8 output%03d.ts

---

As result i have an numbers of .ts files and m3u8 like this:
#EXTM3U
#EXT-X-VERSION:3
#EXT-X-MEDIA-SEQUENCE:0
#EXT-X-ALLOW-CACHE:YES
#EXT-X-TARGETDURATION:19
#EXTINF:10.040000,
output000.ts
#EXTINF:10.840000,
output001.ts
#EXTINF:10.360000,
output002.ts
<...>
#EXTINF:17.360000,
output100.ts
#EXTINF:3.640000,
output101.ts
#EXT-X-ENDLIST

---

It works perfect on my laptop in Safari and Chrome browsers, but when i try to watch the video on my iPad or iPhone it returns "File could not be played". When i try to open m3u8 file directly on iPad, it works perfect. Here is my embed code:

jwplayer("videoPlayer").setup({
file: 'http://localhost:3000/240/child.m3u8',
tracks: [{
file: 'http://localhost:3000/240/thumbnails.vtt',
kind: "thumbnails"
}],
debug: "true",
image: "<%=resource.front.url(:player, false)%>",
primary: "flash",
'autostart': false
});



5 Community Answers

tony

User  
0 rated :

And here is output of ffmpeg -i /raid2005/angelica/segment000.ts

Input #0, mpegts, from '/raid2005/angelica/segment000.ts':
Duration: 00:00:19.78, start: 0.058667, bitrate: 711 kb/s
Program 1
Metadata:
service_name : Service01
service_provider: FFmpeg
Stream #0:0[0x100]: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p, 960x540 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc
Stream #0:1[0x101](und): Audio: aac ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp, 4 kb/s

Andrew

JW Player Support Agent  
1 rated :

Have you considered that your CORS settings may be incorrect? If it works directly via playing the M3U8 in your browser, and via Flash, maybe your HTML5 CORS settings may need to be tweaked?
http://support.jwplayer.com/customer/portal/articles/1403679-crossdomain-file-loading
We do rely on iOS’s native handling of HLS, so this should technically work. If you place the m3u8 into a straight-up HTML video tag, are you seeing the same behavior?

tony

User  
0 rated :

Well. I have tested it in html5 mode and it works fine on my laptop. But still doesn't work on my iPad. HTML video tag doesn't works too. Do you have an example of successful segmentation my ffmpeg for jwplayer?

tony

User  
0 rated :

Also i used to try another ffmpeg config:
ffmpeg -i input.mp4 -vcodec libx264 -strict experimental -profile:v baseline -b:v 720k -hls_time 10 -vf scale=-2:360 -hls_list_size 0 -strict experimental playlist.m3u8

Still doesnt works.

Andrew

JW Player Support Agent  
0 rated :

I’m not able to help with the configuration of FFMPEG. Again, setting something to work in HTML 5 mode may not work depending on the browser. Are you sure that the player is rendering in HTML5? Have you tried right clicking the player to make sure Flash wasn’t being utilized?

This question has received the maximum number of answers.