a+v 的 RTMP 流只播放音频,不播放视频

发布于 2024-08-12 00:15:29 字数 295 浏览 3 评论 0 原文

在Flash、AS3中,我使用NetConnection连接到RTMP服务器,然后使用NetStream播放视频+音频流。

我将流 (attachNetStream) 附加到添加到舞台的 flash.media.Video 实例(仔细检查它是否在舞台上)并播放它,但我得到的只是正在播放的流的声音 - 没有视频显示。

请注意,即使我看不到视频,当我收听流的 onMetaData 时,我可以获得有关视频的大量信息,例如宽度、高度、FPS(播放过程中的变化,就像显示视频一样)、解码数量帧。

有人知道我怎样才能使视频也正常工作吗?

In Flash, AS3, I am using NetConnection to connect to a RTMP server, then I use NetStream to play a video+audio stream.

I attach the stream (attachNetStream) to a flash.media.Video instance that is added to stage (double checked that it is ON the stage) and play it, but all I get is the sound of the stream that's being played - no video is displayed.

Note that even though I cannot see the video, when I listen to the onMetaData of the stream I can get plenty of information about the video such as width, height, FPS (changes during playback as if a video is shown), number of decoded frames.

Does anybody have an idea how can I make the video work too?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

乱了心跳 2024-08-19 00:15:30

谢谢你们!但我找到了答案:

显然Flash的(CS3)内置Video类不支持H.264流。我尝试在 Flex 3.5 中编译完全相同的代码,一切正常!

CS4 也有可能支持 H.264 流。我没有尝试。

JWPlayer 很棒,我没有尝试 Pyro。

干杯。

Thank you guys! but I found out the answer:

Apparently Flash's (CS3) built-in Video class does not support H.264 streams. I tried to compile the exact same code in Flex 3.5 and everything worked!

There is a possibility that CS4 also supports H.264 streams. I did not try.

JWPlayer is great, I did not try Pyro.

Cheers.

你在我安 2024-08-19 00:15:29

我建议使用一些包装器,例如 火焰兵玩家。它基本上是一个视频 API,我已经多次将它用于 RTMP 视频,它的工作方式就像一个魅力(我总是发现 Adob​​e 的视频组件有很多错误,特别是在显示来自 RTMP 服务器的视频时)。尝试一下!

Instead of using "raw" NetConnection and NetStream and attach it to a flash.media.Video, I'd recommend using some wrapper such as Pyro Player. Its basically a video API and I've used it many times for RTMP video and it works like a charm (I've always found the Video component from Adobe very buggy, specially when displaying video from a RTMP server). Give it a try!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文