Multichannel kinescope method and system
Technical field
The invention belongs to videoing skill field, particularly relate to multichannel kinescope method and system.
Background technology
Along with the arrival of information age, Video Supervision Technique obtains long-range development.
Existing kinescope method belongs to single channel video recording, it can only obtain a kind of coded system or the video image of a kind of coded image size, and in practical application, more user is desirable to obtain the video image of different coding mode or different coding image size, to meet the demanding terminal of different hardware configurations, such as, the resolution of monitoring video that user is expected on PC and plays is high, and the resolution of the monitoring video play on the mobile terminals such as mobile phone is low. Multiple different coding mode or the video image of different coding image size can not be obtained due to single channel videoing skill, therefore user can not select the video image of corresponding resolution to play out according to the difference of terminal configuration, make troubles to user, reduce Consumer's Experience.
Summary of the invention
Embodiments provide a kind of multichannel kinescope method, it is intended to solve existing kinescope method and single coded system or the video image of single coded image size can only be provided, make troubles to user, the problem reducing Consumer's Experience.
The embodiment of the present invention is achieved in that a kind of multichannel kinescope method, and described method comprises the steps:
Step S11, receives the video data of input;
Step S12, create at least two example, and to create example be encoded mode and the setting of coded image size, wherein, different instances arrange coded system have at least with coded image size one different;
Step S13, starts first example created, and first Frame of the video data of input is encoded by the coded system and the coded image size that arrange according to described first example;
Step S14, after first example code Frame terminates, starting next example, first Frame is encoded by the coded system and the coded image size that arrange according to described next example, until first Frame has all been encoded by the example created;
Step S15, is again started up first example created, and the next Frame of coded data frame in video data is encoded by the coded system and the coded image size that arrange according to described first example;
Step S16, after first example code next one Frame terminates, it is again started up next example, identical next Frame is encoded with coded image size according to the coded system that described next example is arranged, until identical next Frame has all been encoded by the example created;
Circulation performs step S15 and step S16, until the video data encoding of input is terminated.
The another object of the embodiment of the present invention is in that to provide a kind of multichannel video recording system, and described system includes:
Video data receives unit, for receiving the video data of input;
Example creates and arranges unit, is used for creating at least two example, and the example created is encoded mode and the setting of coded image size, wherein, the coded system that different instances is arranged have at least with coded image size one different;
First coding unit, for starting first example of establishment, first Frame of the video data of input is encoded by the coded system and the coded image size that arrange according to described first example;
Second coding unit, after terminating at first example code Frame, starting next example, first Frame is encoded by the coded system and the coded image size that arrange according to described next example, until first Frame has all been encoded by the example created;
3rd coding unit, for being again started up first example created, the next Frame of coded data frame in video data is encoded by the coded system and the coded image size that arrange according to described first example;
4th coding unit, after terminating at first example code next one Frame, it is again started up next example, identical next Frame is encoded with coded image size according to the coded system that described next example is arranged, until identical next Frame has all been encoded by the example created;
Circulation performs the 3rd coding unit and the 4th coding unit, until the video data encoding of input is terminated.
In the embodiment of the present invention, create at least two example, the coding video data to input further according to the coded system set by the example created and coded image size. Coded system and coded image size set by different instances have at least one to differ, therefore the multichannel kinescope method that the embodiment of the present invention provides is adopted can to obtain different coding mode, or different coding image size, or the video image of different coding mode and different coding image size, choosing according to practical situation thus being beneficial to user, improve Consumer's Experience.
Accompanying drawing explanation
Fig. 1 is the multichannel kinescope method flow chart that first embodiment of the invention provides;
Fig. 2 is the multichannel video recording system structure chart that second embodiment of the invention provides;
Fig. 3 is the another kind of multichannel video recording system structure chart that second embodiment of the invention provides.
Detailed description of the invention
In order to make the purpose of the present invention, technical scheme and advantage clearly understand, below in conjunction with drawings and Examples, the present invention is further elaborated. Should be appreciated that specific embodiment described herein is only in order to explain the present invention, is not intended to limit the present invention.
In the embodiment of the present invention, create at least two example, the coding video data to input further according to the coded system set by the example created and coded image size.
Embodiments provide one: multichannel kinescope method and system.
Described method includes: step S11, receives the video data of input;
Step S12, create at least two example, and to create example be encoded mode and the setting of coded image size, wherein, different instances arrange coded system have at least with coded image size one different;
Step S13, starts first example created, and first Frame of the video data of input is encoded by the coded system and the coded image size that arrange according to described first example;
Step S14, after first example code Frame terminates, starting next example, first Frame is encoded by the coded system and the coded image size that arrange according to described next example, until first Frame has all been encoded by the example created;
Step S15, is again started up first example created, and the next Frame of coded data frame in video data is encoded by the coded system and the coded image size that arrange according to described first example;
Step S16, after first example code next one Frame terminates, it is again started up next example, identical next Frame is encoded with coded image size according to the coded system that described next example is arranged, until identical next Frame has all been encoded by the example created;
Circulation performs step S15 and step S16, until the video data encoding of input is terminated.
Described system includes: video data receives unit, for receiving the video data of input;
Example creates and arranges unit, is used for creating at least two example, and the example created is encoded mode and the setting of coded image size, wherein, the coded system that different instances is arranged have at least with coded image size one different;
First coding unit, for starting first example of establishment, first Frame of the video data of input is encoded by the coded system and the coded image size that arrange according to described first example;
Second coding unit, after terminating at first example code Frame, starting next example, first Frame is encoded by the coded system and the coded image size that arrange according to described next example, until first Frame has all been encoded by the example created;
3rd coding unit, for being again started up first example created, the next Frame of coded data frame in video data is encoded by the coded system and the coded image size that arrange according to described first example;
4th coding unit, after terminating at first example code next one Frame, it is again started up next example, identical next Frame is encoded with coded image size according to the coded system that described next example is arranged, until identical next Frame has all been encoded by the example created;
Circulation performs the 3rd coding unit and the 4th coding unit, until the video data encoding of input is terminated.
In the embodiment of the present invention, coded system and coded image size set by different instances have at least one to differ, therefore the multichannel kinescope method that the embodiment of the present invention provides is adopted can to obtain different coding mode, or different coding image size, or the video image of different coding mode and different coding image size, choosing according to practical situation thus being beneficial to user, improve Consumer's Experience.
In order to technical solutions according to the invention are described, illustrate below by specific embodiment.
Embodiment one:
Fig. 1 illustrates a kind of multichannel kinescope method flow chart that first embodiment of the invention provides, and details are as follows:
Step S11, receives the video data of input.
In the present embodiment, video data can input from photographing unit or video camera etc.
Step S12, create at least two example, and to create example be encoded mode and the setting of coded image size, wherein, different instances arrange coded system have at least with coded image size one different.
In the present embodiment, in multiple examples of establishment, coded system and coded image size that each example is corresponding have at least one to differ, and are different to ensure the multichannel obtained video recording.
Such as, it is assumed that creating two examples, example first and example second, H.264 the coded system of example first may be configured as, and coded image size may be configured as 720p; H.264 the coded system of example second may be configured as, and coded image size may be configured as CLV Common Intermediate Format (CommonIntermediateFormat, CIF), and this CIF is sized to 352 × 288 pixels. Or, the coded system of example first may be alternatively provided as motor rest Image Compression (MotionJointPhotographicExpertsGroup, MJPEG) coding, and coded image is dimensioned to 720p; The coded system of example second may be configured as MJPEG coding, and coded image size may be configured as CIF. Certainly, coded system and coded image size that each example is corresponding can also be set according to practical situation, are not construed as limiting herein.
Step S13, starts first example created, and first Frame of the video data of input is encoded by the coded system and the coded image size that arrange according to this first example.
In the present embodiment, start first example created, first Frame of the video data of input is encoded by the coded system and the coded image size that arrange according to this first example, such as, assume that H.264 the coded system that first example is arranged is, coded image is sized to 720p, then use coded system H.264 that one Frame of input is encoded, and the image after coding is sized to 720p.
Step S14, after first example code Frame terminates, starting next example, first Frame is encoded by the coded system and the coded image size that arrange according to this next one example, until first Frame has all been encoded by the example created.
In the present embodiment, assume to create 3 examples, then after first data frame end of first example code, start second example, first above-mentioned Frame is encoded by the coded system and the coded image size that arrange according to this second example, after second example is to first Frame end-of-encode, restarts the 3rd example and first Frame is encoded.
Step S15, is again started up first example created, and the next Frame of coded data frame in video data is encoded by the coded system and the coded image size that arrange according to this first example.
In the present embodiment, after the example created is all to same Frame end-of-encode, if there is also uncoded Frame, then being again started up first example, the next Frame of coded data frame is encoded by the coded system and the coded image size that arrange according to this first example. Such as, it is assumed that 3 examples of establishment all to first Frame end-of-encode, then start first example, second Frame is encoded by the coded system and the coded image size that arrange according to this first example.
Step S16, after first example code next one Frame terminates, it is again started up next example, identical next Frame is encoded with coded image size according to the coded system that this next one example is arranged, until identical next Frame has all been encoded by the example created.
In the present embodiment, starting the example of establishment one by one, the next Frame of coded data frame is encoded by coded system and coded image size according to creating example setting. Such as, if creating 3 examples, then after second data frame end of first example code, start second Frame of second example code, after second data frame end of second example code, restart second Frame of the 3rd example code.
Circulation performs step S15 and step S16, until the video data encoding of input is terminated.
In the present embodiment, when there is multiple Frame in video data, first start first example a uncoded Frame is encoded, after first example code terminates, restart second example identical Frame is encoded, if the example more than two created, then after second example code terminates, continue the next example after starting second example identical Frame is encoded, until identical Frame is all encoded by the example of all establishments, just it is again started up first example next Frame to coded data frame to be encoded, circulation performs above-mentioned steps, until the video data encoding of input is terminated. further, after the video data encoding of input is terminated, the multiple examples created are recorded into a file, or the multiple examples created are recorded into a code stream be transmitted.
In the embodiment of the present invention, create at least two example, the coding video data to input further according to the coded system set by the example created and coded image size. Coded system and coded image size set by different instances have at least one to differ, therefore the multichannel kinescope method that the embodiment of the present invention provides is adopted can to obtain different coding mode, or different coding image size, or the video image of different coding mode and different coding image size, choosing according to practical situation thus being beneficial to user, improve Consumer's Experience.
As one embodiment of the present invention, start first example created, before the step that first Frame of the video data of input is encoded by the coded system arranged according to described first example and coded image size, farther include step:
Judge that whether the size of the video data of input is equal with the coded image size of setting, if unequal, the video data of input is carried out pretreatment, so that the size of pretreated video data is equal in magnitude with the coded image of setting.
In the present embodiment, judge that whether the size of the video data of input is equal with the coded image size of setting, when being sized larger than the coded image size arranged of video data when input, need some pixels abandoning in the video data of input, so that abandoning the size coded image size equal to setting of the video data after some pixels, certainly, abandon the video data after some pixels and will not cause discovering of human eye; When the coded image size being smaller in size than setting of the video data of input, it is necessary to increase corresponding pixel, so that increasing the size coded image size equal to setting of the video data after pixel.
As one embodiment of the present invention, during video data encoding, the method comprising the steps of:
Judge that whether the scramble time of Frame is more than pre-arranged code threshold value, if more than pre-arranged code threshold value, inserting empty Frame, if less than pre-arranged code threshold value, abandoning the Frame that next frame need to encode.
In the present embodiment, using the coding rate of bite rate control video data: if the scramble time is long, coding rate is inadequate, and frame per second is too low, can carry out the operation of plug hole frame; If the scramble time is too short, coding rate is too fast, and frame per second is too high, can be made directly frame losing operation.
Wherein, it is judged that whether the scramble time of Frame specifically includes more than the step of pre-arranged code threshold value:
A1, according to user set frame per second determine coding one Frame needed for time. In the present embodiment, determine the time needed for one Frame of coding according to the frame per second that user sets: when user sets two frame per second, the time needed for one Frame of two codings can be determined according to two frame per second set; When user sets plural frame per second, the time needed for two or more one Frame of coding can be determined according to the plural frame per second set. Wherein, the frame per second that user sets can be that 25 frames are per second or 30 frames/per second etc., it is not construed as limiting herein.
A2, the scramble time as Frame of the maximum duration needed for a Frame will be encoded. In the present embodiment, when obtaining the time needed for one Frame of multiple codings, using the scramble time as Frame maximum for numerical value. Such as, if user is respectively provided with, 25 frames are per second and 30 frames/two frame per second per second, then can determine that the times needed for one Frame of two codings: 1/25 and 1/30, and using 1/25 as scramble time of Frame, this scramble time of follow-up use is with pre-arranged code threshold ratio relatively.
A3, judge that whether scramble time of Frame is more than pre-arranged code threshold value.
In the embodiment of the present invention, using an encoder is multi-channel video by the video data encoding of input, allowing users to the difference according to terminal configuration selects the video image of corresponding resolution to play out, meet the different user demand to picture quality, facilitate user, improve Consumer's Experience. Meanwhile, in video data encoding process, by inserting null frame or abandoning some Frames and control coding rate, meet user's requirement to frame per second.
Embodiment two:
Fig. 2 illustrates the structure of the multichannel video recording system that second embodiment of the invention provides, and for the ease of illustrating, illustrate only the part relevant to the embodiment of the present invention.
This multichannel video recording system may be used for by wired or wireless network Connection Service device the various information processing terminals, such as mobile phone, pocket computer (PocketPersonalComputer, PPC), palm PC, computer, notebook computer, watch-dog etc., the unit that the software unit in these terminals, hardware cell or software and hardware combine can be operate in, can also be integrated in these terminals as independent suspension member or run in the application system of these terminals, wherein:
Video data receives unit 21, for receiving the video data of input.
Example creates and arranges unit 22, is used for creating at least two example, and the example created is encoded mode and the setting of coded image size, wherein, the coded system that different instances is arranged have at least with coded image size one different.
In the present embodiment, create at least two example, and the coded system corresponding to example and the coded image size of establishment are set, owing to needs obtain at least two-path video, coded system and coded image size that therefore different instances is arranged have at least one to be different. Wherein, H.264 coded system may be configured as or MJPEG etc., and coded image size may be configured as 720p or CIF etc., is not construed as limiting herein.
First coding unit 23, for starting first example of establishment, first Frame of the video data of input is encoded by the coded system and the coded image size that arrange according to this first example.
Second coding unit 24, after terminating at first example code Frame, starting next example, first Frame is encoded by the coded system and the coded image size that arrange according to this next one example, until first Frame has all been encoded by the example created.
In the present embodiment, start the example of establishment one by one, and first Frame is encoded by the coded system and coded image size according to the example setting started. Such as after first example is to first Frame end-of-encode, restart second example first Frame is encoded, after second example code terminates, continue to start the 3rd example first Frame is encoded, just terminate until first Frame has all been carried out coding by the example created.
3rd coding unit 25, for being again started up first example created, the next Frame of coded data frame in video data is encoded by the coded system and the coded image size that arrange according to this first example.
In the present embodiment, owing to video data exists multiple Frame, therefore after the example created is all to first Frame end-of-encode of the video data of input, still need to be again started up first example and the Frame after first Frame is encoded.
4th coding unit 26, after terminating at first example code next one Frame, it is again started up next example, identical next Frame is encoded with coded image size according to the coded system that this next one example is arranged, until identical next Frame has all been encoded by the example created.
In the present embodiment, after first example is to certain the Frame end-of-encode after first Frame, it is necessary to a same Frame is encoded by the example starting other establishments one by one.
Circulation performs the 3rd coding unit 25 and the 4th coding unit 26, until the video data encoding of input is terminated.
Further, after the video data encoding of input is terminated, the multiple examples created are recorded into a file, or the multiple examples created are recorded into a code stream be transmitted.
In the embodiment of the present invention, create at least two example, the coding video data to input further according to the coded system set by the example created and coded image size. Coded system and coded image size set by different instances have at least one to differ, therefore the multichannel video recording system that the embodiment of the present invention provides is adopted can to obtain different coding mode, or different coding image size, or the video image of different coding mode and different coding image size, choosing according to practical situation thus being beneficial to user, improve Consumer's Experience.
As a preferred embodiment, Fig. 3 illustrates the structure of the another kind of multichannel video recording system that the embodiment of the present invention provides, and in figure 3, this system includes:
Pretreatment unit 27, whether the size for judging the video data of input is equal with the coded image size of setting, if unequal, the video data of input is carried out pretreatment, so that the size of pretreated video data is equal in magnitude with the coded image of setting.
In the present embodiment, video data to the incoming yuv form of same photographing unit or video camera, if the coded image size arranged is different from the size of the video data of incoming yuv form, then need the video data of incoming yuv form is carried out pretreatment, so that the size of the video data of pretreated yuv form is identical with the coded image size of setting.
As a preferred embodiment, this system includes:
Whether code speed control unit 28, be used for the scramble time judging Frame more than pre-arranged code threshold value, if more than pre-arranged code threshold value, inserting empty Frame, if less than pre-arranged code threshold value, then abandoning the Frame that next frame need to encode.
In the present embodiment, by inserting null frame or abandoning the Frame that need to encode and control the coding rate of video data.
As a preferred embodiment, this yard of fast control unit 28 includes:
First scramble time determined module 281, and the frame per second for setting according to user determines the time needed for one Frame of coding.
Second scramble time determined module 282, for encoding the scramble time as Frame of the maximum duration needed for a Frame.
In the present embodiment, owing to creating at least two example, for multiplex coding, therefore the scramble time of Frame is to encode the more road coding of spended time to be as the criterion.
Whether scramble time comparison module 283, be used for the scramble time judging Frame more than pre-arranged code threshold value.
In the embodiment of the present invention, using an encoder is multi-channel video by the video data encoding of input, allowing users to the difference according to terminal configuration selects the video image of corresponding resolution to play out, meet the different user demand to picture quality, facilitate user, improve Consumer's Experience. Meanwhile, in video data encoding process, by inserting null frame or abandoning some Frames and control coding rate, meet user's requirement to frame per second.
The foregoing is only presently preferred embodiments of the present invention, not in order to limit the present invention, all any amendment, equivalent replacement and improvement etc. made within the spirit and principles in the present invention, should be included within protection scope of the present invention.