Disclosure of Invention
In order to solve the problems in the prior art, embodiments of the present invention provide a method and an apparatus for recording multimedia data.
In one aspect, a multimedia data recording method is provided, and the method includes:
receiving a recording instruction;
the method comprises the steps of simultaneously obtaining multimedia data of a first resolution and multimedia data of a second resolution, wherein the first resolution is different from the second resolution.
Optionally, after the simultaneously acquiring the multimedia data of the first resolution and the multimedia data of the second resolution, the method further includes:
and transmitting the multimedia data with the second resolution to a preset server in real time through a network.
Optionally, the second resolution is a preview resolution of the mobile terminal.
Optionally, the simultaneously acquiring the multimedia data of the first resolution and the multimedia data of the second resolution includes:
acquiring the first resolution and the second resolution;
recording the multimedia data based on the first resolution to obtain the multimedia data of the first resolution;
displaying preview data of the multimedia data based on the second resolution in the process of recording the multimedia data of the first resolution;
and recording the preview data of the multimedia data to obtain the multimedia data of the second resolution.
Optionally, when the recording instruction is received, after the first resolution and the second resolution are obtained, the method further includes:
setting a preview resolution of the preview data to the second resolution; or,
and when a resolution setting instruction of the preview data is received, setting the preview resolution as the second resolution carried by the resolution setting instruction.
Optionally, after the simultaneously acquiring the multimedia data of the first resolution and the multimedia data of the second resolution, the method further includes:
when a recording stopping instruction is received, stopping recording the multimedia data;
storing the multimedia data of the first resolution.
Optionally, the first resolution is greater than the second resolution.
In another aspect, there is provided a multimedia data recording apparatus, the apparatus including:
the receiving module is used for receiving a recording instruction;
the device comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for simultaneously acquiring multimedia data of a first resolution and multimedia data of a second resolution, and the first resolution is different from the second resolution.
Optionally, the apparatus further comprises:
and the transmission module is used for transmitting the multimedia data with the second resolution to a preset server in real time through a network.
Optionally, the second resolution is a preview resolution of the mobile terminal.
Optionally, the obtaining module includes:
an acquisition unit configured to acquire the first resolution and the second resolution;
the first recording unit is used for recording the multimedia data based on the first resolution to obtain the multimedia data of the first resolution;
the display unit is used for displaying the preview data of the multimedia data based on the second resolution in the process of recording the multimedia data of the first resolution;
and the second recording unit is used for recording the preview data of the multimedia data to obtain the multimedia data with the second resolution.
Optionally, the obtaining module further includes:
a first setting unit configured to set a preview resolution of the preview data to the second resolution; or,
and the second setting unit is used for setting the preview resolution as the second resolution carried by the resolution setting instruction when the resolution setting instruction of the preview data is received.
Optionally, the apparatus further comprises:
the stopping module is used for stopping recording the multimedia data when receiving a recording stopping instruction;
and the storage module is used for storing the multimedia data with the first resolution.
Optionally, the first resolution is greater than the second resolution.
The technical scheme provided by the embodiment of the invention has the following beneficial effects: in the embodiment of the invention, when the terminal receives the recording instruction, the multimedia data with the first resolution and the multimedia data with the second resolution can be simultaneously obtained, and the first resolution is not equal to the second resolution, so that the recording of the multimedia data with a plurality of resolutions is completed, the multimedia data with different resolutions is obtained, the terminal can select the multimedia data with lower resolution to be transmitted to the preset server in real time, the real-time uploading of the multimedia data is ensured, the multimedia data with high resolution is also obtained, and the quality of the recorded multimedia data is ensured.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, embodiments of the present invention will be described in detail with reference to the accompanying drawings.
Before explaining the embodiments of the present invention in detail, an application scenario of the embodiments of the present invention will be described. At present, the capability of recording multimedia data by a terminal is getting stronger, and when the terminal determines that a resolution for recording the multimedia data is set by a user through a specified operation, the multimedia data can be recorded according to the resolution. However, in some scenarios, not only the multimedia data with high resolution needs to be recorded, but also the recorded multimedia data needs to be uploaded to a preset server in real time for the preset server to process. However, the requirement of the high-definition multimedia data on the network is high, so that a pause phenomenon may occur during real-time uploading, and the real-time performance of multimedia data uploading is reduced. Recording only low definition multimedia data may not satisfy the user's demand for multimedia data, such as law enforcement scene recording. Therefore, the embodiment of the present invention provides a multimedia data recording method, which can record multimedia data with low definition resolution in a process of recording multimedia data with high definition resolution, so that the multimedia data with low definition resolution can be uploaded to a preset server in real time, thereby ensuring the real-time uploading of the multimedia data, acquiring the multimedia data with high definition resolution, and ensuring the quality of the recorded multimedia data.
Fig. 1 is a flowchart of a multimedia data recording method according to an embodiment of the present invention, and referring to fig. 1, the method includes:
step 101: and receiving a recording instruction.
Step 102: and simultaneously acquiring multimedia data with a first resolution and multimedia data with a second resolution, wherein the first resolution is different from the second resolution so as to record the multimedia data. In the embodiment of the invention, when the terminal receives the recording instruction, the multimedia data with the first resolution and the multimedia data with the second resolution can be simultaneously obtained, and the first resolution is different from the second resolution, so that the multimedia data with the multiple resolutions can be recorded, the multimedia data with different resolutions can be obtained, the terminal can select the multimedia data with lower resolution to be uploaded to the preset server in real time, the real-time uploading of the multimedia data is ensured, the multimedia data with high resolution is also obtained, and the quality of the recorded multimedia data is ensured.
Fig. 2 is a flowchart of a multimedia data recording method according to an embodiment of the present invention, and referring to fig. 2, the method includes:
step 201: and when the mobile terminal receives the recording instruction, acquiring the first resolution and the second resolution.
In order to record multimedia data of different resolutions simultaneously, the first resolution and the second resolution may be acquired when the mobile terminal receives a recording instruction.
It should be noted that the multimedia data is data acquired by the mobile terminal through the camera to the external environment.
It should be further noted that the recording instruction is used for recording the multimedia data, and the recording instruction may be triggered by a user through a specified operation, where the specified operation may be a click operation, a slide operation, a voice operation, and the like, and this is not specifically limited in this embodiment of the present invention.
The operation of the mobile terminal to acquire the first resolution and the second resolution may be: when the mobile terminal receives the first resolution setting instruction, the mobile terminal can receive the resolution carried by the first resolution setting instruction and set the received resolution as the first resolution; when the mobile terminal receives the second resolution setting instruction, the mobile terminal may receive the resolution carried by the second resolution setting instruction, and set the received resolution as the second resolution.
For example, when the mobile terminal receives a first resolution setting instruction, the mobile terminal may receive a resolution 1280 × 720 carried in the first resolution setting instruction, and set the received resolution 1280 × 720 as the first resolution setting; when the mobile terminal receives the second resolution setting instruction, the mobile terminal may receive the resolution 720 × 480 carried in the second resolution setting instruction, and set the received resolution 720 × 480 as the second resolution.
It should be noted that the first resolution setting instruction is used to set the first resolution, and the first resolution setting instruction may be triggered by a user through a specified operation, which is not specifically limited in this embodiment of the present invention. Similarly, the second resolution setting instruction is used to set the second resolution, and the second resolution setting instruction may also be triggered by a user through a specified operation, which is also not specifically limited in this embodiment of the present invention.
In addition, the mobile terminal may not only obtain the first resolution and the second resolution in the above manner, but also obtain the first resolution and the second resolution in other manners, for example, the mobile terminal may obtain the default first resolution and the default second resolution, or the mobile terminal may obtain the first resolution and the second resolution that are set when the user records the multimedia data last time, which is not specifically limited in the embodiment of the present invention.
It should be noted that, in the embodiment of the present invention, the first resolution is different from the second resolution, and the first resolution may be greater than the second resolution, and certainly, the first resolution may also be smaller than the second resolution, which is not specifically limited in the embodiment of the present invention.
Furthermore, since the mobile terminal usually displays the preview data of the multimedia data on the screen of the mobile terminal when recording the multimedia data, so that the user can view the recording effect in real time, and the preview resolution of the preview data may be the same as or different from the resolution of the recorded multimedia data. Therefore, in the embodiment of the present invention, after the mobile terminal receives the recording instruction and acquires the first resolution and the second resolution, the mobile terminal may further set the preview resolution of the preview data.
In order to record the multimedia data with the second resolution, the mobile terminal may set the preview resolution of the preview data to the second resolution, or the mobile terminal may set the preview resolution to the second resolution carried by the resolution setting instruction of the preview data when receiving the resolution setting instruction of the preview data.
For example, when the second resolution is 720 × 480, the mobile terminal may set the preview resolution of the preview data to 720 × 480; or, when the mobile terminal receives a resolution setting instruction and the second resolution carried in the resolution setting instruction is 720 × 480, the mobile terminal may set the preview resolution to 720 × 480.
It should be noted that the resolution setting instruction of the preview data is used to set the preview resolution of the preview data, and the resolution setting instruction may also be triggered by a user through a specified operation, which is not specifically limited in this embodiment of the present invention.
It should be further noted that, in the embodiment of the present invention, the preview resolution of the mobile terminal may also be a fixed value, that is, the mobile terminal cannot set the preview resolution. Therefore, the second resolution acquired by the mobile terminal is a preview resolution of the mobile terminal, which is not specifically limited in the embodiment of the present invention.
Step 202: and the mobile terminal records the multimedia data based on the first resolution to obtain the multimedia data with the first resolution.
Specifically, the mobile terminal may record the multimedia data based on the first resolution by using a recording interface of an operating system where the mobile terminal is located, so as to obtain the multimedia data with the first resolution.
It should be noted that the operating system may be an operating system used by an IOS (operating system used by an intelligent mobile terminal such as an iPhone mobile Phone introduced by the APPLE inc.), a Windows Phone system, an Android system, and the like, which is not specifically limited in this embodiment of the present invention.
It should be further noted that, based on the first resolution, the mobile terminal records the multimedia data by using the recording interface of the operating system where the mobile terminal is located, and reference may be made to related technologies for obtaining the multimedia data with the first resolution, which is not described in detail in this embodiment of the present invention.
Step 203: and displaying the preview data of the multimedia data based on the second resolution in the process of recording the multimedia data of the first resolution by the mobile terminal.
Since the mobile terminal sets the preview resolution of the preview data to the second resolution after the mobile terminal acquires the first resolution and the second resolution in order to record the multimedia data with different resolutions at the same time, the preview data of the multimedia data can be displayed based on the second resolution in the process of recording the multimedia data with the first resolution by the mobile terminal.
It should be noted that, reference may be made to related technologies for the operation of displaying the preview data of the multimedia data by the mobile terminal, and this is not specifically limited in the embodiment of the present invention.
Step 204: and the mobile terminal records the preview data of the multimedia data to obtain the multimedia data with the second resolution.
Specifically, the mobile terminal may encode the preview data into data in a specified format through a preview module; sending the encoded preview data to a recording module; and when the encoded preview data is received through the recording module, decoding the encoded preview data through the recording module so as to record the multimedia data with the second resolution.
It should be noted that the preview module and the recording module are entity modules in the mobile terminal, the preview module is used for performing operations such as encoding on the preview data, and the recording module is used for performing operations such as decoding on the encoded preview data, which is not specifically limited in this embodiment of the present invention.
It should be noted that, in the embodiment of the present invention, only the preview module and the recording module are taken as examples to describe the entity apparatus of the embodiment of the present invention, and the embodiment of the present invention is not limited.
In addition, the specified format is a format that can be encoded by an encoder in the preview module and a format that can be decoded by a decoder in the recording module, and the specified format may be a YUV422 format, a YUV420 format, or the like.
It should be further noted that the recording module decodes the encoded preview data, that is, the recording module records the multimedia data with the second resolution.
In addition, when the mobile terminal records the multimedia data at the first resolution and the second resolution simultaneously, the mobile terminal can acquire the multimedia data with the high-definition resolution as the first resolution and transmit the recorded multimedia data with the low-definition resolution as the second resolution to the preset server in real time through the network because the first resolution is higher than the second resolution, thereby ensuring the quality of recording the multimedia data and the real-time property of uploading the multimedia data.
Moreover, in the embodiment of the present invention, the first resolution may be greater than the second resolution, or the first resolution may be smaller than the second resolution, so that, in order to ensure the real-time performance of the multimedia data uploading, when the first resolution is greater than the second resolution, the multimedia data of the second resolution may be transmitted to the preset server in real time through the network; when the first resolution is smaller than the second resolution, the multimedia data of the first resolution can be transmitted to a preset server in real time through a network.
It should be further noted that, when the encoder and the decoder encode and decode data with different resolutions, the amount of calculation that the encoder needs to perform is smaller for the data with the smaller resolution, and similarly, the amount of calculation that the decoder needs to perform is also smaller when the decoder decodes, therefore, when the first resolution is greater than the second resolution, and when the mobile terminal records multimedia data, the amount of calculation that the mobile terminal performs is smaller in the process of encoding preview data by the encoder, and the amount of calculation is also smaller in the process of decoding the encoded preview data by the decoder, thereby reducing the burden of the mobile terminal in operation and improving the recording efficiency of the mobile terminal in recording multimedia data.
In addition, when the first resolution is lower than the second resolution and the preview resolution of the preview data is the second resolution of the high-definition resolution, the mobile terminal has higher requirement on the encoding technology of the encoder when the mobile terminal encodes the preview data through the encoder, and the encoder has higher precision in encoding the preview data; meanwhile, when the mobile terminal decodes the encoded preview data through the decoder, the decoding technology requirement of the decoder is higher, and the decoding precision of the decoder on the encoded preview data is also higher, so that the recording quality of the multimedia data with the second resolution is ensured.
It should be noted that, in the embodiment of the present invention, in order to improve the efficiency of recording the multimedia data, it is generally preferable that the first resolution is greater than the second resolution.
Further, when the mobile terminal receives a recording stop instruction during recording the preview data of the multimedia data, the mobile terminal may stop recording the multimedia data and store the multimedia data with the first resolution.
When the mobile terminal receives the stop instruction, the recording of the multimedia data with the first resolution can be stopped, the U-shield-european media data with the second resolution is encapsulated by a media multiplexer in the recording module, and a recording file is generated, so that the recording of the multimedia data with the second resolution is stopped.
It should be noted that, for the operation of stopping recording the multimedia data with the first resolution by the mobile terminal, encapsulating the multimedia data with the second resolution by the media multiplexer, and generating the recording file, reference may be made to related technologies, and this is not described in detail in this embodiment of the present invention.
It should be further noted that the recording stopping instruction is used to stop recording the multimedia data, and the recording stopping instruction may be triggered by a user through a specified operation, which is not specifically limited in the embodiment of the present invention.
In the embodiment of the present invention, the mobile terminal may obtain the first resolution and the second resolution, and record the multimedia data based on the first resolution to obtain the multimedia data with the first resolution. Because the mobile terminal can set the preview resolution of the preview data to the second resolution, the mobile terminal can display the preview data with the second resolution in the process of recording the multimedia data with the first resolution, and record the preview data based on the second resolution, thereby obtaining the multimedia data with the second resolution, and completing the recording of the multimedia data with a plurality of resolutions. Meanwhile, because the first resolution is greater than the second resolution, the mobile terminal can transmit the multimedia data of the second resolution to the preset server in real time in the recording process of the multimedia data of the second resolution, so that the real-time uploading of the multimedia data is ensured, the multimedia data of which the high-definition resolution is the first resolution is also acquired, and the quality of recording the multimedia data is ensured.
Referring to fig. 3, an embodiment of the present invention provides a schematic structural diagram of a multimedia data recording apparatus, where the apparatus includes: a receiving module 301 and an obtaining module 302.
A receiving module 301, configured to receive a recording instruction;
the obtaining module 302 is configured to obtain multimedia data of a first resolution and multimedia data of a second resolution at the same time, where the first resolution is different from the second resolution.
Optionally, the apparatus further comprises:
a transmission module 303, configured to transmit the multimedia data with the second resolution to a preset server in real time through a network.
Optionally, the second resolution is a preview resolution of the mobile terminal.
Optionally, referring to fig. 4, the obtaining module 302 includes:
an acquisition unit 3021 configured to acquire a first resolution and a second resolution;
a first recording unit 3022, configured to record the multimedia data based on the first resolution to obtain the multimedia data with the first resolution;
a display unit 3023, configured to display preview data of the multimedia data based on the second resolution in the process of recording the multimedia data of the first resolution;
the second recording unit 3024 is configured to record the preview data of the multimedia data to obtain the multimedia data with the second resolution.
Optionally, the obtaining module 302 further includes:
a first setting module 3025 configured to set the preview resolution of the preview data to the second resolution; or,
a second setting module 3026, configured to, when receiving the resolution setting instruction of the preview data, set the preview resolution to the second resolution carried by the resolution setting instruction.
Optionally, the apparatus further comprises:
a stopping module 304, configured to stop recording the multimedia data when receiving a recording stopping instruction;
a storage module 305, configured to store the multimedia data of the first resolution.
Optionally, the first resolution is greater than the second resolution.
In summary, in the embodiment of the present invention, the terminal may obtain the first resolution and the second resolution, and record the multimedia data based on the first resolution to obtain the multimedia data with the first resolution. Because the terminal can set the preview resolution of the preview data to the second resolution, the terminal can display the preview data with the second resolution in the process of recording the multimedia data with the first resolution, and record the preview data based on the second resolution, thereby obtaining the multimedia data with the second resolution and completing the recording of the multimedia data with a plurality of resolutions. Meanwhile, the first resolution is larger than the second resolution, and the terminal can transmit the multimedia data of the second resolution to the preset server in real time in the recording process of the multimedia data of the second resolution, so that the real-time uploading of the multimedia data is ensured, the multimedia data with the high-definition resolution as the first resolution is also acquired, and the quality of recording the multimedia data is ensured.
It should be noted that: in the multimedia data recording apparatus provided in the foregoing embodiment, only the division of the functional modules is illustrated when multimedia recording is performed, and in practical applications, the function distribution may be completed by different functional modules according to needs, that is, the internal structure of the apparatus is divided into different functional modules to complete all or part of the functions described above. In addition, the embodiments of the multimedia data recording apparatus and the multimedia data recording method provided by the above embodiments belong to the same concept, and specific implementation processes thereof are described in the embodiments of the methods for details, and are not described herein again.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, where the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.