CN117119241A - Recording method, device, computer equipment and medium for synchronous audio and video effects - Google Patents

Recording method, device, computer equipment and medium for synchronous audio and video effects Download PDF

Info

Publication number
CN117119241A
CN117119241A CN202311065765.9A CN202311065765A CN117119241A CN 117119241 A CN117119241 A CN 117119241A CN 202311065765 A CN202311065765 A CN 202311065765A CN 117119241 A CN117119241 A CN 117119241A
Authority
CN
China
Prior art keywords
recording
audio
video
file
initialization
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311065765.9A
Other languages
Chinese (zh)
Inventor
何浩彬
余振中
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangzhou Weimeng Technology Co ltd
Original Assignee
Guangzhou Weimeng 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 Guangzhou Weimeng Technology Co ltd filed Critical Guangzhou Weimeng Technology Co ltd
Priority to CN202311065765.9A priority Critical patent/CN117119241A/en
Publication of CN117119241A publication Critical patent/CN117119241A/en
Pending legal-status Critical Current

Links

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/4302Content synchronisation processes, e.g. decoder synchronisation
    • H04N21/4307Synchronising the rendering of multiple content streams or additional data on devices, e.g. synchronisation of audio on a mobile phone with the video output on the TV screen
    • H04N21/43072Synchronising the rendering of multiple content streams or additional data on devices, e.g. synchronisation of audio on a mobile phone with the video output on the TV screen of multiple content streams on the same device
    • 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
    • H04N21/4398Processing of audio elementary streams involving reformatting operations of audio signals
    • 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/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs
    • H04N21/4402Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display
    • H04N21/440218Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display by transcoding between formats or standards, e.g. from MPEG-2 to MPEG-4

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Signal Processing For Digital Recording And Reproducing (AREA)

Abstract

The embodiment of the invention provides a recording method, a device, computer equipment and a medium for synchronizing audio and video effects, which are characterized in that a recording module corresponding to a user instruction in recording equipment is started according to the user instruction, the current recording module is subjected to recording test, the current recording module is subjected to initialization processing, if the result is normal, video and audio are recorded respectively according to a video encoder and an audio encoder in the recording module, the generated video recording file and audio recording file are calibrated respectively according to a calibration rule preset in the recording module, a video calibration file and an audio calibration file are obtained, and the current video calibration file and the audio calibration file are packaged respectively according to a packaging rule preset in the recording module, so that a final recording file is obtained.

Description

