使用FFMPEG播放MPEG-dash流 [英] playing MPEG-dash streaming with FFMPEG

查看:586
本文介绍了使用FFMPEG播放MPEG-dash流的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用ffmpeg播放MPEG-dash流时遇到问题.我知道有很多工具可以像OSMO4,DASH.js一样播放MPEG-dash.但是,我想知道我是否可以使用FFMPEG播放MPEG-dash? 还有一个问题,在播放MPEG-dash流时如何确定启动时间?这意味着从服务器请求MPD文件到在屏幕上获得视频显示的第一张图片之前的持续时间? 谢谢!

I'm having a problem when playing MPEG-dash streaming with ffmpeg. I know there are a lot of tools can play MPEG-dash like OSMO4, DASH.js.. However, I am wondering if I can play MPEG-dash with FFMPEG? And one more question, How can I determine startup time when playing MPEG-dash streaming? It means, the duration time when I request a MPD file from a server until I get the first picture of video display on a screen? Thanks!

推荐答案

ffmpeg现在可以(票证: 5269 7382 已修复)播放MPEG DASH,但您需要确保支持已在二进制文件中启用(这似乎并不常见,因为默认情况下似乎未正常启用DASH脱胶支持).如@aergistal在评论中所提到的,您可以检查是否支持破折号脱胶(根据DASH MPD,您还需要适当的编解码器支持,但通常会启用大多数常用的解码器):

ffmpeg can now (tickets:5269,7382 were fixed) play MPEG DASH but you need to make sure that support is enabled in the binary (which appears to be uncommon as DASH demuxing support doesn't seem to be normally enabled by default). As mentioned in the comments by @aergistal you can check for dash demuxing support (you will also need appropriate codec support according to the DASH MPD but most of the usual ones are usually enabled):

ffmpeg -formats | grep dash

它应该显示(D表示支持解复用,而E表示支持复用):

It should show (D indicates support for Demuxing and E for muxing):

DE dash            DASH Muxer

如果看不到DASH Demuxing支持,则需要(重新)编译ffmpeg. 下载源代码,解压缩并输入src代码目录,然后使用configure启用破折号脱胶支持(您可以如果没有,还需要安装libxml2支持):

If you don't see DASH Demuxing support then you'll need to (re)compile ffmpeg. Download the sources, unpack and enter the src code directory, then enable dash demuxing support using configure (you'll also need to install libxml2 support if you don't have it):

ffmpeg-X.X.X$ ./configure --enable-demuxer=dash --enable-libxml2
ffmpeg-X.X.X$ make

启用支持后,您应该可以像这样播放测试流:

Once supported is enabled you should be able to play a test stream like this:

ffplay  http://dash.edgesuite.net/dash264/TestCases/1a/netflix/exMPD_BIP_TC1.mpd

要回答第二个问题-启动延迟由下载MPD然后在MPD中执行操作所需的时间确定-通常,它需要下载初始化段,然后获取第一个媒体段才能开始播放.

To answer your second question - the startup delay is determined by the time taken to download the MPD and then perform the actions in the MPD - typically it needs to download the initialisation segment and then get the first media segment before playback can begin.

这篇关于使用FFMPEG播放MPEG-dash流的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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