本文介绍了如何使用 ActionScript 通过 Socket Class(或 XMLSocket)流式传输视频?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用 ActionScript 通过 Socket 类(或 XMLSocket)流式传输视频?

或\和

如何在 AIR 中使用 Socket Class(或 XMLSocket)?

推荐答案

您为什么要使用 Socket 流式传输视频?性能将远远低于 Adob​​e 为此提供的内置类.

Why are you looking to stream video using Socket? The performance would be far, far less than what's offered by Adobe's built-in classes for this.

要在 Flash 中流式传输音频和视频,您需要一个类似 FMS 的服务器.Red5 是一个允许这样做的开源服务器(如 Maciek 所说).但是,通过 flash.net.Socket 然后自己解码会产生可怕的性能.从本质上讲,以性能可接受的方式流式传输视频的唯一方法是使用flash.net.NetConnection.这使用 RTMP 协议进行媒体流式传输.

To stream audio and video in Flash, you'll need an FMS-alike server. Red5 is an open-source server that allows this (like Maciek said). However, serving your own live video over flash.net.Socket and then decoding it yourself would yield horrible performance. Essentially, the only way to stream video in performance-acceptable way would be to use flash.net.NetConnection. This uses the RTMP protocol for media streaming.

此外,如果您正在寻找的不是实时视频流,请查看通过普通 HTTP 服务器和 FLV 格式.

Also, if it's not live streaming of video you are looking for, take look at serving those video files over a normal HTTP server and the FLV format.

这篇关于如何使用 ActionScript 通过 Socket Class(或 XMLSocket)流式传输视频?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-12 20:26