Recording method, device, computer equipment and medium for synchronous audio and video effects
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a recording method, an apparatus, a computer device, and a medium for synchronizing audio and video effects.
Background
At present, in the process of video recording and rendering, the electronic equipment needs to rapidly perform video synchronous recording to achieve rapid calibration of video and audio, and in the process of performing synchronous calibration, the previous audio and video synchronization is only performed aiming at a specific video file, and the time when an audio and video end actually starts recording is ignored. The video and the audio cannot be calibrated synchronously, whether the electronic equipment can record the video or not cannot be predicted in advance in the process of recording the video by most equipment, and the video and the audio are synchronized before only by aiming at the real starting time of the video end calibration by the encapsulated pts. Therefore, the prior art method has the problem that the recorded video and audio cannot be rapidly and synchronously calibrated in the process of recording the multimedia file.
Disclosure of Invention
The embodiment of the invention provides a recording method for synchronizing audio and video effects, which aims to solve the problem that in the prior art, recorded video and audio cannot be rapidly and synchronously calibrated in the screen recording process.
In a first aspect, an embodiment of the present invention provides a recording method for synchronization of audio and video effects, where the method includes:
starting a recording module corresponding to the user instruction in recording equipment according to the user instruction;
performing a recording test on the current recording module to obtain a recording test result whether the recording test is normal or not after the recording test is performed;
initializing the current recording module to obtain an initialization test result whether the initialization test result is normal or not after the initialization process is carried out;
if the recording test result and the initializing test result are normal, recording video and audio according to a video encoder and an audio encoder in a recording module, and generating a video recording file and an audio recording file;
and respectively calibrating the current video recording file and the audio recording file through a preset calibration rule in the recording module to obtain a video calibration file and an audio calibration file.
In a second aspect, an embodiment of the present invention further provides a recording apparatus for synchronization of audio and video effects, where the apparatus includes:
and the recording starting unit is used for starting a recording module corresponding to the user instruction in the recording equipment according to the user instruction.
And the recording test unit is used for carrying out recording test on the current recording module so as to obtain a recording test result whether the recording test is normal or not after the recording test is carried out.
And the initialization processing unit is used for carrying out initialization processing on the current recording module to obtain an initialization test result whether the initialization processing is normal or not.
And the recording unit is used for recording the video and the audio according to the video encoder and the audio encoder in the recording module respectively, and generating a video recording file and an audio recording file.
And the video calibration unit is used for calibrating the current video recording file and the audio recording file respectively through a calibration rule preset in the recording module to obtain a video calibration file and an audio calibration file.
In a third aspect, an embodiment of the present invention further provides a computer device, where the device includes a processor, a communication interface, a memory, and a communication bus, where the processor, the communication interface, and the memory complete communication with each other through the communication bus;
and a memory for storing a computer program.
And the processor is used for realizing the steps of the recording method for synchronizing the audio and video effects in the first aspect when executing the program stored in the memory.
In a fourth aspect, an embodiment of the present invention further provides a computer readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the steps of the recording method for synchronization of audio and video effects described in the first aspect.
Compared with the prior art, the invention has the following advantages:
the embodiment of the invention provides a recording method, a recording device, computer equipment and a recording medium for synchronizing audio and video effects, wherein a recording module corresponding to a user instruction in recording equipment is started according to the user instruction; performing recording test on the current recording module and attempting to initialize the current recording module to obtain a normal recording test result; if the recording test result is normal, recording video and audio according to a video encoder and an audio encoder in a recording module, and generating a video recording file and an audio recording file; respectively calibrating the current video recording file and the audio recording file through a preset calibration rule in the recording module to obtain a video calibration file and an audio calibration file; and respectively packaging the current video calibration file and the audio calibration file through a preset packaging rule in the recording module so as to obtain a final recording file. According to the recording method, the video recording file and the audio recording file are synchronously calibrated by detecting the actual recording starting time of the two ends of the audio and the video, so that the aim of synchronizing the audio and the video effects of recorded contents is fulfilled, the initialized time period is fully utilized, the time for waiting for starting recording by a user is reduced, and the fact that the display of a recorded timer is consistent with the actual display is ensured.
In addition, the initialization processing of the recording module is completed before the recording starts, various abnormal conditions can be detected in advance, the user is informed and made to select early, the user is not required to be informed of recording failure after waiting until the actual recording starting stage, and the user experience is effectively optimized.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a flowchart of a recording method for synchronizing audio and video effects according to an embodiment of the present invention;
fig. 2 is a schematic block diagram of a recording apparatus for synchronizing audio and video effects according to an embodiment of the present invention;
fig. 3 is a schematic block diagram of a computer device according to an embodiment of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are some, but not all embodiments of the invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
It should be understood that the terms "comprises" and "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It is also to be understood that the terminology used in the description of the invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in this specification and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
It should be further understood that the term "and/or" as used in the present specification and the appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes such combinations.
Referring to fig. 1, as shown in the drawing, an embodiment of the present invention provides a recording method for synchronization of audio and video effects, where the recording method for synchronization of audio and video effects is applied to a recording terminal, that is, a terminal device for performing the recording method for synchronization of audio and video effects to record content displayed on a screen, where the recording terminal may be a desktop computer, a notebook computer, a tablet computer, a mobile phone, etc., as shown in fig. 1, the method includes sub-steps S110-S150.
S110, starting a recording module corresponding to the user instruction in the recording equipment according to the user instruction.
In this embodiment, the user command is a video recording command sent by a current user, and the recording module is a recording module applied to the electronic recording device.
In one embodiment, step S110 further includes the steps of: and starting a recording function matched with the current user instruction in the user recording equipment.
And detecting whether the current user has user permission, and if so, opening a recording module corresponding to the user instruction.
Specifically, when a user needs to perform related operations of recording video, namely starting a recording function matched with a user instruction in user equipment, detecting whether a user currently using the equipment has user rights or not, if the user rights exist, starting a recording module corresponding to the user instruction, in one embodiment, automatically closing the recording function if the user rights do not exist, and the setting mode facilitates related use management flow of a subsequent recording module, ensures the integrity of the equipment in the use process, controls the recording process, and improves the reliability of video and audio content recording.
S120, performing a recording test on the current recording module to obtain a recording test result whether the recording test is normal or not after the recording test is performed;
in this embodiment, the recording test is mainly used for recording test on the electronic recording device and the recording module in the device.
In one embodiment, step S120 further includes the steps of: and starting a recorder unit preset in the recording module.
And detecting the recording equipment used by the current user through the recording detection rule matched with the recorder unit.
Judging whether recording equipment used by a user can normally record or not, and if so, generating a normal recording test result.
Specifically, a recorder unit preset in a recording module is started, recording equipment used by a current user is detected through recording detection rules matched with the recorder unit, whether the recording equipment used by the user is normally recorded or not is judged, and then normal equipment can generate a normal recording test result through a recording test.
S130, initializing the current recording module to obtain an initialization test result whether the current recording module is normal or not after the initialization process is carried out.
In this embodiment, the initialization process is mainly used for performing a system initialization process on the electronic recording device and a recording module in the device.
In an embodiment, step S130 further includes the steps of: and setting a test countdown according to the preset test duration.
Initializing the recording module to obtain a corresponding initialization result.
And carrying out recording test on the recording module to obtain a corresponding recording test result.
And if the test countdown is finished, judging the initialization result and the recording test result to obtain a normal recording test result.
Specifically, the corresponding initialization result is obtained by initializing the recording module, the recording module is subjected to recording test to obtain the corresponding recording test result, at the moment, the system judges that the current initialization result has two test results, if the initialization of the recording module fails, the initialization time is not corresponding to the initialization rule pair in the recording module, the failed initialization test result is obtained, at the moment, debugging is carried out again until the initialization of the recording module can reach the standard, the recording is started until the initialization of the recording module is successful, and in the setting mode, by judging whether the current recording module meets the initialization standard, the user can be informed in advance and select in advance, the recording failure of the user is not informed again in the actual recording starting stage, and the user experience is further optimized.
Further, in one embodiment, the initialization process is two processes, in one process, a MediaRecorder engine is started at the same time, and by initializing the media recorder engine, an execution body of a current virtual display is initialized, after initializing Exta Virtual Display (an additional computer virtual display), setting sub-items of the virtual display panel set in the virtual display are all initialization settings, so that video and audio are conveniently recorded later, in the other process, the mediaencoder engine is initialized at the same time, and simultaneously, the initialization process is performed on VideoEncoder Task (a video encoder) and the audiorecorder (an audio encoder), wherein the video encoder executes the initialization sub-items of the virtual display panel set in the virtual display, and the initialization sub-items of the virtual display panel set in the virtual display are all finished after the initialization process is completed.
In one embodiment, the step S120 further includes the following steps after the step is performed; and initializing the video encoder through a preset media coding engine to obtain a first initialization generation time of the video encoder.
And initializing the media reading encoder through a preset media encoding engine to obtain second initialization generation time of the media reading encoder.
Integrating the generation time and judging whether the generation time accords with an initialization rule or not so as to obtain an initialization result, wherein the generation time comprises the first initialization generation time and the second initialization generation time, and the initialization rule is independently arranged in a memory.
Specifically, the recording test result is a test result of recording test on the electronic recording device and the recording module in the device, the video encoder is mainly used for recording video, and the audio encoder is mainly used for recording audio.
Specifically, after the media reading encoder is initialized through the media decoder engine, a first initialization generating time of the video decoder is obtained, wherein the first initialization generating time is a triggering time of a video file which enters the video encoder from the first time to the initialization processing, the media reading encoder is initialized through the preset media encoding engine, a second initialization generating time of the media reading encoding is obtained, the second initialization generating time is a triggering time of the media encoder which enters the media encoding engine from the first time, the generating time is integrated and judged whether the initialization time accords with an initialization rule or not is judged, so that an initialization result is obtained, the generating time comprises the first initialization generating time and the second initialization generating time, the initialization rule is independently arranged in a memory, a recording test and an initialization test are respectively completed, various abnormal conditions can be detected in advance, a user is informed and made a selection is made in advance, the user is not required to be informed of recording failure again when the actual recording stage starts, and user experience is optimized.
Further, in an embodiment, if the current initialization task is finished, the recording process of video and audio is started, where a media recorder preset in the recording module starts when receiving a recording execution instruction at this time, executes a media recording instruction flow after starting, executes a current MediaRecorder initialization execution process, and synchronously invokes a video end virtual display to set a Surface to start receiving the picture content, and starts recording the current recording time after the initialization is performed at this time, and another media encoder engine starts recording at the same time.
And S140, if the recording test result and the initializing test result are normal, recording video and audio according to a video encoder and an audio encoder in the recording module, and generating a video recording file and an audio recording file.
In this embodiment, the video encoder is an execution memory for video recording in the recording module, and the audio encoder is an audio recording execution memory in the recording module.
In one embodiment, S140 further comprises the sub-steps of: and if the recording test result and the initializing test result are normal, reading the video recording rule and the audio recording rule in the recording module, and generating a video list to be processed and an audio list to be processed.
And processing the video tasks in each current video list to be processed one by one, thereby generating a video recording file.
And processing the audio tasks in each current audio list to be processed one by one, thereby generating an audio recording file.
Specifically, if the recording test result and the initializing test result are normal, the video recording rule and the audio recording rule in the recording module are read, a to-be-processed video list and an to-be-processed audio list are generated, a plurality of to-be-processed video task chains exist in each to-be-processed video list, a plurality of to-be-processed audio task chains exist in each to-be-processed audio list, the video tasks in each current to-be-processed video list are processed one by reading a current user instruction, so that a video recording file is generated, the audio tasks in the audio in each current to-be-processed audio list are processed one by reading a current user instruction, and accordingly an audio recording file is generated.
And S150, respectively calibrating the current video recording file and the current audio recording file through a calibration rule preset in the recording module to obtain a video calibration file and an audio calibration file.
In this embodiment, the calibration rule is to calibrate the video recording file and the audio recording file synchronously, and calibrate the related items such as the generation time and sound of the video synchronously.
In one embodiment, step S150 further includes the steps of: and calibrating the video recording file and the audio recording file according to the video calibration processor and the audio calibration processor in the media calibration rule. The audio calibrator acquires video picture content from the video calibrator and performs read time synchronization, and the audio calibrator perform thread synchronization blocking operation according to the synchronized read time. And the video calibrator feeds back video picture data according to the blocking time point of the video synchronous blocking operation. And the audio calibrator synchronously reads the audio cycle according to the blocking time point to generate an audio cycle reading file. And integrating the fed-back video picture data and the audio cycle reading file to obtain a final audio calibration file and a final video calibration file.
Specifically, the video recording file and the audio recording file are calibrated according to the video calibration processor and the audio calibration processor in the media calibration rule respectively. The audio calibrator acquires video picture content from the video calibrator and performs read time synchronization, and the audio calibrator perform thread synchronization blocking operation according to the synchronized read time. And the video calibrator feeds back video picture data according to the blocking time point of the video synchronous blocking operation. And the audio calibrator synchronously reads the audio cycle according to the blocking time point to generate an audio cycle reading file. The method comprises the steps of integrating video picture data and audio cycle reading files after feedback to obtain final audio calibration files and video calibration files, and calibrating each video recording file and each audio recording file one by one after reading time synchronization, so that on one hand, synchronization of audio and video effects is guaranteed, reliability of audio and video synchronous recording is improved, on the other hand, an initialized time period is fully utilized, time for waiting for starting recording by a user is reduced, and the fact that the display of a recorded timer is consistent with that of reality is guaranteed.
Specifically, in one embodiment, the recording process of the MediaRecorder core directly calls an interface, and the VirtualDisplay sets a Surface to start recording. The recording process using the MediaCodec core requires audio/video calibration, and in the first step, the video end and the audio end process data in two threads. And secondly, when the audio end starts recording, starting to continuously read the audio data in a dead loop. And thirdly, before the audio enters a loop, calling a video end virtual display to set a Surface, and starting to receive the picture content, wherein the logic is used for ensuring that the time for starting to read data is consistent for ensuring the video and the audio. Thirdly, when the audio and video are disconnected and enter a content reading stage, a thread synchronous blocking operation is firstly carried out. Meanwhile, on one hand, when the video end receives the virtual display first returned picture data, on the other hand, the audio end enters a dead cycle of reading data, and when the two occasions are triggered, thread blocking is released to start a real recording stage. The logic is to ensure that the timing of receiving the first frame data by the video and the timing of receiving the first data by the audio are consistent, and further calibrate the audio-video synchronization. It provides a simple way to capture and encode audio and video data for creating media files or for real-time transmission. Surface is a carrier in the Android system for processing data that needs to be displayed on a screen.
Specifically, in one embodiment, the recording process of the MediaRecorder (media redirection code) core directly invokes an interface, and the virtual display sets a Surface (execution panel) to start recording. The recording process using the MediaCodec (media codec) core needs to make an audio-video calibration video end and an audio end to process data in two threads, when the audio end starts recording, the audio end starts to continuously read the audio data in a dead loop, and before the audio enters the loop, the video end is called to set a Surface (executing panel) to start receiving the picture content, the logic is used for ensuring that the time for starting reading the data is consistent with the time for starting the video and the audio, and the audio-video is disconnected into a content reading stage, and then a thread synchronous blocking operation is firstly performed. On the one hand, when the video end receives the first return picture data of the virtual display, on the other hand, the audio end enters the dead loop of the read data, and when the two occasions are triggered, the thread blocking is released, and the real recording stage is started. This logic is to ensure that the timing of the first frame data received by the video and the first time data received by the audio are consistent, thereby further calibrating the synchronization between the audio and the video.
Further, in an embodiment, after the current AudioReader (audio reading software) enters a loop, and simultaneously, the virtual display starts to input content into a cyclobarrier (execution loop fence statement) of a Surface panel for running, when the audio reading software waits for reading to succeed, the cyclobarrier can be turned into an open state, and after the audio reading software waits for reading to succeed, the execution statement is not run, at this time, the process blocks the execution path of other threads, and the process starts to run until the last step is opened and executed, so that the process can be used for executing a task chain required to be executed currently, and the cyclobarrier execution statement can be regarded as a pause statement to be executed, and after the calibration synchronization process in the last process is finished, the relevant steps of running and packaging can be started to obtain a final recorded file.
The embodiment of the invention also provides a recording device for audio and video effect synchronization, which can be configured in a recording terminal and is used for executing any embodiment of the recording method for audio and video effect synchronization. Specifically, referring to fig. 2, fig. 2 is a schematic block diagram of a resource allocation-based screen content recording apparatus according to an embodiment of the present invention.
As shown in fig. 2, the recording apparatus 100 for audio and video effect synchronization includes a recording start unit 110, an initialization processing unit 120, a recording unit 130, a video calibration unit 140, and a video encapsulation unit 150.
The recording starting unit 110 is configured to start a recording module corresponding to a user instruction in a recording device according to the user instruction.
The recording test unit 120 is configured to perform a recording test on the current recording module to obtain a recording test result whether the recording test result is normal after the recording test is performed.
The initialization processing unit 130 is configured to perform an initialization process on the current recording module, and obtain an initialization test result whether the current recording module is normal after the initialization process is performed.
The recording unit 140 is configured to record video and audio according to the video encoder and the audio encoder in the recording module, and generate a video recording file and an audio recording file.
The video calibration unit 150 is configured to calibrate the current video recording file and the audio recording file according to the calibration rule preset in the recording module, so as to obtain a video calibration file and an audio calibration file.
Specifically, the recording device for audio and video effect synchronization provided in the embodiment of the present invention is applied to the above recording method for audio and video effect synchronization, and the method includes: the method comprises the steps of firstly executing a recording module corresponding to a user instruction in recording equipment according to the user instruction, secondly executing initialization processing on a current recording module if a recording test result is normal, thirdly executing video and audio recording files according to a video encoder and an audio encoder in the recording module respectively, and generating video recording files and audio recording files, fourthly executing calibration on the current video recording files and the audio recording files respectively through a preset calibration rule in the recording module to obtain video calibration files and audio calibration files, and fifthly executing packaging processing on the current video calibration files and the audio calibration files respectively through a preset packaging rule in the recording module to obtain final recording files. The final recorded file obtained by the method is recorded and tested before synchronization is carried out, the video file and the audio file are respectively subjected to synchronization calibration through the built-in synchronization calibration engine and then packaged, the initialized time period is fully utilized, the time for waiting for starting recording by a user is reduced, the display of a recorded timer is ensured to be consistent with the actual display, and the overall reliability of generating the final recorded file is improved.
The recording apparatus for audio and video effect synchronization based on resource allocation described above may be implemented in the form of a computer program that can be run on a computer device as shown in fig. 3.
Referring to fig. 3, as shown in the drawing, fig. 3 is a schematic block diagram of a computer device according to an embodiment of the present invention. The computer device may be a recording terminal for performing a recording method of audio-video effect synchronization to record screen display contents.
Referring to fig. 3, as shown, the computer device 500 includes a processor 502, a memory, and a network interface 505, which are connected by a communication bus 501, wherein the memory may include a storage medium 503 and an internal memory 504.
The storage medium 503 may store an operating system 5031 and a computer program 5032. The computer program 5032, when executed, may cause the processor 502 to perform a recording method for synchronizing audio and video effects, wherein the storage medium 503 may be a volatile storage medium or a nonvolatile storage medium.
The processor 502 is used to provide computing and control capabilities to support the operation of the overall computer device 500.
The internal memory 504 provides an environment for the execution of a computer program 5032 in the storage medium 503, which computer program 5032, when executed by the processor 502, causes the processor 502 to perform a recording method for synchronizing audio and video effects.
The network interface 505 is used for network communication, such as providing for transmission of data information, etc. It will be appreciated by those skilled in the art that the architecture shown in fig. 3 is merely a block diagram of some of the architecture relevant to the present inventive arrangements and is not limiting of the computer device 500 to which the present inventive arrangements may be implemented, and that a particular computer device 500 may include more or fewer components than shown, or may combine some of the components, or have a different arrangement of components.
The processor 502 is configured to run a computer program 5032 stored in a memory, so as to implement the corresponding functions in the recording method of the audio/video effect synchronization.
Those skilled in the art will appreciate that the embodiment of the computer device shown in fig. 3 is not limiting of the specific construction of the computer device, and in other embodiments, the computer device may include more or less components than those shown, or certain components may be combined, or a different arrangement of components. For example, in some embodiments, the computer device may include only a memory and a processor, and in such embodiments, the structure and function of the memory and the processor are consistent with the embodiment shown in fig. 3, and will not be described again.
It should be appreciated that in an embodiment of the invention, the processor 502 may be a central processing unit (Central Processing Unit, CPU), the processor 502 may also be other general purpose processors, digital signal processors (Digital Signal Processor, DSPs), application specific integrated circuits (Application Specific Integrated Circuit, ASICs), off-the-shelf programmable gate arrays (Field-Programmable Gate Array, FPGAs) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. Wherein the general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
In another embodiment of the invention, a computer-readable storage medium is provided. The computer readable storage medium may be a volatile or nonvolatile computer readable storage medium. The computer readable storage medium stores a computer program, wherein the computer program when executed by a processor realizes the steps included in the recording method for the synchronization of the audio and video effects.
It will be clearly understood by those skilled in the art that, for convenience and brevity of description, specific working procedures of the apparatus, device and unit described above may refer to corresponding procedures in the foregoing method embodiments, which are not repeated herein. Those of ordinary skill in the art will appreciate that the elements and algorithm steps described in connection with the embodiments disclosed herein may be embodied in electronic hardware, in computer software, or in a combination of the two, and that the elements and steps of the examples have been generally described in terms of function in the foregoing description to clearly illustrate the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
In the several embodiments provided by the present invention, it should be understood that the disclosed apparatus, device and method may be implemented in other manners. For example, the apparatus embodiments described above are merely illustrative, and for example, the division of the units is merely a logical function division, there may be another division manner in actual implementation, or a set of units having the same function may be packaged into one unit, for example, multiple units or components may be combined or may be integrated into another system, or some features may be omitted, or not performed. In addition, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices, or elements, or may be an electrical, mechanical, or other form of connection.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the embodiment of the present invention.
In addition, each functional unit in the embodiments of the present invention may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention is essentially or part of what contributes to the prior art, or all or part of the technical solution may be embodied in the form of a software product stored in a computer-readable storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned computer-readable storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a magnetic disk, an optical disk, or other various media capable of storing program codes.
The embodiment of the invention provides a recording method, a device, computer equipment and a medium for synchronizing audio and video effects, wherein a recording module corresponding to a user instruction in recording equipment is started according to the user instruction, a recording test is carried out on a current recording module, initialization processing is carried out on the current recording module to obtain a normal recording test result, if the recording test result is normal, a video and an audio are recorded respectively according to a video encoder and an audio encoder in the recording module, a generated video recording file and an audio recording file are calibrated respectively according to a preset calibration rule in the recording module, a video calibration file and an audio calibration file are obtained, and the current video calibration file and the audio calibration file are packaged respectively according to a preset packaging rule in the recording module, so that a final recording file is obtained. According to the recording method, the video recording file and the audio recording file are synchronously calibrated by detecting the actual recording starting time of the two ends of the audio and the video, so that the aim of synchronizing the audio and the video effects of recorded contents is fulfilled, the initialized time period is fully utilized, the time for waiting for starting recording by a user is reduced, and the fact that the display of a recorded timer is consistent with the actual display is ensured.
In addition, the initialization processing of the recording module is completed before the recording starts, various abnormal conditions can be detected in advance, the user is informed and made to select early, the user is not required to be informed of recording failure after waiting until the actual recording starting stage, and the user experience is effectively optimized.
While the invention has been described with reference to certain preferred embodiments, it will be understood by those skilled in the art that various changes and substitutions of equivalents may be made and equivalents will be apparent to those skilled in the art without departing from the scope of the invention. Therefore, the protection scope of the invention is subject to the protection scope of the claims.

