CN103813121A - Method and apparatus for recording video - Google Patents
Method and apparatus for recording video Download PDFInfo
- Publication number
- CN103813121A CN103813121A CN201410054914.6A CN201410054914A CN103813121A CN 103813121 A CN103813121 A CN 103813121A CN 201410054914 A CN201410054914 A CN 201410054914A CN 103813121 A CN103813121 A CN 103813121A
- Authority
- CN
- China
- Prior art keywords
- video
- camera
- thread
- video data
- size
- 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
Links
Images
Landscapes
- Television Signal Processing For Recording (AREA)
- Studio Devices (AREA)
Abstract
The invention discloses a method and apparatus for recording video. According to the method and apparatus for recording video, pause is available in a video data capturing, previewing and saving process when a camera is turned on, only the previewing without saving is performed during the pause, and camera switch is available during the pause, so that a user can show more originality in a video recording process and does not need to edit a plurality of video clips, and convenient operation can be obtained.
Description
Technical field
The present invention relates to a kind of method and apparatus of recorded video.
Background technology
In prior art, recorded video only has a start button often, after beginning, this button can become conclusion button, so just cause us in recorded video, can not suspend, if record the video of different periods, can only realize by recording multistage video, and cannot support multiple cameras to record same video file.
Summary of the invention
The present invention is for addressing the above problem, and a kind of method and apparatus of recorded video of simple to operate, functional diversities is provided.
For achieving the above object, the technical solution used in the present invention is:
A method for recorded video, is characterized in that, comprises the following steps:
10. open camera;
20. gather video data and carry out preview and preservation;
30. judge whether to receive time-out request, and if so, only carry out preview but do not preserve and perform step 40, otherwise execution step 20;
40. intervals judge whether to receive camera handover request, if so, close current camera and open another camera, otherwise continue only carry out preview but do not preserve;
50. judge whether to receive recovery request, if so, perform step 20, otherwise continue only carry out preview but do not preserve.
As preferred embodiment, in described step 30, receive and suspend after request, the time-out icon showing on the screen of equipment changes to recovery icon automatically.
As preferred embodiment, in described step 40 in the time that interval receives camera handover request, suspend the catching and preview of video data of current camera, and close current camera, then open another camera and proceed catching and preview of video data.
As preferred embodiment, described camera comprises front-facing camera and post-positioned pick-up head.
As preferred embodiment, described camera is built-in camera or external camera, and quantity is two or more.
As preferred embodiment, when maximum video size that described camera is supported is inconsistent, get minimum dimension in the maximum video size of the same ratio that all cameras support as the size of preserving video.
As preferred embodiment, when the video data size that described camera is caught is inconsistent with the size of preserving video, the video data size of camera being caught is carried out corresponding convergent-divergent.
In addition, the present invention also provides a kind of device of recorded video, it is characterized in that, it comprises:
Data acquisition module, for opening camera and gathering video data;
Coding output module, for exporting coding video data;
Thread control module, it is connected with described data acquisition module and coding output module, for the preservation thread of the buffer memory thread of the data acquisition module described in controlling and described coding output module;
Described thread control module receives while suspending request only carries out the preview of video data and allows to carry out the switching of camera; The preservation thread that continues the buffer memory thread of control data acquisition module and the output module of encoding when described thread control module receives recovery request carries out buffer memory and the preservation of video data.
As preferred embodiment, described camera is built-in camera or external camera, and quantity is two or more.
As preferred embodiment, when maximum video size that described camera is supported is inconsistent, get minimum dimension in the maximum video size of the same ratio that all cameras support as the size of preserving video.
As preferred embodiment, when the video data size that described camera is caught is inconsistent with the size of preserving video, the video data size of camera being caught is carried out corresponding convergent-divergent.
As preferred embodiment, described buffer memory thread writes multiple hard disk cache files by video data according to the rule of space or time, preserve the coding that thread takes out fixed disk file that buffer memory has completed and carry out video data in real time, this hard disk cache file of rear deletion of then having encoded.
As preferred embodiment, described thread control module adopts double buffering technology, and its circulation step comprises:
A, obtain, after video data, these data are carried out to buffer memory by system API, carry out the establishment of cache file at the hard disk of equipment by certain rule;
B, in the time that data reach certain threshold values, the data of suspending this cache file write and notify preserves the data that thread takes out this cache file and carries out the coding of video format and be saved in video file;
C, carry out the buffer memory of video data according to the new cache file of rule creation, by that analogy until suspend record or record complete;
D, be saved in video file when preserving the coding that thread reads the video data of cache file after notified and carry out video format, all encode the notice of rear wait buffer memory thread.
As preferred embodiment, described thread control module can also be heightened buffer memory thread and the thread priority of preserving thread.
The invention has the beneficial effects as follows:
The method and apparatus of a kind of recorded video of the present invention, it,, opening camera collection video data and carrying out can suspending in the process of preview and preservation, only carries out preview when time-out but does not preserve, and allowing to carry out camera switching at interval; Make user can bring into play more intention in video record process, and without multiple video segments are edited, more convenient operation.
Accompanying drawing explanation
Accompanying drawing described herein is used to provide a further understanding of the present invention, forms a part of the present invention, and schematic description and description of the present invention is used for explaining the present invention, does not form inappropriate limitation of the present invention.In the accompanying drawings:
Fig. 1 is the general flow chart of the method for a kind of recorded video of the present invention;
Fig. 2 is the device schematic diagram of a kind of recorded video of the present invention.
Embodiment
In order to make technical problem to be solved by this invention, technical scheme and beneficial effect clearer, clear, below in conjunction with drawings and Examples, the present invention is further elaborated.Should be appreciated that specific embodiment described herein, only in order to explain the present invention, is not intended to limit the present invention.
As shown in Figure 1, the method for a kind of recorded video of the present invention, it comprises the following steps:
10. open camera;
20. gather video data and carry out preview and preservation;
30. judge whether to receive time-out request, and if so, only carry out preview but do not preserve and perform step 40, otherwise execution step 20;
40. intervals judge whether to receive camera handover request, if so, close current camera and open another camera, otherwise continue only carry out preview but do not preserve;
50. judge whether to receive recovery request, if so, perform step 20, otherwise continue only carry out preview but do not preserve.
The method of recorded video of the present invention, opening camera collection video data and carrying out can suspending in the process of preview and preservation, is only carried out preview when time-out but does not preserve, and allowing to carry out camera switching at interval; Make user can bring into play more intention in video record process, and without multiple video segments are edited, more convenient operation.
Preferably, receive and suspend after request in described step 30, the time-out icon showing on the screen of equipment changes to recovery icon automatically; In described step 40, in the time that interval receives camera handover request, suspend the catching and preview of video data of current camera, and close current camera, then open another camera and proceed catching and preview of video data.
Above-mentioned camera can comprise front-facing camera and post-positioned pick-up head, allows user between front-facing camera and post-positioned pick-up head, to switch so that the seizure of camera lens at the interval of video record process; Or described camera is built-in camera or external camera, and quantity is two or more, same can switching according to the method described above between each built-in camera or between external camera or between built-in camera and external camera.
In the present embodiment, when maximum video size that described camera is supported is inconsistent, get minimum dimension in the maximum video size of the same ratio that all cameras support as the size of preserving video; Or when the video data size that described camera is caught is inconsistent with the size of preserving video, the video data size of camera being caught is carried out corresponding convergent-divergent.
In addition, as shown in Figure 2, the present invention also provides a kind of device of applying above-mentioned recorded video method, and it comprises:
Data acquisition module 100, for opening camera 400 and gathering video data;
Coding output module 200, for exporting coding video data;
Thread control module 300, it is connected with described data acquisition module 100 and coding output module 200, for controlling the buffer memory thread of described data acquisition module 100 and the preservation thread of described coding output module 200;
Described thread control module 300 receives while suspending request only carries out the preview of video data and allows to carry out the switching of camera 400; The preservation thread that continues the buffer memory thread of control data acquisition module 100 and the output module 200 of encoding when described thread control module 300 receives recovery request carries out buffer memory and the preservation of video data.Described buffer memory thread writes multiple hard disk cache files by video data according to the rule of space or time, preserves thread and take out in real time fixed disk file that buffer memory has completed and carry out the coding of video data, this hard disk cache file of rear deletion of then having encoded.Described thread control module 300 can also be heightened buffer memory thread and the thread priority of preserving thread.
Above-mentioned camera 400 be for can adopt built-in camera or external camera, and quantity is two or more, same can switching according to the method described above between each built-in camera or between external camera or between built-in camera and external camera.
In the present embodiment, when maximum video size that described camera 400 is supported is inconsistent, get minimum dimension in the maximum video size of the same ratio that all cameras support as the size of preserving video; Or when the video data size that described camera 400 is caught is inconsistent with the size of preserving video, the video data size of camera being caught is carried out corresponding convergent-divergent.
In the present embodiment, described thread control module 300 adopts double buffering technology, and its circulation step comprises:
A, obtain, after video data, these data are carried out to buffer memory by system API, carry out the establishment of cache file at the hard disk of equipment by certain rule;
B, in the time that data reach certain threshold values, the data of suspending this cache file write and notify preserves the data that thread takes out this cache file and carries out the coding of video format and be saved in video file;
C, carry out the buffer memory of video data according to the new cache file of rule creation, by that analogy until suspend record or record complete;
D, be saved in video file when preserving the coding that thread reads the video data of cache file after notified and carry out video format, all encode the notice of rear wait buffer memory thread.
The inventive method and device are adapted to the various equipment that has camera, the such as equipment such as pc client, cell-phone customer terminal, can also pass through the number of fetch equipment cpu, and carry out the coding efficiency of judgment device according to the number of cpu, and then arrange and the pixel of the corresponding recorded video of this coding efficiency, thereby make the video quality recorded better.
Above-mentioned explanation illustrates and has described the preferred embodiments of the present invention, as front, be to be understood that the present invention is not limited to disclosed form herein, should not regard the eliminating to other embodiment as, and can be used for various other combinations, modification and environment, and can, in invention contemplated scope herein, change by technology or the knowledge of above-mentioned instruction or association area.And the change that those skilled in the art carry out and variation do not depart from the spirit and scope of the present invention, all should be in the protection range of claims of the present invention.
Claims (14)
1. a method for recorded video, is characterized in that, comprises the following steps:
10. open camera;
20. gather video data and carry out preview and preservation;
30. judge whether to receive time-out request, and if so, only carry out preview but do not preserve and perform step 40, otherwise execution step 20;
40. intervals judge whether to receive camera handover request, if so, close current camera and open another camera, otherwise continue only carry out preview but do not preserve;
50. judge whether to receive recovery request, if so, perform step 20, otherwise continue only carry out preview but do not preserve.
2. the method for a kind of recorded video according to claim 1, is characterized in that: in described step 30, receive and suspend after request, the time-out icon showing on the screen of equipment changes to recovery icon automatically.
3. the method for a kind of recorded video according to claim 1, it is characterized in that: in described step 40 in the time that interval receives camera handover request, suspend the catching and preview of video data of current camera, and close current camera, then open another camera and proceed catching and preview of video data.
4. according to the method for a kind of recorded video described in claim 1 or 2 or 3, it is characterized in that: described camera comprises front-facing camera and post-positioned pick-up head.
5. according to the method for a kind of recorded video described in claim 1 or 2 or 3, it is characterized in that: described camera is built-in camera or external camera, and quantity is two or more.
6. according to the method for a kind of recorded video described in claim 1 or 2 or 3, it is characterized in that: when maximum video size that described camera is supported is inconsistent, get minimum dimension in the maximum video size of the same ratio that all cameras support as the size of preserving video.
7. according to the method for a kind of recorded video described in claim 1 or 2 or 3, it is characterized in that: when the video data size that described camera is caught is inconsistent with the size of preserving video, the video data size of camera being caught is carried out corresponding convergent-divergent.
8. a device for recorded video, is characterized in that, it comprises:
Data acquisition module, for opening camera and gathering video data;
Coding output module, for exporting coding video data;
Thread control module, it is connected with described data acquisition module and coding output module, for the preservation thread of the buffer memory thread of the data acquisition module described in controlling and described coding output module;
Described thread control module receives while suspending request only carries out the preview of video data and allows to carry out the switching of camera; The preservation thread that continues the buffer memory thread of control data acquisition module and the output module of encoding when described thread control module receives recovery request carries out buffer memory and the preservation of video data.
9. the device of a kind of recorded video according to claim 8, is characterized in that: described camera is built-in camera or external camera, and quantity is two or more.
10. the device of a kind of recorded video according to claim 8 or claim 9, it is characterized in that: when maximum video size that described camera is supported is inconsistent, get minimum dimension in the maximum video size of the same ratio that all cameras support as the size of preserving video.
The device of 11. a kind of recorded video according to claim 8 or claim 9, is characterized in that: when the video data size that described camera is caught is inconsistent with the size of preserving video, the video data size of camera being caught is carried out corresponding convergent-divergent.
The device of 12. a kind of recorded video according to claim 8, it is characterized in that: described buffer memory thread writes multiple hard disk cache files by video data according to the rule of space or time, preserve the coding that thread takes out fixed disk file that buffer memory has completed and carry out video data in real time, this hard disk cache file of rear deletion of then having encoded.
The device of 13. a kind of recorded video according to claim 8, is characterized in that: described thread control module adopts double buffering technology, and its circulation step comprises:
A, obtain, after video data, these data are carried out to buffer memory by system API, carry out the establishment of cache file at the hard disk of equipment by certain rule;
B, in the time that data reach certain threshold values, the data of suspending this cache file write and notify preserves the data that thread takes out this cache file and carries out the coding of video format and be saved in video file;
C, carry out the buffer memory of video data according to the new cache file of rule creation, by that analogy until suspend record or record complete;
D, be saved in video file when preserving the coding that thread reads the video data of cache file after notified and carry out video format, all encode the notice of rear wait buffer memory thread.
The device of 14. a kind of recorded video according to claim 8, is characterized in that: described thread control module can also be heightened buffer memory thread and the thread priority of preserving thread.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410054914.6A CN103813121A (en) | 2014-02-18 | 2014-02-18 | Method and apparatus for recording video |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410054914.6A CN103813121A (en) | 2014-02-18 | 2014-02-18 | Method and apparatus for recording video |
Publications (1)
Publication Number | Publication Date |
---|---|
CN103813121A true CN103813121A (en) | 2014-05-21 |
Family
ID=50709267
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201410054914.6A Pending CN103813121A (en) | 2014-02-18 | 2014-02-18 | Method and apparatus for recording video |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN103813121A (en) |
Cited By (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105554386A (en) * | 2015-12-23 | 2016-05-04 | 努比亚技术有限公司 | Mobile terminal and camera shooting control method thereof |
CN106254776A (en) * | 2016-08-22 | 2016-12-21 | 北京金山安全软件有限公司 | Video processing method and device and electronic equipment |
CN106303238A (en) * | 2016-08-16 | 2017-01-04 | 北京金山安全软件有限公司 | Video shooting method and device and electronic equipment |
CN106331478A (en) * | 2016-08-22 | 2017-01-11 | 维沃移动通信有限公司 | Video shooting method and mobile terminal |
CN106657774A (en) * | 2016-11-25 | 2017-05-10 | 杭州联络互动信息科技股份有限公司 | Method and device for recording video |
CN108090491A (en) * | 2017-11-08 | 2018-05-29 | 北京川上科技有限公司 | A kind of video recording method, device and computer readable storage medium |
CN108108268A (en) * | 2017-11-28 | 2018-06-01 | 北京川上科技有限公司 | Reboot process method and apparatus are exited in a kind of video record application |
CN108200341A (en) * | 2018-01-15 | 2018-06-22 | 青岛海信移动通信技术股份有限公司 | Seamless handover method, device and the terminal device of camera |
CN108769562A (en) * | 2018-06-29 | 2018-11-06 | 广州酷狗计算机科技有限公司 | The method and apparatus for generating special efficacy video |
CN109729294A (en) * | 2019-01-15 | 2019-05-07 | 深圳市云歌人工智能技术有限公司 | Video image acquisition methods, device, equipment and storage medium |
CN112188134A (en) * | 2020-09-30 | 2021-01-05 | 深圳市快易典教育科技有限公司 | Answer recording method, answer recording device, answer recording system, computer equipment and storage medium |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20040130658A1 (en) * | 2002-10-15 | 2004-07-08 | Matsushita Electric Industrial Co., Ltd. | Foldable mobile terminal device |
CN1933575A (en) * | 2006-09-30 | 2007-03-21 | 康佳集团股份有限公司 | Video recording method for photographic hand-held equipment |
CN101237556A (en) * | 2008-03-03 | 2008-08-06 | 宇龙计算机通信科技(深圳)有限公司 | Realization method, image display method and communication terminal for terminal with dual cameras |
CN202178804U (en) * | 2011-09-14 | 2012-03-28 | 舒东风 | Digital image device having externally connected pick-up head |
CN103281500A (en) * | 2013-04-24 | 2013-09-04 | 贵阳朗玛信息技术股份有限公司 | Method and device for processing videos |
CN103559150A (en) * | 2013-11-08 | 2014-02-05 | 深圳市道通科技有限公司 | Realizing method and device for external camera of host, and mobile terminal |
-
2014
- 2014-02-18 CN CN201410054914.6A patent/CN103813121A/en active Pending
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20040130658A1 (en) * | 2002-10-15 | 2004-07-08 | Matsushita Electric Industrial Co., Ltd. | Foldable mobile terminal device |
CN1933575A (en) * | 2006-09-30 | 2007-03-21 | 康佳集团股份有限公司 | Video recording method for photographic hand-held equipment |
CN101237556A (en) * | 2008-03-03 | 2008-08-06 | 宇龙计算机通信科技(深圳)有限公司 | Realization method, image display method and communication terminal for terminal with dual cameras |
CN202178804U (en) * | 2011-09-14 | 2012-03-28 | 舒东风 | Digital image device having externally connected pick-up head |
CN103281500A (en) * | 2013-04-24 | 2013-09-04 | 贵阳朗玛信息技术股份有限公司 | Method and device for processing videos |
CN103559150A (en) * | 2013-11-08 | 2014-02-05 | 深圳市道通科技有限公司 | Realizing method and device for external camera of host, and mobile terminal |
Cited By (14)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105554386A (en) * | 2015-12-23 | 2016-05-04 | 努比亚技术有限公司 | Mobile terminal and camera shooting control method thereof |
CN106303238B (en) * | 2016-08-16 | 2019-10-25 | 北京金山安全软件有限公司 | Video shooting method and device and electronic equipment |
CN106303238A (en) * | 2016-08-16 | 2017-01-04 | 北京金山安全软件有限公司 | Video shooting method and device and electronic equipment |
CN106254776A (en) * | 2016-08-22 | 2016-12-21 | 北京金山安全软件有限公司 | Video processing method and device and electronic equipment |
CN106331478A (en) * | 2016-08-22 | 2017-01-11 | 维沃移动通信有限公司 | Video shooting method and mobile terminal |
CN106657774A (en) * | 2016-11-25 | 2017-05-10 | 杭州联络互动信息科技股份有限公司 | Method and device for recording video |
CN108090491A (en) * | 2017-11-08 | 2018-05-29 | 北京川上科技有限公司 | A kind of video recording method, device and computer readable storage medium |
CN108090491B (en) * | 2017-11-08 | 2021-12-17 | 北京密境和风科技有限公司 | Video recording method, device and computer readable storage medium |
CN108108268A (en) * | 2017-11-28 | 2018-06-01 | 北京川上科技有限公司 | Reboot process method and apparatus are exited in a kind of video record application |
CN108200341A (en) * | 2018-01-15 | 2018-06-22 | 青岛海信移动通信技术股份有限公司 | Seamless handover method, device and the terminal device of camera |
CN108769562A (en) * | 2018-06-29 | 2018-11-06 | 广州酷狗计算机科技有限公司 | The method and apparatus for generating special efficacy video |
CN109729294A (en) * | 2019-01-15 | 2019-05-07 | 深圳市云歌人工智能技术有限公司 | Video image acquisition methods, device, equipment and storage medium |
CN112188134A (en) * | 2020-09-30 | 2021-01-05 | 深圳市快易典教育科技有限公司 | Answer recording method, answer recording device, answer recording system, computer equipment and storage medium |
CN112188134B (en) * | 2020-09-30 | 2023-02-28 | 深圳市快易典教育科技有限公司 | Answer recording method, answer recording device, answer recording system, computer equipment and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN103813121A (en) | Method and apparatus for recording video | |
US11551721B2 (en) | Video recording method and device | |
US10021302B2 (en) | Video recording method and device | |
US8314856B2 (en) | Imaging apparatus, variable speed imaging method, and recording medium storing program thereof | |
CN105187713A (en) | Shooting startup method and device synchronously supporting picture taking and video recording and shooting terminal | |
US20190166306A1 (en) | Imaging element, imaging apparatus, and control method for imaging element | |
JP2012151705A5 (en) | ||
US9740776B2 (en) | Method for extracting residual videos and deleted videos in a DVR hard disk | |
CN103916597A (en) | Shooting method based on simulated scenario | |
JP6137980B2 (en) | Recording apparatus and control method thereof | |
CN106657762A (en) | Method and system for generating thumbnail based on dual cameras | |
CN105933624A (en) | Method and device for recording website video | |
WO2015085930A1 (en) | Method and apparatus for comprehensively controlling photography | |
US9544532B2 (en) | System and method for pre-recording video | |
JP5268569B2 (en) | Recording apparatus and recording method | |
JP5284074B2 (en) | Image processing apparatus and image processing method | |
JP2006303641A5 (en) | ||
US9966103B2 (en) | Imaging apparatus and image recording processing method | |
JP2014175954A (en) | Data recording device, control method thereof, and computer program | |
JP2005039792A (en) | Recording apparatus and reproducing apparatus | |
RU2012103494A (en) | IMAGE DATA RECORDING DEVICE | |
KR20110038429A (en) | Photographing control method for setting photograph configuration according to image processing scheme applying to image contents and photographing apparatus using the same | |
JP2015023317A5 (en) | Image management apparatus, image management method, program, and storage medium | |
KR101610007B1 (en) | Method for generating video data | |
CN111107296A (en) | Audio data acquisition method and device, electronic equipment and readable storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
WD01 | Invention patent application deemed withdrawn after publication |
Application publication date: 20140521 |
|
WD01 | Invention patent application deemed withdrawn after publication |