CN106231100A - The method of a kind of camera video process and terminal - Google Patents

The method of a kind of camera video process and terminal Download PDF

Info

Publication number
CN106231100A
CN106231100A CN201610624550.XA CN201610624550A CN106231100A CN 106231100 A CN106231100 A CN 106231100A CN 201610624550 A CN201610624550 A CN 201610624550A CN 106231100 A CN106231100 A CN 106231100A
Authority
CN
China
Prior art keywords
interface
file
video data
terminal
encoder
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
CN201610624550.XA
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.)
Hisense Mobile Communications Technology Co Ltd
Original Assignee
Hisense Mobile Communications 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 Hisense Mobile Communications Technology Co Ltd filed Critical Hisense Mobile Communications Technology Co Ltd
Priority to CN201610624550.XA priority Critical patent/CN106231100A/en
Publication of CN106231100A publication Critical patent/CN106231100A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/72Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
    • H04M1/724User interfaces specially adapted for cordless or mobile telephones
    • H04M1/72403User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality
    • H04M1/7243User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality with interactive means for internal management of messages
    • H04M1/72439User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality with interactive means for internal management of messages for image or video messaging
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/42Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by implementation details or hardware specially adapted for video compression or decompression, e.g. dedicated software implementation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/80Camera processing pipelines; Components thereof
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N5/00Details of television systems
    • H04N5/222Studio circuitry; Studio devices; Studio equipment
    • H04N5/262Studio circuits, e.g. for mixing, switching-over, change of character of image, other special effects ; Cameras specially adapted for the electronic generation of special effects

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Business, Economics & Management (AREA)
  • General Business, Economics & Management (AREA)
  • Human Computer Interaction (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

The invention discloses method and terminal that a kind of camera video processes, to solve the problem that Video processing mode present in prior art easily produces interval.When in the embodiment of the present invention, terminal carries out Video processing, terminal passes through encoder to coding video data;The video data that encoder exports is stored in the file that first interface is corresponding by terminal by first interface;After the file that first interface is corresponding meets switching condition, the video data that encoder exports is stored in the file that the second interface is corresponding by the second interface by terminal, use the mode of the embodiment of the present invention, the output data of encoder alternately can be stored by terminal with the multiple interface of passage, prevent the situation that frame losing leakage frame occurs in video processing procedure, it is ensured that the integrity of video data.

Description

The method of a kind of camera video process and terminal
Technical field
The present invention relates to field of video processing, a kind of method processed particularly to camera video and terminal.
Background technology
Nowadays, the range of intelligent terminal is increasingly extensive, and the application demand for intelligent terminal creates further Extension, such as video processing function, simultaneously because people for the multiple requirements of video file, Video processing are the most no longer One additional function of intelligent terminal, video processing function is the most specialized.
Now in intelligent terminal, Video processing is by containing video coding interface and video memory interface in terminal Interface complete the coding of video data and storage, terminal is by containing video coding interface and video memory interface More facilitate when interface processes video data but Video coding and video cannot be stored two kinds of functional separations and be implemented separately, and work as When video file storage reaches the upper limit, terminal needs to contain video coding interface and the interface of video memory interface and phase thereof Close resource all to discharge, then re-create new interface and continue with video video.And this interface and related resource thereof are all released During putting and re-creating, there is certain time delay, video data produces interval, causes video data imperfect.
To sum up, existing Video processing mode easily produces interval, causes video file imperfect.
Summary of the invention
The present invention provides a kind of method and terminal that camera video processes, in order to solve video present in prior art The problem that processing mode easily produces interval.
The embodiment of the present invention provides a kind of method that camera video processes, and the method includes:
Terminal passes through encoder to coding video data;
The video data that encoder exports is stored in the file that first interface is corresponding by described terminal by first interface;
After the file that first interface is corresponding meets switching condition, encoder is exported by described terminal by the second interface Video data stores in the file that the second interface is corresponding.
The embodiment of the present invention provides the terminal that a kind of camera video processes, and this terminal includes:
Coding module: be used for by encoder coding video data;
Processing module: for the video data that described coding module exports being stored first interface pair by first interface In the file answered;
After the file that first interface is corresponding meets switching condition, described processing module passes through the second interface by described coding The video data of module output stores in the file that the second interface is corresponding.
When in the embodiment of the present invention, terminal carries out Video processing, terminal passes through encoder to coding video data;Eventually The video data that encoder exports is stored in the file that first interface is corresponding by end by first interface;When first interface is corresponding File meet switching condition after, it is corresponding that the video data that encoder exports is stored the second interface by the second interface by terminal File in, use the mode of the embodiment of the present invention, the output data of encoder alternately can be entered by terminal with the multiple interface of passage Row storage, it is therefore prevented that the situation of frame losing leakage frame occurs in video processing procedure, it is ensured that the integrity of video data.
Accompanying drawing explanation
For the technical scheme being illustrated more clearly that in the embodiment of the present invention, in embodiment being described below required for make Accompanying drawing briefly introduce, it should be apparent that, below describe in accompanying drawing be only some embodiments of the present invention, for this From the point of view of the those of ordinary skill in field, on the premise of not paying creative work, it is also possible to obtain it according to these accompanying drawings His accompanying drawing.
Fig. 1 is the method schematic diagram that embodiment of the present invention camera video processes;
Fig. 2 be embodiment of the present invention camera video data flow to schematic diagram;
Fig. 3 is the process schematic that embodiment of the present invention camera video processes;
Fig. 4 is the terminal structure schematic diagram that embodiment of the present invention camera video processes.
Detailed description of the invention
In order to make the object, technical solutions and advantages of the present invention clearer, below in conjunction with accompanying drawing the present invention made into One step ground describes in detail, it is clear that described embodiment is only a part of embodiment of the present invention rather than whole enforcement Example.Based on the embodiment in the present invention, those of ordinary skill in the art are obtained under not making creative work premise All other embodiments, broadly fall into the scope of protection of the invention.
As it is shown in figure 1, be a kind of method that in the embodiment of the present invention, camera video processes, the method includes:
Step 101: terminal passes through encoder to coding video data;
Step 102: it is corresponding that the video data that encoder exports is stored first interface by first interface by described terminal File in;
Step 103: after the file that first interface is corresponding meets switching condition, described terminal will coding by the second interface The video data of device output stores in the file that the second interface is corresponding.
It should be noted that after the file that the second interface is corresponding meets switching condition, terminal will be compiled by first interface The video data of code device output stores in the file that first interface is corresponding, so circulates, until video data process terminates.Institute Stating before the video data that encoder exports stored in the file that first interface is corresponding by terminal by first interface, terminal is first Establishment first interface and the second interface, and the relevant information of video storage file is set, including code check, frame per second, encode lattice Formulas etc., in order to later during terminal switching interface, terminal can be by being provided with the interface of the relevant information of video storage file The video data storage that encoder is exported.Terminal is before to coding video data, and terminal can create multiple first and connect Mouth and the second interface, be used for storing video data.
Wherein, first interface and the second interface can be MediaMuxer (media storage) interfaces in terminal, and terminal can To create multiple MediaMuxer interfaces for the video data that encoder exports being stored by this interface the file of correspondence In.
With terminal system as Android system, as a example by first interface and the second interface are MediaMuxer interface, simply introduce The establishment of MediaMuxer interface and storing process, first terminal call Android standard interface new MediaMuxer () and create Two MediaMuxer interfaces, the parameter that two of which interface is arranged is finally the record a video file path being stored in and file storage lattice Formula, after encoder starts to export data, obtains encoder output data by dequeueOutputBuffer () order, and Judge return value according to output data, if return value is " INFO_FORMAT_CHANGED ", then show these output data are wrapped Containing Color-spatial distribution characteristic information, two MediaMuxer interfaces call addTrack () interface respectively, output data are deposited Enter in the file that MediaMuxer interface is corresponding.
Such as terminal can create three MediaMuxer interfaces, i.e. interface 1, interface 2 and interface 3, if current with connecing Mouth 1, then when switching, can be with in interface 2 and interface 3, it is assumed that selecting interface 3, if also needing to switching afterwards, then may be used With with in interface 1 and interface 2.
The most such as terminal can create three MediaMuxer interfaces, i.e. interface 1, interface 2 and interface 3, uses if current Interface 1, then, when switching, can use interface 2;If also needing to switching afterwards, then can be with in interface 3;If also needed to afterwards Switching, then can be with in interface 1.
Use MediaCodec (media encoders) interface to video data coding video data with terminal below As a example by carrying out coded treatment, illustrate:
1, terminal obtains video data from webcam driver;
2, terminal creates MediaCodec interface;
3, the video data of acquisition is encoded by terminal by MediaCodec interface.
In embodiments of the present invention, except using MediaCodec interface, the embodiment of the present invention can also use MediaRecorder (media record) interface.But MediaRecorder interface contains MediaCodec interface and MediaMuxer interface, utilize MediaRecorder interface process video data cannot by MediaCodec interface and The functional separation of MediaMuxer interface is implemented separately, when storing the file of data of video and meeting switching condition, Resource shared by MediaRecorder interface and MediaRecorder interface needs all release, then re-creates MediaRecorder interface, there is time delay in this process, easily produces the phenomenon of frame losing leakage frame.
Based on this, use MediaCodec interface can reduce the phenomenon of frame losing leakage frame.
In embodiments of the present invention, switching condition include but not limited to following in part or all of:
The video record duration of the file that switching condition one, first interface are corresponding exceedes first threshold;
The capacity of the file that switching condition two, first interface are corresponding exceedes Second Threshold.
Wherein, first threshold and Second Threshold can rule of thumb, application scenarios, emulation etc. is configured.First threshold Can also be updated the most in real time with Second Threshold.
Below above-mentioned two switching condition is described in detail.
Switching condition one:
After the video record duration of file corresponding to described first interface exceedes first threshold, described terminal stops passing through First interface stores the video data of encoder output, and the interface arranging storage video data is the second interface.
When terminal stops the video data by first interface storage encoder output, the video that encoder is exported by terminal Data cache, and after the second interface enables, by the second interface, the video data of caching are stored described second and connect In the file that mouth is corresponding, to ensure that video data is complete, there is not interval, not frame losing.
Wherein, in the output buffer (buffer area) leaving encoder in of the video data that encoder is exported by terminal, Encoder in general terminal has a number of output buffer, is used for caching the video data of encoder output.
Optionally, if the video data being buffered in buffer cannot be deposited by terminal in time by the second interface Storage, terminal can arrange the video data in the output buffe of other buffer areas caching encoder.
Described terminal stops the video data of first interface storage encoder output, and arranges the interface of storage video data After being the second interface, by the second interface, the video data of caching is stored in the file that described second interface is corresponding.
Described terminal, when the file that the second interface is corresponding meets switching condition, stops the second interface storage encoder output Video data, and arrange storage video data interface be first interface.
When terminal stops the video data by the second interface storage encoder output, the video that encoder is exported by terminal Data cache, and after first interface enables, by first interface, the video data of caching are stored described first and connect In the file that mouth is corresponding, to ensure that video data is complete, there is not interval, not frame losing.
The video data that encoder exports is stored in the file that first interface is corresponding by terminal, and first interface is corresponding The file that file is corresponding with the video data exported by first interface storage encoder before is not identical file, i.e. terminal Often interface of switching, will produce a new file corresponding with memory interface.
In embodiments of the present invention, the video data that encoder exports is stored in first by first interface by described terminal In the file that interface is corresponding, the video data that encoder exports is stored in the first file by such as terminal, when the first file is full During foot switching condition, described terminal stops the video data of first interface storage encoder output, and arranges storage video data Interface be the second interface after, by the second interface, the video data of caching stored the file that described second interface is corresponding In, the video data that encoder exports is stored in the second file by such as terminal, when the second file meets switching condition, and institute State terminal and stop the video data of the second interface storage encoder output, and the interface arranging storage video data is first interface After, by first interface, the video data of caching is stored in the file that described first interface is corresponding, such as terminal will coding The video data of device output is stored in the 3rd file, it should be noted that the first file and the 3rd file are all first interfaces Corresponding file, but the first file and the 3rd file are not identical file.
As a example by first threshold is as 10min, when the video record duration of file corresponding to described first interface is more than 10min After, described terminal stops the video data by first interface storage encoder output, the video counts that encoder is exported by terminal According to caching, and the interface arranging storage video data is the second interface.After the second interface enables, will by the second interface The video data of caching stores in the file that described second interface is corresponding, when the video record of file corresponding to described second interface Duration processed, more than time after 10min, stops the video data of the second interface storage encoder output, and terminal is by regarding that encoder exports Frequency is according to caching, and the interface arranging storage video data is first interface, after first interface enables, connects by first The video data of caching is stored in the file that described first interface is corresponding by mouth.
Switching condition two:
After the capacity of file corresponding to the file first interface that described first interface is corresponding exceedes Second Threshold, described end End stops the video data by first interface storage encoder output, and the interface arranging storage video data is second to connect Mouthful.
When terminal stops the video data by first interface storage encoder output, the video that encoder is exported by terminal Data cache, and after the second interface enables, by the second interface, the video data of caching are stored described second and connect In the file that mouth is corresponding, to ensure that video data is complete, there is not interval, not frame losing.
Wherein, in the output buffer (buffer area) leaving encoder in of the video data that encoder is exported by terminal, Encoder in general terminal has a number of output buffer, is used for caching the video data of encoder output.
Optionally, if the video data being buffered in buffer cannot be deposited by terminal in time by the second interface Storage, terminal can arrange the video data in the output buffe of other buffer areas caching encoder.
Described terminal stops the video data of first interface storage encoder output, and arranges the interface of storage video data After being the second interface, by the second interface, the video data of caching is stored in the file that described second interface is corresponding.
Described terminal, when the file that the second interface is corresponding meets switching condition, stops the second interface storage encoder output Video data, and arrange storage video data interface be first interface.
When terminal stops the video data by the second interface storage encoder output, the video that encoder is exported by terminal Data cache, and after first interface enables, by first interface, the video data of caching are stored described first and connect In the file that mouth is corresponding, to ensure that video data is complete, there is not interval, not frame losing.
The video data that encoder exports is stored in the file that first interface is corresponding by terminal, and first interface is corresponding The file that file is corresponding with the video data exported by first interface storage encoder before is not identical file, i.e. terminal Often interface of switching, will produce a new file corresponding with memory interface.In embodiments of the present invention, described terminal is led to Crossing first interface to be stored in the file that first interface is corresponding by the video data that encoder exports, such as terminal is defeated by encoder The video data gone out is stored in the first file, and when the first file meets switching condition, described terminal stops first interface and deposits The video data of storage encoder output, and after the interface arranging storage video data is the second interface, will be slow by the second interface The video data deposited stores in the file that described second interface is corresponding, the video data storage that encoder is exported by such as terminal In the second file, when the second file meets switching condition, described terminal stops regarding of the second interface storage encoder output Frequency evidence, and arrange storage video data interface be first interface after, by first interface will caching video data store In the file that described first interface is corresponding, the video data that encoder exports is stored in the 3rd file by such as terminal, needs It is noted that the first file and the 3rd file are all the files that first interface is corresponding, but the first file and the 3rd file are not Identical file.
As a example by Second Threshold is as 200MB, after the capacity of file corresponding to described first interface is more than 200MB, described Terminal stops the video data by first interface storage encoder output, and the video data that encoder exports is delayed by terminal Deposit, and the interface arranging storage video data is the second interface.After the second interface enables, by the second interface regarding caching Frequency is according in storage to file corresponding to described second interface, when the capacity of file corresponding to described second interface is more than 200MB Time rear, stopping the video data of the second interface storage encoder output, the video data that encoder exports is cached by terminal, And the interface arranging storage video data is first interface, after first interface enables, by first interface by the video of caching Data store in the file that described first interface is corresponding.
When the capacity of file corresponding to first interface and file corresponding to the second interface reaches to may store in terminal Large Copacity, and when there is the video data not encoded by encoder, terminal is by the file according to first interface and the second correspondence The sequencing of storage carries out deleting the file stored at first, to store the video data of the output of encoder.
With terminal storage space as 1G, the file that first interface is corresponding is the first file and the 3rd file, the second interface pair The file answered is the second file, and the sequencing of the storage of file is the first file, as a example by the second file and the 3rd file, when First file, the total capacity of the second file and the 3rd file has reached 1G, and terminal still suffers from needing being encoded by encoder Video data, the most now terminal carries out deleting the file stored at first, by first interface pair according to the sequencing that file stores File the first file answered is deleted, and to store the video data of the output of encoder, also needs to store the output of encoder afterwards Video data and terminal in there is no enough memory spaces, then the second file is deleted by the sequencing stored according to file Remove.
As in figure 2 it is shown, for embodiment of the present invention camera video data flow to schematic diagram.
Terminal leaves the video data in USB Camera (USB camera) in UVC Driver, and (external camera is driven Dynamic) in;
Terminal obtains video data from external camera drives, and by kernel, transmission is to encoder;
Terminal, is encoded with coded system H.264 video data by encoder;
The video data that encoder exports is stored in the file that MediaMuxer1 (video storage 1) is corresponding by terminal;
When file corresponding to (video storage 1) MediaMuxer1 meets switching condition, terminal is by regarding that encoder exports In the file that frequency is corresponding according to being stored in MediaMuxer2 (video storage 2).
It should be noted that, coded system H.264 is merely illustrative, and the coded system of video data has in many, Every the coded system of coding video data can be suitable for the embodiment of the present invention.
As it is shown on figure 3, the procedure chart processed for embodiment of the present invention camera video, including:
Step 301: terminal passes through encoder to coding video data;
Step 302: terminal creates first interface and the second interface, and completes first interface and the setting of the second interface;
Step 303: terminal is arranged and stored by the video data that encoder exports by first interface;
Step 304: the video data that encoder exports is stored the literary composition that first interface is corresponding by first interface by terminal In part;
Step 305: whether the file that terminal judges first interface is corresponding meets switching condition, if it is, perform step 306, otherwise perform step 304;
Step 306: terminal stops, by first interface, the video data that encoder export stores first interface correspondence File in;
Step 307: terminal is arranged and stored by the video data that encoder exports by the second interface;
Step 308: the video data that encoder exports is stored the literary composition that the second interface is corresponding by the second interface by terminal In part;
Step 309: whether the file that terminal judges the second interface is corresponding meets switching condition, if it is, perform step 310, otherwise perform step 308;
Step 310: terminal stops, by the second interface, the video data that encoder export stores the second interface correspondence File in;
Step 311: whether terminal judges exists not encoded video data, if it is performs step 303, otherwise holds Row step 312;
Step 312: terminal stops by encoder coding video data.
Based on same inventive concept, the embodiment of the present invention also provides for the terminal of a kind of Video processing, owing to this terminal solves The principle of problem is similar to the method for embodiment of the present invention information processing, and therefore the enforcement of this terminal may refer to the reality of method Execute, repeat no more in place of repetition.
As shown in Figure 4, the terminal that embodiment of the present invention camera video processes, including coding module 400 and processing module 401。
Described coding module 400: be used for by encoder coding video data;
Described processing module 401: for the video data that described coding module 400 exports being stored by first interface In the file that first interface is corresponding;
After the file that first interface is corresponding meets switching condition, described processing module 401 passes through the second interface by described The video data of coding module 400 output stores in the file that the second interface is corresponding.
It should be noted that after the file that the second interface is corresponding meets switching condition, described processing module 401 is by the The video data that described coding module 400 exports is stored in the file that first interface is corresponding by one interface, so circulates, until Video data process terminates.The video data that described coding module 400 exports is deposited by described processing module 401 by first interface Before storing up in the file that first interface is corresponding, described processing module 401 first creates first interface and the second interface, and setting regards Frequency stores the relevant information of file, including code check, frame per second, coded format etc., in order to later during terminal switching interface, institute State processing module 401 to be exported by described coding module 400 by being provided with the interface of the relevant information of video storage file Video data storage.Described coding module 400 is before to coding video data, and described processing module 401 can create Multiple first interfaces and the second interface, be used for storing video data.
Wherein, first interface and the second interface can be the MediaMuxer interfaces in terminal, and described processing module 401 can Right for the video data that described coding module 400 exports being stored by this interface to create multiple MediaMuxer interfaces In the file answered.
With terminal system as Android system, as a example by first interface and the second interface are MediaMuxer interface, simply introduce The establishment of MediaMuxer interface and storing process, first terminal call Android standard interface new MediaMuxer () and create Two MediaMuxer interfaces, the parameter that two of which interface is arranged is finally the record a video file path being stored in and file storage lattice Formula, after encoder starts to export data, obtains encoder output data by dequeueOutputBuffer () order, and Judge return value according to output data, if return value is " INFO_FORMAT_CHANGED ", then show these output data are wrapped Containing Color-spatial distribution characteristic information, two MediaMuxer interfaces call addTrack () interface respectively, output data are deposited Enter in the file that MediaMuxer interface is corresponding.
The most described processing module 401 can create three MediaMuxer interfaces, i.e. interface 1, interface 2 and interface 3, when With interface 1 before if, then when switching, can be with in interface 2 and interface 3, it is assumed that select interface 3, if the most also needed Switch, then can be with in interface 1 and interface 2.
The most described processing module 401 can create three MediaMuxer interfaces, i.e. interface 1, interface 2 and interface 3, If current with interface 1, then, when switching, interface 2 can be used;If also needing to switching afterwards, then can be with in interface 3;Afterwards If also needing to switching, then can be with in interface 1.
Coding video data is processed by MediaCodec interface so that coding video data is used below As a example by, illustrate:
1, described coding module 400 obtains video data from webcam driver;
2, described coding module 400 creates MediaCodec interface;
3, the video data of acquisition is encoded by described coding module 400 by MediaCodec interface.
In embodiments of the present invention, except using MediaCodec interface, the embodiment of the present invention can also use MediaRecorder interface.But MediaRecorder interface contains MediaCodec interface and MediaMuxer interface, Utilize MediaRecorder interface to process video data cannot the function of MediaCodec interface and MediaMuxer interface be divided Open and be implemented separately, when the file of data storing video meets switching condition, MediaRecorder interface and Resource shared by MediaRecorder interface needs all release, then re-creates MediaRecorder interface, this process There is time delay, easily produce the phenomenon of frame losing leakage frame.
Based on this, use MediaCodec interface can reduce the phenomenon of frame losing leakage frame.
In embodiments of the present invention, switching condition include but not limited to following in part or all of:
The video record duration of the file that switching condition one, first interface are corresponding exceedes first threshold;
The capacity of the file that switching condition two, first interface are corresponding exceedes Second Threshold.
Wherein, first threshold and Second Threshold can rule of thumb, application scenarios, emulation etc. is configured.First threshold Can also be updated the most in real time with Second Threshold.
Below above-mentioned two switching condition is described in detail.
Switching condition one:
After the video record duration of file corresponding to described first interface exceedes first threshold, described processing module 401 Stop being stored by first interface the video data of described coding module 400 output, and the interface arranging storage video data is Second interface.
When described processing module 401 stops the video data being stored the output of described coding module 400 by first interface, institute State processing module 401 to be cached by the video data that described coding module 400 exports, and after the second interface enables, pass through The video data of caching is stored in the file that described second interface is corresponding by the second interface, to ensure that video data is complete, no There is interval, not frame losing.
Wherein, the video data that described coding module 400 is exported by described processing module 401 leave the defeated of encoder in Going out in buffer, general encoder has a number of output buffer, is used for caching the video data of encoder output.
Optionally, if described processing module 401 cannot will be buffered in the video in buffer by the second interface in time Data store, and described processing module 401 can arrange the video counts in the output buffe of other buffer areas caching encoder According to.
Described processing module 401 stops first interface and stores the video data of described coding module 400 output, and setting is deposited After the interface of storage video data is the second interface, by the second interface, the video data of caching stored described second interface pair In the file answered.
Described processing module 401, when the file that the second interface is corresponding meets switching condition, stops the second interface storage and compiles Code device output video data, and arrange storage video data interface be first interface.
When described processing module 401 stops the video data being stored the output of described coding module 400 by the second interface, institute State processing module 401 to be cached by the video data that described coding module 400 exports, and after first interface enables, pass through The video data of caching is stored in the file that described first interface is corresponding by first interface, to ensure that video data is complete, no There is interval, not frame losing.
The video data that described coding module 400 exports is stored in the literary composition that first interface is corresponding by described processing module 401 In part, and file corresponding to first interface with store, by first interface, the video data that described coding module 400 exports before Corresponding file is not identical file, and the most described processing module 401 often switches an interface, new with storage by producing one The file that interface is corresponding.
In embodiments of the present invention, described processing module 401 passes through first interface by regarding that described coding module 400 exports Frequency is according to being stored in the file that first interface is corresponding, and the most described processing module 401 is by regarding that described coding module 400 exports Frequency is according to being stored in the first file, and when the first file meets switching condition, described processing module 401 stops first interface and deposits Store up described coding module 400 output video data, and arrange storage video data interface be the second interface after, by second The video data of caching is stored in the file that described second interface is corresponding by interface, and the most described processing module 401 is by described The video data of coding module 400 output is stored in the second file, when the second file meets switching condition, and described process mould Block 401 stops the second interface and stores the video data of described coding module 400 output, and the interface arranging storage video data is After first interface, by first interface, the video data of caching is stored in the file that described first interface is corresponding, such as institute State processing module 401 to be stored in the 3rd file by the video data that described coding module 400 exports, it should be noted that the One file and the 3rd file are all the files that first interface is corresponding, but the first file and the 3rd file are not identical file.
As a example by first threshold is as 10min, when the video record duration of file corresponding to described first interface is more than 10min After, described processing module 401 stops being stored the video data of described coding module 400 output, described process by first interface The video data that described coding module 400 exports is cached by module 401, and the interface arranging storage video data is second Interface.After the second interface enables, by the second interface, the video data of caching stored the literary composition that described second interface is corresponding In part, when after the video record duration of file corresponding to described second interface is more than 10min, stop the second interface storage described The video data of coding module 400 output, the video data that described coding module 400 exports is carried out by described processing module 401 Cache, and the interface arranging storage video data is first interface, after first interface enables, by first interface by caching Video data stores in the file that described first interface is corresponding.
Switching condition two:
After the capacity of file corresponding to the file first interface that described first interface is corresponding exceedes Second Threshold, described place Reason module 401 stops being stored the video data of described coding module 400 output by first interface, and arranges storage video data Interface be the second interface.
When described processing module 401 stops the video data being stored the output of described coding module 400 by first interface, institute State processing module 401 to be cached by the video data that described coding module 400 exports, and after the second interface enables, pass through The video data of caching is stored in the file that described second interface is corresponding by the second interface, to ensure that video data is complete, no There is interval, not frame losing.
Wherein, the video data that described coding module 400 is exported by described processing module 401 leave the defeated of encoder in Going out in buffer, general encoder has a number of output buffer, is used for caching the video data of encoder output.
Optionally, if described processing module 401 cannot will be buffered in the video in buffer by the second interface in time Data store, and described processing module 401 can arrange the video counts in the output buffe of other buffer areas caching encoder According to.
Described processing module 401 stops first interface and stores the video data of described coding module 400 output, and setting is deposited After the interface of storage video data is the second interface, by the second interface, the video data of caching stored described second interface pair In the file answered.
Described processing module 401, when the file that the second interface is corresponding meets switching condition, stops the second interface and stores institute State the video data of coding module 400 output, and the interface arranging storage video data is first interface.
When described processing module 401 stops the video data being stored the output of described coding module 400 by the second interface, institute State processing module 401 to be cached by the video data that described coding module 400 exports, and after first interface enables, pass through The video data of caching is stored in the file that described first interface is corresponding by first interface, to ensure that video data is complete, no There is interval, not frame losing.
The video data that described coding module 400 exports is stored in the literary composition that first interface is corresponding by described processing module 401 In part, and file corresponding to first interface with store, by first interface, the video data that described coding module 400 exports before Corresponding file is not identical file, i.e. terminal often switches an interface, new corresponding with memory interface by producing one File.
In embodiments of the present invention, described processing module 401 passes through first interface by regarding that described coding module 400 exports Frequency is according to being stored in the file that first interface is corresponding, and the most described processing module 401 is by regarding that described coding module 400 exports Frequency is according to being stored in the first file, and when the first file meets switching condition, described processing module 401 stops first interface and deposits Store up described coding module 400 output video data, and arrange storage video data interface be the second interface after, by second The video data of caching is stored in the file that described second interface is corresponding by interface, and the most described processing module 401 is by described The video data of coding module 400 output is stored in the second file, when the second file meets switching condition, and described process mould Block 401 stops the second interface and stores the video data of described coding module 400 output, and the interface arranging storage video data is After first interface, by first interface, the video data of caching is stored in the file that described first interface is corresponding, such as institute State processing module 401 to be stored in the 3rd file by the video data that described coding module 400 exports, it should be noted that the One file and the 3rd file are all the files that first interface is corresponding, but the first file and the 3rd file are not identical file.
As a example by Second Threshold is as 200MB, after the capacity of file corresponding to described first interface is more than 200MB, described Processing module 401 stops being stored the video data of described coding module 400 output, described processing module 401 by first interface The video data that described coding module 400 exports is cached, and the interface arranging storage video data is the second interface.? After second interface enables, by the second interface, the video data of caching is stored in the file that described second interface is corresponding, when The capacity of the file that described second interface is corresponding, more than time after 200MB, stops the second interface described coding module 400 of storage and exports Video data, the video data that described coding module 400 exports is cached, and arranges storage by described processing module 401 The interface of video data is first interface, after first interface enables, is stored by the video data of caching by first interface In the file that described first interface is corresponding.
When the capacity of file corresponding to first interface and file corresponding to the second interface reaches to may store in terminal Large Copacity, and when there is the video data not encoded by described coding module 400, described processing module 401 will connect according to first The sequencing of the storage of the file of mouth and the second correspondence carries out deleting the file stored at first, to store described coding module The video data of the output of 400.
With terminal storage space as 1G, the file that first interface is corresponding is the first file and the 3rd file, the second interface pair The file answered is the second file, and the sequencing of the storage of file is the first file, as a example by the second file and the 3rd file, when First file, the total capacity of the second file and the 3rd file has reached 1G, still suffers from the video needing to be encoded by encoder Data, the most described processing module 401 carries out deleting the file stored at first according to the sequencing that file stores, by first File the first file that interface is corresponding is deleted, and to store the video data of the output of described coding module 400, also needs to afterwards deposit Store up in the video data of the output of described coding module 400 and terminal and there is no enough memory spaces, the most described processing module 401 Second file is deleted by the sequencing stored according to file.
Above by reference to the method illustrated according to the embodiment of the present application, device (system) and/or the frame of computer program Figure and/or flow chart describe the application.Should be understood that and can realize block diagram and/or flow process diagram by computer program instructions One block of figure and the combination of the block of block diagram and/or flowchart illustration.Can be supplied to lead to by these computer program instructions By computer, the processor of special-purpose computer and/or other programmable data processing means, to produce machine so that via meter The instruction that calculation machine processor and/or other programmable data processing means perform creates and is used for realizing block diagram and/or flow chart block The method of the function/action specified by.
Correspondingly, it is also possible to implement the application with hardware and/or software (including firmware, resident software, microcode etc.).More Further, the application can take computer to use or the shape of computer program on computer-readable recording medium Formula, it has the computer realized in media as well and can use or computer readable program code, to be made by instruction execution system With or combined command perform system and use.In the present context, computer can use or computer-readable medium is permissible Being arbitrary medium, it can comprise, stores, communicates, transmit or transmission program, to be made by instruction execution system, device or equipment With, or combined command execution system, device or equipment use.
Obviously, those skilled in the art can carry out various change and the modification essence without deviating from the present invention to the present invention God and scope.So, if these amendments of the present invention and modification belong to the scope of the claims in the present invention and equivalent technologies thereof Within, then the present invention is also intended to comprise these change and modification.

Claims (10)

1. the method that a camera video processes, it is characterised in that the method includes:
Terminal passes through encoder to coding video data;
The video data that encoder exports is stored in the file that first interface is corresponding by described terminal by first interface;
After the file that first interface is corresponding meets switching condition, the video that encoder is exported by described terminal by the second interface Data store in the file that the second interface is corresponding.
2. the method for claim 1, it is characterised in that described switching condition includes the part in following condition or complete Portion:
The video record duration of the file that first interface is corresponding exceedes first threshold;
The capacity of the file that first interface is corresponding exceedes Second Threshold.
3. the method for claim 1, it is characterised in that after the file that first interface is corresponding meets switching condition, institute Before stating the terminal video data by the second interface storage encoder output, also include:
Described terminal stops the video data by first interface storage encoder output, and the interface arranging storage video data is Second interface.
4. method as claimed in claim 3, it is characterised in that described terminal stops regarding of first interface storage encoder output Frequency according to afterwards, arranges before the interface of storage video data is the second interface, also includes:
The video data that encoder exports is cached by described terminal;
Described terminal, by the video data of the second interface storage encoder output, also includes:
The video data of caching is stored in the file that described second interface is corresponding by described terminal by the second interface.
5. the method as described in claims 1 to 3 is arbitrary, it is characterised in that described terminal is defeated by encoder by the second interface After the video data gone out stores in the file that the second interface is corresponding, also include:
When the capacity of file corresponding to first interface and file corresponding to the second interface reaches the maximum that may store in terminal Capacity, and when there is the video data not encoded by encoder, terminal is deposited the file according to first interface and the second correspondence The sequencing of storage is deleted, to store the video data of the output of encoder.
6. the terminal that a camera video processes, it is characterised in that this terminal includes:
Coding module: be used for by encoder coding video data;
Processing module: corresponding for the video data that described coding module exports being stored first interface by first interface In file;After the file that first interface is corresponding meets switching condition, by the second interface by regarding that described coding module exports In the file that frequency is corresponding according to storing the second interface.
7. terminal as claimed in claim 6, it is characterised in that described switching condition includes the part in following condition or complete Portion:
The video record duration of the file that first interface is corresponding exceedes first threshold;
The capacity of the file that first interface is corresponding exceedes Second Threshold.
8. terminal as claimed in claim 6, it is characterised in that described processing module is additionally operable to:
After the file that first interface is corresponding meets switching condition, stop the video counts by first interface storage encoder output According to, the interface arranging storage video data is the second interface, and by the video data of the second interface storage encoder output.
9. terminal as claimed in claim 8, it is characterised in that described processing module is additionally operable to:
After stopping the video data of first interface storage encoder output, the video data that encoder exports is cached; Arrange after the interface of storage video data is the second interface, by the second interface, the video data of caching stored described the In the file that two interfaces are corresponding.
10. the terminal as described in as arbitrary in claim 6~8, it is characterised in that described processing module is additionally operable to:
After the video data that encoder exports being stored in the file that the second interface is corresponding by the second interface, when first connects The capacity of mouthful corresponding file and file corresponding to the second interface reaches the heap(ed) capacity that may store in terminal, and exists not During the video data encoded by encoder, described processing module is by according to first interface and the elder generation of the storage of the file of the second correspondence Rear order is deleted, to store the video data of the output of encoder.
CN201610624550.XA 2016-07-29 2016-07-29 The method of a kind of camera video process and terminal Pending CN106231100A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610624550.XA CN106231100A (en) 2016-07-29 2016-07-29 The method of a kind of camera video process and terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610624550.XA CN106231100A (en) 2016-07-29 2016-07-29 The method of a kind of camera video process and terminal

Publications (1)

Publication Number Publication Date
CN106231100A true CN106231100A (en) 2016-12-14

Family

ID=57536517

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610624550.XA Pending CN106231100A (en) 2016-07-29 2016-07-29 The method of a kind of camera video process and terminal

Country Status (1)

Country Link
CN (1) CN106231100A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112312057A (en) * 2020-02-24 2021-02-02 北京字节跳动网络技术有限公司 Multimedia conference data processing method and device and electronic equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1731827A (en) * 2005-08-04 2006-02-08 北京华傲精创科技开发有限公司 Video device, video camera recording device and video & audio editing system
US20080074501A1 (en) * 2006-09-27 2008-03-27 Canon Kabushiki Kaisha Imaging device and control method therefor, and program for the same
CN102892020A (en) * 2011-07-22 2013-01-23 索尼公司 Stereoscopic imaging system, recording control method, stereoscopic image reproduction system, and method
CN103489231A (en) * 2013-09-26 2014-01-01 浙江吉利控股集团有限公司 Driving condition recording device and driving condition recording method
CN104660968A (en) * 2013-11-22 2015-05-27 南京视威电子科技股份有限公司 Method for storing alarm information by using multiple storage cards

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1731827A (en) * 2005-08-04 2006-02-08 北京华傲精创科技开发有限公司 Video device, video camera recording device and video & audio editing system
US20080074501A1 (en) * 2006-09-27 2008-03-27 Canon Kabushiki Kaisha Imaging device and control method therefor, and program for the same
CN102892020A (en) * 2011-07-22 2013-01-23 索尼公司 Stereoscopic imaging system, recording control method, stereoscopic image reproduction system, and method
CN103489231A (en) * 2013-09-26 2014-01-01 浙江吉利控股集团有限公司 Driving condition recording device and driving condition recording method
CN104660968A (en) * 2013-11-22 2015-05-27 南京视威电子科技股份有限公司 Method for storing alarm information by using multiple storage cards

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112312057A (en) * 2020-02-24 2021-02-02 北京字节跳动网络技术有限公司 Multimedia conference data processing method and device and electronic equipment
US11758087B2 (en) 2020-02-24 2023-09-12 Douyin Vision Co., Ltd. Multimedia conference data processing method and apparatus, and electronic device

Similar Documents

Publication Publication Date Title
CN100571368C (en) The method and apparatus that a kind of many picture control shows
CN107040794A (en) Video broadcasting method, server, virtual reality device and panoramic virtual reality play system
CN104363463B (en) A kind of method for processing video frequency, apparatus and system
CN106161991A (en) A kind of camera video processing method and terminal
CN107469352B (en) Resource caching method and storage medium for game front end
CN106815015A (en) View method for organizing and system in a kind of IOS
CN105867944A (en) Web front-end terminal operating layer and implementing method thereof
CN106231100A (en) The method of a kind of camera video process and terminal
CN108243345A (en) A kind of video stream pushing method
CN102723093B (en) A kind of caching method of image file
CN106168974A (en) Method and system for processing multi-system screenshot file
CN104793911B (en) Processing method, device and terminal is presented using split screen
CN105704207A (en) Method for generating unique identifier, terminal and network side
CN105912664A (en) Method and equipment for file processing
CN101511007B (en) Method, equipment and system for implementing picture record in network video monitoring system
CN101262370B (en) Disaster tolerance rehearsal method, device and server
CN105306858B (en) A kind of video data storage method and device
CN104253807A (en) Media resource control method and device
CN106210781A (en) A kind of multichannel control method for playing back and system
CN104700378A (en) Genetic algorithm based low-illumination video image processing method
CN110012003A (en) A kind of cloud application grabs screen method and apparatus
CN106558019A (en) Picture arrangement method and device
CN105049771A (en) Search engine based video clip retrieval method and device
CN101005619B (en) Loop circuit filtering method
CN103885813B (en) Packet capturing method in virtual machine environment

Legal Events

Date Code Title Description
C06 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
RJ01 Rejection of invention patent application after publication

Application publication date: 20161214