CN109660745A - Video recording method, device, terminal and computer readable storage medium - Google Patents

Video recording method, device, terminal and computer readable storage medium Download PDF

Info

Publication number
CN109660745A
CN109660745A CN201811586656.0A CN201811586656A CN109660745A CN 109660745 A CN109660745 A CN 109660745A CN 201811586656 A CN201811586656 A CN 201811586656A CN 109660745 A CN109660745 A CN 109660745A
Authority
CN
China
Prior art keywords
video
camera
video recording
preset
light
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
CN201811586656.0A
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.)
WeBank Co Ltd
Original Assignee
WeBank 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 WeBank Co Ltd filed Critical WeBank Co Ltd
Priority to CN201811586656.0A priority Critical patent/CN109660745A/en
Publication of CN109660745A publication Critical patent/CN109660745A/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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/234Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs
    • H04N21/2343Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs involving reformatting operations of video signals for distribution or compliance with end-user requests or end-user device requirements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/80Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
    • H04N21/85Assembly of content; Generation of multimedia applications
    • H04N21/854Content authoring
    • H04N21/85406Content authoring involving a specific file format, e.g. MP4 format

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Television Signal Processing For Recording (AREA)

Abstract

The invention discloses a kind of video recording methods, this method comprises: obtaining the collected encoding video pictures data of camera, the encoding video pictures data are converted to the video stream file of preset format;Obtain the camera it is current towards parameter;By the video stream file and it is described be sent to background server towards parameter so that the background server is according to the video stream file and described towards one video file of parameter synthesis.The invention also discloses a kind of video recording device, terminal and a kind of computer readable storage mediums.The present invention is able to solve in the prior art, and terminal carries out video record when carrying out recognition of face to realize, existing video record is ineffective, needs the problem that SDK packet to be mounted is excessive and processing load is larger.

Description

