CN112153456A - Video data recording method and device, electronic equipment and storage medium - Google Patents

Video data recording method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN112153456A
CN112153456A CN202011023587.XA CN202011023587A CN112153456A CN 112153456 A CN112153456 A CN 112153456A CN 202011023587 A CN202011023587 A CN 202011023587A CN 112153456 A CN112153456 A CN 112153456A
Authority
CN
China
Prior art keywords
data
target audio
audio data
video data
track
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.)
Granted
Application number
CN202011023587.XA
Other languages
Chinese (zh)
Other versions
CN112153456B (en
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.)
Beijing Dajia Internet Information Technology Co Ltd
Original Assignee
Beijing Dajia Internet Information 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 Beijing Dajia Internet Information Technology Co Ltd filed Critical Beijing Dajia Internet Information Technology Co Ltd
Priority to CN202011023587.XA priority Critical patent/CN112153456B/en
Publication of CN112153456A publication Critical patent/CN112153456A/en
Application granted granted Critical
Publication of CN112153456B publication Critical patent/CN112153456B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/433Content storage operation, e.g. storage operation in response to a pause request, caching operations
    • H04N21/4334Recording operations
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/439Processing of audio elementary streams
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/80Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
    • H04N21/81Monomedia components thereof
    • H04N21/8106Monomedia components thereof involving special audio data, e.g. different tracks for different languages

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Signal Processing For Digital Recording And Reproducing (AREA)
  • Management Or Editing Of Information On Record Carriers (AREA)

Abstract

The present disclosure relates to a method and an apparatus for recording video data, an electronic device, and a storage medium, wherein the method for recording video data includes: responding to screen recording operation of video data, acquiring an image frame of the image data played currently, and extracting target audio data from a target audio track of a data storage area; wherein each target audio data in the video data is played while being synchronously stored to a unique one of the tracks of the data storage area; each track in the data store refers to a unique one of the data store regions; the target audio track stores the currently played target audio data in the video data; and combining the collected image frames and the extracted target audio data to be used as a recorded video of the video data. Therefore, the purpose of avoiding the mixing of the audio in the recorded video data and recording the recorded video containing high-quality target audio data in the playing process of the video data is achieved.

Description

