从FFMPEG mp4实时流式传输m3u8文件? [英] FFMPEG mp4 from http live streaming m3u8 file?

查看:457
本文介绍了从FFMPEG mp4实时流式传输m3u8文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何从http live流m3u8文件中提取mp4?我在下面尝试了此命令:

How Can I extract mp4 from http live streaming m3u8 file? I Tried this command below:

ffmpeg -i {input file} -f rawvideo -bsf h264_mp4toannexb -vcodec copy out.mp4

我遇到了这个错误:

[NULL @ 0000000002f07060]数据包头未包含在全局额外数据,损坏的流或无效的MP4/AVCC比特流中,无法使用编解码器副本打开流0的比特流过滤器h264_mp4toannexb:I

[NULL @ 0000000002f07060] Packet header is not contained in global extradata, corrupted stream or invalid MP4/AVCC bitstream Failed to open bitstream filter h264_mp4toannexb for stream 0 with codec copy: I

推荐答案

您的命令完全不正确.输出格式不是rawvideo,并且不需要位流过滤器h264_mp4toannexb,当您要将mp4中包含的h264转换为MPEG-TS所使用的Annex B格式时使用例子.您要使用的是AAC流的aac_adtstoasc.

Your command is completely incorrect. The output format is not rawvideo and you don't need the bitstream filter h264_mp4toannexb which is used when you want to convert the h264 contained in an mp4 to the Annex B format used by MPEG-TS for example. What you want to use instead is the aac_adtstoasc for the AAC streams.

ffmpeg -i http://.../playlist.m3u8 -c copy -bsf:a aac_adtstoasc output.mp4

这篇关于从FFMPEG mp4实时流式传输m3u8文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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