Disclosure of Invention
In order to solve the technical problem, the invention provides a method and a device for recording a video.
According to an aspect of the embodiment, a method for recording a video is provided, and is applied to a cloud server, and the method includes:
receiving a recording instruction aiming at a target application from a terminal, taking a time point of receiving the recording instruction as an end time, or taking a time point of a first preset duration earlier than the time point as an end time, taking a time point of a second preset duration earlier than the end time as a start time, and taking a time period from the start time to the end time as a target time period;
determining videos in the target time period in the cache videos of the terminal in the cloud server, and determining historical operation information of the terminal for the target application;
and synchronously overlapping the historical operation information and the display video according to the timestamp of each operation in the historical operation information, and storing the overlapped video in a cloud or sending the overlapped video to the terminal.
The video recording method also has the following characteristics:
the synchronously overlaying the historical operation information with the display video comprises:
setting an operation key template of the terminal; and converting the historical operation information into a control video of the corresponding operation key on the operation key template, and overlapping the display video and the control video.
The video recording method also has the following characteristics:
overlaying the display video with the control video comprises: and setting the control video to be superposed on the display video in a display mode of preset transparency.
The video recording method also has the following characteristics:
after taking a time point of a second preset duration earlier than the end time as a start time, the method further includes: correcting the starting time, which specifically comprises the following steps: and judging whether the preset state change of the important character occurs in the time period from the time point before the second preset duration of the starting time to the starting time, and if so, taking the time point of the preset state change of the important character as the corrected starting time.
The video recording method also has the following characteristics:
the step of storing the superposed video in a cloud or sending the superposed video to the terminal comprises the following steps:
acquiring the network communication quality of the terminal and the cloud server in real time;
determining a compression ratio matching the network communication quality;
compressing the superposed video by a preset compression ratio;
and storing the compressed video in a cloud terminal or sending the compressed video to the terminal.
According to another aspect of the embodiment, there is also provided an apparatus for recording a video, applied to a cloud server, including:
the receiving module is used for receiving a recording instruction aiming at the target application from the terminal;
a first determining module, configured to use a time point at which the recording instruction is received as an end time, or use a time point that is earlier than the time point by a first preset time length as an end time, use a time point that is earlier than the end time by a second preset time length as a start time, and use a time period from the start time to the end time as a target time period;
the second determining module is used for determining videos in the target time period in the cache videos of the terminal in the cloud server and determining historical operation information of the terminal for the target application;
the superposition module is used for synchronously superposing the historical operation information and the display video according to the timestamp of each operation in the historical operation information;
the storage module is used for storing the superposed video in a cloud terminal;
and the sending module is used for sending the superposed video to the terminal.
The video recording device also has the following characteristics:
the superposition module is further used for synchronously superposing the historical operation information and the display video by using the following methods: setting an operation key template of the terminal; and converting the historical operation information into a control video of the corresponding operation key on the operation key template, and overlapping the display video and the control video.
The video recording device also has the following characteristics:
the overlay module is further configured to overlay the display video with the control video using: and setting the control video to be superposed on the display video in a display mode of preset transparency.
The video recording device also has the following characteristics:
the device further includes a correction module for correcting the start time, and specifically includes: and judging whether the preset state change of the important character occurs in the time period from the time point before the second preset duration of the starting time to the starting time, and if so, taking the time point of the preset state change of the important character as the corrected starting time.
The video recording device also has the following characteristics:
the device further comprises:
the detection module is used for acquiring the network communication quality of the terminal and the cloud server in real time;
the third determining module is used for determining a compression ratio matched with the network communication quality;
the compression module is used for compressing the superposed video by a preset compression ratio;
the storage module is used for storing the compressed video in a cloud terminal;
the sending module is further configured to send the compressed video to the terminal.
The method and the device for recording the video can intelligently provide the cloud video which is close to the user requirement to the maximum extent for the terminal, so that the user can conveniently obtain the required historical video.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention. It should be noted that the embodiments and features of the embodiments in the present application may be arbitrarily combined with each other without conflict.
Fig. 1 is a flowchart illustrating a method for recording a video according to an embodiment, where the method is applied to a cloud server, and as shown in fig. 1, the method includes:
step S101, receiving a recording instruction for a target application from a terminal.
Step S102, taking the time point of receiving the recording instruction as the end time, or taking the time point of a first preset time length earlier than the time point as the end time, taking the time point of a second preset time length earlier than the end time as the start time, and taking the time period from the start time to the end time as the target time period.
Step S103, determining videos in a target time period in cache videos of a terminal in a cloud server, and determining historical operation information of the terminal for a target application;
and step S104, synchronously overlaying the historical operation information and the display video according to the time stamp of each operation in the historical operation information.
And step S105, storing the superposed video in a cloud or sending the superposed video to the terminal.
Wherein the content of the first and second substances,
the scheme that the time point of the first preset time length earlier than the time point is taken as the ending time fully considers the problem of network delay, and the first preset time length is smaller than 1 second in general.
In step S102, after taking a time point of a second preset duration earlier than the end time as a start time, the method further includes: correcting the starting time, which specifically comprises the following steps: and judging whether the preset state change of the important character occurs in the time period from the time point before the second preset duration of the starting time to the starting time, and if so, taking the time point of the preset state change of the important character as the corrected starting time. The important role may be a role preset by a user. For example, the preset states of the important character include: survival status, death status, etc. Compared with the mode of presetting fixed time length, the method can more intelligently record important contents for users.
The step of synchronously overlaying the historical operation information and the display video in the step S104 comprises the following steps: setting an operation key template of the terminal; and converting the historical operation information into a control video of the corresponding operation key on the operation key template, and overlapping the display video and the control video. For example, when the terminal is a handle device, an operation key template is set, the operation key template is provided with a plurality of virtual keys, and the virtual keys correspond to the physical keys on the handle device one to one.
The superimposing the display video and the control video in the step S104 includes: and setting a display mode of the control video with preset transparency to be superposed on the display video.
In order to maximally accommodate terminals with different processing capabilities and storage capabilities, in step S105, a mode of storing the superimposed video in the cloud is preferred, and after receiving a request for acquiring the video sent by the terminal, the video is sent to the terminal.
The step S105 of sending the superimposed video to the terminal includes: and compressing the superposed video by a preset compression ratio, and then sending the video to the terminal. The compression function can improve the data transmission efficiency and save the storage space of the terminal.
Fig. 2 is a structural diagram of an apparatus for recording video, which is applied to a cloud server in an embodiment, as shown in fig. 2, the apparatus includes:
the receiving module is used for receiving a recording instruction aiming at the target application from the terminal;
a first determining module, configured to use a time point at which the recording instruction is received as an end time, or use a time point that is earlier than the time point by a first preset time length as an end time, use a time point that is earlier than the end time by a second preset time length as a start time, and use a time period from the start time to the end time as a target time period;
the second determining module is used for determining videos in the target time period in the cache videos of the terminal in the cloud server and determining historical operation information of the terminal for the target application;
the superposition module is used for synchronously superposing the historical operation information and the display video according to the timestamp of each operation in the historical operation information;
the storage module is used for storing the superposed video in a cloud terminal;
and the sending module is used for sending the superposed video to the terminal.
Wherein the content of the first and second substances,
a superimposing module further configured to superimpose the historical operational information in synchronization with the display video using: setting an operation key template of the terminal; and converting the historical operation information into a control video of the corresponding operation key on the operation key template, and overlapping the display video and the control video.
A superimposition module further configured to superimpose the display video with the control video using: and setting the control video to be superposed on the display video in a display mode of preset transparency.
The device further comprises a correction module for correcting the starting time, and the correction module specifically comprises: and judging whether the preset state change of the important character occurs in the time period from the time point before the second preset duration of the starting time to the starting time, and if so, taking the time point of the preset state change of the important character as the corrected starting time.
This device still includes:
the detection module is used for acquiring the network communication quality of the terminal and the cloud server in real time;
the third determining module is used for determining a compression ratio matched with the network communication quality;
and the compression module is used for compressing the superposed video by a preset compression ratio.
The storage module is used for storing the compressed video in a cloud terminal;
the sending module is further configured to send the compressed video to the terminal.
The method and the device for recording the video can intelligently provide the cloud video which is close to the user requirement to the maximum extent for the terminal, so that the user can conveniently obtain the required historical video.
The above-described aspects may be implemented individually or in various combinations, and such variations are within the scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein.
It will be understood by those skilled in the art that all or part of the steps of the above methods may be implemented by instructing the relevant hardware through a program, and the program may be stored in a computer-readable storage medium, such as a read-only memory, a magnetic or optical disk, and the like. Alternatively, all or part of the steps of the foregoing embodiments may also be implemented by using one or more integrated circuits, and accordingly, each module/unit in the foregoing embodiments may be implemented in the form of hardware, and may also be implemented in the form of a software functional module. The present invention is not limited to any specific form of combination of hardware and software.
It is to be noted that, in this document, the terms "comprises", "comprising" or any other variation thereof are intended to cover a non-exclusive inclusion, so that an article or apparatus including a series of elements includes not only those elements but also other elements not explicitly listed or inherent to such article or apparatus. Without further limitation, an element defined by the phrase "comprising … …" does not exclude the presence of additional like elements in the article or device comprising the element.
The above embodiments are merely to illustrate the technical solutions of the present invention and not to limit the present invention, and the present invention has been described in detail with reference to the preferred embodiments. It will be understood by those skilled in the art that various modifications and equivalent arrangements may be made without departing from the spirit and scope of the present invention and it should be understood that the present invention is to be covered by the appended claims.