Adaptive video transcoding gateway with multiple translation function
Technical field
The present invention relates to the video information transcoding technology, particularly, relate to and a kind ofly can be adapted under the heterogeneous network environment, video information process and display capabilities according to the different network bandwidths and channel bit error rate and end equipment, the adaptive video flowing that is fit to transmission and shows that is converted into of source video, with the adaptive video transcoding gateway with multiple translation function of the access that adapts to the more weak end equipment of narrower transmission channel and processing, display capabilities.
Background technology
Because the difference and the multimedia communication network of present various multimedia video audio coding forms are made up of different network configurations, agreement, so all need a kind of multi-media communication mode between can crossover heterogeneous networks under many circumstances.
Such as, in video request program (VOD-Video On Demand) system, in the video distribution server be video quality than higher source video, higher speed, frame per second and resolution are arranged, the outlet network bandwidth bigger.If the available network channel width of access side is smaller, reciever does not have enough bandwidth to accept the source video flowing at all, and this just need reduce the video flowing code check under the situation of as far as possible keeping the source video quality.On the other hand, along with developing rapidly of present handheld device and wireless network, increasing handheld device can be linked in this system.And the processor ability of the low bandwidth of wireless network and higher bit error rate and handheld device and exploration on display resolution ratio are all far away from PC, therefore we are except will reducing the video flowing code check, also to reduce the spatial resolution of video, play to be adapted at handheld device.The application of these reality all requires the transcoding that carries out of video information is handled.
Video code conversion is exactly that current compressed video signal is transformed into other a kind of video compression mode, and the video after the conversion may have different speed, frame per second, frame sign or even compression standard with former video, mode can be different.Video code conversion and common source video encoder have certain similar, he can come automatically video data to be modulated dynamically and changed by adjusting series of parameters (comprising video quality, frame per second, resolution etc.) according to feature, the bandwidth of different transmission channels.
In such as this class Video Applications system of VOD, the different network insertion of the general multiple condition of permission, ask video data simultaneously, but because the source video of coding has higher video quality and high bit rate in advance, and the receptible video flowing of client can not guarantee high video quality because of the disposal ability of the restriction of transmission channel or end equipment usually.
Summary of the invention
Can insert and receive suitable video information in order to solve multiple different communication network and end equipment, need be according to the condition of different transmission channels and the processing of end equipment, display capabilities carries out suitable conversion to the source video information, the present invention proposes a kind ofly can be adapted under the heterogeneous network environment, video information process and display capabilities according to the different network bandwidths and channel bit error rate and end equipment, the adaptive video flowing that is fit to transmission and shows that is converted into of source video, to adapt to narrower transmission channel and processing, the adaptive video transcoding gateway with multiple translation function of the access of the end equipment that display capabilities is more weak.
The technical solution adopted for the present invention to solve the technical problems is: a kind of adaptive video transcoding gateway with multiple translation function comprises:
Decoder carries out partial decoding of h by decoder to the source video information, promptly only is decoded to the DCT territory;
The automatic detection module of channel, the automatic situation that detects connecting channel comprises effective channel width, channel bit error rate when the user inserts, the parameter of real-time detection channel changes in the transmission course of reality, adjusts the transcoding parameter; Once monitor network channel per 10 seconds, and the notice control module recomputates the transcoding parameter;
The client configuration enquiry module obtains the end facility information by the simple queries agreement when state by a simple communications protocol inquiry end equipment of transcoding network and end equipment and client connect, and comprises end device processes performance, display resolution;
Control module comprises the end facility information that acceptance detected network channel information of automatic detection module and client configuration enquiry module inquire, and these information is analyzed and is arbitrated, and be converted into the input transcoding parameter that transcoder needs; Control module is responsible for selecting the transcoding strategy of video code translator and the parameter setting in the real-time change transcoding strategy;
Video code translator can be handled the transcoding that the source video be done multiple mode, comprise transformation, the frame per second of transformation, the frame resolution of video coding type transformation, video flowing code check transformation and video flowing strengthened fault recovering mechanism.
The parameter that video code translator calculates according to control module decides the Transcoding Scheme of employing, calls different modules then and carries out conversion and processing, and these processing mainly comprise:
1. the size conversion of frame of video: the user according to link disposes the size that changes frame of video, for example: most handheld devices can only show smaller video window (QCIF, 176x144pixel), if the size of the video that has just the encoded video size that can show greater than end equipment just need be transcoded into the less video format of frame size in advance.
2. the self adaptation of video code rate: the code check that changes video according to the bandwidth constraints of connecting channel.Need be converted to the channel that the video that hangs down code check satisfies low bandwidth for the high video of image quality.
3. video frame rate conversion: for example: most handheld device can only be come displaying video (5fps, 10fps) with lower frame per second, and for those high-quality videos (30fps), just need carry out transcoding to reduce frame per second.
4. wrong recovery the: than higher channel, should in video flowing, add more fault recovering mechanism for the error rate, reduce the error rate.
5. coded system transforms: change the coding standard of video, for example: from MPEG-2 to H.263 conversion.
For the processing that the coded system in the transcoder transforms, need to select the Final Format of coding by the coding selector.The video here all is based on the video format of macroblock coding and dct transform coding techniques, promptly is MPEG series or H.26X serial video format.
Beneficial effect of the present invention mainly shows:
1, effectively guarantees the video quality that access side obtains.Do not passing through under the situation of transcoding gateway, end equipment that disposal ability is more weak and narrower channel width make video transmission and broadcasting speed very slow, even almost can't see complete image information; On the handheld device of wireless access, because the channel bit error rate of wireless telecommunications is higher, if do not add more wrong recovering information in the Video stream information, cause the error in data accepted too many, so that information dropout is serious in can't decoding or decode, and causes the mosaic effect of serious picture.And adopt transcoding processed video information more suitably on objective network, to transmit, and keep video quality preferably.
2, the different network and the adaptivity of equipment.This transcoding gateway can automatic, real-time monitoring network channel when the user asks to connect, detects the various parameters of connecting channel and equipment, thereby reasonably judge and select transcoding mode.In transcoding and transmission while, the state transformation of real-time monitoring and controlling channels is adjusted the transcoding parameter.
3, the multi-functional core transcoder of this transcoding gateway more helps the access that the network bandwidth is lower, channel bit error rate is higher wireless network side inserted, supported the handheld device that disposal ability and display resolution are lower.
4, the framework of whole transcoding gateway system is the sub-module design, accomplishes the high cohesion in the module and the low coupling of intermodule, and each functions of modules division of labor is relatively independent.Can load and remove some functional module easily in the system, have the configurability of height.
Description of drawings
Fig. 1 is a structural representation of the present invention;
Fig. 2 is the structural representation of control module of the present invention;
Fig. 3 is the operating process schematic diagram of control module of the present invention;
Fig. 4 is a thread structure schematic diagram of the present invention.
Embodiment
Below in conjunction with accompanying drawing the present invention is further described.
With reference to the accompanying drawings 1, have the self adaptation transcoding gateway system configuration of multiple transcoding function, step below adopting:
If control module (2) detects source video information itself and has been adapted at transmitting on the objective network, then do not need video information is done any processing, video code translator (5) is not worked, and video directly sends in the transmission channel;
Video flowing in the video of source is at first by decoder (1), and the decoder is here done the decoding on the DCT territory at the video flowing based on macro block and dct transform coding, promptly only handles by variable-length decoding VLD and inverse quantization.Enter into the core of video code translator (5) through the code stream of partial decoding of h;
The automatic detection module of channel (3) that is used for real-time detected transmission network condition, the detected object of the automatic detection module of described channel is the network condition of the client that connects with server.This module detects one time channel conditions every 10 seconds, and the parameter value that obtains is passed to control module (2);
Be used to detect the client configuration enquiry module (4) of the equipment situation of the client that connects with server, by the configuring condition of a simple communications protocol inquiring client terminal, the communication format of query messages is as follows when connecting foundation for described client configuration enquiry module:
<message>
<target>
ip_address
</target>
<query_tag>
</query_tag>
<query_result>
<cpu_speed>
...
</cpu_speed>
<resolution>
...
</resolution>
<media_type>
...
</media_type>
</query_result>
</message>
Be used for video code translator (5) module that video code flow transforms, the core of described video code translator (5) is made up of five concrete transcoding modules, and in this software module, the folding of five switches is controlled by control module (2).These five functional modules are respectively frame size and transform (6), bit rate conversion (7), frame rate conversion (8), error code recovery (9), type of coding conversion (10).
With reference to the accompanying drawings 2, control module (2) is an implementation structure of the present invention.Described control module is made of a calculation of parameter main thread (12) and parameter watcher thread (11).The parameter watcher thread is a background thread, and it monitors the state variation parameter of the transmission channel of being sent by the automatic detection module of channel constantly, just removes to recomputate control coefrficient in case receive new parameter.The channel condition information here has two aspects: available bandwidth and channel bit error rate; The end status information of equipment has three aspects: CPU disposal ability, display resolution and decodable form.These parameters are interactive a bit, as: the code check of video also decreases when reducing video resolution or video frame rate; The coded format of converting video (MPEG-2 is to MPEG-4) also can make code check reduction etc.Therefore the calculation of parameter function is weighted calculating according to the influence between each parameter when calculating, and selects suitable transcoding strategy according to result of calculation, the see reference calculation process of accompanying drawing 4 of concrete operations.
With reference to the accompanying drawings 3, whether control module needs to carry out the type of coding conversion if at first being checked, if desired, just directly opens switch (17), carries out type of coding and changes; If do not need to carry out type conversion, then respectively the parameter error rate, display resolution, disposal ability, channel width calculated.Function (31) cal_error_rate ([in] error_rate, [in] bandwidth) wants to increase more wrong recovering information when video flowing is recoded according to channel width and error rate calculation; Function (32) cal_resolution ([in] resolution, [in] bandwidth) code check after the calculating reduction resolution, judge whether to satisfy bandwidth requirement, function (33) cal_frame_rate ([in] cpu_speed, [in] resolution, [in] bandwidth) calculate the video frame number that per second can be handled under current resolution according to the disposal ability of equipment, and can the operation of judgement reduction video frame rate satisfy bandwidth requirement; Function (34) cal_video_bit_rate ([in] source_video_rate, [in] bandwidth) calculates video transmission code check suitable under this network bandwidth condition according to the available bandwidth and the source video code rate of current channel.The value of these calculating is weighted according to each other influence and to the influence of final video, weight coefficient is the empirical coefficient that draws through overtesting, if usually under the situation that display resolution is relatively lower and disposal ability is more weak of end equipment, to the result of calculation weight of function cal_frame_rate and cal_resolution between 0.6~0.8, the weight of the error rate of channel decides according to function cal_error_rate result's height, the error rate is high more, and weight is big more.According to the result who finally calculates, which is opened in the decision control switch (18) (19) (20) (21), and which is closed.These control switchs can be opened a plurality of simultaneously, for example under the access situation of radio hand-held equipment, will open (18) or (19) and (21) usually, also need add extra wrong recovering information in code stream when carrying out frame size or frame rate conversion.After having determined the transcoding strategy, control module and Channel Detection module communication obtain current network channel situation, and calculate the optimal parameter of transcoder under this situation of being fit to, the output optimization process result of control transcoder.
With reference to the accompanying drawings 4, video code conversion gateway thread structure is the thread structure framework of video code conversion gateway of the present invention.Threads of conversation in the described thread structure (41) is responsible for and the client of sending request connects; Network monitor thread (43) is responsible for the parameter variation that real-time detection connects network; Transcoding thread (42) is responsible for carrying out the transcoding processing of video; Control thread (44) is monitored the variation getparms of network monitor thread, and the parameter of control transcoding thread; Transmission thread (45) is responsible for the video flowing behind the transcoding is sent to the client that connects in the threads of conversation.