Embodiment
In order to make purpose of the present invention, technical scheme and advantage clearer, below in conjunction with drawings and Examples, the present invention is further elaborated.Should be appreciated that specific embodiment described herein only in order to explaining the present invention, and be not used in restriction the present invention.
In the embodiment of the invention, create at least two examples, again according to the example of creating set coded system and the coding video data of coded image size to importing.
It is a kind of that the embodiment of the invention provides: multichannel kinescope method and system.
Described method comprises: step S11 receives the video data of importing;
Step S12 creates at least two examples, and the example of creating is carried out the setting of coded system and coded image size, wherein, the coded system of different instances setting and coded image size have at least one different;
Step S13 starts first example of creating, according to coded system and the coded image size of described first example setting first Frame of the video data of input is encoded;
Step S14, after first example code Frame finishes, start next example, according to coded system and the coded image size of described next example setting first Frame is encoded, all first Frame is encoded up to the example of creating;
Step S15 starts first example of creating again, according to coded system and the coded image size of described first example setting the next Frame of coded data frame in the video data is encoded;
Step S16, after the next Frame of first example code finishes, start next example again, coded system according to described next example setting is encoded to identical next Frame with the coded image size, all identical next Frame is encoded up to the example of creating;
Circulation execution in step S15 and step S16 are up to the video data end-of-encode to input.
Described system comprises: the video data receiving element is used for receiving the video data of importing;
The unit is created and arranged to example, is used for creating at least two examples, and the example of creating is carried out the setting of coded system and coded image size, wherein, the coded system of different instances setting and coded image size have at least one different;
First coding unit is used for starting first example of creating, according to coded system and the coded image size of described first example setting first Frame of the video data of input is encoded;
Second coding unit, be used for after first example code Frame finishes, start next example, according to coded system and the coded image size of described next example setting first Frame is encoded, all first Frame is encoded up to the example of creating;
The 3rd coding unit is used for starting again first example of creating, according to coded system and the coded image size of described first example setting the next Frame of coded data frame in the video data is encoded;
The 4th coding unit, be used for after the next Frame of first example code finishes, start next example again, coded system according to described next example setting is encoded to identical next Frame with the coded image size, all identical next Frame is encoded up to the example of creating;
The 3rd coding unit and the 4th coding unit are carried out in circulation, up to the video data end-of-encode to input.
In the embodiment of the invention, since the set coded system of different instances and coded image size have at least one inequality, therefore the multichannel kinescope method that adopts the embodiment of the invention to provide can obtain the different coding mode, or different coding image size, or the video image of different coding mode and different coding image size, choose according to actual conditions thereby be beneficial to the user, improved user's experience.
For technical solutions according to the invention are described, describe below by specific embodiment.
Embodiment one:
Fig. 1 shows 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 importing.
In the present embodiment, video data can be from inputs such as camera or video cameras.
Step S12 creates at least two examples, and the example of creating is carried out the setting of coded system and coded image size, wherein, the coded system of different instances setting and coded image size have at least one different.
In the present embodiment, in a plurality of examples of establishment, each example corresponding coding manner and coded image size have at least one to be inequality, are different with the multichannel video recording that guarantees to obtain.
Such as, suppose to create two examples, example first and example second, H.264 the coded system of example first can be set to, and the big I of coded image is set to 720p; H.264 the coded system of example second can be set to, and the big I of coded image is set to CLV Common Intermediate Format, and (Common Intermediate Format, CIF), this CIF size is 352 * 288 pixels.Perhaps, the coded system of example first also can be set to motion rest image compress technique (Motion Joint Photographic Experts Group, MJPEG) coding, the coded image size is set to 720p; The coded system of example second can be set to the MJPEG coding, and the big I of coded image is set to CIF.Certainly, each example corresponding coding manner and coded image size also can be set according to actual conditions, do not limit herein.
Step S13 starts first example of creating, according to coded system and the coded image size of this first example setting first Frame of the video data of input is encoded.
In the present embodiment, start first example of creating, coded system and coded image size according to this first example setting are encoded to first Frame of the video data of input, such as, suppose that coded system that first example arranges is for H.264, the coded image size is 720p, then uses coded system H.264 that a Frame of input is encoded, and the image size behind the coding is 720p.
Step S14, after first example code Frame finishes, start next example, according to coded system and the coded image size of this next one example setting first Frame is encoded, all first Frame is encoded up to the example of creating.
In the present embodiment, suppose to have created 3 examples, then after first Frame of first example code finishes, start second example, coded system and coded image size according to this second example setting are encoded to first above-mentioned Frame, after second example is to first Frame end-of-encode, restarts the 3rd example first Frame is encoded.
Step S15 starts first example of creating again, according to coded system and the coded image size of this first example setting the next Frame of coded data frame in the video data is encoded.
In the present embodiment, after the example of creating is all to same Frame end-of-encode, if also there is uncoded Frame, then start first example again, according to coded system and the coded image size of this first example setting the next Frame of coded data frame is encoded.Such as, 3 examples supposing to create then start first example all to first Frame end-of-encode, according to coded system and the coded image size of this first example setting second Frame are encoded.
Step S16, after the next Frame of first example code finishes, start next example again, coded system according to this next one example setting is encoded to identical next Frame with the coded image size, all identical next Frame is encoded up to the example of creating.
In the present embodiment, start the example of creating one by one, according to coded system and the coded image size of creating the example setting the next Frame of coded data frame is encoded.Such as, if created 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 execution in step S15 and step S16 are up to the video data end-of-encode to input.
In the present embodiment, when there is a plurality of Frame in video data, at first starting first example encodes to a uncoded Frame, after first example code finishes, restarting second example encodes to identical Frame, if the example of creating is more than two, then after second example code finishes, continuing to start second example next example afterwards encodes to identical Frame, example up to all establishments is all encoded to identical Frame, just starting first example again encodes to the next Frame of coded data frame, above-mentioned steps is carried out in circulation, up to the video data end-of-encode to input.Further, after the video data end-of-encode to input, a plurality of examples of creating are recorded into a file, a plurality of examples that perhaps will create are recorded into a code stream and are transmitted.
In the embodiment of the invention, create at least two examples, again according to the example of creating set coded system and the coding video data of coded image size to importing.Since the set coded system of different instances and coded image size have at least one inequality, therefore the multichannel kinescope method that adopts the embodiment of the invention to provide can obtain the different coding mode, or different coding image size, or the video image of different coding mode and different coding image size, choose according to actual conditions thereby be beneficial to the user, improved user's experience.
As one embodiment of the present invention, at first example of start creating, before the step of first Frame of the video data of input being encoded according to the coded system of described first example setting and coded image size, further comprise step:
Whether the size of judging the video data of input equates with the coded image size of setting, if unequal, the video data of importing is carried out preliminary treatment, so that the coded image equal and opposite in direction of the size of pretreated video data and setting.
In the present embodiment, whether the size of judging the video data of input equates with the coded image size of setting, when the size of the video data of importing is big or small greater than the coded image that arranges, need abandon some pixels in the video data of input, so that abandon the coded image size that the size of the video data behind some pixels equals to arrange, certainly, the video data that abandons behind some pixels can not cause discovering of human eye; When the size of the video data of importing is big or small less than the coded image that arranges, need to increase corresponding pixel, so that the coded image size that the size of the video data behind the increase pixel equals to arrange.
As one embodiment of the present invention, during the video data coding, the method comprising the steps of:
Whether the scramble time of judgment data frame is greater than default coding threshold value, if greater than default coding threshold value, insert empty Frame, if less than default coding threshold value, abandon next frame and need the coded data frame.
In the present embodiment, use the coding rate of code stream control video data: if the scramble time is long, coding rate is not enough, and frame per second is low excessively, 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 directly carry out the frame losing operation.
Wherein, whether the scramble time of judgment data frame specifically comprises greater than default step of encoding threshold value:
A1, the frame per second of setting according to the user are determined time that Frame is required of coding.In the present embodiment, determine time that Frame is required of coding according to the frame per second that the user sets: when the user has set two frame per second, can determine two times that Frame is required of coding according to two frame per second setting; When the user has set plural frame per second, can determine time that Frame is required of coding more than two according to the plural frame per second of setting.Wherein, the frame per second of user's setting can not limit for 25 frame per seconds or 30 frames/per second etc. herein.
The required maximum duration of A2, the Frame of will encoding is as the scramble time of Frame.In the present embodiment, when obtaining required time of Frame of a plurality of codings, with the scramble time as Frame of numerical value maximum.Such as, if the user is provided with 25 frame per seconds and 30 frames/two frame per second of per second respectively, then can determine two times that Frame is required of coding: 1/25 and 1/30, and with 1/25 scramble time as Frame, follow-up this scramble time of use compares with default coding threshold value.
Whether the scramble time of A3, judgment data frame is greater than default coding threshold value.
In the embodiment of the invention, use an encoder that the video data of input is encoded to multi-channel video, make the user to select the video image of corresponding resolution to play according to the difference of terminal configuration, satisfied the demand of different user to picture quality, make things convenient for the user, improved user's experience.Simultaneously, in the video data cataloged procedure, control coding rate by inserting empty frame or abandoning some Frames, satisfied the requirement of user to frame per second.
Embodiment two:
Fig. 2 shows the structure of the multichannel video recording system that second embodiment of the invention provides, and for convenience of explanation, only shows the part relevant with the embodiment of the invention.
This multichannel video recording system can be used for by the various information processing terminals wired or wireless network Connection Service device, for example mobile phone, pocket computer (Pocket Personal Computer, PPC), palmtop PC, computer, notebook computer, watch-dog etc., can be to run on the unit that software unit, hardware cell or software and hardware in these terminals combine, also can be used as independently, suspension member is integrated in these terminals or runs in the application system of these terminals, wherein:
Video data receiving element 21 is used for receiving the video data of importing.
Unit 22 is created and arranged to example, is used for creating at least two examples, and the example of creating is carried out the setting of coded system and coded image size, wherein, the coded system of different instances setting and coded image size have at least one different.
In the present embodiment, create at least two examples, and the corresponding coded system of the example that establishment is set and coded image size, owing to need obtain two-path video at least, so the coded system of different instances setting has at least one to be different with the coded image size.Wherein, H.264 coded system can be set to or MJPEG etc., and the big I of coded image is set to 720p or CIF etc., does not limit herein.
First coding unit 23 is used for starting first example of creating, according to coded system and the coded image size of this first example setting first Frame of the video data of input is encoded.
Second coding unit 24, be used for after first example code Frame finishes, start next example, according to coded system and the coded image size of this next one example setting first Frame is encoded, all first Frame is encoded up to the example of creating.
In the present embodiment, start the example of creating one by one, and according to coded system and the coded image size of the example setting that starts first Frame is encoded.Such as after first example is to first Frame end-of-encode, restarting second example encodes to first Frame, after second example code finishes, continue to start the 3rd example first Frame is encoded, just finish until the example of creating has all carried out coding to first Frame.
The 3rd coding unit 25 is used for starting again first example of creating, according to coded system and the coded image size of this first example setting the next Frame of coded data frame in the video data is encoded.
In the present embodiment, because there are a plurality of Frames in video data, therefore, still need start first example again the Frame of first Frame back is encoded all after first Frame end-of-encode to the video data of input at the example of creating.
The 4th coding unit 26, be used for after the next Frame of first example code finishes, start next example again, coded system according to this next one example setting is encoded to identical next Frame with the coded image size, all identical next Frame is encoded up to the example of creating.
In the present embodiment, after certain the Frame end-of-encode to first Frame back of first example, the example that need start other establishments is one by one encoded to a same Frame.
The 3rd coding unit 25 and the 4th coding unit 26 are carried out in circulation, up to the video data end-of-encode to input.
Further, after the video data end-of-encode to input, a plurality of examples of creating are recorded into a file, a plurality of examples that perhaps will create are recorded into a code stream and are transmitted.
In the embodiment of the invention, create at least two examples, again according to the example of creating set coded system and the coding video data of coded image size to importing.Since the set coded system of different instances and coded image size have at least one inequality, therefore the multichannel video recording system that adopts the embodiment of the invention to provide can be obtained the different coding mode, or different coding image size, or the video image of different coding mode and different coding image size, choose according to actual conditions thereby be beneficial to the user, improved user's experience.
As a preferred embodiment, Fig. 3 shows the structure of the another kind of multichannel video recording system that the embodiment of the invention provides, and in Fig. 3, this system comprises:
Pretreatment unit 27, be used for judging whether the size of the video data of importing equates with the coded image size of setting, if unequal, the video data of importing is carried out preliminary treatment, so that the coded image equal and opposite in direction of the size of pretreated video data and setting.
In the present embodiment, the video data of the yuv form that same camera or video camera are imported into, if the coded image that arranges size is different with the size of the video data of the yuv form that imports into, then need the video data of the yuv form that imports into is carried out preliminary treatment, 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 comprises:
Whether sign indicating number speed control unit 28 processed is used for the scramble time of judgment data frame greater than default coding threshold value, if greater than default coding threshold value, insert empty Frame, if less than default coding threshold value, then abandon next frame and need the coded data frame.
In the present embodiment, by inserting empty frame or abandoning the coding rate that needs the coded data frame to control video data.
As a preferred embodiment, this yard speed control unit 28 processed comprises:
The first scramble time determination module 281, the frame per second that is used for setting according to the user is determined time that Frame is required of coding.
The second scramble time determination module 282, the required maximum duration of the Frame of being used for encoding is as the scramble time of Frame.
In the present embodiment, owing to created at least two examples, be multiplex coding, so the scramble time of Frame is, and more one road coding of spended time of encoding is as the criterion.
Whether scramble time comparison module 283 is used for the scramble time of judgment data frame greater than default coding threshold value.
In the embodiment of the invention, use an encoder that the video data of input is encoded to multi-channel video, make the user to select the video image of corresponding resolution to play according to the difference of terminal configuration, satisfied the demand of different user to picture quality, make things convenient for the user, improved user's experience.Simultaneously, in the video data cataloged procedure, control coding rate by inserting empty frame or abandoning some Frames, satisfied the requirement of user to frame per second.
The above only is preferred embodiment of the present invention, not in order to limiting the present invention, all any modifications of doing within the spirit and principles in the present invention, is equal to and replaces and improvement etc., all should be included within protection scope of the present invention.