CN106341638A - Method for adding watermarks to video for Android equipment production - Google Patents

Method for adding watermarks to video for Android equipment production Download PDF

Info

Publication number
CN106341638A
CN106341638A CN201610801369.1A CN201610801369A CN106341638A CN 106341638 A CN106341638 A CN 106341638A CN 201610801369 A CN201610801369 A CN 201610801369A CN 106341638 A CN106341638 A CN 106341638A
Authority
CN
China
Prior art keywords
data
video
time
added
array
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201610801369.1A
Other languages
Chinese (zh)
Inventor
黄旭
杨博
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
SICHUAN MWH INFORMATION SAFETY TECHNOLOGY Co Ltd
Original Assignee
SICHUAN MWH INFORMATION SAFETY TECHNOLOGY Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by SICHUAN MWH INFORMATION SAFETY TECHNOLOGY Co Ltd filed Critical SICHUAN MWH INFORMATION SAFETY TECHNOLOGY Co Ltd
Publication of CN106341638A publication Critical patent/CN106341638A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N5/00Details of television systems
    • H04N5/76Television signal recording
    • H04N5/91Television signal processing therefor
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N5/00Details of television systems
    • H04N5/76Television signal recording
    • H04N5/91Television signal processing therefor
    • H04N5/92Transformation of the television signal for recording, e.g. modulation, frequency changing; Inverse transformation for playback
    • H04N5/9201Transformation of the television signal for recording, e.g. modulation, frequency changing; Inverse transformation for playback involving the multiplexing of an additional signal and the video signal
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N5/00Details of television systems
    • H04N5/76Television signal recording
    • H04N5/91Television signal processing therefor
    • H04N5/93Regeneration of the television signal or of selected parts thereof

Abstract

The invention discloses a method for adding watermarks to videos for Android equipment production. The method comprises steps that S1, video coding analysis on an Android equipment source video stream is carried out; S2, a general RBG colorful space is coded and converted into an Android source video stream coding YUV mode; S3, the present machine time is calibrated; S4, real-time watermark adding is customized; and S5, real-time time stamp adding is carried out. The method is advantaged in that 1, use restrictions are relatively in a low quantity, and the method supports most of Android platform equipment having cameras; 2, real-time adding to any customized watermark pictures not surpassing video dimensions can be realized during recording; 3, a CPU and a GPU of intelligent equipment can be utilized to carry out video adding, and dependence on a special video coding/decoding chip of traditional recording equipment can be avoided; and 4, the time of a present time zone can be precisely acquired under the Internet, and precise time stamp watermark adding is carried out.

Description

