加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Windows > 正文

如何在Windows 8 Metro C#XAML应用程序中播放H.264 RTSP视频?

发布时间:2020-12-14 04:14:28 所属栏目:Windows 来源:网络整理
导读:我有一个设备,提供来自URL的H.264视频流,如: RTSP://192.168.0.10:554 / videoservice 由于这是实时视频,我不需要能够控制它(暂停,倒带等),只需播放.这是由MediaElement还是其他标准类支持,我需要像Smooth Streaming Client SDK这样的东西还是比我想象的
我有一个设备,提供来自URL的H.264视频流,如:
RTSP://192.168.0.10:554 / videoservice

由于这是实时视频,我不需要能够控制它(暂停,倒带等),只需播放.这是由MediaElement还是其他标准类支持,我需要像Smooth Streaming Client SDK这样的东西还是比我想象的要复杂得多?

更新:
我下载了微软的Player Framework,但这也没有播放.我在RTSP的例子中找不到任何东西.

更新:
我使用Wireshark来比较VLC Media Player(有效)与MediaElement和Player Framework一起发送的数据包,它们似乎都没有使用RTSP协议.相反,即使我提供了源的IP地址,他们也会将WPAD数据包发送到不同的地址.为什么这有必要?有没有办法扭转这种行为?

请参阅文章 here.您需要将数据包装在MPEG-4 Part 14容器中,然后将其传递到 MediaElement.SetSource.看来您只能使用记录的API来执行此操作.以下是链接中的重要信息:

We don’t support RTP but rather the MPEG-4 Part 14 container format.
You will need to write our own source to be able to parse the data a
pass it directly to the Microsoft decoder. At this time we do not have
any samples on how to write a custom source and have it loaded from
your Metro style app. Unfortunately it is not possible to simply use
the documentation to figure out how to do this. I have been talking
with Stan and we are trying to figure out how and when we can make
this information available. As soon as this information is available
I will announce it on my blog 07002.

Here是支持的视频格式列表.

还有一个示例here,介绍如何扩展媒体类,这可能有一个如何做一些类似于你所要求的事情的例子.

有一个类似的例子here.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读