Video data recording method and device, electronic equipment and storage medium
Technical Field
The present disclosure relates to the field of audio processing technologies, and in particular, to a method and an apparatus for recording video data, an electronic device, and a storage medium.
Background
Currently, in the playing process of video data, video recording can be performed synchronously, for example: and the game player synchronously records the video during the game playing process. In the process of recording video data, the audio in the video data is usually the sound played by a speaker recorded by a microphone.
However, the sound quality of sound reproduced by a speaker recorded by a microphone is poor. Moreover, if the user speaks or connects a microphone with another user online during the process of recording the video data, the microphone may record the voice of the user speaking, which may cause the audio in the recorded video data to be mixed.
Disclosure of Invention
The present disclosure provides a method and an apparatus for recording video data, an electronic device, and a storage medium, so as to record a recorded video containing high-quality audio data during a playing process of the video data. The technical scheme of the disclosure is as follows:
according to a first aspect of the embodiments of the present disclosure, there is provided a method for recording video data, including:
responding to screen recording operation of video data, acquiring an image frame of the image data played currently, and extracting target audio data from a target audio track of a data storage area; wherein each target audio data in the video data is played while being synchronously stored to a unique one of the tracks of the data storage area; each track in the data store refers to a unique one of the data store regions; the target audio track stores the currently played target audio data in the video data;
and combining the collected image frames and the extracted target audio data to be used as a recorded video of the video data.
Optionally, the extracting target audio data from a target audio track in the data storage area includes:
extracting target audio data subsections stored on the target audio track within the preset time interval at the end time point of each preset time interval;
and combining the target audio data sub-segments according to the extracted sequence of the target audio data sub-segments to obtain the extracted target audio data.
Optionally, before the combining the target audio data sub-segments according to the extracted order of the target audio data sub-segments to obtain the extracted target audio data, the method further includes:
and mixing a plurality of target audio data sub-segments belonging to the same preset time interval, wherein different target audio data sub-segments belonging to the same preset time interval come from different target audio tracks.
Optionally, the extracting target audio data from a target audio track in the data storage area includes:
extracting target audio data stored on each audio track currently existing in the data storage area; wherein the audio track belonging to the extracted target audio data in the data storage area is deleted;
and mixing the extracted target audio data stored on each audio track.
Optionally, the extracting target audio data stored on each audio track currently existing in the data storage area includes:
extracting target audio data subsegments stored in each audio track currently existing in the data storage area within the preset time interval at the end time point of each preset time interval;
wherein the mixing the extracted target audio data stored on each audio track includes:
and mixing the plurality of target audio data sub-segments belonging to the same preset time interval.
Optionally, before storing the target audio data, each audio track in the data storage area stores mute data for a preset time period; wherein the duration of the mute data of the preset time period is related to the speed of the audio track stored in the data storage area when the target audio data is played and the speed of extracting the target audio data from the target audio track in the data storage area.
Optionally, the method for recording video data further includes:
responding to the pause playing operation of video data, stopping playing the video data, synchronously storing the target audio data currently played in the video data to the audio track corresponding to the target audio data, and stopping extracting the target audio data stored on the target audio track;
responding to the continuous playing operation of the video data, starting from the pause point of the video data, continuously playing the video data, continuously and synchronously storing the target audio data after the pause point in the target audio data which is paused in the video data into the audio track corresponding to the target audio data, and extracting the target audio data after the pause point stored in the target audio track.
According to a second aspect of the embodiments of the present disclosure, there is provided an apparatus for recording video data, including:
the acquisition unit is configured to execute screen recording operation responding to video data and acquire an image frame of the image data played currently; wherein each target audio data in the video data is played while being synchronously stored to a unique one of the tracks in the data storage area; the target audio track stores the currently played target audio data in the video data; each track in the data store refers to a unique one of the data store regions;
an extraction unit configured to perform a screen recording operation in response to the video data, extracting target audio data from a target track of the data storage area;
a first combining unit configured to perform combining the captured image frame and the extracted target audio data as a recorded video of the video data.
Optionally, the extracting unit includes:
a first extraction subunit configured to perform extraction of a target audio data sub-segment within each preset time interval stored on the target audio track at an end time point of the preset time interval;
a second combining unit configured to perform combining the target audio data sub-segments in an order in which the target audio data sub-segments are extracted, resulting in the extracted target audio data.
Optionally, the apparatus for recording video data further includes:
a first mixing unit, configured to perform mixing of multiple target audio data sub-segments belonging to the same preset time interval before the step of combining each target audio data sub-segment according to the extracted sequence of the target audio data sub-segments, where different target audio data sub-segments belonging to the same preset time interval are from different target tracks.
Optionally, the extracting unit includes:
a second extraction subunit configured to perform extraction of target audio data stored on the respective tracks currently in the data storage area; wherein the audio track belonging to the extracted target audio data in the data storage area is deleted;
and the second mixing unit is used for mixing the extracted target audio data stored on each audio track.
Optionally, when the second extracting subunit performs extracting target audio data stored on each current audio track of the data storage area, the second extracting subunit is configured to perform extracting, at an end time point of each preset time interval, a target audio data sub-segment stored on each current audio track of the data storage area within the preset time interval;
the second mixing unit is configured to perform mixing of a plurality of target audio data sub-segments belonging to the same preset time interval when performing mixing of the extracted target audio data stored on each audio track.
Optionally, the apparatus for recording video data further includes:
before storing target audio data, each audio track in the data storage area stores mute data of a preset time period; wherein the duration of the mute data of the preset time period is related to the speed of the audio track stored in the data storage area when the target audio data is played and the speed of extracting the target audio data from the target audio track in the data storage area.
Optionally, the apparatus for recording video data further includes:
a stopping unit configured to perform a pause playing operation in response to video data, stop playing the video data, stop synchronously storing target audio data currently played in the video data to a track corresponding to the target audio data, and stop extracting the target audio data stored on the target track;
the continuous playing unit is configured to execute a continuous playing operation responding to video data, continue playing the video data from the pause point of the video data, continue synchronously storing the target audio data after the pause point in the target audio data of the video data which is paused to the audio track corresponding to the target audio data, and extract the target audio data after the pause point stored on the target audio track.
According to a third aspect of the embodiments of the present disclosure, there is provided an electronic apparatus including:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the method of recording video data as claimed in any one of the above.
According to a fourth aspect of embodiments of the present disclosure, there is provided a storage medium, wherein instructions that, when executed by a processor of an electronic device, enable the electronic device to perform the method of recording video data as in any one of the above.
According to a fifth aspect of embodiments of the present disclosure, there is provided a computer program product for performing any of the above-described video data recording methods when the computer program product is executed.
The technical scheme provided by the embodiment of the disclosure at least brings the following beneficial effects:
after the screen recording operation of the response video data, acquiring an image frame of the image data played currently, and extracting target audio data from a target audio track in a data storage area; wherein each track in the data store refers to a unique one of the data store; when each target audio data in the video data is played, synchronously storing the target audio data into only one audio track of the data storage area; the target audio track stores the currently played target audio data in the video data; and combining the collected image frames and the extracted target audio data to be used as a recorded video of the video data. Therefore, the purpose of avoiding the mixing of the audio in the recorded video data and recording the recorded video containing high-quality target audio data in the playing process of the video data is achieved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the disclosure and are not to be construed as limiting the disclosure.
Fig. 1 is a flow chart illustrating a method of recording video data according to an exemplary embodiment;
fig. 2 is a flow chart illustrating another method of recording video data according to an example embodiment;
fig. 3 is a schematic diagram illustrating a method of recording video data according to an example embodiment;
fig. 4 is a flow chart illustrating another method of recording video data according to an example embodiment;
fig. 5 is a flow chart illustrating another method of recording video data according to an example embodiment;
fig. 6 is a block diagram illustrating an apparatus for recording video data according to an exemplary embodiment;
fig. 7 is a block diagram illustrating another apparatus for recording video data according to an example embodiment;
fig. 8 is a block diagram illustrating another apparatus for recording video data according to an example embodiment;
FIG. 9 is a block diagram illustrating an electronic device in accordance with an example embodiment.
Detailed Description
In order to make the technical solutions of the present disclosure better understood by those of ordinary skill in the art, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.
It should be noted that the terms "first," "second," and the like in the description and claims of the present disclosure and in the above-described drawings 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 disclosure described herein are capable of operation in sequences other than those illustrated or otherwise described herein. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
In the process of playing video data, a user can record the video data being played according to the requirements of the user, for example: many game players record synchronously during playing games at present, and then edit the recorded videos to form short videos at a later stage and distribute the short videos to various short video platforms; various game broadcasters, food broadcasters and the like can record own live broadcast content, and edit the live broadcast content at a later stage to form short videos to be published on various short video platforms; when watching the teaching video, the user can select the video content required by the user to record so as to watch the teaching video again later and the like. However, in the process of recording video data, the audio in the video data is usually the sound played by a speaker recorded by a microphone. However, the sound quality of sound reproduced by a speaker recorded by a microphone is poor. Moreover, if the user speaks or connects a microphone with another user online during the process of recording the video data, the microphone may record the voice of the user speaking, which may cause the audio in the recorded video data to be mixed.
Based on this, the embodiments of the present disclosure provide a method and an apparatus for recording video data, an electronic device, and a storage medium, so as to record high-quality audio data during the playing process of video data.
Fig. 1 is a flowchart illustrating a method of recording video data according to an exemplary embodiment, where the method of recording video data includes the following steps, as shown in fig. 1.
In step S101, in response to a screen recording operation of video data, an image frame in which image data is currently played is captured, and target audio data is extracted from a target audio track in the data storage area.
Wherein the video data may be, but is not limited to, game video data, movies, educational courses, anchor video data, and the like. When each target audio data in the video data is played, synchronously storing the target audio data into only one audio track of the data storage area; and each track in the data store refers to a unique one of the data store regions. The data storage area may be a pre-established data storage area, or may be a data storage area established for currently played video data when video data is played, and is not limited herein. The data storage area may accommodate a plurality of audio tracks, and the number of audio tracks that may be accommodated in the data storage area may also be dynamically increased or decreased.
It should be noted that, video data usually includes a plurality of audio data, for example: when the video data is game video data, in the running process of the game, a plurality of audio data are usually included in the same picture frame, such as audio data of a speech of a player's own character, audio data of a weapon colliding with other players in a fighting process, audio data of background music of the game, and the like. All audio data generated in the game running process can be used as target audio data, and similarly, a part of audio data in the video data can also be selected as the target audio data, so that a user can adjust the audio data according to actual requirements, and the audio data is not limited here.
When the video data is ready for playing, a unique identifier is generated for each target audio data, and the identifier is made to form a unique corresponding relationship with a preset audio track in the data storage area. Similarly, before preparing to play the video data, the number of target audio data in the current video data may be determined, a new audio track is established in the data storage area for each target audio data, and a unique identifier may be generated for each target audio data, so as to ensure that the target audio data corresponds to the audio track one to one. And when the target audio data is played, a deletion mark can be set for the target audio data, and after the target audio data is completely extracted, the audio track corresponding to the newly established target audio data is deleted, so that the effect that the data of the audio track which can be contained in the data storage area can be dynamically increased and decreased is achieved.
Establishing a unique corresponding audio track for the target audio data in the data storage area, it is understood that a data storage area is opened up for the target audio data in the data storage area, which is only used for storing the target audio data.
The target audio track stores target audio data which is currently played in the video data. The screen recording operation of the video data can be a screen recording operation of the video data generated by a user performing touch selection on a terminal, such as a mobile phone, an iPad and the like, or starting screen recording through a function key, such as pressing a power-off key three times in succession. The method is diversified and is not limited herein.
When video data is played, the screen recording of the video data is started synchronously, and it can be seen that: each target audio data in the video data is stored in the corresponding track of the data storage area from the play start time, and then the target audio data stored in the track is extracted. Of course, in the playing process of the target audio data, the target audio data is stored in the corresponding audio track and extracted from the audio track, and since the time difference is small, if the time difference is ignored, the two processes can also be understood as being performed synchronously, that is, the execution processes of acquiring the image frame of the image data currently being played and extracting the target audio data from the target audio track in the data storage area are parallel.
It should be noted that, if the data storage area where the target audio track is located is a data storage area set in advance, that is, the data storage area can be adapted to a plurality of different video data, after all the target audio data stored on the target audio track is extracted, the target audio track generally needs to be deleted. If the data storage area where the target audio track is located is a data storage area for customizing the video data, after all the target audio data stored on the target audio track are extracted, the target audio track does not need to be deleted, so that the target audio track can be used again when the screen recording operation of the video data is responded next time.
It should be noted that each track in the data storage area may also store a preset time period of mute data before storing the target audio data. The method is used for preventing the speed of extracting the target audio data stored on the target audio track when responding to the screen recording operation of the video data in the playing process of the target audio data from being faster than the speed of synchronously storing the target audio data to the audio track corresponding to the target audio data in the playing process of the target audio data, so that data discontinuity is caused, and noise is generated.
It will be understood, of course, that the duration of the mute data for a preset period of time is related to the speed of the track stored in the data store at the time the target audio data is played and the speed of the extraction of the target audio data from the target track in the data store. In general, the mute data of the time period can synchronously store the target audio data to the speed of the audio track, and the difference value of the speed of extracting the target audio data stored on the target audio track is offset when responding to the screen recording operation of the video data.
For example: the target audio data is stored in the 15 th S in the playing process, and if the speed of extracting the target video data stored in the target audio track is faster than the storage speed of the target audio data, the problem that the data after the 15 th S of the target video data stored in the target audio track cannot be extracted occurs. Then the system will report an error or fill in with blank data at this time, resulting in discontinuity of the finally extracted audio data, and thus noise. Therefore, it is necessary to add a mute data before storing the target video data on the target audio track, so as to prevent the speed of extracting the target audio data stored on the target audio track in response to the screen recording operation of the video data during the playing of the target audio data from being faster than the speed of synchronously storing the target audio data to the audio track corresponding to the target audio data during the playing of the target audio data.
And, when capturing an image frame in which image data is currently played and extracting target audio data from a target track in the data storage area in response to a user's screen recording operation for video data, extracting the target audio data from the target track in the data storage area with a delay with respect to the image frame in which the captured image data is currently played, the delay being a time of adding mute data to the target audio data.
In step S102, the captured image frame and the extracted target audio data are combined as a recorded video of the video data.
Specifically, the video data generally includes a plurality of target audio data, and therefore, after each target audio data is extracted from the audio track according to the playing sequence of the target audio data, it is also necessary to combine the target audio data according to the playing sequence of the target audio data, combine the combined target audio data, and combine the combined target audio data with the acquired image frame to obtain the final recorded video of the video data.
In the method for recording video data provided by the embodiment of the disclosure, each target audio data is synchronously stored in the audio track corresponding to the target audio data respectively in the playing process of each target audio data in the video data. That is, in the process of playing each target audio data in the video data by a speaker, a microphone, or the like, each target audio data is stored in a track corresponding to the target audio data, respectively; it can be seen that the target audio data stored in the audio track in the present disclosure is audio data that is not played through a speaker, a microphone, etc., so the target audio data stored in the audio track is audio data without any loss of tone quality, and thus when a user performs a screen recording operation on video data, the target audio data with high tone quality stored in the target audio track is extracted while an image frame of the image data currently being played is collected; the target audio track stores target audio data which is played currently in the video data; and when each target audio data in the video data is played, combining the collected image frames and the extracted target audio data to be used as a recorded video of the video data. Therefore, the purpose of avoiding the mixing of the audio in the recorded video data and recording the recorded video containing high-quality target audio data in the playing process of the video data is achieved.
Fig. 2 is a flowchart illustrating another video data recording method according to an exemplary embodiment, and as shown in fig. 2, the video data recording method includes the following steps.
In step S201, in response to the screen recording operation of the video data, an image frame of the image data currently being played is acquired, and at the end time point of each preset time interval, a target audio data sub-segment within the preset time interval stored on the target audio track is extracted.
The target audio track stores target audio data which is currently played in the video data.
It should be noted that, at the beginning of recording, a time interval T (for example, 20ms) may be set, and a preset timer is started to extract target audio data of T duration from the end time point of the last time interval T in each audio track in the data storage area. The time interval T may be a time interval T that is prompted to select by a user through a pop-up window or the like before the recording starts, or the time interval T may be changed by the user through an operation interface or the like according to a demand of the user during the recording. By setting the time interval T, the target audio data to be recorded is divided into a plurality of target audio data subsections, so that the problem that the target audio data extracted at one time is more and the data is lost is avoided.
It should be noted that, if each track in the data storage area stores the mute data for the preset time period TS before storing the target audio data. Then, the preset time interval T set in step S202 is smaller than the preset time period TS of the mute data, so as to avoid that the speed when the target audio data sub-segment in the preset time interval T stored on the target audio track is extracted at the end time point of each preset time interval T in the playing process of the target audio data is faster than the speed when the target audio data is synchronously stored in the audio track corresponding to the target audio data in the playing process of the target audio data, which results in data discontinuity and thus generates noise.
In the exemplary embodiment, the target audio data currently being played corresponds to only one track. Therefore, the audio track corresponding to the played target audio data, i.e. the target audio track in step S202, can be searched in the data storage area through the corresponding relationship, and then the target audio data sub-segment with the time length of T is extracted from the target audio track starting from the end time point of the last time interval T.
In step S202, the target audio data sub-segments are combined in the order in which the target audio data sub-segments are extracted, to obtain the extracted target audio data.
Specifically, when each target audio data in the video data is played, all the target audio data sub-segments extracted in step S201 are combined according to the extracted sequence of the target audio data sub-segments in step S201, and the combined target audio data is used as the recorded audio data of the video data.
Optionally, in another embodiment of the present disclosure, before performing step S202, the method may further include:
and mixing a plurality of target audio data subsections belonging to the same preset time interval.
Wherein, different target audio data sub-segments belonging to the same preset time interval come from different target audio tracks.
At a moment or a time period, there may be a plurality of target audio data played simultaneously in the video data, and when the audio tracks are stored, there may be some or all contents belonging to the same time. Thus, in step S201, the target audio data sub-segments are extracted from multiple tracks at the same time, in which case, different target audio data sub-segments belonging to the same preset time interval and from different target tracks need to be mixed.
For example: in step S202, three target audio data played in the same time period are stored in the track 1, the track 2 and the track 3, and in this case, target audio data sub-segments belonging to the time interval T1 are extracted from the track 1, the track 2 and the track 3, respectively, and in this case, the target audio data sub-segments belonging to the preset time interval T1 need to be mixed, so that the target audio data sub-segment X after being mixed at the time interval T1 is obtained.
Similarly, the target audio data sub-segment belonging to the time interval T2 in the audio track 1, the audio track 2, and the audio track 3 may be mixed to obtain the target audio data sub-segment Y mixed at the time interval T2; and mixing the target audio data sub-segments belonging to the preset time interval T3 in the audio track 1, the audio track 2 and the audio track 3 to obtain a target audio data sub-segment Z mixed at the time interval T3.
Certainly, in step S202, the post-mixing target audio data sub-segment X, the post-mixing target audio data sub-segment Y, and the post-mixing target audio data sub-segment Z are combined according to the sequence of T1, T2, and T3 to obtain final combined post-mixing target audio data XYZ, and the final combined post-mixing target audio data XYZ is used as the recorded audio data of the video data.
By way of example, as shown in fig. 3, the video data being played includes audio data 1 and audio data 2, i.e., target audio data 1 and target audio data 2, and it can be seen that the 1 st to 8 th pieces of data of audio data 1 and the 1 st to 3 rd pieces of data of audio data 2 have been played by a speaker, and at the same time, the 1 st to 8 th pieces of data of audio data 1 and the 1 st to 3 rd pieces of data of audio data 2 are stored in a data storage area, and in the audio track corresponding to the audio data, in this example, audio data 1 corresponds to audio track 1, and audio data 2 corresponds to audio track 2. Responding to a screen recording operation of video data generated by a user while the video data is played, thereby extracting audio data sub-segments within a preset time interval stored on a target track at the end time point of each preset time interval, as shown in fig. 3, the audio data in the track currently in a data storage area is audio data sub-segments within a second preset time interval, i.e. 3 rd to 8 th segments of audio data 1, 1 st to 3 rd segments of audio data 2, and mute data is added before the 1 st segment of audio data 2, the audio data sub-segments within the first preset time interval extracted currently are audio data sub-segments 1 to 2 th segments of audio data 1, mute data before the 1 st segment of audio data 1, and mute data before the 1 st segment of audio data 2, and the 1 st to 2 nd segments of audio data 1, After the mute data before the 1 st data of the audio data 1 and the mute data before the 1 st data of the audio data 2 are combined, all the mute data are deleted, and finally the 1 st-2 nd data of the audio data 1 are obtained and are used as the recorded audio data of the video data which is being played in the first preset time interval.
In step S203, the captured image frame and the extracted target audio data are combined as a recorded video of the video data.
It should be noted that, the specific implementation manner of step S203 may refer to step S102 in the foregoing method embodiment, and details are not described here.
Fig. 4 is a flowchart illustrating another method of recording video data according to an exemplary embodiment, and as shown in fig. 4, the method of recording audio data includes the following steps.
In step S401, in response to a screen recording operation of video data, an image frame in which image data is currently played is captured, and target audio data stored on each audio track in which the data storage region currently exists is extracted.
Wherein the track belonging to the extracted target audio data in the data storage area is deleted.
Specifically, the target audio data stored in each audio track existing in the current data storage area is extracted, and the target audio data stored in one audio track is extracted completely, which indicates that the target audio data stored in the audio track has been played completely, so that the audio track can be deleted to release the space of the data storage area, thereby facilitating the establishment of a new audio track to store the target audio data to be played.
It can be seen that a track exists in the data storage area only when target audio data is stored, and the target audio data stored in the track is not extracted completely, which means that the target audio data is in the process of playing. Thus, the method for extracting the target audio data proposed in step S401 is also an embodiment for extracting the target audio data from the target audio track.
In step S402, the extracted target audio data stored on each track is mixed.
Specifically, the extracted target audio data stored in each audio track is subjected to audio mixing to obtain audio-mixed target audio data, and the audio-mixed target audio data is used as the extracted target audio data.
In step S403, the captured image frame and the extracted target audio data are combined as a recorded video of the video data.
It should be noted that, the specific implementation manner of step S403 may refer to step S102 in the foregoing method embodiment, and details are not described here.
Fig. 5 is a flowchart illustrating another video data recording method according to an exemplary embodiment, and as shown in fig. 5, the video data recording method includes the following steps.
In step S501, in response to a screen recording operation of video data, an image frame of the image data currently being played is acquired, and at the end time of each preset time interval, a target audio data sub-segment stored in each audio track currently existing in the data storage area within the preset time interval is extracted.
Wherein the track belonging to the extracted target audio data in the data storage area is deleted.
Specifically, at the end time point of each preset time interval, target audio data subsections stored in each audio track in the current data storage area in the preset time interval are extracted, and audio tracks where the target audio data of all the extracted target audio data subsections are located are deleted.
In step S502, a plurality of target audio data sub-segments belonging to the same preset time interval are mixed.
Specifically, the multiple target audio data sub-segments belonging to the same preset time interval extracted in step S501 are mixed to obtain the mixed target audio data sub-segments.
In step S503, the captured image frame and the extracted target audio data are combined as a recorded video of the video data.
It should be noted that, when each target audio data in the video data is completely played, all mixed target audio data sub-segments obtained in step S502 are combined according to the extracted sequence of the target audio data sub-segments in step S501, and the combined target audio data is used as the recorded audio data of the video data.
The specific implementation manner of step S503 may refer to step S102 in the foregoing method embodiment accordingly, and details are not repeated here.
It should be particularly noted that, at any time during the execution of steps S101 to S102, at any time during the execution of steps S201 to S203, at any time during the execution of steps S401 to S403, and at any time during the execution of steps S501 to S503, the user can pause the playing and recording operations of the video data through corresponding operations, such as: clicking a pause playing key on a mobile phone screen, calling Siri to pause and record the screen and the like, wherein the modes are diversified and are not limited.
After the user performs the operations of pausing the playing and recording the screen of the video data, the method for recording the audio data provided by the disclosure further includes:
and after the pause playing operation of the video data is responded, stopping playing the video data, synchronously storing the target audio data currently played in the video data to the audio track corresponding to the target audio data, and stopping extracting the target audio data stored on the target audio track.
Similarly, at any time after the pause playing operation of the video data is responded, the user can continue the screen recording operation of the video data through corresponding operations, for example: clicking a continuous playing key on a mobile phone screen, calling Siri to continue recording the screen and the like. Certainly, the method for recording audio data provided by the present disclosure further includes:
and in response to the continuous playing operation of the video data, starting from the pause point of the video data, continuously playing the video data, continuously and synchronously storing the target audio data after the pause point in the target audio data which is paused to be played in the video data into the audio track corresponding to the target audio data, and extracting the target audio data after the pause point stored in the target audio track.
For example, a user is recording a favorite television program, such as a television drama, a variety program, and the like, and at the moment, an advertisement content is inserted into a television station, the user can pause recording of the television program by clicking a play pause key on a mobile phone screen, calling Siri to pause recording, and the like, and continue recording of the television program by clicking a play continuation key on the mobile phone screen, calling Siri to pause recording, and the like after the advertisement is finished, so that the advertisement part in the recorded video does not need to be cut at a later stage, the difficulty in performing post-processing on the recorded video is reduced, and the use experience of the user is improved.
Fig. 6 illustrates an apparatus for recording video data according to an exemplary embodiment. Referring to fig. 6, the apparatus includes: an acquisition unit 601, an extraction unit 602 and a first combination unit 603.
The capture unit 601 is configured to perform a screen recording operation in response to video data, and capture an image frame in which image data is currently played.
When each target audio data in the video data is played, the target audio data is synchronously stored in a unique audio track of the data storage area; the target audio track stores the currently played target audio data in the video data; each track in the data store refers to a unique one of the data store regions.
An extracting unit 602 configured to perform a screen recording operation in response to the video data, extracting target audio data from a target track of the data storage area.
A first combining unit 603 configured to perform combining the captured image frame and the extracted target audio data as a recorded video of the video data.
It should be noted that, in the above embodiment, the specific working process of each unit in the audio data recording apparatus may refer to the specific implementation process of the corresponding step in the above method embodiment, as shown in fig. 1, which is not described herein again.
Alternatively, in a video data recording apparatus according to another embodiment, each track in a data storage area of the video data recording apparatus stores mute data for a preset time period before storing target audio data.
It should be noted that, for the specific working processes of each unit in the video data recording apparatus shown in the foregoing embodiments, reference may be made to the specific implementation processes of the corresponding steps in the foregoing method embodiments, and details are not described here again.
Optionally, in a video data recording apparatus provided in another embodiment, the video data recording apparatus further includes: a stop unit and a resume unit.
And the stopping unit is configured to execute pause playing operation responding to the video data, stop playing the video data, stop synchronously storing the target audio data currently played in the video data to the audio track corresponding to the target audio data, and stop extracting the target audio data stored on the target audio track.
And the continuous playing unit is configured to execute continuous playing operation responding to the video data, continuously play the video data from the pause point of the video data, continuously and synchronously store the target audio data after the pause point in the target audio data of the video data after the pause point into the audio track corresponding to the target audio data, and extract the target audio data after the pause point stored in the target audio track.
It should be noted that, for the specific working processes of each unit in the video data recording apparatus shown in the foregoing embodiments, reference may be made to the specific implementation processes of the corresponding steps in the foregoing method embodiments, and details are not described here again.
The video data recording method provided by the embodiment of the disclosure acquires the image frame of the image data played currently through the screen recording operation of the acquisition unit responding to the video data, and extracts the target audio data from the target audio track of the data storage area through the screen recording operation of the extraction unit responding to the video data; and finally, combining the acquired image frames and the extracted target audio data by the combination unit to be used as a recorded video of the video data. Therefore, the purpose of avoiding the mixing of the audio in the recorded video data and recording the recorded video containing high-quality target audio data in the playing process of the video data is achieved.
Fig. 7 illustrates an apparatus for recording video data according to an exemplary embodiment. Referring to fig. 7, the apparatus includes: an acquisition unit 701, a first extraction subunit 702, a second combination unit 703 and a first combination unit 704.
An acquisition unit 701 configured to perform a screen recording operation in response to the video data, and acquire an image frame in which the image data is currently played.
It should be noted that, for a specific implementation manner of the acquisition unit 701, reference may be made to the acquisition unit 601 in the foregoing embodiment, and details are not described here again.
A first extraction sub-unit 702 configured to perform a screen recording operation in response to video data, at the end point of each preset time interval, extracting a target audio data sub-segment within the preset time interval stored on a target track.
The target audio track stores target audio data which is currently played in the video data.
A second combining unit 703 configured to perform combining the target audio data sub-segments in the order in which the target audio data sub-segments are extracted, resulting in extracted target audio data.
A first combining unit 704 configured to perform combining the captured image frame and the extracted target audio data as a recorded video of the video data.
It should be noted that, in the above embodiment, the specific working process of each unit in the video data recording apparatus may refer to the specific implementation process of the corresponding step in the above method embodiment, as shown in fig. 2, which is not described herein again.
Optionally, in an apparatus for recording video data provided by another embodiment, the apparatus for recording video data further includes a first mixing unit.
And the first mixing unit is configured to perform mixing of a plurality of target audio data sub-segments belonging to the same preset time interval before the step of combining each of the target audio data sub-segments according to the extracted sequence of the target audio data sub-segments.
Wherein, different target audio data sub-segments belonging to the same preset time interval come from different target audio tracks.
It should be noted that, for the specific working processes of each unit in the video data recording apparatus shown in the foregoing embodiments, reference may be made to the specific implementation processes of the corresponding steps in the foregoing method embodiments, and details are not described here again.
The recording device of video data provided by the embodiment of the disclosure acquires the image frame of the image data currently played through the screen recording operation of the acquisition unit responding to the video data, and extracts the target audio data subsection stored in the target audio track within the preset time interval at the end time point of each preset time interval by the first extraction subunit; the target audio track stores target audio data which is played currently in the video data; and combining the target audio data sub-segments by using a second combination unit according to the extracted sequence of the target audio data sub-segments to obtain the extracted target audio number. Finally, the first combination unit combines the acquired image frame and the extracted target audio data as a recorded video of the video data. Therefore, the purpose of avoiding the mixing of the audio in the recorded video data and recording the recorded video containing high-quality target audio data in the playing process of the video data is achieved.
Fig. 8 illustrates an apparatus for recording video data according to an exemplary embodiment. Referring to fig. 8, the apparatus includes: an acquisition unit 801, a second extraction sub-unit 802, a second mixing unit 803 and a first combining unit 804.
An acquisition unit 801 configured to perform a screen recording operation in response to video data, acquires an image frame in which image data is currently played.
It should be noted that, for a specific implementation manner of the acquisition unit 801, reference may be made to the acquisition unit 601 in the foregoing embodiment, and details are not described here again.
A second extraction subunit 802 configured to perform extraction of target audio data stored on the respective tracks currently in the data storage area.
Wherein the track belonging to the extracted target audio data in the data storage area is deleted.
Alternatively, in the video data recording apparatus provided in another embodiment, when the second extraction sub-unit 802 performs extraction of target audio data stored on respective tracks currently in the data storage area, it may be further configured to perform extraction of target audio data sub-segments within a preset time interval stored on respective tracks currently in the data storage area at an end point of each preset time interval.
It should be noted that, in the above embodiment, the specific working process of each unit in the video data recording apparatus may refer to the specific implementation process of the corresponding step in the above method embodiment, as shown in fig. 5, which is not described herein again.
The second mixing unit 803 mixes the extracted target audio data stored on each track.
Alternatively, in the video data recording apparatus provided by another embodiment, when the second extraction sub-unit 802 performs extraction of target audio data stored on respective tracks currently in the data storage area, it is configured to perform extraction of target audio data sub-segments within a preset time interval stored on respective tracks currently in the data storage area at the end point of each preset time interval. The second mixing unit 803 is configured to perform mixing of a plurality of target audio data sub-segments belonging to the same preset time interval, while performing mixing of target audio data stored on the extracted respective tracks.
It should be noted that, in the above embodiment, the specific working process of each unit in the video data recording apparatus may refer to the specific implementation process of the corresponding step in the above method embodiment, as shown in fig. 5, which is not described herein again.
A first combining unit 804 configured to perform combining the captured image frame and the extracted target audio data as a recorded video of the video data.
It should be noted that, in the above embodiment, the specific working process of each unit in the video data recording apparatus may refer to the specific implementation process of the corresponding step in the above method embodiment, as shown in fig. 4, which is not described herein again.
The video data recording device provided by the disclosed embodiment collects the image frame of the image data played currently through the collection unit responding to the screen recording operation of the video data, and the second extraction subunit extracts the target audio data stored on each audio track currently existing in the data storage area when responding to the screen recording operation of the video data; wherein, the audio track belonging to the extracted target audio data in the data storage area is deleted; then, the second mixing unit mixes the extracted target audio data stored on each audio track; the first combination unit combines the collected image frames and the extracted target audio data as a recorded video of the video data. Therefore, the purpose of avoiding the mixing of the audio in the recorded video data and recording the recorded video containing high-quality target audio data in the playing process of the video data is achieved.
FIG. 9 is a block diagram illustrating an electronic device in accordance with an exemplary embodiment. Referring to fig. 9, the electronic device includes: a processor 901 and a memory 902 for storing processor-executable instructions.
Wherein the processor 901 is configured to execute the instructions to implement the method for recording video data as in any of the above embodiments.
Another embodiment of the present disclosure provides a storage medium, wherein when the instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the method for recording video data according to any one of the embodiments described above.
Alternatively, the storage medium may be a non-transitory computer readable storage medium, which may be, for example, a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
Another embodiment of the present disclosure provides a computer program product, which when executed, is configured to perform the video data recording method provided in any one of the above embodiments.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (10)

