5

I have done all that from This I have also made .ts and m3u8 file. In local server and live server i can play mp4 file like

 <video width="320" height="240" controls="controls" autoplay="autoplay">
 <source src="movie.mp4" type="video/mp4" />
 </object>
 </video>

But i have problem with playing .m3u8 file

 <video width="320" height="240" controls="controls" autoplay="autoplay">
 <source src="movie.m3u8" type="video/m3u8" />
 </object>
 </video>

My mediafilesegmenter created two .ts file and one .m3u8 . My m3u8 file is

 #EXTM3U
 #EXT-X-TARGETDURATION:10
 #EXT-X-VERSION:4
 #EXT-X-MEDIA-SEQUENCE:0
 #EXT-X-PLAYLIST-TYPE:VOD
 #EXT-X-I-FRAMES-ONLY
 #EXTINF:1.0117,    
 #EXT-X-BYTERANGE:8084@376
 fileSequence0.ts
 #EXTINF:1.0117,    
 #EXT-X-BYTERANGE:7332@36096   and so on....

So is there any problem in mime.types because i wrote all the confusions in mime.types see like -

 application/x-mpegURL                          m3u8
 video/MP2T                                     ts

 AddType appliction/x-mpegURL                   m3u8
 AddType video/MP2T                             ts

 #application/x-mpegURL                          m3u8
 #video/MP2T                                     ts

 application/x-mpegURL.m3u8
 video/MP2T.ts

 #application/x-mpegURL.m3u8
 #video/MP2T.ts

 #AddType application/x-mpegURL                   m3u8
 #AddType video/MP2T                             ts

 #AddType application/x-mpegURL.m3u8
 #AddType video/MP2T.ts

 AddType application/x-mpegURL.m3u8
 AddType video/MP2T.ts

I can't play .m3u8 file in VLC and got that error Link

Community
  • 1
  • 1
Prabhjot Singh Gogana
  • 1,408
  • 1
  • 14
  • 39

3 Answers3

5

As long as your conf is

AddType application/x-mpegURL .m3u8
AddType video/MP2T .ts

it should work for apache. I'm not sure if it's your .ts or .m3u8 problem, so I suggest the following:

  • Download example .ts and .m3u8 file from Apple and test them on your server
  • check if there is empty lines in the index file, as this question
Community
  • 1
  • 1
BabyPanda
  • 1,562
  • 12
  • 18
  • 1
    yeah i can run .ts and .m3u8 file from apple and i can also run my .ts file but not .m3u8 file. One thing more rename .m3u8 file...will it be a problem or not – Prabhjot Singh Gogana Aug 17 '12 at 05:14
  • 1
    Then it should go back to the procedure when you generate .ts and .m3u8. Did you rename the .m3u8 file after generation? – BabyPanda Aug 17 '12 at 06:48
  • 1
    yeah i renamed .m3u8 file but now i created new one .ts and .m3u8 without renaming (Created files are fileSequence0.ts ... and iframe_index.m3u8). i can play .ts file but not .m3u8 file.. can you make it for me .ts file and .m3u8 file but i dont think so there is problem in files. and one thing more i config mime type (application/x-mpegURL .m3u8 video/MP2T .ts) in /etc/apache2/mime.types not in httpd.config – Prabhjot Singh Gogana Aug 17 '12 at 07:00
  • 1. will it work if you play the index file with VLC? 2. which segmenter have you used? – BabyPanda Aug 17 '12 at 08:44
  • 1
    it is not working with VLC. i use media file segmenter tool for converting. – Prabhjot Singh Gogana Aug 17 '12 at 09:31
  • did you use command like this `mediafilesegmenter -f [destinationPath] [videoSource] -t 1` – BabyPanda Aug 17 '12 at 10:01
  • i use mediafilesegmenter -t 10 movie.mp4 ... and why u use -t 1 – Prabhjot Singh Gogana Aug 17 '12 at 10:03
  • and it will convert my file into .ts and .m3u8 file then i move it to my sites and documents folder for hosting – Prabhjot Singh Gogana Aug 17 '12 at 10:05
  • let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/15457/discussion-between-pravi-jay-and-babypanda) – Prabhjot Singh Gogana Aug 17 '12 at 10:06
  • i have done that sir just now please tell me about live streaming this is VOD .. now i want to do live streaming like dvr cameras – Prabhjot Singh Gogana Aug 17 '12 at 12:09
1

The video tag source type video/m3u8 is not valid on the iOS platform. I suggest you simply omit declaring the source attribute, which is not required.

If you really want to specify the source type, i.e. to allow non-compatible clients to select another source, I have found that audio/x-mpegurl works.

Gil
  • 3,529
  • 1
  • 19
  • 22
0

The m3u8 you're using was generated for seeking only. See EXT-X-I-FRAMES-ONLY as described here: https://developer.apple.com/library/ios/technotes/tn2288/_index.html#//apple_ref/doc/uid/DTS40012238-CH1-I_FRAME_PLAYLIST

tmm1
  • 2,025
  • 1
  • 20
  • 35