iPhone HTTP Streaming .m3u8和.ts文件 - 如何使用ffmpeg创建 [英] iPhone HTTP Streaming .m3u8 and .ts files - how to create using ffmpeg

查看:387
本文介绍了iPhone HTTP Streaming .m3u8和.ts文件 - 如何使用ffmpeg创建的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用ffmpeg获取苹果验证的http媒体流,并且收到错误。以下是一些错误示例:

I'm trying to get apple-validated http media streams using ffmpeg and am getting errors. Here are some error examples:


警告:播放列表Content-Type是application / x-mpegurl,但是应该
一个'application / vnd.apple.mpegurl','audio / x-mpegurl'或
'audio / mpegurl'。

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

警告:258个样本88.966%)在轨道256
(avc1)中没有时间戳。 4:us2-1.ts
~~~~~~~~

WARNING: 258 samples (88.966 %) do not have timestamps in track 256 (avc1). 4: us2-1.ts ~~~~~~~~

警告:媒体片段持续时间超出预期持续时间47.733
% (5.23对10.00秒,限制为20%)。 40:us2-19.ts
~~~~~~~~~

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



Average segment duration: 10.16 seconds
Average segment bitrate: 320.12 kbit/s
Average segment structural overhead: 175.89 kbit/s (54.94 %)

Video codec: avc1
Video resolution: 320x320 pixels
Video frame rate: 29.72, 29.78, 29.82, 30.00, 29.64 fps
Average video bitrate: 100.66 kbit/s
H.264 profile: Baseline
H.264 level: 3.0

Audio codec: aac 
Audio sample rate: 48000 Hz
Average audio bitrate: 43.57 kbit/s






以下是我提交的最终文件: http://files.chesscomfiles.com/images_users/using/us2.m3u8

这是我用来创建的文件: HTTP://files.chessc omfiles.com/images_users/using/using-computers-1.mp4

Here is the file I used to create this: http://files.chesscomfiles.com/images_users/using/using-computers-1.mp4

我已尝试过这些命令,其中包括:

I've tried these commands, among others:


ffmpeg -i using-computers-1.mp4 -f mpegts -acodec libfaac -ar 48000
-ab 64k -s 320x320 -vcodec libx264 -vbsf h264_mp4toannexb -b 96k -flags + loop -cmp + chroma -partitions + parti4x4 + partp8x8 + partb8x8 -subq 5 -trellis 1 -refs 1 -coder 0 -me_range 16 -keyint_min 2 -sc_threshold 40 -i_qfactor 0.71 -bt 200k-maxrate 96k -bufsize 96k -rc_eq'blurCplx ^(1-qComp)'-qcomp 0.6 -qmin 10 -qmax 51 -qdiff 4 -level 30 -g 30 -async 2 us2.ts

ffmpeg -i using-computers-1.mp4 -f mpegts -acodec libfaac -ar 48000 -ab 64k -s 320x320 -vcodec libx264 -vbsf h264_mp4toannexb -b 96k -flags +loop -cmp +chroma -partitions +parti4x4+partp8x8+partb8x8 -subq 5 -trellis 1 -refs 1 -coder 0 -me_range 16 -keyint_min 2 -sc_threshold 40 -i_qfactor 0.71 -bt 200k -maxrate 96k -bufsize 96k -rc_eq 'blurCplx^(1-qComp)' -qcomp 0.6 -qmin 10 -qmax 51 -qdiff 4 -level 30 -g 30 -async 2 us2.ts

ffmpeg -i using-computers-1.mp4 -f mpegts -acodec libfaac -ar 48000
-ab 64k -s 320x320 -vcodec libx264 -vbsf h264_mp4toannexb -b 96k -flags + loop -cmp + chroma - 分区+ parti4x4 + partp8x8 + partb8x8 -subq 5 -trellis 1 -refs 1 -coder 0 -me_range 16 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -bt 200k-maxrate 96k -bufsize 96k -rc_eq'blurCplx ^(1-qComp) '-qcomp 0.6 -q min 10 -qmax 51 -qdiff 4-level 30 -g 30 -async 2 us1.ts

ffmpeg -i using-computers-1.mp4 -f mpegts -acodec libfaac -ar 48000 -ab 64k -s 320x320 -vcodec libx264 -vbsf h264_mp4toannexb -b 96k -flags +loop -cmp +chroma -partitions +parti4x4+partp8x8+partb8x8 -subq 5 -trellis 1 -refs 1 -coder 0 -me_range 16 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -bt 200k -maxrate 96k -bufsize 96k -rc_eq 'blurCplx^(1-qComp)' -qcomp 0.6 -qmin 10 -qmax 51 -qdiff 4 -level 30 -g 30 -async 2 us1.ts

ffmpeg -i using-computers-1.mp4 -vbsf h264_mp4toannexb -acodec copy -vcodec copy -f mpegts output.ts

ffmpeg -i using-computers-1.mp4 -vbsf h264_mp4toannexb -acodec copy -vcodec copy -f mpegts output.ts

如果有人能帮我弄清楚我应该运行什么ffmpeg命令,我会非常感谢!

If someone can help me figure out what ffmpeg commands I should be running I'd really appreciate it!

推荐答案

关于第一个警告:


警告:播放列表Content-Type是
'application / x-mpegurl',但应该是

'application / vnd.apple.mpegurl',
'audio / x-mpegurl'或'audio / mpegurl'。

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

它可以来自服务器设置。按照 Ion Cannon post

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


准备HTTP服务器上传一组
的文件,代表流和
a流定义文件(ts和
m3u8)。这些文件现在可以上传到
a网络服务器,但是
是另一个重要的步骤,即
确保他们正确地下载
,并且正在设置mime
类型。有两种mime类型,
对于流
内容很重要:

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应用程序/ x-mpegURL

.m3u8 application/x-mpegURL

.ts video / MP2T

.ts video/MP2T

如果您使用Apache,您
想要将以下内容添加到
中httpd.conf文件:

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

AddType应用程序/ x-mpegURL .m3u8

AddType application/x-mpegURL .m3u8

AddType video / MP2T .ts

AddType video/MP2T .ts

如果你是
使用lighttpd,你会想把
这在你的配置文件(如果
你有其他mime类型定义make
确定你只是添加这些,不要设置
他们):

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)

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

这篇关于iPhone HTTP Streaming .m3u8和.ts文件 - 如何使用ffmpeg创建的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