Video recording method, device, terminal and computer readable storage medium
Technical field
The present invention relates to field of terminal technology more particularly to video recording method, device, terminal and computer-readable storages Medium.
Background technique
Currently, face recognition technology is applied in all kinds of identity authorization systems more and more widely, known based on face Other identity authorization system, it is usually required mainly for solve two problems, one is face verification, the other is In vivo detection.Wherein, living Physical examination survey is primarily used to confirm that collected face image data rather than is played back or puppet producing material from user Material.Requirement with each field to identity authorization system safety and reliability is higher and higher, in addition to face verification and living body are examined Except survey, also while requiring the video recorded when user carries out recognition of face and being sent to authenticate and deposit for monitoring party from the background Card.
In the prior art, it is recorded to realize that side carries out recognition of face (including face verification and In vivo detection) Bian Jinhang video System, in video record, after camera data and audio data are converted to predetermined format by terminal needs, by being integrated in SDK (one for handling the third party of audio frequency and video by FFMpeg in (Software Development Kit, software development kit) Library) by audio, video data synthesize MP4 file reach backstage.The defect of this video recording method is: (1) terminal must be first Downloading is just able to achieve video record comprising the SDK packet of FFMpeg, and since terminal is all kinds of, certain terminal operating FFMpeg Performance is bad, causes user experience poor;(2) SDK externally provided as one, client are very sensitive to the size of SDK packet, FFMpeg is introduced, the packet size of 1MB is directly increased;It (3) include audio in the video file finally synthesized, and practical recognition of face Video authentication under scene does not need sound, so will lead to and increases the unnecessary processing load of terminal.
Summary of the invention
It is a primary object of the present invention to propose a kind of video recording method, device, terminal and computer-readable storage medium Matter, it is intended to solve in the prior art, terminal carries out video record when carrying out recognition of face to realize, existing video record Make problem ineffective, that need SDK packet to be mounted is excessive and processing load is larger.
To achieve the above object, the present invention provides a kind of video recording method, and the video recording method includes following step It is rapid:
The collected encoding video pictures data of camera are obtained, the encoding video pictures data are converted into default lattice The video stream file of formula;
Obtain the camera it is current towards parameter;
By the video stream file and it is described be sent to background server towards parameter so that the background server according to The video stream file and described towards one video file of parameter synthesis.
Optionally, the collected encoding video pictures data of acquisition camera, by the encoding video pictures data Before the step of being converted to the video stream file of preset format, further includes:
Video record instruction is received, is instructed according to the video record and calls camera;
Control the camera acquisition encoding video pictures data.
Optionally, described the step of controlling the camera acquisition encoding video pictures data, includes:
During the camera acquires encoding video pictures data, screen is controlled according to preset luminous parameters and is pressed The light of default kind of color is successively issued according to preset order, so that the camera successively acquires the light of default kind of the color Corresponding facial image forms human face image sequence, and wherein the light of each color corresponds to several frame facial images;
The disparity map between color adjacent two-by-two in the human face image sequence is obtained, difference graphic sequence is obtained;
The preset luminous parameters and the difference graphic sequence are sent to backstage light In vivo detection service, so that institute Whether state that light In vivo detection service judges the camera current shooting is true man;
When the detection knot that the camera current shooting for receiving the light In vivo detection service return is true man When fruit, step is executed: obtaining the collected encoding video pictures data of camera, the encoding video pictures data are converted to The video stream file of preset format.
Optionally, the disparity map obtained between color adjacent two-by-two in the human face image sequence, obtains difference The step of graphic sequence includes:
Identify the color change position in the human face image sequence;
Obtain the corresponding two frames facial image of two different colors of light at the color change position;
Two frame facial image corresponding to the light of described two different colours carries out variance analysis, obtains the face The disparity map of color mutated site;
The disparity map for taking all colours mutated site in the human face image sequence obtains difference graphic sequence.
Optionally, the step of encoding video pictures data are converted into the video stream file of preset format packet It includes:
When the encoding video pictures data got are yuv format, multimedia coding class MediaCodec is called The encoding video pictures data of the yuv format are converted to the video stream file of H264 format by class.
Optionally, the calling multimedia coding class MediaCodec class, by the video image coding yardage of the yuv format Include: according to the step of video stream file for being converted to H264 format
Multimedia coding class MediaCodec class is called, and obtains preset video tuning parameter;
According to the MediaCodec class and the preset video tuning parameter, by the video image of the yuv format Coded data is converted to the video stream file of H264 format.
Optionally, the video tuning parameter includes code rate, frame per second and the key frame interval of video.
Optionally, it is described obtain the camera it is current include: towards the step of parameter
The application programming interface for calling camera programm, gets the camera shooting by the application programming interface Head it is current towards parameter, wherein the camera is called by the camera programm.
In addition, to achieve the above object, the present invention also provides a kind of video recording device, the video recording device packet It includes:
Camera, for acquiring encoding video pictures data;
First obtains module, for obtaining the collected encoding video pictures data of camera, by the video image coding Code data are converted to the video stream file of preset format;
Second obtains module, for obtain the camera it is current towards parameter;
Sending module, for by the video stream file and it is described be sent to background server towards parameter so that described Background server is according to the video stream file and described towards one video file of parameter synthesis.
Optionally, described device further include:
Processing module instructs according to the video record for receiving video record instruction and calls camera;
Control module, for controlling the camera acquisition encoding video pictures data.
Optionally, the control module includes:
Control unit, for being shone during the camera acquires encoding video pictures data according to preset State modulator screen successively issues the light of default kind of color according to preset order so that the camera successively acquire it is described pre- If planting the corresponding facial image of light of color, human face image sequence is formed, wherein the light of each color corresponds to several frame people Face image;
Acquiring unit obtains difference for obtaining the disparity map between color adjacent two-by-two in the human face image sequence Different graphic sequence;
Transmission unit, for the preset luminous parameters and the difference graphic sequence to be sent to the inspection of backstage light living body Service is surveyed, so that whether what the light In vivo detection service judged the camera current shooting is true man;
Described first obtains module, is also used to work as when the camera for receiving the light In vivo detection service return When preceding shooting is the testing result of true man, the collected encoding video pictures data of camera are obtained, by the video image Coded data is converted to the video stream file of preset format.
Optionally, the acquiring unit includes:
Identify subelement, for identification the color change position in the human face image sequence;
Subelement is obtained, for obtaining the two different colors of light corresponding two at the color change position Frame facial image;
Subelement is analyzed, carries out difference for the corresponding two frames facial image of light to described two different colours Analysis, obtains the disparity map of the color change position;
The acquisition subelement, is also used to take the disparity map of all colours mutated site in the human face image sequence, obtains To difference graphic sequence.
Optionally, described first module is obtained, is also used to when the encoding video pictures data got be yuv format When, multimedia coding class MediaCodec class is called, the encoding video pictures data of the yuv format are converted into H264 format Video stream file.
Optionally, described first module is obtained, is also used to call multimedia coding class MediaCodec class, and obtain default Video tuning parameter;According to the MediaCodec class and the preset video tuning parameter, by the view of the yuv format Frequency image coded data is converted to the video stream file of H264 format.
In addition, to achieve the above object, the present invention also provides a kind of terminal, the terminal include: memory, processor and It is stored in the video record program that can be run on the memory and on the processor, the video record program is described The step of processor realizes video recording method as described above when executing.
In addition, to achieve the above object, it is described computer-readable the present invention also provides a kind of computer readable storage medium Video record program is stored on storage medium, the video record program realizes video as described above when being executed by processor The step of method for recording.
Video recording method proposed by the present invention, by transferring to background server to handle the synthesis of final video file, So that it is not necessary that comprising FFMpeg, this not only avoids performance existing for terminal operating FFMpeg is bad in the SDK packet of terminal downloads The problem of, the size of SDK packet is also reduced, in addition, the present invention is according only to video stream file and towards parameter synthesis final video File avoids the burden of terminal processes caused by audio recording.To which the present invention solves in the prior art, terminal is for reality Existing that video record is carried out when carrying out recognition of face, existing video record is ineffective, needs SDK packet to be mounted excessive, And the problem that processing load is larger.
Detailed description of the invention
Fig. 1 is the terminal structure schematic diagram for the hardware running environment that the embodiment of the present invention is related to;
Fig. 2 is the flow diagram of video recording method first embodiment of the present invention.
The embodiments will be further described with reference to the accompanying drawings for the realization, the function and the advantages of the object of the present invention.
Specific embodiment
It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, it is not intended to limit the present invention.
As shown in Figure 1, Fig. 1 is the terminal structure schematic diagram for the hardware running environment that the embodiment of the present invention is related to.
The terminal of that embodiment of the invention can be PC, be also possible to smart phone, tablet computer, portable computer etc. with aobvious Show the packaged type terminal device of function.
As shown in Figure 1, the terminal may include: processor 1001, such as CPU, network interface 1004, user interface 1003, memory 1005, communication bus 1002.Wherein, communication bus 1002 is for realizing the connection communication between these components. User interface 1003 may include display screen (Display), input unit such as keyboard (Keyboard), optional user interface 1003 can also include standard wireline interface and wireless interface.Network interface 1004 optionally may include that the wired of standard connects Mouth, wireless interface (such as WI-FI interface).Memory 1005 can be high speed RAM memory, be also possible to stable memory (non-volatile memory), such as magnetic disk storage.Memory 1005 optionally can also be independently of aforementioned processor 1001 storage device.
Optionally, terminal can also include camera, RF (Radio Frequency, radio frequency) circuit, sensor, audio Circuit, WiFi module etc..Wherein, sensor such as optical sensor, motion sensor and other sensors.Specifically, light Sensor may include ambient light sensor and proximity sensor, wherein ambient light sensor can according to the light and shade of ambient light come The brightness of display screen is adjusted, proximity sensor can close display screen and/or backlight when mobile terminal is moved in one's ear.As One kind of motion sensor, gravity accelerometer can detect the size of (generally three axis) acceleration in all directions, quiet Size and the direction that can detect that gravity when only, the application that can be used to identify mobile terminal posture are (such as horizontal/vertical screen switching, related Game, magnetometer pose calibrating), Vibration identification correlation function (such as pedometer, tap) etc.;Certainly, mobile terminal can also match The other sensors such as gyroscope, barometer, hygrometer, thermometer, infrared sensor are set, details are not described herein.
It will be understood by those skilled in the art that the restriction of the not structure paired terminal of terminal structure shown in Fig. 1, can wrap It includes than illustrating more or fewer components, perhaps combines certain components or different component layouts.
As shown in Figure 1, as may include that operating system, network are logical in a kind of memory 1005 of computer storage medium Believe module, Subscriber Interface Module SIM and video record program.
In terminal shown in Fig. 1, network interface 1004 is mainly used for connecting background server, carries out with background server Data communication;User interface 1003 is mainly used for connecting client (user terminal), carries out data communication with client;And processor 1001 can be used for calling the video record program stored in memory 1005, and execute in following video recording method embodiments Operation.
The specific embodiment of terminal of the present invention and each specific embodiment of following video recording methods are essentially identical, herein not It repeats.
Based on above-mentioned hardware configuration, video recording method embodiment of the present invention is proposed.
It is the flow diagram of video recording method first embodiment of the present invention referring to Fig. 2, Fig. 2, which comprises
Step S10 obtains the collected encoding video pictures data of camera, by the encoding video pictures data conversion For the video stream file of preset format;
The present embodiment video recording method is applied to the scene that terminal carries out authentication to user, and such as each type of financial is infused Volume, payment scene, wherein terminal can be the terminal for carrying Android operation system, be also possible to carry the end of other operating systems End.In authentication scene, the requirement with each field to identity authorization system safety and reliability is higher and higher, in addition to Except face verification and In vivo detection, also while requiring the video recorded when user carries out recognition of face and being sent to backstage for prison Pipe side is authenticated and is deposited card, that is, terminal needs to carry out recognition of face on one side, carries out video record on one side.The present embodiment master If the improvement made for video record scheme.
In the present embodiment, when carrying out video record, terminal acquires encoding video pictures data by camera first, i.e., Then the encoding video pictures data are converted to the video stream file of preset format by the data of video image portion, in order to Subsequent processing.
Specifically, the described the step of encoding video pictures data are converted to the video stream file of preset format, can be with It include: to call multimedia coding class MediaCodec class when the encoding video pictures data got are yuv format, The encoding video pictures data of the yuv format are converted to the video stream file of H264 format.
YUV is a kind of colour coding method, is often used in each video output component, and YUV is to photo or video volume When code, it is contemplated that the sensing capability of the mankind allows to reduce the bandwidth of coloration.In the present embodiment, when the video image coding got When code data are yuv format, terminal calls the multimedia coding class MediaCodec class of own system, by the view of the yuv format Frequency image coded data is converted to the video stream file of H264 format.Wherein, MediaCodec class can be used for accessing terminal bottom Multimedia coding-decoder, to realize encoding and decoding;H264 is a kind of video compression algorithm being commonly used, and passes through video figure As coded data is converted to H264 format, can be very good to realize video compress.
Further, the calling multimedia coding class MediaCodec class, by the encoding video pictures of the yuv format Data be converted to the step of video stream file of H264 format may include: call multimedia coding class MediaCodec class, and Obtain preset video tuning parameter;According to the MediaCodec class and the preset video tuning parameter, by the YUV The encoding video pictures data of format are converted to the video stream file of H264 format.
Specifically, target component that can in advance in terminal profile video tuning parameter as H264 compression algorithm, the mesh Mark parameter can be obtained by experiment, later, can call MediaCodec using the preset video tuning parameter as ginseng is entered Class is converted to the video flowing text of H264 format by the encoding video pictures data of yuv format by H264 video compression algorithm Part can so guarantee that the image definition of finally obtained video stream file and size meet actual application scenarios demand.
Further, video tuning parameter may include code rate, frame per second and the key frame interval of video.It preferably, can be with Tuning parameter is set are as follows: code rate 100kbps, frame per second 15fps and 5 frame of key frame interval, such value not only can satisfy identity The requirement to image definition is authenticated, and the video flowing size finally compressed is also more appropriate.
Certainly, other transformation rules can be used when specific implementation also to get video stream file, wherein transformation rule It can and flexible setting different according to the formats of encoding video pictures data.
Step S20, obtain the camera it is current towards parameter;
In the step, to synthesize final video file, terminal further obtain camera it is current towards parameter, the direction Parameter is used to indicate the relative position situation of the video of camera and recording.Due to for different terminals, the position of camera It sets and is likely located to the left above screen, to the right above screen, when face face screen, the video image of recording is not but with people Centered on face, it is so not easy to certification of the later period to video, to carry out direction correction to video image, needs to obtain camera and works as It is preceding towards parameter.
Specifically, step S20 may include: the application programming interface for calling camera programm, pass through the application Program Interfaces get the camera it is current towards parameter, wherein the camera is called by the camera programm.
In terminal recorded video, camera is called by the camera programm of terminal built-in, and terminal is by calling the camera journey The application programming interface of sequence, can get camera it is current towards parameter, this specifically can be with degree towards parameter Form, such as 0 degree, 90 degree, 180 degree etc..
Step S30, by the video stream file and it is described be sent to background server towards parameter so that the backstage take Device be engaged according to the video stream file and described towards one video file of parameter synthesis.
Later, terminal is sent to background server by the above-mentioned video stream file got and towards parameter, which takes Business device is used to provide the service of video file synthesis, can specifically be serviced and be realized by FFMpeg, FFmpeg be a set of can to use Come record, converted digital audio, video, and the open source computer program of stream can be translated into.Background server is receiving Video stream file and described towards after parameter, can be by FFmpeg order by the video stream file and towards parameter synthesis one The video file of MP4 format, and the video file is saved, so that supervisor checks at any time.
It should be noted that since the video authentication under practical recognition of face scene does not need sound, thus this implementation Example is only handled video image data, is realized under the premise of meeting actual video certification demand, is mitigated the place of terminal Reason burden.
The video recording method that the present embodiment proposes, by transferring to the synthesis of final video file at background server Reason, so that it is not necessary that comprising FFMpeg, this not only avoids performances existing for terminal operating FFMpeg not in the SDK packet of terminal downloads Good problem also reduces the size of SDK packet, in addition, the present embodiment is final according only to video stream file and towards parameter synthesis Video file avoids the burden of terminal processes caused by audio recording.To which the present embodiment solves in the prior art, terminal Video record is carried out when carrying out recognition of face in order to realize, existing video record is ineffective, needs SDK packet to be mounted Excessive and larger processing load problem.
Further, it is based on video recording method first embodiment of the present invention, proposes video recording method second of the present invention Embodiment.
It in the present embodiment, can also include: to receive video record instruction, according to the view before above-mentioned steps S10 Camera is called in frequency record command;Control the camera acquisition encoding video pictures data.
Wherein, video record instruction can be triggered manually by user, can also by terminal applies automatic trigger, such as with During the payment application of family using terminal, when the payment application receives payment instruction, that is, automatically generates video record and refer to It enables to carry out authentication to user.
After terminal receives video record instruction, itself camera is called, camera is then controlled and acquires video image coding Code data show customized face frame during controlling camera acquisition encoding video pictures data in application interface Control, with the video image acquired by the customized face frame control display, by the way that face frame is made into customized control, It can be convenient the style (border color fills gradual change, text color etc.) that user customizes face frame, meet the personalized need of user It asks.
Further, it is based on video recording method second embodiment of the present invention, proposes video recording method third of the present invention Embodiment.
In the present embodiment, the step of control camera acquisition encoding video pictures data may include: During the camera acquisition encoding video pictures data, screen is controlled according to preset order according to preset luminous parameters The light of default kind of color is successively issued, so that the camera successively acquires the corresponding face of light of default kind of the color Image forms human face image sequence, and wherein the light of each color corresponds to several frame facial images;Obtain the facial image sequence Disparity map in column between color adjacent two-by-two obtains difference graphic sequence;By the preset luminous parameters and the difference Graphic sequence is sent to backstage light In vivo detection service, so that the light In vivo detection service judges that the camera is currently clapped Whether what is taken the photograph is true man;It is true man's when receiving the camera current shooting that the light In vivo detection service returns When testing result, step is executed: the collected encoding video pictures data of camera are obtained, by the encoding video pictures data Be converted to the video stream file of preset format.
Specifically, during camera acquires encoding video pictures data, face In vivo detection, the people can be carried out The step of face In vivo detection specifically: firstly, successively being sent out according to preset luminous parameters controlling terminal screen according to preset order Preset the light of kind of color out, wherein the color category of light and quantity can with flexible choice, such as can from it is red, yellow, blue, Randomly select 4 kinds in the light of 6 kinds of colors such as purple, green, orange, then controlling terminal screen successively issued according to preset order this 4 The light of kind color, reflects according to light, and camera can successively collect the corresponding facial image of light of this 4 kinds of colors, by This forms a human face image sequence, and wherein the light of each color is all corresponding with several frame facial images;Then, the people is obtained Disparity map in face image sequence between color adjacent two-by-two, obtains difference graphic sequence, for example, terminal screen successively issue it is red, The light of this yellow, blue, purple 4 kinds of colors, then need to obtain reddish yellow respectively, champac, the difference between these adjacent colors of royal purple Figure, thus obtains a difference graphic sequence;Later, after above-mentioned preset luminous parameters and the difference graphic sequence being sent to together Platform light In vivo detection service works as end so that whether what the light In vivo detection service judged camera current shooting is true man Termination receives the camera current shooting of light In vivo detection service return when being the testing result of true man, i.e. execution step: The collected encoding video pictures data of camera are obtained, the encoding video pictures data are converted to the video of preset format Stream file, conversely, work as the camera current shooting for receiving light In vivo detection service return is not the testing result of true man When, video record and output error prompt information can be terminated.
By above-mentioned light In vivo detection, terminal can identify camera current shooting during video record Whether it is true man, further improves the safety and reliability of video record.
Further, it is based on video recording method 3rd embodiment of the present invention, proposes video recording method the 4th of the present invention Embodiment.
In the present embodiment, the disparity map obtained between color adjacent two-by-two in the human face image sequence, obtains It may include: the color change position in the identification human face image sequence to the step of difference graphic sequence;Obtain the color The corresponding two frames facial image of the two different colors of light of variant positions;To the light of described two different colours Corresponding two frames facial image carries out variance analysis, obtains the disparity map of the color change position;Take the face figure As the disparity map of all colours mutated site in sequence, difference graphic sequence is obtained.
In the present embodiment, to obtain difference graphic sequence, the color change position in human face image sequence can be identified first It sets, which refers to a kind of position of the facial image in human face image sequence by color change for another color It sets, for example terminal screen successively issues the light of this red, yellow, blue, purple 4 kinds of colors, then can identify from human face image sequence 3 color change positions out;Then, the corresponding two frames people of two different colors of light at color change position is obtained Face image, since for random color mutated site, the right and left is corresponding two frame of two different colors of light respectively Facial image can respectively obtain a frame facial image from the right and left at this time;Later, to the right and left from color change position The two frame facial images got carry out variance analysis, the disparity map of the color change position are obtained, for example, can be to two frame people The pixel coordinate pair of face image should do subtraction, to obtain the disparity map of two frame facial images;Finally, taking the face In image sequence the disparity map of all colours mutated site to get arrive difference graphic sequence.
By the above-mentioned means, the disparity map between color adjacent two-by-two in human face image sequence can be effectively got, Whether for the service of subsequent ray In vivo detection premise is provided for true man according to what difference graphic sequence judged camera current shooting Guarantee.
The present invention also provides a kind of video recording devices.Video recording device of the present invention includes:
Camera, for acquiring encoding video pictures data;
First obtains module, for obtaining the collected encoding video pictures data of camera, by the video image coding Code data are converted to the video stream file of preset format;
Second obtains module, for obtain the camera it is current towards parameter;
Sending module, for by the video stream file and it is described be sent to background server towards parameter so that described Background server is according to the video stream file and described towards one video file of parameter synthesis.
Further, described device further include:
Processing module instructs according to the video record for receiving video record instruction and calls camera;
Control module, for controlling the camera acquisition encoding video pictures data.
Further, the control module includes:
Control unit, for being shone during the camera acquires encoding video pictures data according to preset State modulator screen successively issues the light of default kind of color according to preset order so that the camera successively acquire it is described pre- If planting the corresponding facial image of light of color, human face image sequence is formed, wherein the light of each color corresponds to several frame people Face image;
Acquiring unit obtains difference for obtaining the disparity map between color adjacent two-by-two in the human face image sequence Different graphic sequence;
Transmission unit, for the preset luminous parameters and the difference graphic sequence to be sent to the inspection of backstage light living body Service is surveyed, so that whether what the light In vivo detection service judged the camera current shooting is true man;
Described first obtains module, is also used to work as when the camera for receiving the light In vivo detection service return When preceding shooting is the testing result of true man, the collected encoding video pictures data of camera are obtained, by the video image Coded data is converted to the video stream file of preset format.
Further, the acquiring unit includes:
Identify subelement, for identification the color change position in the human face image sequence;
Subelement is obtained, for obtaining the two different colors of light corresponding two at the color change position Frame facial image;
Subelement is analyzed, carries out difference for the corresponding two frames facial image of light to described two different colours Analysis, obtains the disparity map of the color change position;
The acquisition subelement, is also used to take the disparity map of all colours mutated site in the human face image sequence, obtains To difference graphic sequence.
Further, described first module is obtained, is also used to when the encoding video pictures data got be YUV lattice When formula, multimedia coding class MediaCodec class is called, the encoding video pictures data of the yuv format are converted into H264 lattice The video stream file of formula.
Further, described first module is obtained, is also used to call multimedia coding class MediaCodec class, and obtain pre- If video tuning parameter;According to the MediaCodec class and the preset video tuning parameter, by the yuv format Encoding video pictures data are converted to the video stream file of H264 format.
Operation performed by above-mentioned camera and each module specifically can refer to video recording method embodiment of the present invention, herein It repeats no more.
The present invention also provides a kind of computer readable storage mediums.
Video record program is stored on computer readable storage medium of the present invention, the video record program is by processor The step of video recording method as described above is realized when execution.
Wherein, the video record program run on the processor, which is performed realized method, can refer to the present invention Video recording method embodiment, details are not described herein again.
It should be noted that, in this document, the terms "include", "comprise" or its any other variant are intended to non-row His property includes, so that the process, method, article or the system that include a series of elements not only include those elements, and And further include other elements that are not explicitly listed, or further include for this process, method, article or system institute it is intrinsic Element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that including being somebody's turn to do There is also other identical elements in the process, method of element, article or system.
The serial number of the above embodiments of the invention is only for description, does not represent the advantages or disadvantages of the embodiments.
Through the above description of the embodiments, those skilled in the art can be understood that above-described embodiment side Method can be realized by means of software and necessary general hardware platform, naturally it is also possible to by hardware, but in many cases The former is more preferably embodiment.Based on this understanding, technical solution of the present invention substantially in other words does the prior art The part contributed out can be embodied in the form of software products, which is stored in one as described above In storage medium (such as ROM/RAM, magnetic disk, CD), including some instructions are used so that terminal device (it can be mobile phone, Computer, server, air conditioner or network equipment etc.) execute method described in each embodiment of the present invention.
The above is only a preferred embodiment of the present invention, is not intended to limit the scope of the invention, all to utilize this hair Equivalent structure or equivalent flow shift made by bright specification and accompanying drawing content is applied directly or indirectly in other relevant skills Art field, is included within the scope of the present invention.

