开发者

Optimize loading of hd .flv video with large size

I have such a problem.

There is a simple html page with intro video (.mp4 file). Video frame size is 1280*1024 (I need video to be as large as page up to 1280 px).

With such quality settings video file size is:

.mp4 = 42 mb (HD 1690*1080)

.flv = 32 mb (1280*1024, 25 fps)

For video playing I used as3 sample script (because there must be only play\pause, replay, mute buttons with custom styles), like that

    v开发者_如何转开发ar strSource:String = "video.flv";

    // create a new net connection, add event listener and connect
    // to null because we don't have a media server
    ncConnection = new NetConnection();
    ncConnection.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
    ncConnection.connect(null);

    // create a new netstream with the net connection, add event
    // listener, set client to this for handling meta data and
    // set the buffer time to the value from the constant
    nsStream = new NetStream(ncConnection);
    nsStream.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
    nsStream.client = this;
    nsStream.bufferTime = BUFFER_TIME;

    nsStream.play(strSource);

The problem is that I can't find a way to play it smoothly. It's loading in very annoying way, video is interrupted after each few seconds of playing.

I understand that the main problem is large video file size and hd quality, but may be there is some way to largely decrease .flv size or handle playback in more friendly way?

Sorry for some messy question, but I'm not often dealing with flash, so asking for your clever advice) Thanks


When you are encoding the video into a FLV ensure that you set the bitrate of the file to something reasonable. For high quality you're going to want the bitrate between 500-700 kbps. This is important because that is the real factor for buffering/streaming etc. If you have a very high bitrate file then setting the buffer time is going to do nothing, except tell the VM how much of the video in seconds it needs to load before resuming auto-play, and the higher the bitrate, the higher/more amount of data this will be. I'm no expert in video encoding but this is what understanding I have. Use the Flash Media Encoder to re-encode the video source and manually set the bitrate to something reasonable: somewhere between 300-700 kbps. Yes this will affect quality but that varies based on your settings.


If you are looking to try and display HD quality video and the dimensions are of a large size then you should be using .mp4 H264. FLV does not do a good job of displaying HD quality video.


Optimizing video files is about video file size versus video quality. For web playback users wont use huge sized files. Yet you have to make sure the video quality stays the same.

A mp4 format should be good choice for that matter. You will have to check if your file can be optimized any better. The file size of flv video files are even bigger... If your video stutters you will have to make sure you have a reliable hosting provider. You can also check the options for auto load for a video file or split a file in a couple of smaller ones...

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