Video sites related to video decoding and oversize file upload and other issues

Source: Internet
Author: User
Tags file upload http request server memory

I. Large File Upload analysis

Issues that need to be addressed

1. Resolve Client Request Restrictions

The default value for the maxRequestLength parameter of the httpruntime section in Web.config is 4096 (4 MB). Therefore, files larger than this value cannot be uploaded by default.

We have to change this parameter here.

2. Server memory footprint Problem

Using HttpModule to truncate HTTP requests, get HttpWorkerRequest objects, and then rearrange the client request data for chunking, such processing results can make the client upload size no longer restricted, But httpruntime still throws a page warning, but it has nothing to do with the upload logic.

3. Large-File Block processing

First, partial data for a preloaded HTTP request is judged

This data I tested a bit is generally about 49152, as long as it does not exceed this size, this request does not need to do the following block processing once processing is completed.

If this value is greater than. NET 2.0 will automatically block processing, I in the program in allocating a cache size in the Webconfig configuration appsetting unit for K<add key= "buffersize" value= "1024"/>

Each time you finish processing the data in this cache, continue to request the next data from HTTP

The HTTP request data is not submitted at a time, the data in any one place may have breakpoint problem, the program for the breakpoint algorithm reference some of the online data, debugging results or OK, which add System Application data analysis. function is to provide data in the following progress reading module

The main chunk processing result is completed to encapsulate the HTTP request,

4. Upload Progress Live Display

The AJAX poll calls the information above to generate a static page, including the current upload size, average upload speed, the time used, the estimated time remaining, the size of the rest, and the relatively rough and not yet made comparisons using a good user interface

Two. Video decoding

1. Tool use

Ffmepg,mencoder. The difference of 2 people

FFmpeg compressed A video file, may use less than a minute, but mencoder compressed for several minutes, because mencoder need to calculate more things, so, need to spend more time. FFmpeg can also compress video, but the effect is better than mencoder. and ffmpeg to "," WMV "," RMVB "," rm "effect is not very good, so consider the performance as well as function," ASF "," avi "," MPG "," 3gp "," mov "type and screenshot function using FFMEPG," wmv "," RMVB "," rm " Type uses mencoder to implement

2.net Invoke System Tools

The main use of System.Diagnostics.Process at the same time need System.Diagnostics.ProcessStartInfo with parameter information

3. Asynchronous processing

In order not to allow users to upload after the encoding time, the implementation of the coding process by the asynchronous processing, the player UI upload can be seen after the audited information.

4. Code processing

According to the player promotion System instance, I have carried on 4 layer processing to the coded parameter setup

The first layer in the Webconfig system initialization is the application of

The second layer is the system parameter the third level game Project application parameter layer fourth is the individual video individual parameter

Initial uploaded video Read game item application parameters if the project parameter is not configured to read system parameters

Coded rules and methods configure the interface operations that provide primary functionality in the background management (interface operations are not yet completed in the collation) and all function parameter operations

Effect Chart:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.