Recording high quality video using Flash and Red5 Media Server

杀马特。学长 韩版系。学妹 提交于 2019-12-02 07:13:26

You need to use

// Ensure that no more than 43690.6(43K/second) is used to send video. camera.setQuality(43690.6,0);

This works for me. I used Amazon EC2 extra large instance.

Your issue stems from these 3 causes happening simultaneously:

  • recording high quality video which results in the data having to be buffered locally
  • Flash Player buffering just the video data (good for when doing live streaming)
  • Red5's buggy mechanism for dealing with video data coming at the end of the recording

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.

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 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).

Red5 0.9 had audio video recording totally broken.

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 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.

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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!