Summary of the invention
In view of above-mentioned the deficiencies in the prior art part, the object of the present invention is to provide a kind of channel switching method and device of filtering advertisements, filtering advertisements in the time of can making user watch TV programme, the channel that automatically switches back and need to watch before TV programme starts broadcasting.
In order to achieve the above object, the present invention has taked following technical scheme:
A channel switching method for filtering advertisements, it comprises:
A, startup advertisement filter pattern, the target channel that mark need to switch;
The sound of B, Real-time Obtaining target channel, video data, and mate with sound, the video data of sample fragment; Wherein, the TV programme that the user that described sample fragment is recorded for user pays close attention to is fixed sound, the video data of playing before playing;
C, when the Voice & Video data of target channel and the Voice & Video Data Matching of sample fragment, switch to target channel.
The channel switching method of described filtering advertisements, wherein, before described steps A, also comprises and records sample fragment, specifically comprises:
A01, according to input instruction, eject input window, prompting user inputs television programme title;
A02, according to input record command record sound, the video data of current broadcasting;
A03, according to the halt instruction of input, stop recording, the sound of having recorded, video data is associated with the television programme title of input, and be stored as a sample chips section.
The channel switching method of described filtering advertisements, wherein, also comprises after described steps A 03:
A04, convert voice data to audio volume control, according to storing after preset ratio convergent-divergent; Meanwhile,
Convert video data to frame of video, extract the information of the sampled point in each frame of video, the information of described sampled point is recorded in sampling chained list according to corresponding frame number.
The channel switching method of described filtering advertisements, wherein, in described step B, the voice data of Real-time Obtaining target channel also mates specifically and comprises with the voice data of sample fragment:
The voice data of B1, Real-time Obtaining target channel also converts target audio waveform to;
B2, described target audio waveform is mated with sample audio volume control, and output matching result.
The channel switching method of described filtering advertisements, wherein, in described step B, the video data of Real-time Obtaining target channel also mates specifically and comprises with the video data of sample fragment:
The video data of B11, Real-time Obtaining target channel, extract a plurality of target video frames mark frame number according to the order of sequence, extract the information of the corresponding sampled point of each target video frame;
B12, by the information matches of the sampled point of frame of video in the sampling chained list of the information of the sampled point of current goal frame of video and sample fragment, and output matching result.
The channel switching method of described filtering advertisements, wherein, described sampled point comprises the random stochastical sampling point arranging of fixed sample point and sampling location that position is fixing.
The channel switching method of described filtering advertisements, wherein, the method to set up of described fixed sample point comprises: using the central point of frame of video as a fixed pixel point, in the peripheral direction of central point every default pixel of counting as fixed sample point.
The channel switching method of described filtering advertisements, wherein, after described steps A 03, described channel switching method also comprises:
A01, when sample fragment is play, according to pause instruction, suspend video playback, record current display frame;
A02, ejection input window, prompting user is to this display frame name;
A03, by the display frame names associate of the display frame of having recorded and input;
A04, the video data using the display frame of having recorded as sample fragment, the sampled point in the frame of video of extraction display frame and the information of sampled point storage.
The channel switching method of described filtering advertisements, wherein, in described step B, the video data of Real-time Obtaining target channel also mates specifically and comprises with the video data of sample fragment:
The video data of b111, Real-time Obtaining target channel, extract a plurality of target video frames mark frame number according to the order of sequence, extract the information of the sampled point of each target video frame;
B112, judge that whether the information of the information of sampled point of current goal frame of video and the sampled point of the frame of video of display frame is identical: if so, output matching result; Otherwise, continue to judge that whether the information of the sampled point of target video frame is identical with the frame of video of display frame.
A channel switching mechanism for filtering advertisements, it comprises:
Start module, for starting advertisement filter pattern, the target channel that mark need to switch;
Data extraction module, for sound, the video data of Real-time Obtaining target channel;
Data processing module, for mating the sound of Real-time Obtaining target channel, video data with sound, the video data of sample fragment; The TV programme that the user that described sample fragment is recorded for user pays close attention to is fixing sound, the video data of playing before playing;
Handover module, during for the Voice & Video Data Matching of the Voice & Video data in target channel and sample fragment, switches to target channel.
Compared to prior art, the channel switching method of filtering advertisements provided by the invention and device, by recording according to user's request startup advertisement filter pattern before user pays close attention to TV programme broadcasting, fix the audio, video data of broadcasting the target channel that mark need to switch, the sound of Real-time Obtaining target channel, video data, and mate with sound, the video data of sample fragment; When the Voice & Video data of target channel and the Voice & Video Data Matching of sample fragment, switch to target channel; If when the advertisement of playing between TV programme, user changes channel like this, energy is sound, the video data of monitoring objective channel in real time, without user, grasp the time spot and just can before TV programme is play, switch back target channel, avoid user to cause missing TV programme to misvaluing of time spot.
Embodiment
The invention provides a kind of channel switching method and device of filtering advertisements, described channel switching mechanism is arranged in the television set of supporting multi-channel sound vision signal or in Set Top Box, by recording the fixing sound of playing before the broadcasting of each TV programme, video data as sample fragment, the sound of target channel, video data and with sound, the video data of the sample fragment target channel that automatically switches back while mating, without user, grasp the time spot and just can switch back target channel in time, be convenient for users to operate.
For making object of the present invention, technical scheme and effect clearer, clear and definite, referring to accompanying drawing, developing simultaneously, the present invention is described in more detail for embodiment.Should be appreciated that specific embodiment described herein, only in order to explain the present invention, is not intended to limit the present invention.
Refer to Fig. 1, the flow chart of its channel switching method preferred embodiment that is filtering advertisements of the present invention.As shown in Figure 1, the channel switching method of filtering advertisements provided by the invention comprises:
S100, startup advertisement filter pattern, the target channel that mark need to switch.
The TV programme kind of paying close attention to based on user is more, and the reproduction time of TV programme is different.For the ease of user, the current program of watching is carried out to advertisement filter, automatically switch.User can start advertisement filter pattern by the mode button arranging on remote controller, and the current channel of watching of mark is target channel.When this channel broadcast advertisement makes after user's zapping, continue this target channel of monitoring, so that target channel is returned in follow-up automatic switchover.
The sound of S200, Real-time Obtaining target channel, video data, and mate with sound, the video data of sample fragment; Wherein, the TV programme that the user that described sample fragment is recorded for user pays close attention to is fixed sound, the video data of playing before playing.
The broadcasting TV play of take is example, and when user switches to because of advertisement after other channels, meeting of the present invention continues sound, the video data of monitoring objective channel on backstage, and mates with sound, the video data of sample fragment, does not affect the program of normal play on display screen.
S300, when the Voice & Video data of target channel and the Voice & Video Data Matching of sample fragment, switch to target channel.
Should be understood that, it is total and identical that TV play all can have a fragment before every collection is play, as shows the title of this TV play, the leader that TV play is play front broadcasting etc.The content of this fragment is fixed, and generally occurs will formally starting to play TV programme after this fragment.Therefore, the present invention using TV programme that this fragment pays close attention to as user play before fixing sound, the video data of playing, user records this fragment foundation as a channel switching, reaches the object of advertisement filter.Before described step S100, need user to record this fragment and mate with sound, the video data of target channel as sample fragment, specifically comprise:
The first step, according to input instruction, eject input window, prompting user inputs television programme title;
Second step, according to input record command record sound, the video data of current broadcasting;
The 3rd step, according to the halt instruction of input, stop recording, the sound of having recorded, video data is associated with the television programme title of input, and be stored as a sample chips section.
Described input instruction, record command, halt instruction can send to channel switching mechanism reception & disposal by the button arranging on remote controller, also can realize by controlling button corresponding on the mobile terminal of TV operation.The different content of the TV programme of paying close attention to based on user, need to record respectively its corresponding sample fragment to different programs by user.Described sample fragment is vid by sample video v01(form) and sample audio frequency au01(form be aud) form.
The input of television programme title was carried out before recording, the broadcast that does not now affect program with watch, when needs are recorded, start again to record, it does not have continuity with recording.What in the present embodiment, record is real-time original sound, video data, and not screenshotss video recording, also can not affect the normal play of program while therefore recording.Can certainly be after having recorded automatic spring input window, after prompting user inputs television programme title, preserve input title and also do not affect the normal play of program while preserving.
After sample fragment has been recorded, user can start advertisement filter pattern by key control television system by one on remote controller, mark current channel is target channel, so that user switches to after other channels because of advertisement, target channel can also again automatically switch back before the programme content of target channel is play.
In the present embodiment, need respectively target channel to be mated with voice data and the video data of sample fragment.During voice data coupling, being the comparison based on audio volume control, is the comparison based on frame of video during video data coupling.Content based on comparison is different, when storing sample fragment, also needs respectively sound, video data to be done to respective handling, after described the 3rd step, also comprises:
The 4th step, convert voice data to audio volume control, according to storing after preset ratio convergent-divergent.Meanwhile, convert video data to frame of video, extract the information of the sampled point in each frame of video, the information of described sampled point is recorded in sampling chained list according to corresponding frame number.
In the specific implementation, can dwindle or amplify by preset reference volume (energy), to guarantee that the waveform of storage has certain amplitude.Described sampling chained list has recorded the frame number fn(n of each frame of video as being greater than 0 positive integer in (l1 of take represents)), the recording time tn of this frame of video, and the information of the sampled point in frame of video.The information of described sampled point comprises the position coordinates (x, y) of sampled point in frame, the rgb value of each sampled point and transparence value tp.Described sampled point is a plurality of, and the audio volume control in sampling chained list is also sample audio volume control, and frame of video wherein is also sample frame of video.
Then carry out voice data and video data comparison, in described step S200, the voice data of Real-time Obtaining target channel also mates specifically and comprises with the voice data of sample fragment:
The voice data of step 1, Real-time Obtaining target channel also converts target audio waveform to.
This step conversion becomes after target audio waveform, need to carry out convergent-divergent according to the preset ratio in the 4th step, conveniently target audio waveform and sample audio volume control is compared.
Step 2, described target audio waveform is mated with sample audio volume control, and output matching result.
For target audio waveform and sample audio volume control, the present embodiment extracts the coordinate of an audio frequency point every Preset Time (as 0.1s), judge whether target audio waveform overlaps with the audio frequency point of sample audio volume control or approach coincidence (situation of error), overlapping and illustrate that both waveforms are identical.
In the present embodiment, judge that the mode that a plurality of continuity points overlap has two kinds:
One, whether the ordinate of a plurality of continuity points on calculating sample fragment waveform and the absolute value of the difference of the ordinate on target audio waveform are less than a predetermined threshold value, are less than and overlap: it specifically comprises:
Step 110, judge whether the absolute value of difference of ordinate of the initial audio frequency point of the audio frequency point of target audio waveform on current point in time and sample fragment is less than a predetermined threshold value (as 0.3); If so, perform step 120; Otherwise, continue execution step 110;
Step 120, the current point in time of target audio waveform is recorded in audio queue, judges whether the absolute value of difference of ordinate of the audio frequency point of target audio waveform on next time point and sample fragment is less than described predetermined threshold value; If so, perform step 130; Otherwise, empty audio queue, return to step 110;
Whether step 130, the time point that judges tail of the queue in audio queue are greater than the first predetermined threshold value with the difference of the time point of team head: if so, stop tone audio data is mated, output matching result; Otherwise, return to step 120.
That is to say, audio frequency point on the target audio waveform of Real-time Obtaining and the audio frequency point of sample fragment are judged one by one, only have and on target audio waveform, have a plurality of continuous audio frequency points to overlap with the audio frequency point of sample fragment or approach, this section of target audio waveform just mates with sample audio volume control.
Whether the ordinate of a plurality of continuity points and the absolute value of the ordinate sum on target audio waveform that two, calculate on sample fragment waveform are less than a predetermined threshold value, are less than and overlap: it specifically comprises:
Step 11, by sample audio volume control flip vertical, form the sample mirror image figure of 180 degree;
The voice data of step 12, Real-time Obtaining target channel also converts target audio waveform to;
Step 13, judge whether the ordinate sum of the initial audio frequency point of the audio frequency point of target audio waveform on current point in time and sample fragment is less than threshold value: if so, perform step 14; Otherwise, continue execution step 13;
Step 14, the current point in time of target audio waveform is recorded in audio queue, judges whether the ordinate sum of the audio frequency point of target audio waveform on next time point and sample fragment is less than threshold value; If so, perform step 15; Otherwise, empty audio queue, return to step 13;
Whether step 15, the time point that judges tail of the queue in audio queue are greater than the first predetermined threshold value with the difference of the time point of team head: if so, stop tone audio data is mated; Otherwise, return to step 14.
As shown in Figure 2, that is to say, sample mirror image figure r1 is constantly compared with real-time target audio waveform i1; Wherein, h represents crest, i.e. ordinate, and t represents the time.As an A ' and point, to approach 0(be that the absolute value of ordinate sum is less than threshold value to the ordinate sum between A, as 0.3), the time coordinate t1 of point A is recorded in audio queue q, as the ordinate sum between fruit dot A ' and some A is greater than threshold value s, this point is not carried out to record, and empty audio queue q.Then to next time point t2 (with the time interval of t1 be 0.1s) 2 B ', B carry out same calculating, if h2 and h's ' 2 and absolute value be also less than threshold value s, t2 is also recorded in audio queue q; Otherwise empty audio queue q.By that analogy respectively to point (C ', C), (D ', D), (E ', E), (F ', F), (G ', G) ... carry out identical calculating.If the tail of the queue time point of audio queue deducts the absolute value of the time point of team's head and is greater than the first predetermined threshold value (as 10 seconds), think that now the program audio of television for play is consistent with the sample audio frequency of recording, from voice data judgement, match, now television set needs automatically to adjust platform to target channel.
In described step S200, the video data of Real-time Obtaining target channel also mates specifically and comprises with the video data of sample fragment:
The video data of step 21, Real-time Obtaining target channel, extract a plurality of target video frames mark frame number according to the order of sequence, extract the information of the corresponding sampled point of each target video frame;
Step 22, by the information matches of the sampled point of frame of video in the sampling chained list of the information of the sampled point of current goal frame of video and sample fragment, and output matching result.
Wherein, described step 22 specifically comprises:
In step a, the information of sampled point that judges current goal frame of video and the sampling chained list of sample fragment, whether the information of the sampled point of initial frame of video is identical: if so, perform step b; Otherwise, continue execution step a.
Step b, the time point of current goal frame of video is recorded in video queue, judges that whether the information of the sampled point of target video frame in next frame number is identical with the information of the sampled point of sample fragment; If so, perform step c; Otherwise, empty video queue, return to step a;
Whether step c, the time point that judges tail of the queue in video queue are greater than the second predetermined threshold value with the difference of the time point of team head: if so, stop video data and mate; Otherwise, return to step b.
The information of described sampled point comprises the position coordinates (x, y) of sampled point in frame, the rgb value of each sampled point and transparence value tp.Only have and when these information is all identical, just think coupling.
Hypothetical target frame of video represents with sfn, and the frame of video in sampling chained list represents with rfn.That is to say, the video data of Real-time Obtaining current television signal also converts frame of video to, extract a frame sf1 sampled point information and writing time sf1t1, the information of extracting the sampled point of sample fragment the first frame of video rf1 from sampling chained list l1, if frame sf1 is identical with the information of the sampled point of frame rf1, is recorded in the time point sf1t1 of frame sf1 in video queue q2; If not identical, the second frame of video rf2 of frame sf1 and sample fragment is being compared, until compare and identically the time point sf1t1 of sf1 is recorded in video queue q2 with a certain frame of sampling in chained list.If compare all unsuccessfully, empty queue q2, the sf2 of frame once in target video frame is compared, by that analogy.If the time point of the tail of the queue of video queue q2 is deducted to the absolute value of the time point of team's head, be greater than the second predetermined threshold value (for example 10s), represent to have comprised in TV real time video data and in the sample fragment of recording, surpass a section of 10s, so now can judge and need zapping to the TV play channel of just now seeing (being target channel) from vision signal.
Should be understood that, can according to voice data matching result or video data matching result, judge whether coupling separately.So that improve accuracy, the present embodiment after voice data all mates with video data, think and will play TV programme, can switching channels.
In the present embodiment, described sampled point comprises fixed sample point and stochastical sampling point.As shown in Figure 3, in Fig. 3, black round dot is fixed sample point, and its position coordinates is fixed; Empty circles is stochastical sampling point, represents the point of stochastical sampling in each frame, its position coordinates change at random.The present embodiment only need mate the information of fixed sample point and stochastical sampling point, can reduce the comparison to all pixels, accelerates comparison time and reduces contrast workload; And the comparison of putting by stochastical sampling can also be guaranteed the accuracy of comparing result.
In the specific implementation, the set-up mode of described fixed sample point is: using the central point of frame of video as a fixed pixel point, in the peripheral direction of central point every the pixel of default count (as 100 pixels) as fixed sample point.
Further, the present embodiment also provides a kind of set-up mode of fixed sample point:
The whole frame of video ragged edge pixel of a week of take (is original video pixel, non-display screen image vegetarian refreshments) be frame, in horizontal, vertical direction, will be every the row, column at the pixel place of default count (as 100 pixels) as vertical line and horizontal line.Vertical line and horizontal intersection point are the position of the fixed sample point of selection.The position of stochastical sampling point is distributed in whole frame of video as far as possible.As shown in Figure 4, dotted line is the frame that the whole frame of video ragged edge pixel of a week surrounds.Dotted line h1/V1 for the be separated by column/row at pixel place of 100 pixels (i.e. the 102nd pixel, 1 pixel+100 pixel of frame) of frame.Solid line h2/V2 for the be separated by column/row at pixel place of 100 pixels (i.e. the 203rd pixel) of dotted line h1/V1, the like obtain solid line hn/Vn(n>1), ranks joining is fixed sample point.
Should be understood that, the default difference of counting, the position of the fixed sample point of extraction and number are not identical yet.The set-up mode of described fixed pixel point can also have other modes, as using the central point of frame of video as a fixed sample point, take central point as the center of circle, pixel every default count (as 150 pixels) is annulus, the pixel that annulus is divided into 10 parts is other fixed sample points, and the present embodiment is not restricted the set-up mode of fixed sample point.
Further, when carrying out video data comparison, can also only compare important frame of video, only obtain a frame of video and compare,, after recording sample fragment, described channel switching method also comprises:
Step a01, when sample fragment is play, according to pause instruction, suspend video playback, record current display frame;
Step a02, ejection input window, prompting user is to this display frame name;
Step a03, by the display frame names associate of the display frame of having recorded and input;
Step a04, the video data using the display frame of having recorded as sample fragment, the sampled point in extraction display frame and the information of sampled point storage.
User can play the sample fragment of recording, when being played to the every collection of TV play, start the picture (picture that shows TV play name having, or every collection TV play starts and next collection certain picture in all can that section of repeat playing) time, a button by remote controller sends pause instruction and makes to play and suspend, and selects this picture record and with TV play naming.Certainly, also can be in advance with TV play naming, then charged timeout display frame.When mating with the video data of target channel, can only compare with the frame of video of display frame.A kind of special circumstances when comparing important frame of video and can be understood as the video data of target channel and mate with the video data of sample fragment,, in step S200, the video data of Real-time Obtaining target channel also mates specifically and comprises with the video data of sample fragment:
The video data of step b111, Real-time Obtaining target channel, extract a plurality of target video frames mark frame number according to the order of sequence, extract the information of the sampled point of each target video frame;
Step b112, judge that whether the information of the information of sampled point of current goal frame of video and the sampled point of the frame of video of display frame is identical: if so, output matching result; Otherwise, continue to judge that whether the information of the sampled point of target video frame is identical with the frame of video of display frame.
Adopt the matching way of a frame of video, reduced amount of calculation, when there being a plurality of samples (Yi Ge TV station may play several different TV play in a day), the video data of playing so in real time just can be distinguished comparison from the frame of video of all different display frame (being the display frame that different TV play are selected), improve comparison success rate and accuracy, so only from the angle of video data, just can judge whether should switching channels, now without voice data is mated, wherein also can the frame of video of display frame be mated with the sample information of frame of video in above-mentioned sampling list simultaneously here simultaneously.
The embodiment of the present invention is the corresponding channel switching mechanism that a kind of filtering advertisements is provided also, and as shown in Figure 5, it comprisesstartup module 10,data extraction module 20,data processing module 30 and handover module 40.Describedstartup module 10 starts advertisement filter pattern, the target channel that mark need to switch.Sound, the video data ofdata extraction module 20 Real-time Obtaining target channel.Data processing module 30 mates the sound of Real-time Obtaining target channel, video data with sound, the video data of sample fragment, whereindata processing module 30 sound intermediate frequency data processing modules (not marking in figure) mate with the voice data of sample fragment for the voice data of Real-time Obtaining target channel, and its video data processing module (not marking in figure) is mated with the video data of sample fragment for the video data of Real-time Obtaining target channel; The TV programme that the user that described sample fragment is recorded for user pays close attention to is fixing sound, the video data of playing before playing.When the Voice & Video data of target channel and the Voice & Video Data Matching of sample fragment, describedhandover module 40 switches to target channel.Specifically please refer to above-mentioned execution mode.
In the specific implementation, the channel switching mechanism of described filtering advertisements also comprises remindingmodule 50 and records module 60.Remindingmodule 50 ejects input window according to input instruction, and prompting user inputs television programmetitle.Record module 60 and record current sound, video data according to the record command of input; And stop recording according to the halt instruction of input, the sound of having recorded, video data is associated with the television programme title of input, and be stored as a sample chips section.Specifically please refer to above-mentioned execution mode.
In order to reduce amount of calculation and the match time of frame of video, further, the channel switching mechanism of described filtering advertisements also comprises important frame logging modle 70, important frame processing module 80 and important frame extraction module 90.When described important frame logging modle 70 is play in sample fragment, according to pause instruction, suspend video playback, record current display frame.Important frame processing module 80 ejects input window, and prompting user is to this display frame name; And by the display frame names associate of the display frame of having recorded and input.The video data of important frame extraction module 90 using the display frame of having recorded as sample fragment, sampled point in the frame of video of extraction display frame and the information of sampled point storage, now, in data processing module 30 video data processing module for the video data of Real-time Obtaining target channel, extract a plurality of target video frames mark frame number according to the order of sequence, extract the information of the sampled point of each target video frame; Whether the information that judges the information of sampled point of current goal frame of video and the sampled point of the frame of video of display frame is identical: if so, output matching result; Otherwise, continue to judge that whether the information of the sampled point of target video frame is identical with the frame of video of display frame, this video data processing module also can be mated the sampling point information of frame of video in display frame frame of video and above-mentioned sampling list simultaneously simultaneously.
In sum, the channel switching method of filtering advertisements of the present invention and device, by start advertisement filter pattern according to user's request, record the target channel that before user pays close attention to TV programme and plays, fixedly playing audio-video data mark need to switch, the sound of Real-time Obtaining target channel, video data, and mate with sound, the video data of sample fragment; When the Voice & Video data of target channel and the Voice & Video Data Matching of sample fragment, switch to target channel; If when the advertisement of playing between TV programme, user changes channel like this, energy is sound, the video data of monitoring objective channel in real time, without user, grasp the time spot and just can before TV programme is play, switch back target channel, avoid user to cause missing TV programme to misvaluing of time spot.
Be understandable that, for those of ordinary skills, can be equal to replacement or change according to technical scheme of the present invention and inventive concept thereof, and all these changes or replacement all should belong to the protection range of the appended claim of the present invention.