CN-119316654-B - Video recording method, device, storage medium and video recording equipment
Abstract
The application provides a video recording method, a video recording device, a storage medium and video recording equipment. The video recording device continuously collects the unit video data and the unit audio data in the recording process, encodes the unit video data by adopting a preset video encoding format to obtain a unit video encoding file, and encodes the unit audio data by adopting the preset audio encoding format to obtain a unit audio encoding file. The unit video coding file and the unit audio coding file are continuously stored, and because the unit video coding file and the unit audio coding file are stored, the video recording equipment can directly package the stored unit video coding file and unit audio coding file in a preset package format to obtain the video file, thereby realizing video recording.
Inventors
- ZHOU YINGJUN
Assignees
- 广州视源电子科技股份有限公司
- 广州视睿电子科技有限公司
Dates
- Publication Date
- 20260512
- Application Date
- 20230711
Claims (10)
- 1. A video recording method, comprising: continuously collecting unit video data and unit audio data in the recording process; the unit video data is encoded by adopting a preset video encoding format to obtain a unit video encoding file, and the unit audio data is encoded by adopting a preset audio encoding format to obtain a unit audio encoding file; continuously storing the unit video coding file and the unit audio coding file; Responding to the packaging instruction, and packaging the stored unit video coding files and the stored unit audio coding files into video files in a preset packaging format; The response to the packaging instruction packages each stored unit video coding file and each stored unit audio coding file into a video file in a preset packaging format, and the method comprises the following steps: And responding to the packaging instruction, packaging each stored unit video coding file to a video track corresponding to the preset packaging format, packaging each stored unit audio coding file to an audio track corresponding to the preset packaging format, thereby generating a video file, and obtaining complete index information corresponding to the video file, wherein the index information is used for playing the video file by a player.
- 2. The video recording method according to claim 1, wherein after the unit video encoded files and the unit audio encoded files are continuously stored, the method further comprises, in response to a packaging instruction, before packaging each stored unit video encoded file and each stored unit audio encoded file into a video file in a preset packaging format: receiving a user operation for ending recording; and generating a packaging instruction based on the user operation for ending recording.
- 3. The video recording method according to claim 1, wherein after the unit video encoded files and the unit audio encoded files are continuously stored, the method further comprises, in response to a packaging instruction, before packaging each stored unit video encoded file and each stored unit audio encoded file into a video file in a preset packaging format: after the recording process is abnormally finished, receiving user operation for storing the video file; and generating a packaging instruction based on the user operation for storing the video file.
- 4. The video recording method according to any one of claims 1 to 3, wherein after the stored each of the unit video encoding files and each of the unit audio encoding files are packaged into a video file in a preset package format, further comprising: generating file information based on the unit video coding file and the unit audio coding file; and writing the file information into a preset container of the video file.
- 5. The video recording method according to claim 1, wherein the continuously storing the unit video encoded file and the unit audio encoded file includes: and continuously storing the unit video coding file and the unit audio coding file into a local memory and/or a cloud memory respectively.
- 6. The video recording method according to claim 5, wherein the continuously storing the unit video encoded file and the unit audio encoded file in the local memory and/or the cloud memory respectively includes: And continuously storing the unit video coding file into a video folder named by a unique identification code, and continuously storing the unit audio coding file into an audio folder named by the unique identification code, wherein the video folder and the audio folder are positioned in a local memory and/or a cloud memory.
- 7. The video recording method according to claim 6, wherein the package instruction carries the unique identification code; The response to the packaging instruction packages each stored unit video coding file and each stored unit audio coding file into a video file in a preset packaging format, and the method comprises the following steps: In response to the packaging instruction, acquiring each unit video coding file in the video folder named by the unique identification code, and acquiring each unit audio coding file in the audio folder named by the unique identification code; And packaging each unit video coding file and each unit audio coding file into a video file in a preset packaging format.
- 8. A video recording apparatus, comprising: the acquisition module is used for continuously acquiring the unit video data and the unit audio data in the recording process; the coding module is used for coding the unit video data by adopting a preset video coding format to obtain a unit video coding file, and coding the unit audio data by adopting a preset audio coding format to obtain a unit audio coding file; The storage module is used for continuously storing the unit video coding file and the unit audio coding file; The packaging module is used for responding to the packaging instruction and packaging the stored unit video coding files and the unit audio coding files into video files in a preset packaging format; The packaging module is specifically configured to respond to a packaging instruction, package each stored unit video coding file to a video track corresponding to the preset packaging format, and package each stored unit audio coding file to an audio track corresponding to the preset packaging format, so as to generate a video file, and obtain complete index information corresponding to the video file, where the index information is used for playing the video file by a player.
- 9. A computer storage medium, characterized in that the computer storage medium stores a computer program which, when executed, implements the method according to any one of claims 1 to 7.
- 10.A video recording apparatus, comprising: a memory for storing executable program code; a processor for calling and running the executable program code from the memory to cause the video recording device to perform the method of any one of claims 1 to 7.
Description
Video recording method, device, storage medium and video recording equipment Technical Field The present application relates to the field of video recording technologies, and more particularly, to a video recording method, apparatus, storage medium, and video recording device in the field of video recording technologies. Background Video recording devices (e.g., monitoring devices, cell phones, drones, etc.) typically use video packaging formats (e.g., MKV, AVI, MP4, etc.) to package encoded video data and audio data directly into video files. When the video recording device uses this method to perform the video recording process, if an abnormal termination condition (such as a recording application program flashing back) is encountered, the player cannot read the index information located in the header container of the video file, and further cannot find the encoded video data and audio data in the video file, so that the player cannot play (decode) the video file. Disclosure of Invention The application provides a video recording method, a video recording device, a storage medium and video recording equipment, which can ensure that a player can play video files. In a first aspect, the present application provides a video recording method, the method comprising: continuously collecting unit video data and unit audio data in the recording process; the unit video data is encoded by adopting a preset video encoding format to obtain a unit video encoding file, and the unit audio data is encoded by adopting a preset audio encoding format to obtain a unit audio encoding file; continuously storing the unit video coding file and the unit audio coding file; And responding to the packaging instruction, and packaging the stored unit video coding files and the stored unit audio coding files into video files in a preset packaging format. In some embodiments, after the maintaining the unit video encoded files and the unit audio encoded files, before the responding to the packaging instruction to package each of the stored unit video encoded files and each of the unit audio encoded files into a video file in a preset packaging format, the method further comprises: receiving a user operation for ending recording; and generating a packaging instruction based on the user operation for ending recording. In some embodiments, after the maintaining the unit video encoded files and the unit audio encoded files, before the responding to the packaging instruction to package each of the stored unit video encoded files and each of the unit audio encoded files into a video file in a preset packaging format, the method further includes: after the recording process is abnormally finished, receiving user operation for storing the video file; and generating a packaging instruction based on the user operation for storing the video file. In some embodiments, the responding to the packaging instruction packages the stored unit video coding files and the unit audio coding files into video files in a preset packaging format, and includes: And responding to the packaging instruction, packaging each stored unit video coding file to a video track corresponding to the preset packaging format, and packaging each stored audio coding file to an audio track corresponding to the preset packaging format. In some embodiments, after the each stored unit video encoded file and each stored unit audio encoded file are encapsulated into a video file in a preset encapsulation format, the method further includes: generating file information based on the unit video coding file and the unit audio coding file; and writing the file information into a preset amount container of the video file. In some embodiments, the maintaining the unit video encoded file and the unit audio encoded file comprises: and continuously storing the unit video coding file and the unit audio coding file into a local memory and/or a cloud memory respectively. In some embodiments, the continuously storing the unit video encoded file and the unit audio encoded file to the local memory and/or the cloud memory, respectively, includes: And continuously storing the unit video coding file into a video folder named by a unique identification code, and continuously storing the unit audio coding file into an audio file named by the unique identification code, wherein the video folder and the audio folder are positioned in a local memory and/or a cloud memory. In some embodiments, the packaged instructions carry the unique identification code; The response to the packaging instruction packages each stored unit video coding file and each stored unit audio coding file into a video file in a preset packaging format, and the method comprises the following steps: In response to the packaging instruction, acquiring each unit video coding file in the video folder named by the unique identification code, and acquiring each unit audio coding file in the audio folder named by the unique identification code; A