Claims (10)

1. The recording method for the synchronization of the audio and video effects is characterized by comprising the following steps:
starting a recording module corresponding to the user instruction in recording equipment according to the user instruction;
performing a recording test on the current recording module to obtain a recording test result whether the recording test is normal or not after the recording test is performed;
initializing the current recording module to obtain an initialization test result whether the initialization test result is normal or not after the initialization process is carried out;
if the recording test result and the initializing test result are normal, recording video and audio according to a video encoder and an audio encoder in a recording module, and generating a video recording file and an audio recording file;
and respectively calibrating the current video recording file and the audio recording file through a preset calibration rule in the recording module to obtain a video calibration file and an audio calibration file.
2. The method for recording audio and video effects according to claim 1, wherein said starting a recording module corresponding to said user command in a recording device according to the user command comprises:
starting a recording function matched with a current user instruction in the recording equipment;
and detecting whether the current user has user permission, and if so, opening a recording module corresponding to the user instruction.
3. The method for recording audio and video effects according to claim 1, wherein said recording test is performed on a current recording module to obtain a recording test result whether the recording test is normal or not, and further comprising the steps of, before said step of executing:
starting a recorder unit preset in the recording module;
detecting recording equipment used by a current user through recording detection rules matched with the recorder unit;
judging whether recording equipment used by a user can normally record or not, and if so, generating a normal recording test result.
4. The method for recording audio and video effects synchronously according to claim 1, wherein said initializing a current recording module to obtain an initialization test result whether the current recording module is normal after the initializing process comprises:
setting an initialization countdown according to a preset test duration;
initializing the recording module to obtain a corresponding initialization result;
recording test is carried out on the recording module, and a corresponding recording test result is obtained;
and if the test countdown is finished, judging the initialization result and the recording test result to obtain whether the initialization test result is normal or not.
5. The method for recording audio and video effects according to claim 4, wherein after the step of initializing the recording module to obtain a corresponding initialization result, further comprising:
initializing a video encoder through a preset media coding engine to obtain a first initialization generation time of the video encoder;
initializing a media reading encoder through a preset media encoding engine to obtain second initialization generation time of the media reading encoder;
integrating the generation time and judging whether the generation time accords with an initialization rule or not so as to obtain an initialization result, wherein the generation time comprises the first initialization generation time and the second initialization generation time, and the initialization rule is independently arranged in a memory.
6. The method for recording audio and video effects synchronously according to claim 1, wherein if the recording test result and the initializing test result are both normal, recording video and audio according to a video encoder and an audio encoder in a recording module, respectively, and generating a video recording file and an audio recording file, which comprise:
if the recording test result and the initializing test result are normal, reading video recording rules and audio recording rules in the recording module, and generating a video list to be processed and an audio list to be processed;
processing video tasks in each current video list to be processed one by one, so as to generate a video recording file;
and processing the audio tasks in each current audio list to be processed one by one, thereby generating an audio recording file.
7. The method for recording audio and video effects according to claim 1, wherein the calibrating the current video recording file and the audio recording file by using the calibration rule in the recording module to obtain a video calibration file and an audio calibration file respectively includes:
calibrating the video recording file and the audio recording file according to the video calibration processor and the audio calibration processor in the media calibration rule;
the audio calibrator obtains video picture content from the video calibrator, and performs read time synchronization,
the audio calibrator performs thread synchronous blocking operation according to the synchronized reading time;
the video calibrator feeds back video picture data according to the blocking time point of the video synchronous blocking operation;
the audio calibrator synchronously reads audio circulation according to the blocking time point to generate an audio circulation reading file;
and integrating the fed-back video picture data and the audio cycle reading file to obtain a final audio calibration file and a final video calibration file.
8. Recording apparatus for audio-video effect synchronization, wherein the device is configured to perform the audio-video effect synchronization recording method according to any one of claims 1 to 7, the apparatus comprising:
the recording starting unit is used for starting a recording module corresponding to the user instruction in the recording equipment according to the user instruction;
the recording test unit is used for carrying out recording test on the current recording module so as to obtain a recording test result whether the recording test is normal or not after the recording test is carried out;
the initialization processing unit is used for carrying out initialization processing on the current recording module to obtain an initialization test result whether the initialization processing is normal or not;
the recording unit is used for recording video and audio according to the video encoder and the audio encoder in the recording module respectively, and generating a video recording file and an audio recording file;
and the video calibration unit is used for calibrating the current video recording file and the audio recording file respectively through a calibration rule preset in the recording module to obtain a video calibration file and an audio calibration file.
9. A computer device, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus;
a memory for storing a computer program;
a processor for implementing the steps of the recording method for synchronizing audio and video effects according to any one of claims 1 to 7 when executing a program stored on a memory.
10. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, carries out the steps of the recording method of audio-video effect synchronization according to any one of claims 1-7.
CN202311065765.9A 2023-08-22 2023-08-22 Recording method, device, computer equipment and medium for synchronous audio and video effects Pending CN117119241A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311065765.9A CN117119241A (en) 2023-08-22 2023-08-22 Recording method, device, computer equipment and medium for synchronous audio and video effects

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311065765.9A CN117119241A (en) 2023-08-22 2023-08-22 Recording method, device, computer equipment and medium for synchronous audio and video effects