Claims (14)

1.一种视频录制方法,其特征在于,所述视频录制方法包括如下步骤:1. a video recording method, is characterized in that, described video recording method comprises the steps: 获取摄像头采集到的视频图像编码数据,将所述视频图像编码数据转换为预设格式的视频流文件;Obtain the video image encoding data collected by the camera, and convert the video image encoding data into a video stream file of a preset format; 获取所述摄像头当前的朝向参数;Obtain the current orientation parameter of the camera; 将所述视频流文件和所述朝向参数发送至后台服务器,以使所述后台服务器根据所述视频流文件和所述朝向参数合成一个视频文件。Sending the video stream file and the orientation parameter to a background server, so that the background server synthesizes a video file according to the video stream file and the orientation parameter. 2.如权利要求1所述的视频录制方法,其特征在于,所述获取摄像头采集到的视频图像编码数据,将所述视频图像编码数据转换为预设格式的视频流文件的步骤之前,还包括:2. The video recording method according to claim 1, wherein, before the step of converting the video image encoding data into the video stream file of the preset format, the video image encoding data collected by the acquisition camera is further include: 接收视频录制指令,根据所述视频录制指令调用摄像头;receiving a video recording instruction, and calling the camera according to the video recording instruction; 控制所述摄像头采集视频图像编码数据。Control the camera to collect video image encoded data. 3.如权利要求2所述的视频录制方法,其特征在于,所述控制所述摄像头采集视频图像编码数据的步骤包括:3. The video recording method according to claim 2, wherein the step of controlling the camera to collect video image coded data comprises: 在所述摄像头采集视频图像编码数据的过程中,根据预设的发光参数控制屏幕按照预设顺序依次发出预设种颜色的光线,以使所述摄像头依次采集所述预设种颜色的光线对应的人脸图像,形成人脸图像序列,其中每种颜色的光线对应若干帧人脸图像;During the process of capturing video image coding data by the camera, the screen is controlled to emit light of preset colors in a preset order according to preset lighting parameters, so that the camera sequentially collects the lights of the preset colors corresponding to face images, forming a face image sequence, in which each color of light corresponds to several frames of face images; 获取所述人脸图像序列中两两相邻的颜色之间的差异图,得到差异图序列;Obtaining the difference map between the adjacent colors in the sequence of face images to obtain a sequence of difference maps; 将所述预设的发光参数和所述差异图序列发送至后台光线活体检测服务,以使所述光线活体检测服务判断所述摄像头当前拍摄的是否为真人;Sending the preset lighting parameters and the difference map sequence to the background light liveness detection service, so that the light liveness detection service judges whether the current shot by the camera is a real person; 当接收到所述光线活体检测服务返回的所述摄像头当前拍摄的为真人的检测结果时,执行步骤:获取摄像头采集到的视频图像编码数据,将所述视频图像编码数据转换为预设格式的视频流文件。When receiving the detection result returned by the light living body detection service that the current camera shot is a real person, perform the steps of: acquiring the video image encoding data collected by the camera, and converting the video image encoding data into a preset format. Video streaming file. 4.如权利要求3所述的视频录制方法,其特征在于,所述获取所述人脸图像序列中两两相邻的颜色之间的差异图,得到差异图序列的步骤包括:4. video recording method as claimed in claim 3, is characterized in that, described obtaining the difference map between two adjacent colors in described human face image sequence, the step of obtaining difference map sequence comprises: 识别所述人脸图像序列中的颜色突变位置;Identifying the color mutation position in the sequence of face images; 获取所述颜色突变位置处的两种不同颜色的光线分别对应的两帧人脸图像;Acquiring two frames of face images corresponding to the two different colors of light at the color mutation position respectively; 对所述两种不同颜色的光线分别对应的两帧人脸图像进行差异分析,得到所述颜色突变位置的差异图;Performing a difference analysis on the two frames of face images corresponding to the two different colors of light respectively, to obtain a difference map of the color mutation positions; 取所述人脸图像序列中所有颜色突变位置的差异图,得到差异图序列。Take the difference map of all the color mutation positions in the face image sequence to obtain a sequence of difference maps. 5.如权利要求1所述的视频录制方法,其特征在于,所述将所述视频图像编码数据转换为预设格式的视频流文件的步骤包括:5. The video recording method according to claim 1, wherein the step of converting the encoded video image data into a video stream file of a preset format comprises: 当获取到的所述视频图像编码数据为YUV格式时,调用多媒体编码类MediaCodec类,将所述YUV格式的视频图像编码数据转换为H264格式的视频流文件。When the obtained encoded video image data is in YUV format, the MediaCodec class of the multimedia encoding class is called to convert the encoded video image data in YUV format into a video stream file in H264 format. 6.如权利要求5所述的视频录制方法,其特征在于,所述调用多媒体编码类MediaCodec类,将所述YUV格式的视频图像编码数据转换为H264格式的视频流文件的步骤包括:6. video recording method as claimed in claim 5, is characterized in that, described calling multimedia coding class MediaCodec class, the step that the video image coding data of described YUV format is converted into the video stream file of H264 format comprises: 调用多媒体编码类MediaCodec类,并获取预设的视频调优参数;Call the MediaCodec class of the multimedia encoding class and obtain the preset video tuning parameters; 根据所述MediaCodec类和所述预设的视频调优参数,将所述YUV格式的视频图像编码数据转换为H264格式的视频流文件。According to the MediaCodec class and the preset video tuning parameters, the video image encoding data in the YUV format is converted into a video stream file in the H264 format. 7.如权利要求6所述的视频录制方法,其特征在于,所述视频调优参数包括视频的码率、帧率和关键帧间隔。7 . The video recording method according to claim 6 , wherein the video tuning parameters include a bit rate, a frame rate and a key frame interval of the video. 8 . 8.如权利要求1至7中任一项所述的视频录制方法,其特征在于,所述获取所述摄像头当前的朝向参数的步骤包括:8. The video recording method according to any one of claims 1 to 7, wherein the step of acquiring the current orientation parameter of the camera comprises: 调用相机程序的应用程序编程接口,通过所述应用程序编程接口获取到所述摄像头当前的朝向参数,其中,所述摄像头被所述相机程序调用。The application programming interface of the camera program is called, and the current orientation parameter of the camera is acquired through the application programming interface, wherein the camera is called by the camera program. 9.一种视频录制装置,其特征在于,所述视频录制装置包括:9. A video recording device, wherein the video recording device comprises: 摄像头,用于采集视频图像编码数据;Camera, used to collect video image encoding data; 第一获取模块,用于获取摄像头采集到的视频图像编码数据,将所述视频图像编码数据转换为预设格式的视频流文件;The first acquisition module is used to acquire the video image encoding data collected by the camera, and convert the video image encoding data into a video stream file of a preset format; 第二获取模块,用于获取所述摄像头当前的朝向参数;a second acquisition module, configured to acquire the current orientation parameter of the camera; 发送模块,用于将所述视频流文件和所述朝向参数发送至后台服务器,以使所述后台服务器根据所述视频流文件和所述朝向参数合成一个视频文件。A sending module, configured to send the video stream file and the orientation parameter to a background server, so that the background server synthesizes a video file according to the video stream file and the orientation parameter. 10.如权利要求9所述的视频录制装置,其特征在于,所述装置还包括:10. The video recording device of claim 9, wherein the device further comprises: 处理模块,用于接收视频录制指令,根据所述视频录制指令调用摄像头;a processing module for receiving a video recording instruction, and calling a camera according to the video recording instruction; 控制模块,用于控制所述摄像头采集视频图像编码数据。The control module is used to control the camera to collect video image coded data. 11.如权利要求10所述的视频录制装置,其特征在于,所述控制模块包括:11. The video recording device of claim 10, wherein the control module comprises: 控制单元,用于在所述摄像头采集视频图像编码数据的过程中,根据预设的发光参数控制屏幕按照预设顺序依次发出预设种颜色的光线,以使所述摄像头依次采集所述预设种颜色的光线对应的人脸图像,形成人脸图像序列,其中每种颜色的光线对应若干帧人脸图像;a control unit, configured to control the screen to emit light of preset colors in a preset order according to preset lighting parameters during the process of collecting video image coding data by the camera, so that the camera sequentially collects the preset colors face images corresponding to different colors of light to form a sequence of face images, where each color of light corresponds to several frames of face images; 获取单元,用于获取所述人脸图像序列中两两相邻的颜色之间的差异图,得到差异图序列;an acquisition unit, used for acquiring the difference map between the adjacent colors in the face image sequence, to obtain a difference map sequence; 发送单元,用于将所述预设的发光参数和所述差异图序列发送至后台光线活体检测服务,以使所述光线活体检测服务判断所述摄像头当前拍摄的是否为真人;a sending unit, configured to send the preset light-emitting parameters and the difference map sequence to the background light living body detection service, so that the light living body detection service can judge whether the current shot by the camera is a real person; 所述第一获取模块,还用于当接收到所述光线活体检测服务返回的所述摄像头当前拍摄的为真人的检测结果时,获取摄像头采集到的视频图像编码数据,将所述视频图像编码数据转换为预设格式的视频流文件。The first acquisition module is further configured to acquire the video image encoding data collected by the camera when receiving the detection result returned by the light living body detection service that the camera currently captures a real person, and encode the video image The data is converted into a video stream file in a preset format. 12.如权利要求11所述的视频录制装置,其特征在于,所述获取单元包括:12. The video recording device according to claim 11, wherein the acquiring unit comprises: 识别子单元,用于识别所述人脸图像序列中的颜色突变位置;an identification subunit for identifying the color mutation position in the face image sequence; 获取子单元,用于获取所述颜色突变位置处的两种不同颜色的光线分别对应的两帧人脸图像;an acquisition subunit, used for acquiring two frames of face images corresponding to the two different colors of light at the color mutation position; 分析子单元,用于对所述两种不同颜色的光线分别对应的两帧人脸图像进行差异分析,得到所述颜色突变位置的差异图;an analysis subunit, configured to perform a difference analysis on the two frames of face images corresponding to the two different colors of light respectively, to obtain a difference map of the color mutation positions; 所述获取子单元,还用于取所述人脸图像序列中所有颜色突变位置的差异图,得到差异图序列。The obtaining subunit is further configured to obtain a difference map of all the color mutation positions in the face image sequence to obtain a sequence of difference maps. 13.一种终端,其特征在于,所述终端包括:用于采集视频图像编码数据的摄像头、存储器、处理器及存储在所述存储器上并可在所述处理器上运行的视频录制程序,所述视频录制程序被所述处理器执行时实现如权利要求1至8中任一项所述的视频录制方法的步骤。13. A terminal, characterized in that the terminal comprises: a camera for collecting coded video image data, a memory, a processor, and a video recording program stored on the memory and running on the processor, The video recording program implements the steps of the video recording method according to any one of claims 1 to 8 when the video recording program is executed by the processor. 14.一种计算机可读存储介质,其特征在于,所述计算机可读存储介质上存储有视频录制程序,所述视频录制程序被所述处理器执行时实现如权利要求1至8中任一项所述的视频录制方法的步骤。14. A computer-readable storage medium, wherein a video recording program is stored on the computer-readable storage medium, and when the video recording program is executed by the processor, any one of claims 1 to 8 is implemented. The steps of the video recording method described in the item.
CN201811586656.0A 2018-12-21 2018-12-21 Video recording method, device, terminal and computer readable storage medium Pending CN109660745A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811586656.0A CN109660745A (en) 2018-12-21 2018-12-21 Video recording method, device, terminal and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811586656.0A CN109660745A (en) 2018-12-21 2018-12-21 Video recording method, device, terminal and computer readable storage medium