A kind of method that video for Android device generation adds watermark
Technical field
The present invention relates to field of information security technology, add watermark particularly to a kind of video for Android device generation Method.
Background technology
In evidence obtaining or monitoring etc., some need recorded video the application scenarios achieving, it usually needs be equipped with the video of specialty Record or monitoring device.These equipment cost itself is higher, and operation and maintenance cost is also higher.The recording arrangement energy of specialty Enough realize the video record of fine definition, but volume is generally larger, be difficult to carry with.Meanwhile, in application scenes In it may be necessary to be in real time video interpolation time watermark or self-defining image watermark.The former interpolation function is generally at some There is realization in professional equipment, but the latter is typically all to be added by post-production.This allows for the real-time of added watermark Not strong.Meanwhile, specialty is recorded or monitoring device can increase real-time time stamp in video, but pattern is single, generally Can only be using predefined single form it is impossible to meet various demand.Android smartphone is being readily available now The equipment of kind, the photographic head pixel that it is equipped with is higher, and smart machine equally can support the recording of HD video under normal circumstances.This Kind equipment is easily carried, easy to use and use less-restrictive, but the recording function of Android intelligent equipment is not carried out the time Stamp or the interpolation of other self-defined watermarks.This allows for cannot directly carrying out using Android intelligent equipment in above-mentioned application scenarios Video record.
Content of the invention
The present invention is directed to the defect of prior art, there is provided a kind of video for Android device generation adds the side of watermark Method, can effectively solve the problem that the problem that above-mentioned prior art exists.
A kind of method that video for Android device generation adds watermark, comprises the following steps:
The Video Coding Analysis of the raw video flowing in s1: Android device source, enter to the special yuv structure of Android primary frame of video Row parsing;
S2: general rbg color space coding is converted to ARIXTRA source and gives birth to video stream encryption yuv form;
S3: the machine time calibration;
S4: self-defined watermark is added in real time, this step You Liangge branch, one adds for word, and two add for image, right After frame of video is obtained and added watermark, frame is sent into Video coding and blender, carries out transcoding and output;
S5 timestamp adds in real time.
Preferably, the detailed step of s1 is as follows:
S11: frame of video is given birth in the source that obtains, is that Android device camera adds preview readjustment, opens camera, and in preview readjustment Obtain frame of video, this frame is data to be analyzed;
S12: separate gradation data and color data;
S13: analysis color data, from the beginning of gradation data 0 position, adjacent four pixels are one group, by color data In from 0 beginning one or one group of data be controlled;If dimension of picture is width*height, then be designated as down 0,1, width, The gradation data of width+1, in its color, v passage is width*height, and u passage is then width*height+1, subsequently counts According to by that analogy.
Preferably, the detailed step of s12 is as follows:
S121: set the dimension of picture getting as width*height pixel;
S122: be designated as under in peek group 0 under be designated as the data of width*height-1, as gradation data;
S123: this gradation data is output into picture, then obtains the black and white picture of no color, gradation data is demonstrate,proved Bright;
S124: remainder in peek group, as color data.
Preferably, the detailed step of s2 is as follows:
S21:rbg data is converted to current yuv420 data;First rbg data is read in array, open from first pixel Begin, every three take a secondary data, as the rbg data of current pixel, can obtain phase using current rbg and yuv420 transfer algorithm Answer yuv420 data;
S22:yuv420 is converted to the nv21 form that the raw video in ARIXTRA source is supported, because yuv420 data is given birth to androd source The color component of video is incompatible to be changed it is therefore desirable to enter row format.Specific switch process is:
S221: gray portion former state value;
S222: after extracting gradation data, take v data one first, be placed in first after gradation data.Take u data one again Position, after being placed in a v data, hereafter vu data all order value cross arrangement, holding v0u0v1u1 ... vnun's is suitable Sequence.
Preferably, s3's specifically comprises the following steps that
S31: definition time migration storage position, static overall variable date_offset defined in constants file, For storage time side-play amount;This side-play amount represents the difference between the time of the machine and network time;
S32: obtain network time as follows with time migration step:
S321: call urlconntection to access national time service central server, obtain data and parse.Here obtain To data be time data in units of millisecond.
S322: calculate time offset, obtain the machine time using system system.currentmillis (), calculate this Machine time and the difference of network time, store to offset storage position;This value is tape symbol long;
S33: define actual time, define getcurrentdate method, current time in system is used as benchmark, with when Between deviant be added, obtain current actual time, and be converted using data object and become yyyy-mm-dd hh:mm:ss Form, returns to caller.
Preferably, s4's specifically comprises the following steps that
S41: word adds, and step is as follows:
S411: obtain word lattice coding, using current word lattice transfer algorithm, text conversion to be converted is to retouch State the array of dot matrix;This dot matrix array is the y data of watermark to be added, stores the byte array become famous as pretext;
S412: define text color uv value, text color to be added is converted to the description of uv from the describing mode of rbg The rbg value of color to be added, because y data has existed, now only need to be converted to yuv value by mode;Here will lead to The yuv algorithm of row improves, and abandons and calculates the y passage obtaining, only retains the value of uv passage;Final acquisition one u value and Individual v value;
S413: obtain frame of video to be added and be added;
S42 image adds, and specifically comprises the following steps that
Picture to be added is converted into by s421: the acquisition of picture coding array first by general method or instrument Bmp format-pattern, then removes the head of the bmp image of acquisition;First 56 of bmp image is header, reads from the beginning of the 57th Remainder data enter internal memory, be placed in prepic array;Can get the yuv data of image to be added;
S422: obtain frame of video to be added and be added.
Preferably, the detailed step of s413 is as follows:
From the x of frame of video, y location starts to add watermark for s4131: setting, is that camera adds callback interface, in callback interface Getframedata method in get the frame of video of recording in real time, and be saved as the byte array of entitled src;
S4132: by the memory address mappings of the src getting array in the jni of bottom;
S4133: the pointer p pointing to src is offset to position to be added, according to starting the skew x, the y that specify before adding, will Pointer p moves to y*width+x position, and add up in the value of p y*width+x;
S4134: from the beginning of current p indication deviation post, travel through the data in src array region of memory, simultaneously traversal step The pretext dot matrix coding getting in rapid s411;When pretext array traverses the data of non-zero x00, by pretext phase The data answering position writes in the internal memory of p pointer current location, repeats aforesaid operations until pretext array traversal terminates;
S4135: after y passage has added, according to the arrangement rule of the frame of video getting in s22, calculate src array The address of the uv data of this position, u the and v data that s412 is got writes relevant position, and the address of v can be according to p+y* Width/2+x calculates, and the address of u is then v+1;
It should be noted that step s4134 and s4135 must be carried out simultaneously.
Preferably, the detailed step of described s422 is as follows:
From the x of frame of video, y location starts to add watermark for s4231: setting, is that camera adds callback interface, in callback interface Getframedata method in get the frame of video of recording in real time, and be saved as the byte array of entitled src;
S4232: by the memory address mappings of the src getting array in the jni of bottom;
S4233: the pointer p pointing to src is offset to position to be added, according to starting the skew x, the y that specify before adding, will Pointer p moves to y*width+x position, and add up in the value of p y*width+x;
S4234: set picture size to be superimposed as w*h, if prepic current location data is not 0x00 or 0xff, will The relevant position of the synchronous src array of p pointer indication being incremented by of data write of prepic current location, until travel through to Terminate during the w*h-1 position of prepic;
S4235: to after src write data, obtain u the and v data of prepic current pixel, and write the data into src On uv component belonging to the y data of relevant position, then proceed to traversal until completing to travel through.
Preferably, the detailed step of s5 is as follows:
S51: obtain prover time, the current time is obtained by accompanying method in s3, and is converted into character string, wait to add Plus;
S52: build conventional word lattice mapping array, in advance timestamp is added needed number and symbol is converted to coding Array, and using ascii code as index, it is compiled into static constant, for retrieving in adding procedure and directly using, define each word The dot matrix size of symbol, describes its size used here as n*n;
S53: timestamp watermark is added, and its detailed step is as follows:
S531: by the address of cache of the calibrated time character string getting to jni layer;
S532: each character code in character string is converted to ascii value, and the dot matrix number of each character of acquisition of tabling look-up Group;
S533: searching loop character string, dot matrix array is superimposed in frame of video using the step described by s413, and will The x value of the side-play amount of superposition next time increases n.Until traversal completes.
Compared with prior art it is an advantage of the current invention that: 1, use less-restrictive, support that the overwhelming majority has photographic head Android platform equipment;2nd, when recording, any self-defined watermark picture without departing from video size can be added in real time; 3rd, video interpolation can be carried out using cpu and gpu of smart machine it is not necessary to rely on special video in traditional video recording equipment to compile solution Code chip;4th, accurately obtain the time of current time zone under networking situation and carry out accurately timestamp watermark interpolation.
Brief description
Fig. 1 is the main flow chart of the embodiment of the present invention;
Fig. 2 is the code pattern obtaining after embodiment of the present invention rbg is changed with yuv420;
Fig. 3 is converted to, for embodiment of the present invention yuv420, the nv21 said shank figure that the raw video in android source is supported.
Specific embodiment
For making the objects, technical solutions and advantages of the present invention become more apparent, by the following examples, the present invention is done into One step describes in detail.
As shown in figure 1, a kind of method that video for Android device generation adds watermark, comprise the following steps:
The Video Coding Analysis of the raw video flowing in s1: Android device source;
The raw video data in source that photographic head produces is usually yuv form.But the data that ARIXTRA photographic head produces is set with other Standby different, generally when calling to ARIXTRA photographic head, need to select the video parameter of nv21 form.This parameter then table Show and describe frame of video using yuv color space.Need exist for the special yuv structure of ARIXTRA primary sound frame of video is parsed, Its detailed step is as follows:
S11: frame of video is given birth in the source that obtains, is that Android device camera adds preview readjustment, opens camera, and in preview readjustment Obtain frame of video, this frame is data to be analyzed.
S12: separate gradation data and color data, its detailed step is as follows:
S121: set the dimension of picture getting as width*height pixel;
S122: be designated as under in peek group 0 under be designated as the data of width*height-1, as gradation data;
S123: this gradation data is output into picture, then obtains the black and white picture of no color, gradation data is demonstrate,proved Bright;
S124: remainder in peek group, as color data.
S13: analysis color data;
According to the storage mode of standard yuv420 data, color and gradation data are 1 relations to 4.I.e. from gray scale Data 0 position starts, adjacent four pixels be one group, by color data from 0 one or one group of data controlled System.Equally set dimension of picture as width*height.Then can determine that, under be designated as 0,1, width, the gradation data of width+1, its In color, v passage is width*height, and u passage is then width*height+1, and follow-up data is by that analogy;Android device uv Component is arranged as v0u0, v1u1 ... vnun.
S2: general rbg color space coding is converted to android source and gives birth to video stream encryption yuv form;
Current color space is rbg, will each pixel of image bluish-green be described using three parameters are red.For convenience of right Yuv format video frame is added, and needs for common rgb spatial color to be converted to yuv form.Its detailed step is as follows:
S21:rbg data is converted to current yuv420 data;
First rbg data is read in array, from the beginning of first pixel, every three take a secondary data, as current pixel Rbg data.Corresponding yuv420 data can be obtained using current rbg to yuv420 transfer algorithm, the coding obtaining after conversion is such as Shown in Fig. 2.
S22:yuv420 is converted to the nv21 form that the raw video in android source is supported, due to yuv420 data and androd The color component of the raw video in source is incompatible to be changed it is therefore desirable to enter row format.Specific transfer algorithm can be described as:
S221: gray portion former state value;
S222: after extracting gradation data, take v data one first, be placed in first after gradation data.Take u data one again Position, after being placed in a v data, hereafter vu data all order value cross arrangement, holding v0u0v1u1 ... vnun's is suitable Sequence.
Coding described by Fig. 2 is changed using said method, the Android system described by Fig. 3 can be obtained Yuv (saying it the is nv21 form above) form supported.
S3: the machine time calibration: time calibration is the basis of real-time recording, the accurate and real time can be used for regarding The timestamp of frequency adds;Process require that android equipment is able to access that the Internet.Under normal circumstances, application cannot directly set Put the Android system time, therefore this patent devises a set of simple and effective time calibration mechanism;Specifically comprise the following steps that
S31: definition time migration storage position, static overall variable date_offset defined in constants file, For storage time side-play amount;This side-play amount represents the difference between the time of the machine and network time;
S32: obtain network time as follows with time migration step:
S321: call urlconntection to access national time service central server, obtain data and parse.Here obtain To data be time data in units of millisecond.
S322: calculate time offset, obtain the machine time using system system.currentmillis (), calculate this Machine time and the difference of network time, store to offset storage position;This value is tape symbol long.
S33: define actual time, define getcurrentdate method, current time in system is used as benchmark, with when Between deviant be added, obtain current actual time, and be converted using data object and become yyyy-mm-dd hh:mm:ss Form, returns to caller.
S4: self-defined watermark is added in real time
Watermark is added in real time to be needed to use the achievement of the big step of above-mentioned s1, s2 two.This step You Liangge branch, one is word Add, two add for image.After frame of video is obtained and added watermark, frame is sent into Video coding and blender, enters Row transcoding and output.Specifically comprise the following steps that
It is as follows that s41: word adds step:
S411: obtain word lattice coding, using current word lattice transfer algorithm, text conversion to be converted is to retouch State the array of dot matrix;This dot matrix array is the y data of watermark to be added, stores the byte array become famous as pretext.
S412: define text color uv value, need exist for being converted to text color to be added from the describing mode of rbg The describing mode of uv.Because y data has existed, now only the rbg value of color to be added need to be converted to yuv value.
Here current yuv algorithm is improved, abandon and calculate the y passage obtaining, only retain the value of uv passage;Finally Obtain a u value and a v value.
S413: obtain frame of video to be added and be added, set x watermark to be added being added to video, y position here Put, that is, from the x of frame of video, y location starts to add watermark.
Its step is as follows:
S4131: add callback interface for camera, get recording in the getframedata method of callback interface in real time Frame of video, and be saved as the byte array of entitled src;
S4132: by the memory address mappings of the src getting array in the jni of bottom;
S4133: the pointer p pointing to src is offset to position to be added, according to starting the skew x, the y that specify before adding, will Pointer p moves to y*width+x position, and add up in the value of p y*width+x;
S4134: from the beginning of current p indication deviation post, travel through the data in src array region of memory, simultaneously traversal step The pretext dot matrix coding getting in rapid s411;When pretext array traverses the data of non-zero x00, by pretext phase The data answering position writes in the internal memory of p pointer current location, repeats aforesaid operations until pretext array traversal terminates.
S4135: after y passage has added, according to the arrangement rule of the frame of video getting in s22, calculate src array The address of the uv data of this position, u the and v data that s412 is got writes relevant position, and the address of v can be according to p+y* Width/2+x calculates, and the address of u is then v+1.
It should be noted that step s4134 and s4135 must be carried out simultaneously.
S42 image adds, and specifically comprises the following steps that
S421: the acquisition of picture coding array
First by general method or instrument, picture to be added is converted into bmp format-pattern, then removes and obtain Bmp image head;First 56 of bmp image is header, reads and enters internal memory from the remainder data of the 57th beginning, is placed on In prepic array;Can get the yuv data of image to be added.
S422: obtain frame of video to be added and be added, its detailed step is as follows:
S4231: add callback interface for camera, get recording in the getframedata method of callback interface in real time Frame of video, and be saved as the byte array of entitled src;
S4232: by the memory address mappings of the src getting array in the jni of bottom;
S4233: the pointer p pointing to src is offset to position to be added, according to starting the skew x, the y that specify before adding, will Pointer p moves to y*width+x position, and add up in the value of p y*width+x;
S4234: set picture size to be superimposed as w*h, if prepic current location data is not 0x00 or 0xff, will The relevant position of the synchronous src array of p pointer indication being incremented by of data write of prepic current location, until travel through to Terminate during the w*h-1 position of prepic;
S4235: to after src write data, obtain u the and v data of prepic current pixel, and write the data into src On uv component belonging to the y data of relevant position, then proceed to traversal until completing to travel through.
S5 timestamp adds in real time, and detailed step is as follows:
S51: obtain prover time, the current time is obtained by accompanying method in s3, and is converted into character string, wait to add Plus;
S52: build conventional word lattice mapping array, for ensureing real-time, reduce the number in watermark adding procedure as far as possible According to process time, improve real-time, in advance timestamp is added needed number and symbol is converted to coding array, and with ascii Code, as index, is compiled into static constant, for retrieving in adding procedure and directly using, can define the point of each character here Battle array size, describes its size used here as n*n.
S53: timestamp watermark is added, and its detailed step is as follows:
S531: by the address of cache of the calibrated time character string getting to jni layer;
S532: each character code in character string is converted to ascii value, and the dot matrix number of each character of acquisition of tabling look-up Group;
S533: searching loop character string, dot matrix array is superimposed in frame of video using the step described by s413, and will The x value of the side-play amount of superposition next time increases n.Until traversal completes.For increasing real-time, can be by the step of uv superposition in text addition Rapid omission, is only overlapped to the data of y passage, no longer calculates the address of uv passage, also uv passage is not overlapped, from And time-consuming increase ageing.
Those of ordinary skill in the art will be appreciated that, embodiment described here is to aid in reader and understands this Bright implementation is it should be understood that protection scope of the present invention is not limited to such special statement and embodiment.Ability The those of ordinary skill in domain can according to these technology disclosed by the invention enlightenment make various without departing from the present invention essence its Its various concrete deformation and combination, these deformation and combination are still within the scope of the present invention.

