iPhone HTTP Streaming .m3u8 和 .ts 文件 - 如何使用 ffmpeg 创建
我正在尝试使用 ffmpeg 获取经过苹果验证的 http 媒体流,但出现错误。以下是一些错误示例:
警告:播放列表内容类型为“application/x-mpegurl”,但应该 是“application/vnd.apple.mpegurl”、“audio/x-mpegurl”之一或 '音频/mpegurl'。
警告:258 个样本 (88.966 %) 在轨道 256 中没有时间戳 (avc1)。 4:us2-1.ts ~~~~~~~~~
警告:媒体片段持续时间超出预期持续时间 47.733 %(5.23 与 10.00 秒,限制为 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.chesscomfiles.com/images_users/using/using-computers-1.mp4
我已经尝试过这些命令,其中包括:
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 -编码器 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< /p>
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 -编码器 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< /p>
ffmpeg -i using-computers-1.mp4 -vbsf h264_mp4toannexb -acodec copy -vcodec copy -f mpegts output.ts
如果有人可以帮助我弄清楚我应该运行哪些 ffmpeg 命令,我将非常感激!
I'm trying to get apple-validated http media streams using ffmpeg and am getting errors. Here are some error examples:
WARNING: Playlist Content-Type is 'application/x-mpegurl', but should
be one of 'application/vnd.apple.mpegurl', 'audio/x-mpegurl' or
'audio/mpegurl'.WARNING: 258 samples (88.966 %) do not have timestamps in track 256
(avc1). 4: us2-1.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
Here is the end file I've been submitting: http://files.chesscomfiles.com/images_users/using/us2.m3u8
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.tsffmpeg -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.tsffmpeg -i using-computers-1.mp4 -vbsf h264_mp4toannexb -acodec copy -vcodec copy -f mpegts output.ts
If someone can help me figure out what ffmpeg commands I should be running I'd really appreciate it!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
关于第一个警告:
它可能来自服务器设置。按照此 离子炮帖子:
Regarding the first warning:
It could be from the server setup. Follow the instructions from Step 4 of this Ion Cannon post:
关于第三个警告:
如果某个片段的持续时间与播放列表 (m3u8) 中该片段列出的持续时间不同,通常会发生这种情况。例如,下面的播放列表有一个片段,并且由播放列表列出为10秒。如果该段的实际持续时间相差太大(超过 20%),验证者就会抱怨。
通常播放列表中的最后一个片段与目标略有不同,可以忽略此警告。
并且,作为一般规则,这些“警告”消息可以忽略,但需要认真对待“错误”消息。
然而,第二个警告看起来更严重,并可能导致苹果的拒绝。它可能是您的分段器命令(您正在使用 mediastreamsegmenter 吗?)。
另外,我没有使用“-vbsf h264_mp4toannexb”。而且,我正在使用“-async 50”。
顺便说一句,您的播放列表的链接无效。
Regarding the third warning:
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.
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.