记录使用Flash和Red5的Media Server的高品质视频高品质、视频、Flash、Server

2023-09-08 12:56:40 作者:半分乖巧

我运行从我的本地机硬盘录像机的应用程序(ActionScript 3.0编写)。它记录使用其安装在远程的Amazon EC2服务器上的Red5服务器。

I'm running a Video Recorder application (written in ActionScript 3.0) from my local machine. It records using a Red5 server which is installed on a remote Amazon EC2 server.

要记录,我用下面的设置

To record, I'm using the following settings

在宽度,高度和FPS(对于的Camera.setMode()) - 1920×1080和10 带宽和质量( Camera.setQuality()) - 0和80 在缓冲时间( NetStream.setQuality()) - 3600 Width, height and FPS (for Camera.setMode()) - 1920 x 1080 and 10 Bandwidth and Quality (for Camera.setQuality()) - 0 and 80 Buffer time (for NetStream.setQuality()) - 3600

我能够录制视频,直到缓冲区得到填补(我监视在NetStream.bufferLength 不断)

I'm able to record video till the buffer gets filled (I'm monitoring the NetStream.BufferLength constantly)

在时,记录被停止 - 在缓冲器中的数据被发送到服务器。而现在,当我尝试播放与(的bufferTime = 1 )的视频不会出现。

Once, the recording is stopped - the data in the buffer is sent to the server. And now, when I try to playback with (bufferTime = 1) The video doesn't appear.

我有 SSH 编入EC2服务器,并看到该文件不会获得创建在 RED5 / webapps /下VOD /流文件夹,但我是不能确定它的质量还是它记录了正确与否。我甚至使用了基于命令行的电影播放的mplayer 来尝试播放文件,但它不玩,因为我猜EC2服务器Ubuntu的缺乏回放插件(不知道这不过的。)

I have ssh 'ed into the EC2 server and have seen that the file does get created in the red5/webapps/vod/streams folder, but I'm am unsure about its quality or whether it has recorded correctly or not. I've even used the command line based movie player mplayer to try and play the file, but it doesn't play because I'm guessing the Ec2 server Ubuntu lacks the playback plugins (not sure of this though.)

然而,当它是一个低质量的录制640×480,而不是1920×1080,缓冲区不得到填补超过0.1或0.2,视频播放流畅。

However, when it's a low quality recording with 640 x 480 instead of 1920 x 1080, the buffer doesn't get filled beyond 0.1 or 0.2, and the video plays back smoothly.

我的网络上载速度约为300 kbps的。

My Internet upload speed is around 300 kbps.

如何(如果可能的话),记录,然后播放高品质视频?

How can I (if it is possible), record and then playback high quality video?

推荐答案

这3个原因同时发生您的问题源于:

Your issue stems from these 3 causes happening simultaneously:

记录高质量视频其导致数据具有在本地缓冲 在Flash播放器的缓冲只是视频数据(好做直播的时候) 的Red5的越野车的机制来处理视频数据的记录年底到来

Red5的问题一直困扰着许多记录的问题。录制时,在慢的连接。

Red5 has been plagued by many recording issues. This HDFVR documentation article covers Red5's various recording issues and the mechanism for coping with the FP buffer when recording over slow connections.

媒体服务器需要将数据写入到磁盘(。FLV文件)之前,考虑到这一点通过等待更多的视频数据包,并对其进行排序连同音频数据包。

The media server needs to account for this by waiting more for the video packets and sort them together with the audio packets before writing the data to disk (.flv file).

Red5的0.8却没有这样的机制,因此录制高品质的视频通过慢速连接导致低质量/加扰的视频文件(只是声音,所有的视频​​在结束)。

Red5 0.8 had no such mechanism thus recording high quality video over slow connections resulted in low quality/scrambled video files (just audio, all video at the end).

0.9 Red5的有声视频录制完全中断。

Red5 0.9 had audio video recording totally broken.

Red5的1.0 RC1有一个新的延迟写入机制 - 由Red5的/ conf目录/ RED5-common.xml控制 - 即等待音频和视频数据,并将其写入磁盘之前重新排列分组。该queueThreshold值措施RTMP消息/包。

Red5 1.0 RC1 had a new delayed write mechanism - controlled by in Red5/conf/red5-common.xml - that waits for the audio and video data and rearranges the packets before writing them to disk. The queueThreshold value measures rtmp messages/packets.

Red5的1.0最后,1.0.1和1.0.2有延迟写入机制完全破碎。有了它打开时,通过慢速连接,Red5的是生产的FLV文件,只有1或2的视频关键帧。当播放等。FLV文件的视频会从第一第二和回放卡将继续只用音频。使用yamdi提取关键帧的数据证实。FLV文件所缺乏的视频关键帧。

Red5 1.0 final, 1.0.1 and 1.0.2 had the delayed write mechanism totally broken. With it turned on, over slow connections, Red5 was producing .flv files with only 1 or 2 video keyframes. When playing back such .flv files the video would get stuck from the 1st second and playback would continue only with audio. Using yamdi to extract the keyframe data confirmed that the .flv files were lacking video keyframes.

然而,由于以Red5的 HDFVR 的code贡献,的Red5 1.0.3和后来有视频录制过的慢的连接固定

However, thanks to HDFVR's code contributions to Red5, Red5 1.0.3 and later has video recording over slow connections fixed.