Recording high quality video using Flash and Red5 Media Server

后端 未结 2 1703
孤城傲影
孤城傲影 2021-01-23 09:23

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.

相关标签:
2条回答
  • 2021-01-23 09:57

    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.

    0 讨论(0)
  • 2021-01-23 10:07

    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.

    0 讨论(0)
提交回复
热议问题