【发布时间】:2017-09-01 00:30:52
【问题描述】:
我使用此代码从 mp4 文件创建实时流:
ffmpeg -re -i input.mp4
-c:a aac -c:v libx264 -s uhd2160 -f hls -hls_list_size 0 2160p/out.m3u8
-c:a aac -c:v libx264 -s 2560x1440 -f hls -hls_list_size 0 1440p/out.m3u8
-c:a aac -c:v libx264 -s hd1080 -f hls -hls_list_size 0 1080p/out.m3u8
-c:a aac -c:v libx264 -s hd720 -f hls -hls_list_size 0 720p/out.m3u8
-c:a aac -c:v libx264 -s hd480 -f hls -hls_list_size 0 480p/out.m3u8
-c:a aac -c:v libx264 -s nhd -f hls -hls_list_size 0 360p/out.m3u8
-c:a aac -c:v libx264 -s cga -f hls -hls_list_size 0 200p/out.m3u8
但在流式传输时,延迟非常大。
看来,这种延迟存在于质量非常高的流视频中,就像我用于直播的视频(4k)一样。
我该如何减少此延迟并为此减少内存使用量?
【问题讨论】:
-
HLS 实时方法不是一个好的解决方案。在我的测试中,每次至少延迟 5 秒。
-
@Hokusai,你能告诉我你的推荐吗?
-
您可以通过使用tee muxer 对所有输出的音频只编码一次而不是对同一流单独编码七次来提高编码效率。
标签: ffmpeg live-streaming http-live-streaming