Publications (1)

Publication Number Publication Date
CN109660745A true CN109660745A (en) 2019-04-19

Family

ID=66115078

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811586656.0A Pending CN109660745A (en) 2018-12-21 2018-12-21 Video recording method, device, terminal and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN109660745A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110414346A (en) * 2019-06-25 2019-11-05 北京迈格威科技有限公司 Biopsy method, device, electronic equipment and storage medium
CN111901692A (en) * 2020-08-06 2020-11-06 杭州当虹科技股份有限公司 System for synthesizing VR (virtual reality) based on multi-audio and video streams
CN114389893A (en) * 2022-01-22 2022-04-22 重庆长安汽车股份有限公司 Live video processing vehicle real-name authentication system and method and automobile

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20060032247A (en) * 2004-10-11 2006-04-17 (주)버뮤다정보기술 Apparatus and method for preventing electronic banking fraudulent transactions using face recognition technology
CN1829321A (en) * 2005-02-28 2006-09-06 索尼株式会社 Information processing method and apparatus
CN105447459A (en) * 2015-11-18 2016-03-30 上海海事大学 Unmanned plane automation detection target and tracking method
CN105577664A (en) * 2015-12-22 2016-05-11 深圳前海微众银行股份有限公司 Password reset method and system, client and server
CN105744278A (en) * 2016-02-16 2016-07-06 福建星网智慧科技股份有限公司 Android system based H264 coding and decoding method
CN107846633A (en) * 2016-09-18 2018-03-27 腾讯科技(深圳)有限公司 A kind of live broadcasting method and system
CN107992794A (en) * 2016-12-30 2018-05-04 腾讯科技(深圳)有限公司 A kind of biopsy method, device and storage medium

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20060032247A (en) * 2004-10-11 2006-04-17 (주)버뮤다정보기술 Apparatus and method for preventing electronic banking fraudulent transactions using face recognition technology
KR100715323B1 (en) * 2004-10-11 2007-05-07 (주)버뮤다정보기술 Apparatus and method for preventing electronic banking fraudulent transactions using face recognition technology
CN1829321A (en) * 2005-02-28 2006-09-06 索尼株式会社 Information processing method and apparatus
CN105447459A (en) * 2015-11-18 2016-03-30 上海海事大学 Unmanned plane automation detection target and tracking method
CN105577664A (en) * 2015-12-22 2016-05-11 深圳前海微众银行股份有限公司 Password reset method and system, client and server
CN105744278A (en) * 2016-02-16 2016-07-06 福建星网智慧科技股份有限公司 Android system based H264 coding and decoding method
CN107846633A (en) * 2016-09-18 2018-03-27 腾讯科技(深圳)有限公司 A kind of live broadcasting method and system
CN107992794A (en) * 2016-12-30 2018-05-04 腾讯科技(深圳)有限公司 A kind of biopsy method, device and storage medium

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110414346A (en) * 2019-06-25 2019-11-05 北京迈格威科技有限公司 Biopsy method, device, electronic equipment and storage medium
CN111901692A (en) * 2020-08-06 2020-11-06 杭州当虹科技股份有限公司 System for synthesizing VR (virtual reality) based on multi-audio and video streams
CN111901692B (en) * 2020-08-06 2022-09-06 杭州当虹科技股份有限公司 System for synthesizing VR (virtual reality) based on multi-audio and video streams
CN114389893A (en) * 2022-01-22 2022-04-22 重庆长安汽车股份有限公司 Live video processing vehicle real-name authentication system and method and automobile