Publications (1)

Publication Number Publication Date
CN117119241A true CN117119241A (en) 2023-11-24

Family

ID=88808599

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311065765.9A Pending CN117119241A (en) 2023-08-22 2023-08-22 Recording method, device, computer equipment and medium for synchronous audio and video effects

Country Status (1)

Country Link
CN (1) CN117119241A (en)

Similar Documents

Publication Publication Date Title
US11336953B2 (en) Video processing method, electronic device, and computer-readable medium
JP5781497B2 (en) Hosted application platform with extensible media format
CN110166810B (en) Video rendering engine switching method, device and equipment and readable storage medium
CN110636284B (en) Decoding capability detection method and device
CN109271213B (en) HTML5 page loading method and device, computer equipment and storage medium
US9740952B2 (en) Methods and systems for real time automated caption rendering testing
US9674255B1 (en) Systems, devices and methods for presenting content
US10321206B2 (en) Method for switching an audio/video application, apparatus and smart TV
CN114095784A (en) H.265 format video stream transcoding playing method, system, device and medium
CN106470353B (en) Multimedia data processing method and device and electronic equipment
CN104053002A (en) Video decoding method and device
WO2022228014A1 (en) Test circuit, method and apparatus for module to be subjected to testing
US7669082B2 (en) Fault tolerant and hang resistant media processing applications
CN117119241A (en) Recording method, device, computer equipment and medium for synchronous audio and video effects
CN111294500B (en) Image shooting method, terminal device and medium
US7076392B1 (en) Test bit-stream generator and method for decoders
US20160373829A1 (en) Caption rendering automation test framework
CN113453075A (en) Method and device for decoding multi-channel video, electronic equipment and storage medium
KR100631518B1 (en) How to handle video file playback error
US8782648B2 (en) Information processing system and related method thereof
CN114666514B (en) Data processing method, device, electronic equipment and storage medium
CN114706753B (en) Display interface testing method and device, electronic equipment and storage medium
CN111246280B (en) Method for automatically acquiring application popup image by smart television
CN117615202A (en) Display equipment and method for displaying screen throwing data
CN118485757A (en) Texture data processing method, device, terminal, storage medium and product

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