1. A method for recording video data, comprising:
responding to screen recording operation of video data, acquiring an image frame of the image data played currently, and extracting target audio data from a target audio track of a data storage area; wherein each target audio data in the video data is played while being synchronously stored to a unique one of the tracks of the data storage area; each track in the data store refers to a unique one of the data store regions; the target audio track stores the currently played target audio data in the video data;
and combining the collected image frames and the extracted target audio data to be used as a recorded video of the video data.
2. The recording method as claimed in claim 1, wherein said extracting target audio data from a target track of a data storage area comprises:
extracting target audio data subsections stored on the target audio track within the preset time interval at the end time point of each preset time interval;
and combining the target audio data sub-segments according to the sequence of the target audio data sub-segments being extracted to obtain the extracted target audio data.
3. The recording method according to claim 2, wherein before the step of combining the target audio data sub-segments in the order in which the target audio data sub-segments are extracted to obtain the extracted target audio data, the method further comprises:
and mixing a plurality of target audio data sub-segments belonging to the same preset time interval, wherein different target audio data sub-segments belonging to the same preset time interval come from different target audio tracks.
4. The recording method as claimed in claim 1, wherein said extracting target audio data from a target track of a data storage area comprises:
extracting target audio data stored on each audio track currently existing in the data storage area; wherein the audio track belonging to the extracted target audio data in the data storage area is deleted;
and mixing the extracted target audio data stored on each audio track.
5. The recording method according to claim 4, wherein said extracting target audio data stored on each track where the data storage area currently exists comprises:
extracting target audio data subsegments stored in each audio track currently existing in the data storage area within the preset time interval at the end time point of each preset time interval;
wherein the mixing the extracted target audio data stored on each audio track includes:
and mixing the plurality of target audio data sub-segments belonging to the same preset time interval.
6. The recording method according to any one of claims 1 to 5, wherein each track in the data storage area stores mute data for a preset time period before storing target audio data; wherein the duration of the mute data of the preset time period is related to the speed of the audio track stored in the data storage area when the target audio data is played and the speed of extracting the target audio data from the target audio track in the data storage area.
7. The recording method according to any one of claims 1 to 5, further comprising:
responding to the pause playing operation of video data, stopping playing the video data, synchronously storing the target audio data currently played in the video data to the audio track corresponding to the target audio data, and stopping extracting the target audio data stored on the target audio track;
responding to the continuous playing operation of the video data, starting from the pause point of the video data, continuously playing the video data, continuously and synchronously storing the target audio data after the pause point in the target audio data which is paused in the video data into the audio track corresponding to the target audio data, and extracting the target audio data after the pause point stored in the target audio track.
8. An apparatus for recording video data, comprising:
the acquisition unit is configured to execute screen recording operation responding to video data and acquire an image frame of the image data played currently; wherein each target audio data in the video data is played while being synchronously stored to a unique one of the tracks in the data storage area; the target audio track stores the currently played target audio data in the video data; each track in the data store refers to a unique one of the data store regions;
an extraction unit configured to perform a screen recording operation in response to the video data, extracting target audio data from a target track of the data storage area;
a first combining unit configured to perform combining the captured image frame and the extracted target audio data as a recorded video of the video data.
9. An electronic device, comprising:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the method of recording video data according to any one of claims 1 to 7.
10. A storage medium, characterized in that instructions in the storage medium, when executed by a processor of an electronic device, enable the electronic device to perform a method of recording video data according to any one of claims 1 to 7.
CN202011023587.XA 2020-09-25 2020-09-25 Video data recording method and device, electronic equipment and storage medium Active CN112153456B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011023587.XA CN112153456B (en) 2020-09-25 2020-09-25 Video data recording method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011023587.XA CN112153456B (en) 2020-09-25 2020-09-25 Video data recording method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN112153456A true CN112153456A (en) 2020-12-29
CN112153456B CN112153456B (en) 2023-03-28