Similar Documents

Publication Publication Date Title
US20200012418A1 (en) Video encoding method and electronic device adapted thereto
KR101768980B1 (en) Virtual video call method and terminal
KR102449670B1 (en) Method and server for generating image data using a plurality of cameras
US9536479B2 (en) Image display device and method
US20150341591A1 (en) Automatically Curating Video to Fit Display Time
KR102385188B1 (en) Electronic device and method for processing image data in the electronic device
US11551474B2 (en) Fake video detection
EP4042706B1 (en) Fake video detection using block chain
CN106605403A (en) Photographing method and electronic device
CN107809598B (en) A kind of image pickup method, mobile terminal and server
CN107087101A (en) Apparatus and method for providing dynamic panorama function
CN109660745A (en) Video recording method, device, terminal and computer readable storage medium
CN106030614A (en) System and method for controlling a camera based on processing an image captured by other camera
CN108351960A (en) Electronic equipment with improved iris recognition and its method
CN109756671A (en) Electronic device for recording images using multiple cameras and method of operation thereof
CN107832712A (en) Biopsy method, device and computer-readable recording medium
KR20130056529A (en) Apparatus and method for providing augmented reality service in portable terminal
US20210117690A1 (en) Fake video detection using video sequencing
CN106134189A (en) Image processing apparatus, camera head, image processing method and program
JP6454973B2 (en) Server, control program, and recording medium
CN106982327A (en) Image processing method and device
CN103546677B (en) Interaction system and interaction method
CN114219868A (en) Skin care scheme recommendation method and system
CN115695860A (en) Method for recommending video clip, electronic device and server
WO2021080815A1 (en) Fake video detection

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20190419

RJ01 Rejection of invention patent application after publication