Claims (9)

1. a kind of video for Android device generation adds the method for watermark it is characterised in that comprising the following steps:
The Video Coding Analysis of the raw video flowing in s1: Android device source, solve to the special yuv structure of Android primary frame of video Analysis;
S2: general rbg color space coding is converted to ARIXTRA source and gives birth to video stream encryption yuv form;
S3: the machine time calibration;
S4: self-defined watermark is added in real time, this step You Liangge branch, one adds for word, and two add for image, to video After frame is obtained and added watermark, frame is sent into Video coding and blender, carries out transcoding and output;
S5 timestamp adds in real time.
2. a kind of video for Android device generation according to claim 1 add watermark method it is characterised in that The detailed step of s1 is as follows:
S11: frame of video is given birth in the source that obtains, is that Android device camera adds preview readjustment, opens camera, and obtain in preview readjustment Frame of video, this frame is data to be analyzed;
S12: separate gradation data and color data;
S13: analysis color data, from the beginning of gradation data 0 position, adjacent four pixels be one group, by color data from 0 Start one or one group of data be controlled;If dimension of picture is width*height, then be designated as down 0,1, width, width + 1 gradation data, in its color, v passage is width*height, and u passage is then width*height+1, and follow-up data is with this Analogize.
3. a kind of video for Android device generation according to claim 2 add watermark method it is characterised in that The detailed step of s12 is as follows:
S121: set the dimension of picture getting as width*height pixel;
S122: be designated as under in peek group 0 under be designated as the data of width*height-1, as gradation data;
S123: this gradation data is output into picture, then obtains the black and white picture of no color, gradation data is proved;
S124: remainder in peek group, as color data.
4. a kind of video for Android device generation according to claim 2 add watermark method it is characterised in that The detailed step of s2 is as follows:
S21:rbg data is converted to current yuv420 data;First rbg data is read in array, from the beginning of first pixel, often Three take a secondary data, as the rbg data of current pixel, can be obtained corresponding using current rbg and yuv420 transfer algorithm Yuv420 data;
S22:yuv420 is converted to the nv21 form that the raw video in ARIXTRA source is supported, because yuv420 data gives birth to video with androd source Color component incompatible it is therefore desirable to enter row format conversion.Specific switch process is:
S221: gray portion former state value;
S222: after extracting gradation data, take v data one first, be placed in first after gradation data.Take u data one again, put After a v data, hereafter vu data all order value cross arrangement, keep v0u0v1u1 ... vnun order be Can.
5. a kind of video for Android device generation according to claim 4 add watermark method it is characterised in that S3 specifically comprises the following steps that
S31: define time migration storage position, static overall variable date_offset, is used for defined in constants file Storage time side-play amount;This side-play amount represents the difference between the time of the machine and network time;
S32: obtain network time as follows with time migration step:
S321: call urlconntection to access national time service central server, obtain data and parse.Here get Data is the time data in units of millisecond.
S322: calculate time offset, obtain the machine time using system system.currentmillis (), when calculating the machine Between difference with network time, store to offset storage position;This value is tape symbol long;
S33: define actual time, define getcurrentdate method, current time in system is used as benchmark, inclined with the time Shifting value is added, and obtains current actual time, and is converted using data object and becomes yyyy-mm-dd hh:mm:ss shape Formula, returns to caller.
6. a kind of video for Android device generation according to claim 5 add watermark method it is characterised in that S4 specifically comprises the following steps that
S41: word adds, and step is as follows:
S411: obtain word lattice coding, using current word lattice transfer algorithm, text conversion to be converted is description point The array of battle array;This dot matrix array is the y data of watermark to be added, stores the byte array become famous as pretext;
S412: define text color uv value, text color to be added is converted to the description side of uv from the describing mode of rbg The rbg value of color to be added, because y data has existed, now only need to be converted to yuv value by formula;Here will pass through Yuv algorithm improve, abandon calculate obtain y passage, only retain uv passage value;Finally obtain a u value and a v Value;
S413: obtain frame of video to be added and be added;
S42 image adds, and specifically comprises the following steps that
Picture to be added is converted into bmp lattice first by general method or instrument by s421: the acquisition of picture coding array Formula image, then removes the head of the bmp image of acquisition;First 56 of bmp image is header, reads from the 57th remaining starting Data enters internal memory, is placed in prepic array;Can get the yuv data of image to be added;
S422: obtain frame of video to be added and be added.
7. a kind of video for Android device generation according to claim 6 add watermark method it is characterised in that The detailed step of s413 is as follows:
From the x of frame of video, y location starts to add watermark for s4131: setting, is that camera adds callback interface, in callback interface Get the frame of video of recording in getframedata method in real time, and be saved as the byte array of entitled src;
S4132: by the memory address mappings of the src getting array in the jni of bottom;
S4133: the pointer p pointing to src is offset to position to be added, according to starting the skew x, the y that specify before adding, by pointer P moves to y*width+x position, and add up in the value of p y*width+x;
S4134: from the beginning of current p indication deviation post, travel through the data in src array region of memory, traversal step simultaneously The pretext dot matrix coding getting in s411;When pretext array traverses the data of non-zero x00, pretext is corresponding The data of position writes in the internal memory of p pointer current location, repeats aforesaid operations until pretext array traversal terminates;
S4135: after y passage has added, according to the arrangement rule of the frame of video getting in s22, calculate this position of src array The address of the uv data put, u the and v data that s412 is got writes relevant position, and the address of v can be according to p+y*width/ 2+x calculates, and the address of u is then v+1;
It should be noted that step s4134 and s4135 must be carried out simultaneously.
8. a kind of video for Android device generation according to claim 6 add watermark method it is characterised in that The detailed step of described s422 is as follows:
From the x of frame of video, y location starts to add watermark for s4231: setting, is that camera adds callback interface, in callback interface Get the frame of video of recording in getframedata method in real time, and be saved as the byte array of entitled src;
S4232: by the memory address mappings of the src getting array in the jni of bottom;
S4233: the pointer p pointing to src is offset to position to be added, according to starting the skew x, the y that specify before adding, by pointer P moves to y*width+x position, and add up in the value of p y*width+x;
S4234: set picture size to be superimposed as w*h, if prepic current location data is not 0x00 or 0xff, by prepic The relevant position of the synchronous src array of p pointer indication being incremented by of data write of current location, until travel through to the w* of prepic Terminate during h-1 position;
S4235: to after src write data, obtain u the and v data of prepic current pixel, and it is corresponding to write the data into src On uv component belonging to the y data of position, then proceed to traversal until completing to travel through.
9. a kind of video for Android device generation according to claim 6 add watermark method it is characterised in that The detailed step of s5 is as follows:
S51: obtain prover time, the current time is obtained by accompanying method in s3, and is converted into character string, to be added;
S52: build conventional word lattice mapping array, in advance timestamp is added needed number and symbol is converted to coded number Group, and using ascii code as index, it is compiled into static constant, for retrieving in adding procedure and directly using, define each character Dot matrix size, used here as n*n, its size is described;
S53: timestamp watermark is added, and its detailed step is as follows:
S531: by the address of cache of the calibrated time character string getting to jni layer;
S532: each character code in character string is converted to ascii value, and the dot matrix array of each character of acquisition of tabling look-up;
S533: searching loop character string, dot matrix array is superimposed in frame of video using the step described by s413, and by next time The x value of the side-play amount of superposition increases n.Until traversal completes.
CN201610801369.1A 2016-07-01 2016-09-05 Method for adding watermarks to video for Android equipment production Pending CN106341638A (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610512038 2016-07-01
CN2016105120386 2016-07-01

Publications (1)

Publication Number Publication Date
CN106341638A true CN106341638A (en) 2017-01-18

Family

ID=57823705

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610801369.1A Pending CN106341638A (en) 2016-07-01 2016-09-05 Method for adding watermarks to video for Android equipment production

Country Status (1)

Country Link
CN (1) CN106341638A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108882029A (en) * 2018-06-29 2018-11-23 银河威尔科技(北京)有限公司 A kind of decryption of video method and apparatus
CN110337045A (en) * 2019-06-04 2019-10-15 青岛海信网络科技股份有限公司 The system and two dimensional code adding method of a kind of pair of video source addition two dimensional code
CN112218018A (en) * 2020-09-30 2021-01-12 武汉中仪物联技术股份有限公司 Method, system and medium for superimposing text information on digital video signal

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102244740A (en) * 2011-06-28 2011-11-16 青岛海信移动通信技术股份有限公司 Method and apparatus for adding video information
US20130097630A1 (en) * 2011-10-14 2013-04-18 Tony F. Rodriguez Arrangements employing content identification and/or distribution identification data
CN104063839A (en) * 2014-07-02 2014-09-24 深圳市朵唯志远科技有限公司 Method and system of accelerating picture synthesis

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102244740A (en) * 2011-06-28 2011-11-16 青岛海信移动通信技术股份有限公司 Method and apparatus for adding video information
US20130097630A1 (en) * 2011-10-14 2013-04-18 Tony F. Rodriguez Arrangements employing content identification and/or distribution identification data
CN104063839A (en) * 2014-07-02 2014-09-24 深圳市朵唯志远科技有限公司 Method and system of accelerating picture synthesis

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
AZRAELLY: "图文详解YUV420数据格式", 《博客园》 *

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108882029A (en) * 2018-06-29 2018-11-23 银河威尔科技(北京)有限公司 A kind of decryption of video method and apparatus
CN108882029B (en) * 2018-06-29 2020-07-31 银河威尔科技(北京)有限公司 Video decryption method and device
CN110337045A (en) * 2019-06-04 2019-10-15 青岛海信网络科技股份有限公司 The system and two dimensional code adding method of a kind of pair of video source addition two dimensional code
CN110337045B (en) * 2019-06-04 2021-12-14 海信集团有限公司 System for adding two-dimensional code to video source and two-dimensional code adding method
CN112218018A (en) * 2020-09-30 2021-01-12 武汉中仪物联技术股份有限公司 Method, system and medium for superimposing text information on digital video signal

Similar Documents

Publication Publication Date Title
CN106686333A (en) Method for producing video added watermarks for Android equipment
CN101690190B (en) Imaging device and formation method
CN102693538B (en) Generate the global alignment method and apparatus of high dynamic range images
CN102308584B (en) Multi-view image encoding method, multi-view image decoding method, multi-view image encoding device, and multi-view image decoding device
CN106231205B (en) Augmented reality mobile terminal
JP6316910B2 (en) Reference card for scene-based metadata capture
JP4612845B2 (en) Image processing apparatus and method
CN106851386B (en) Method and device for realizing augmented reality in television terminal based on Android system
CN106341638A (en) Method for adding watermarks to video for Android equipment production
KR102617258B1 (en) Image processing method and apparatus
US20190246087A1 (en) Image processing device, reproduction device, image processing method, and reproduction method
CN109691117A (en) Image processing system and image treatment method
CN101401108B (en) Data processing method of motion picture content
US20220019398A1 (en) Stitching display system and image processing method of the same
EP1301042A2 (en) Method for coding data of special effect
CN114040246A (en) Image format conversion method, device, equipment and storage medium of graphic processor
WO2023010751A1 (en) Information compensation method and apparatus for highlighted area of image, device, and storage medium
CN107979766B (en) Content streaming system and method
CN101459854B (en) Encoding/decoding apparatus for picture compression and encoding/decoding method therefor
CN106599010B (en) Graph code searching method
CN112565887B (en) Video processing method, device, terminal and storage medium
WO2022141515A1 (en) Video encoding method and device and video decoding method and device
CN109584275B (en) Target tracking method, device, equipment and storage medium
KR101937718B1 (en) Image Processing Method and Apparatus Using Bus Protocol Based Valid Pixel
CN108495053B (en) Metadata processing method and device for high dynamic range signal

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information
CB02 Change of applicant information

Address after: 641000 Sichuan province Neijiang City Songshan Road No. 253

Applicant after: Sichuan Miwu Traceless Science and Technology Co., Ltd.

Address before: 641000 Sichuan province Neijiang City Songshan Road No. 253

Applicant before: SICHUAN MWH INFORMATION SAFETY TECHNOLOGY CO., LTD.

RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20170118