Family

ID=73897218

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011023587.XA Active CN112153456B (en) 2020-09-25 2020-09-25 Video data recording method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112153456B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106792069A (en) * 2015-11-19 2017-05-31 北京国双科技有限公司 Method for broadcasting multimedia file and device
CN108614829A (en) * 2016-12-12 2018-10-02 中移(杭州)信息技术有限公司 A kind of playback method and terminal
CN109660911A (en) * 2018-11-27 2019-04-19 Oppo广东移动通信有限公司 Recording sound effect treatment method, device, mobile terminal and storage medium
CN110418183A (en) * 2019-08-05 2019-11-05 北京字节跳动网络技术有限公司 Audio and video synchronization method, device, electronic equipment and readable medium
CN111179970A (en) * 2019-08-02 2020-05-19 腾讯科技(深圳)有限公司 Audio and video processing method, audio and video synthesizing device, electronic equipment and storage medium
CN111402933A (en) * 2020-03-04 2020-07-10 Oppo广东移动通信有限公司 Audio recording method, device, storage medium and related equipment

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106792069A (en) * 2015-11-19 2017-05-31 北京国双科技有限公司 Method for broadcasting multimedia file and device
CN108614829A (en) * 2016-12-12 2018-10-02 中移(杭州)信息技术有限公司 A kind of playback method and terminal
CN109660911A (en) * 2018-11-27 2019-04-19 Oppo广东移动通信有限公司 Recording sound effect treatment method, device, mobile terminal and storage medium
US20200168201A1 (en) * 2018-11-27 2020-05-28 Guangdong Oppo Mobile Telecommunications Corp., Ltd. Processing Method for Sound Effect of Recording and Mobile Terminal
CN111179970A (en) * 2019-08-02 2020-05-19 腾讯科技(深圳)有限公司 Audio and video processing method, audio and video synthesizing device, electronic equipment and storage medium
CN110418183A (en) * 2019-08-05 2019-11-05 北京字节跳动网络技术有限公司 Audio and video synchronization method, device, electronic equipment and readable medium
CN111402933A (en) * 2020-03-04 2020-07-10 Oppo广东移动通信有限公司 Audio recording method, device, storage medium and related equipment

