gpt4 book ai didi

iPhone HTTP Streaming .m3u8 和 .ts 文件 - 如何使用 ffmpeg 创建

转载 作者:行者123 更新时间:2023-12-03 20:29:20 25 4
gpt4 key购买 nike

我正在尝试使用 ffmpeg 获取经过苹果验证的 http 媒体流,但出现错误。以下是一些错误示例:

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

这是我提交的最终文件: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 -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 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 命令,我将非常感激!

最佳答案

关于第一个警告:

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 第 4 步中的说明进行操作:

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" )

关于iPhone HTTP Streaming .m3u8 和 .ts 文件 - 如何使用 ffmpeg 创建,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3209243/

25 4 0