iPhone HTTP Streaming .m3u8 and .ts files - how to create using ffmpeg

人盡茶涼 提交于 2019-12-03 20:34:26

Regarding the first warning:

WARNING: Playlist Content-Type is 'application/x-mpegurl', but should be one of 'application/vnd.apple.mpegurl', 'audio/x-mpegurl' or 'audio/mpegurl'.

It could be from the server setup. Follow the instructions from Step 4 of this Ion Cannon post:

Prepare the HTTP server Upload a set of files that represent the stream and a stream definition file (ts and m3u8). Those files can be uploaded to a web server at this point but there is another important step to take that ensures they will be download correctly and that is setting up mime types. There are two mime types that are important for the streaming content:

.m3u8 application/x-mpegURL

.ts video/MP2T

If you are using Apache you would want to add the following to your httpd.conf file:

AddType application/x-mpegURL .m3u8

AddType video/MP2T .ts

If you are using lighttpd you would want to put this in your configuration file (if you have other mime types defined make sure you just add these and don't set them):

mimetype.assign = ( ".m3u8" => "application/x-mpegURL", ".ts" => "video/MP2T" )

Regarding the third warning:

WARNING: Media segment duration outside of expected duration by 47.733 % (5.23 vs. 10.00 seconds, limit is 20 %). 40: us2-19.ts ~~~~~~~~~

This usually happens if a segment is a different duration than how the duration listed for that segment in the playlist (m3u8). For example, the below playlist has one segment and is listed by the playlist to be 10 seconds. If the actual duration of this segment is different by too much (more than 20%), than the validator will complain.

#EXTM3U
#EXT-X-TARGETDURATION:10
#EXT-X-MEDIA-SEQUENCE:0
#EXTINF:10, 
med0.ts 
#EXT-X-ENDLIST

Usually the last segment in a playlist will differ a bit from the target, and this warning can be ignored.

And, as a general rule these "WARNING" messages can be ignored, but "ERROR" messages need to be taken seriously.

However, the second warning looks more serious, and could possibly lead to a rejection from Apple. It could be your segmenter commands (are you using mediastreamsegmenter?).

Also, I'm not using "-vbsf h264_mp4toannexb". And, I'm using "-async 50".

Btw, the link to your playlist is invalid.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!