Also Published As

Publication number Publication date
CN112153456B (en) 2023-03-28

Similar Documents

Publication Publication Date Title
CN108259989B (en) Video live broadcast method, computer readable storage medium and terminal equipment
CN109327741B (en) Game live broadcast method, device and system
CN106851385B (en) Video recording method and device and electronic equipment
EP1827018B1 (en) Video content reproduction supporting method, video content reproduction supporting system, and information delivery program
CN107613357A (en) Sound picture Synchronous fluorimetry method, apparatus and readable storage medium storing program for executing
CN106792152B (en) Video synthesis method and terminal
CN105187926A (en) Method and device for pushing interactive interface
CN108989883B (en) Live broadcast advertisement method, device, equipment and medium
CN105828214A (en) Method and apparatus for realizing interaction in video live broadcast
CN105898528A (en) Multimedia processing method based on Android platform, device and mobile terminal device
CN104333802A (en) Video playing method and video player
CN107071549A (en) Many player fast switch over method, device and storage medium under single decoder
CN107333163A (en) A kind of method for processing video frequency and device, a kind of terminal and storage medium
CN113411652A (en) Media resource playing method and device, storage medium and electronic equipment
CN105657545A (en) Video play method and apparatus
CN104918101A (en) Method, playing terminal and system for automatically recording program
CN112954426B (en) Video playing method, electronic equipment and storage medium
CN107318052A (en) Player method, television set and the storage medium of television video
CN107135366A (en) Image generating method and device inserted with source of sound
CN112153456B (en) Video data recording method and device, electronic equipment and storage medium
US11006155B2 (en) Real-time incorporation of user-generated content into third-party streams
CN105100936A (en) Method and device for displaying user interaction information
CN107786902A (en) Direct broadcast time-shift method, TV and computer-readable recording medium
CN112135159A (en) Public screen broadcasting method and device, intelligent terminal and storage medium
CN113992638A (en) Synchronous playing method and device of multimedia resources, storage position and electronic device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant