Video file generation method and device, equipment, medium and program product
By constructing picture channels and receiving channels, integrating code stream data and station logo information, and generating video files in advanced streaming format, the problem of integrity and consistency of audio and video data preservation in real-time audio and video conferences is solved, and the control of video conferences is realized. Accurate recording of the process.
Patent Information
- Application Number
- CN202410712905.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-04
- Publication Date
- 2024-09-24
AI Technical Summary
The existing technology is difficult to completely save audio and video data in real-time audio and video conferences, especially when multiple audio and video streams coexist and change in real time, and cannot meet the user's conference video recording needs.
By constructing the picture channel and receiving channel according to the recording area indication information, receiving and integrating the code stream data and station logo information, generating video files in advanced streaming format, ensuring that the audio and video streams in different areas are saved separately, and constructing the station logo information and screen The relationship between channels.
It achieves the perception and accuracy of picture changes in the recording area during the video conference, ensures the integrity and consistency of the recording content, and improves the consistency of the generated video files with the actual recording process.
Smart Images

Figure CN118694883A
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data recording, and in particular to a video file generation method, device, equipment, medium and program product. Background Art
[0002] With the rapid development of Internet technology, video conferencing systems have also developed vigorously. As the number of users increases, the demand for video conferencing systems has gradually diversified. For example, users need to save the content of the meeting to facilitate subsequent summary, review and organization of meeting records.
[0003] Currently, the audio and video information collected during a video conference is often uploaded to the cloud or a server dedicated to conference recording in the form of audio and video code stream data to achieve encoded recording and storage of the audio and video code stream data.
[0004] However, when recording traditional conferences based on the H.323 audio and video transmission protocol, the above recording method can still meet the recording needs because the number of audio and video streams is small, usually only three types of data: main video, auxiliary video and audio. However, in real-time audio and video (RTC) conferences, since the multiple audio and video streams generated by the participating terminals are not processed by the intermediate nodes to form a unified main video, auxiliary video and audio data stream, and during the RTC conference, the audio and video stream data presented in the same screen position changes in real time, the existing recording method is difficult to save all audio and video data in a timely and complete manner, and cannot meet the conference video recording needs of RTC conference users. Summary of the invention
[0005] The present invention provides a method, device, equipment, medium and program product for generating a video file, which respectively stores multiple audio and video streams corresponding to a required recording area according to needs, realizes the perception of picture changes in the recorded area during the video recording process, ensures the integrity and accuracy of the recorded content, and improves the consistency between the generated video file and the content presented in the actual recording process.
[0006] In a first aspect, an embodiment of the present invention provides a method for generating a video file, comprising:
[0007] Constructing picture channels and receiving channels corresponding to each picture channel according to the recording area indication information;
[0008] Receive the code stream data and station logo information corresponding to each picture channel through each receiving channel;
[0009] The corresponding code stream data and station logo information are merged and written into the audio and video stream corresponding to the picture channel to generate a video file in an advanced streaming format containing each picture channel.
[0010] In a second aspect, an embodiment of the present invention further provides a video file generation device, comprising:
[0011] A channel construction module, used to construct a picture channel and a receiving channel corresponding to each picture channel according to the recording area indication information;
[0012] A data receiving module, used for receiving the code stream data and station logo information corresponding to each picture channel through each receiving channel;
[0013] The video file generation module is used to merge the corresponding code stream data and station logo information and write them into the audio and video stream corresponding to the picture channel to generate a video file in an advanced streaming format containing each picture channel.
[0014] In a third aspect, an embodiment of the present invention further provides a video file generation device, including:
[0015] at least one processor; and a memory communicatively coupled to the at least one processor;
[0016] The memory stores a computer program executable by at least one processor, and the computer program is executed by at least one processor so that the at least one processor can execute the video file generation method of any embodiment of the present invention.
[0017] In a fourth aspect, an embodiment of the present invention further provides a storage medium comprising computer executable instructions, and the computer executable instructions are used to execute the video file generation method of any embodiment of the present invention when executed by a computer processor.
[0018] In a fifth aspect, an embodiment of the present invention further provides a computer program product, including a computer program, which is used to execute the video file generation method of any embodiment of the present invention when executed by a processor.
[0019] The embodiment of the present invention provides a video file generation method, device, equipment, medium and program product, which constructs a picture channel and a receiving channel corresponding to each picture channel according to the recording area indication information; receives the code stream data and station logo information corresponding to each picture channel through each receiving channel; and writes the corresponding code stream data and station logo information into the audio and video stream corresponding to the picture channel after merging, so as to generate a video file in an advanced streaming format containing each picture channel. By adopting the above technical scheme, when recording a video conference, based on the generation requirements of the ASF format file and the recording area indication information, the corresponding picture channels are constructed for different positions required to be recorded in the video conference, so as to realize the separate preservation of multiple different audio and video streams corresponding to different areas, and at the same time, the corresponding station logo information is preserved for each picture channel during the recording process, and the association relationship between the station logo information and different picture channels and the code stream data in the picture channel is constructed, so that the necessary factors required to construct a complete recording picture are stored in the generated video file in the advanced streaming format, which ensures the integrity and accuracy of the recorded content and improves the consistency between the generated video file and the content presented in the actual recording process.
[0020] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0022] Figure 1 A flowchart of a method for generating a video file provided in Embodiment 1 of the present invention;
[0023] Figure 2 A flowchart of a method for generating a video file provided in Embodiment 2 of the present invention;
[0024] Figure 3 A schematic diagram of the structure of a video file generating device provided in Embodiment 3 of the present invention;
[0025] Figure 4 A structural schematic diagram of a video file generating device provided in Embodiment 4 of the present invention. DETAILED DESCRIPTION
[0026] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0027] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0028] Embodiment 1
[0029] Figure 1 A flowchart of a method for generating a video file is provided for the first embodiment of the present invention. The embodiment of the present invention can be applied to the case of completely recording a real-time communication conference in which multiple terminals participate simultaneously. The method can be executed by a video file generating device. The video file generating device can be implemented by software and / or hardware. The video file generating device can be configured in a video file generating device. Optionally, the video file generating device can be an electronic device, which can be a notebook, a desktop computer, a recording and broadcasting server, a smart tablet, etc., which is not limited by the embodiment of the present invention. Among them, the recording and broadcasting server can be specifically understood as an electronic device for encapsulating received audio and video streams into files.
[0030] It is understandable that a video conferencing system is often composed of a video conferencing service platform and a plurality of terminal devices connected to the video conferencing service platform. Each terminal device can access the video conferencing service platform and send subscription information to the video conferencing service platform, thereby realizing multi-party video conferencing of different terminal devices based on the subscription information. Each terminal device can be used as a video source to provide audio and video data to the video conferencing service platform. The video conferencing service platform can receive external control instructions to realize the construction of different multi-party video conferences, and forward the audio and video data of each terminal device as a forwarding node. At the same time, the recording and broadcasting server can also access the video conferencing service platform or subscribe to the video conferencing service platform to receive instructions related to video conference recording, as well as receive the audio and video data required for recording forwarded by the video conferencing service platform, and feedback the final recorded video conference video file to the video conferencing service platform. Optionally, the video recording file generation method in the embodiment of the present invention can be executed by the recording and broadcasting server, or by other electronic devices that can realize audio and video data encapsulation, and the embodiment of the present invention does not limit this.
[0031] like Figure 1 As shown, a method for generating a video file provided by an embodiment of the present invention specifically includes the following steps:
[0032] S101, constructing picture channels and receiving channels corresponding to each picture channel according to recording area indication information.
[0033] In this embodiment, the recording area indication information can be specifically understood as information used to indicate the recording area required by the recording and broadcasting server in the video conference screen and the video sources required to be recorded in different recording areas. Exemplarily, the recording area indication information can be generated by the video conference platform according to its own recording strategy and sent to the recording and broadcasting server for configuration, or the recording and broadcasting server can actively subscribe to the video conference platform for acquisition. The screen channel can be specifically understood as a channel for storing audio and video data of a specified area in the video conference screen during the conference. Optionally, an Advanced Streaming Format (ASF) file can store 127 audio and video streams. A screen channel can be composed of an audio stream channel and a video stream channel in the ASF format file, that is, the audio stream channel corresponding to a screen channel can be used to write the audio data of a specified area in the corresponding video conference screen during the conference, and the video stream channel corresponding to a screen channel can be used to write the video data of a specified area in the corresponding video conference screen during the conference. The receiving channel can be specifically understood as a channel used to establish a connection between the picture channel and the video source it needs to record, so that the picture channel can obtain the audio and video data provided by the video source. It can be understood that the two ends of a receiving channel are fixed, that is, one end is the end where the video source is located, and the other end is the picture channel end that receives audio and video information. Since the video source of the area corresponding to the picture channel in the video conference screen may change during the meeting, that is, when the video source changes, since the end where the video source is located has changed, the receiving channel between the video source and the picture channel should also be considered as a new channel, that is, the receiving channel corresponding to the picture channel will also change accordingly when the video source changes.
[0034] Specifically, taking the recording and broadcasting server as the execution subject as an example, the recording and broadcasting server can realize the recording of the video conference screen when accessing the video conference through the video conference service platform. When the recording and broadcasting server obtains the recording area indication information through its own subscription or the video conference service platform, it can determine the area to be recorded in the video conference screen according to the recording area indication information, as well as the video source corresponding to each required recording area at the beginning of recording. For each area to be recorded, two non-overlapping stream channels are selected in the ASF format file as the picture channel, and according to the different video sources corresponding to each recording area, a corresponding receiving channel is constructed between the picture channel and the video source.
[0035] S102: Receive code stream data and station logo information corresponding to each picture channel through each receiving channel.
[0036] In this embodiment, the code stream data can be specifically understood as a data stream transmitted from the receiving channel to the picture channel and forwarded by the video conferencing service platform and presented in the video conferencing picture area corresponding to the picture channel. The station logo information can be specifically understood as image identification information displayed in the video conferencing picture area corresponding to the picture channel to indicate the identity of the video source.
[0037] Specifically, after completing the construction of the screen channels between each required recording area in the video conference screen, each screen channel can receive the code stream data given by the video source corresponding to the required recording area based on the corresponding receiving channel, and the code stream data can simultaneously include the audio data and video data in the video source. At the same time, when a station logo is presented in the screen of the video source, the screen channel can simultaneously obtain the station logo information corresponding to the video source when receiving the data transmitted by the video source through the receiving channel.
[0038] S103: The corresponding code stream data and the station logo information are merged and written into the audio and video stream corresponding to the picture channel to generate a video file in an advanced streaming format including each picture channel.
[0039] Specifically, since the station logo information in the video source is not the same as the audio and video bitstream format in the bitstream data when it is transmitted to the picture channel, and the transmission time of the station logo information is random, it can be considered that the video source does not exist in the picture displayed in the video conference corresponding to the station logo before receiving the station logo information. At the same time, since the audio and video data streams in the ASF format file need to be stored in different stream channels. Therefore, in order to ensure that the exact time and position of the station logo appearing in the video conference picture are correctly and completely recorded, the recording and broadcasting server can convert the station logo information into a format similar to the audio and video data in the bitstream data when receiving the station logo information, and then merge the station logo information with the bitstream data, and divide the merged bitstream data according to audio and video and write it into different audio stream channels and video stream channels corresponding to the picture channel, so as to generate an ASF format recording file in which each picture channel contains the audio and video data presented in different areas of the video conference picture.
[0040] Optionally, the video conferencing service platform may send recording start and end instructions to the recording and broadcasting server to trigger the recording and broadcasting server to complete the generation of the recording file in the ASF format. The recording and broadcasting server may also access the video conferencing service platform to access and record the video conference when recording is needed based on actual recording needs, and exit the video conference to end the recording when recording needs to be ended, thereby triggering the recording and broadcasting server to complete the generation of the recording file in the ASF format.
[0041] The technical solution of this embodiment is to construct a picture channel and a receiving channel corresponding to each picture channel according to the recording area indication information; receive the code stream data and station logo information corresponding to each picture channel through each receiving channel; merge the corresponding code stream data and station logo information and write them into the audio and video stream corresponding to the picture channel to generate a video file in an advanced streaming format containing each picture channel. By adopting the above technical solution, when recording a video conference, based on the generation requirements of the ASF format file and the recording area indication information, the corresponding picture channels are constructed for different positions required to be recorded in the video conference, and the multiple different audio and video streams corresponding to different areas are saved separately. At the same time, during the recording process, the corresponding station logo information is saved for each picture channel, and the association relationship between the station logo information and different picture channels and the code stream data in the picture channel is constructed, so that the necessary factors required to construct a complete recording picture are stored in the generated video file in an advanced streaming format, ensuring the integrity and accuracy of the recorded content, and improving the consistency between the generated video file and the content presented in the actual recording process.
[0042] Embodiment 2
[0043] Figure 2 A flowchart of a method for generating a video file is provided for the second embodiment of the present invention. The embodiment of the present invention is further optimized on the basis of the above-mentioned optional technical solutions. The picture channel and each receiving channel are established according to the conference area to be recorded and the video source information in the recording area indication information. When each picture channel receives the code stream data, the code stream data is written into the audio stream channel or the video stream channel corresponding to the picture channel according to the actual type of the code stream data. At the same time, when the station logo information is received, it is encapsulated and converted into a supplementary enhancement information frame, and written as a video frame into the position corresponding to the moment of receiving the station logo information in the video stream channel, so that the station logo information can be stored in the corresponding video stream, and the accuracy of the appearance time of the station logo information is guaranteed. When the picture sequence switching instruction is received, the reconstruction of the receiving channel corresponding to the picture channel is realized based on the picture sequence switching instruction. By changing the receiving channel, the picture channel can perceive and completely record the real-time changes of the area to be recorded, thereby improving the recording integrity and consistency.
[0044] like Figure 2 As shown, a method for generating a video file provided by an embodiment of the present invention specifically includes the following steps:
[0045] S201. Determine at least one conference area to be recorded according to recording area indication information, and construct a corresponding picture channel for each conference area to be recorded.
[0046] Each picture channel includes a video stream channel and an audio stream channel.
[0047] In this embodiment, the conference area to be recorded can be specifically understood as an area that needs to be recorded in the video conference screen.
[0048] Specifically, the recording area indication information is parsed to obtain at least one meeting area to be recorded in the video conference screen, and then the data corresponding to each meeting area to be recorded is clearly transmitted to the channel for display on the video conference screen based on the recording area indication information, so as to construct a picture channel corresponding to the channel for transmitting the data corresponding to each meeting area to be recorded to the video conference screen for display in the ASF format file, which includes an audio stream channel and a video stream channel, so that each picture channel can complete the acquisition and recording encapsulation of the data information transmitted by the corresponding meeting area to be recorded within the required recording time range.
[0049] Exemplarily, since 127 audio and video streams can be stored in an ASF format file, when establishing a picture channel corresponding to the conference area to be recorded in the ASF format file, the 2nth stream channel in the ASF format file can be determined as the video stream channel corresponding to the picture channel according to the order n of the established picture channel in all the picture channels that need to be established, and the 2n-1th stream channel in the ASF format file can be determined as the audio stream channel corresponding to the picture channel, so as to confirm the audio stream channel and video stream channel belonging to the same picture channel. Exemplarily, assuming that the picture channel corresponding to the conference area to be recorded in the ASF format file is the first picture channel, the video stream channel and audio stream channel corresponding to the first picture channel in the ASF format file are the second stream channel and the first stream channel, respectively. Further, the stream channel sequence number that can be used to receive auxiliary stream information in the ASF format file can be determined according to the maximum number of subscribers in the RTC conference, that is, it can be considered that the stream channel sequence number of the auxiliary stream information should be greater than twice the maximum number of subscribers. If it is assumed that the maximum number of subscribers is 25 terminals, the stream channel number of the auxiliary stream may be set to a value greater than 60, which is not limited in the embodiment of the present invention.
[0050] S202: Determine the video source information corresponding to each conference area to be recorded according to the recording area indication information, and construct a receiving channel corresponding to each picture channel according to each video source information and the correspondence between each conference area to be recorded and each picture channel.
[0051] In this embodiment, the video source information can be specifically understood as information when a terminal connected to the conference area to be recorded is used as a video source when the recording area indication information is acquired.
[0052] Specifically, after parsing the recording area indication information, the identity information of the terminal connected to each conference area to be recorded at the time when the recording area indication information is obtained can also be obtained. Since the terminal connected to the conference area to be recorded can be considered as the video source of the conference area to be recorded at the corresponding time, the identity information of the terminal connected to each conference area to be recorded when the recording area indication information is obtained can also be determined as the video source information corresponding to the conference area to be recorded. In order to synchronously record the data displayed on the conference screen in the conference area to be recorded, it is necessary to forward it to the matching screen channel. Therefore, the channel can be established between the terminal corresponding to the video source information and the screen channel based on the video source information, and the channel established between each group of screen channels and the video source is determined as the receiving channel corresponding to the screen channel.
[0053] S203, receiving the code stream data and station logo information corresponding to each picture channel through each receiving channel.
[0054] S204: Write the video code stream data in the corresponding code stream data into the video stream channel in the picture channel.
[0055] Specifically, for each picture channel, when it receives stream data from the corresponding receiving channel, it can distinguish the data type in the stream data, and for the video stream data in the received stream data, write the video stream data into the video stream channel corresponding to the picture channel.
[0056] S205: Convert the audio code stream data in the corresponding code stream data into a code stream format, and write the converted audio code stream data into the audio stream channel in the picture channel.
[0057] Specifically, for each picture channel, when it receives bitstream data from the corresponding receiving channel, the data type in the bitstream data can be distinguished. For the audio bitstream data in the received bitstream data, since the formats of the audio bitstream data given by different video sources may be different, in order to enable the ASF format file to write the audio bitstream data normally, the audio bitstream data needs to be decoded and re-encoded to complete the format conversion, and then the converted audio bitstream data is written to the audio stream channel corresponding to the picture channel.
[0058] Exemplarily, for format conversion of different audio code stream data, in an embodiment of the present invention, the received audio code stream data may be first decoded and then encoded into a 48K opus code stream, and then encoded into a frame of audio frame data at 20ms and written into the audio stream channel in the picture channel. It can be understood that in the embodiment of the present invention, a 48K sampling rate is selected so that no matter what format the received audio code stream data is in, the original data will not be downsampled to cause sound degradation. At the same time, since the opus encoding and decoding are all in units of 10ms, if the frequency of processing once in 10ms is relatively high, processing once in 30ms may cause voice synchronization problems. Therefore, in the embodiment of the present invention, 20ms is used as an example for processing. In addition to the above-mentioned audio code stream format conversion method, any other feasible audio code stream format conversion method may also be used, and the embodiment of the present invention is not limited to this.
[0059] S206: When the station logo information is received, encapsulate the station logo information into a supplementary enhancement information frame, and write the supplementary enhancement information frame into the video stream channel in the picture channel.
[0060] In this embodiment, the supplemental enhancement information frame (SEI) can be specifically understood as a frame within the code stream range that is used to add additional information to the video code stream.
[0061] Specifically, since the station logo information can be received at any time when the picture channel receives data through the receiving channel, and the representation form of the station logo information in the data is different from the audio and video stream form required by the ASF file, when the station logo information is received, the station logo information can be first converted into a format, encapsulated into an SEI frame, and the SEI frame is written into the video stream channel in the picture channel as a video frame. It can be understood that the writing position of the SEI frame in the video stream channel is the same as the corresponding position of the received station logo information in the entire video code stream data.
[0062] It is understandable that S204, S205 and S206 may be executed simultaneously or in any order. In the embodiment of the present invention, the sequential execution of S204-S206 is taken as an example.
[0063] Optionally, during the video conference, the position information of the video streams corresponding to each video source in the overall video conference screen will be related to the data transmitted in real time by the video source. If a person in the video source suddenly speaks or the video source initiates an auxiliary stream, the position of the video source in the overall video conference screen needs to be adjusted accordingly. Since the corresponding position of each meeting area to be recorded in the overall video conference screen remains unchanged, the position of the video source in the overall video conference screen changes, corresponding to its access to different meeting areas to be recorded for data transmission. It can be considered that a picture channel can always receive data from one video source or multiple different video sources during a complete recording process.
[0064] Therefore, embodiment 2 of the present invention provides a method for generating a video file when the position of a video source changes in the overall screen of a video conference, including: when the corresponding bit stream data and station logo information are merged and written into the audio and video stream corresponding to the screen channel, if a screen sequence switching instruction is received, the receiving channels corresponding to each screen channel are reconstructed according to the screen sequence switching instruction, and return to execute S203.
[0065] In this embodiment, the picture sequence switching instruction can be specifically understood as instruction information given by the video conferencing service platform, which includes the changed recording object information to trigger the change of the video source accessed by different picture channels.
[0066] Specifically, when each screen channel writes the corresponding code stream data and station logo information into the audio and video stream, if the position of the video source in the overall video conference screen changes, the video sources corresponding to different meeting areas to be recorded will change. At this time, the video conferencing service platform will generate a screen sequence switching instruction containing the changed video source information corresponding to each meeting area to be recorded, and send the screen sequence switching instruction to the recording and broadcasting server, so that the recording and broadcasting server can reconstruct the receiving channel corresponding to each screen channel where the video source has changed based on the screen sequence switching instruction, and return to execute S203, so that each screen channel can continue to receive data and write audio and video streams through the receiving channel.
[0067] In an embodiment of the present invention, based on the acquired picture sequence switching instructions and the receiving channel between the picture channel and the video source corresponding to each terminal in the RTC conference, the picture channel is able to perceive and fully record the real-time changes of the conference area to be recorded by changing the receiving channel, thereby improving the recording integrity and consistency.
[0068] S207: Generate a video file in an advanced streaming format including each picture channel.
[0069] Optionally, since the generated video file in ASF format cannot be played directly, after the video file in ASF format is generated, the video file in ASF format may be transcoded into a video file in MP4 format.
[0070] Optionally, transcoding the video file in ASF format to the video file in MP4 format can be achieved in the following ways:
[0071] 1) Reading each group of frames in the video file in the advanced streaming format in sequence; wherein, a set of frames located at the same position in different channels of the video file in the advanced streaming format is a group of frames.
[0072] 2) For each group of frames, the frame type of each frame is determined according to the frame information of each frame in the group of frames, the frame type of which is an audio frame type is determined as an audio frame, and the frame type of which is a video frame type is determined as a video frame.
[0073] 3) Decoding each audio frame to determine the time stamp of each audio frame, mixing the decoded audio frames according to the time stamp of each audio frame, and determining the audio data to be written.
[0074] 4) Decode the video frames that are supplementary enhancement information frames in each video frame into station logo information, and update the current station logo set according to the station logo information.
[0075] 5) Decode the video frames that are video data frames in each video frame into color space data, and perform picture synthesis according to the time stamp of each color space data, each color space data and the current logo set to determine the video data to be written.
[0076] 6) Encode the audio data to be written and the video data to be written respectively and write them into a file in MP4 format to generate a video file in MP4 format.
[0077] Specifically, since the video file in the ASF format is stored in the form of frames in each audio and video stream channel, when transcoding the video file in the ASF format, the frames at the same position in different channels in the video file in the ASF format can be uniformly read each time, and the set of frames obtained by reading is used as a group of frames in the ASF format video file, and the frame type of the frame is determined according to the frame information corresponding to each frame in the group of frames. Then, the frame type of the audio frame type is determined as an audio frame, and the frame type of the video frame type is determined as a video frame.
[0078] By decoding each audio frame belonging to the audio frame type in a group of frames, pulse code modulation (PCM) audio data can be obtained, the PCM data is placed in the corresponding PCM queue, and the timestamp of each PCM data is recorded. According to each timestamp, each audio frame with a smaller time difference can be determined as the audio frame that needs to be mixed in the group of frames, and each audio frame that needs to be mixed can be mixed to obtain the audio data to be written.
[0079] Exemplarily, each audio frame can be decoded and mixed by creating an audio decoder. After decoding each audio frame to obtain a PCM queue containing multiple PCM data and the corresponding timestamps of the PCM data, all PCM data can be converted to a fixed value before performing the mixing operation. Before performing the mixing operation, the audio frame size will be determined first. If it is larger than the number of audio streams in the current ASF format video file, mixing can be performed, otherwise the ASF format file can be read. When mixing, first traverse each PCM queue head to find the data with the smallest timestamp, and then compare it with the PCM timestamps of other queue heads. If the timestamp is less than the preset time threshold, such as 20ms, the timestamp can be added to the same mixing queue for mixing, and the mixed data is determined as the audio data to be written that can be written to the MP4 format file.
[0080] The video frames belonging to the video frame type in a group of frames are further divided into frame types, and the video frames belonging to the SEI frames are decoded into station logo information, and the station logo information can be combined with the corresponding timestamp and video source identity information to update the current station logo set. The current station logo set can contain the specific station logo information and the timestamp of the station logo appearing in different picture channels in the ASF format video file, so as to extract the station logo contained in the ASF format video file, as well as the video source corresponding to the station logo and the appearance duration and other information. The video frames belonging to the video data frames in each video frame are decoded into color space (YUV) data, and then according to the timestamp of each YUV data and the corresponding relationship between the timestamp and the video source corresponding to each station logo in the current station logo set, each YUV data and the station logo in the current station logo set are synthesized to obtain the video data to be written in the MP4 format file, and then the audio data to be written and the video data to be written can be encoded and written into the MP4 format file to generate the MP4 format video file.
[0081] It is understandable that steps 3), 4) and 5) may be performed simultaneously, and this embodiment of the present invention does not limit this.
[0082] Optionally, the image is synthesized according to the timestamp of each color space data, each color space data and the current logo set to determine the video data to be written, which can be specifically implemented in the following manner:
[0083] The color space data whose timestamp difference among the color space data is less than or equal to the preset timestamp threshold is used as the color space data to be synthesized;
[0084] The previous frame of color space data corresponding to the color space data whose timestamp difference in each color space data is greater than a preset timestamp threshold is used as the color space data to be synthesized;
[0085] Performing screen synthesis on the color space data to be synthesized to determine a synthesized screen;
[0086] Each current logo in the current logo set is added to the composite picture, and the video data to be written is determined.
[0087] In this embodiment, the preset timestamp threshold may be specifically understood as a time threshold used to determine whether different picture frames are approximately picture frames acquired at the same time and can be synthesized.
[0088] Specifically, for the YUV data whose timestamp difference among each YUV data is less than or equal to the preset timestamp threshold, it can be considered that the above YUV data can be approximately obtained at the same time. At this time, the above YUV data can be determined as the YUV data to be synthesized; and for the YUV data whose timestamp difference among each YUV data is greater than the preset timestamp threshold, there must be one YUV data at both ends of the timestamp difference that has a smaller difference with the average timestamp in the group. The YUV data with the smaller difference is taken as the YUV data to be synthesized that needs to be retained, and the YUV data with the larger difference can be considered as the data not obtained at the same time as other YUV data in the group. In order to maintain the stability of the picture synthesis, the YUV data with the larger difference can be used as the YUV data to be synthesized in the current picture synthesis. Then, after synthesizing all the YUV data to be synthesized, a composite picture containing all the video source display pictures that need to be recorded at the same time can be obtained. Then, according to the video source correspondence between multiple current logos contained in the current logo set, the current logo is added to the pictures from different video sources in the composite picture, and the composite picture after adding the logo is used as the video data to be written.
[0089] The technical solution of the embodiment of the present invention, during the process of transcoding a video file from ASF format to MP4 format, enables the station logo information to be inserted into the video screen to be displayed in the correct position and order based on the position information and type information of the frames in the video file, and can accurately update the station logo information displayed therein according to different video sources, so that the video screen stored in the MP4 file after fusion has the correct station logo information, and further makes the content displayed in the MP4 format video file during subsequent playback the same as the content displayed during the actual recording process of the area to be recorded, thereby improving the recording integrity and consistency.
[0090] The technical solution of this embodiment completes the establishment of the picture channel and each receiving channel according to the conference area to be recorded and the video source information in the recording area indication information, and when each picture channel receives the code stream data, it is written into the audio stream channel or video stream channel corresponding to the picture channel according to the actual type of the code stream data. At the same time, when the station logo information is received, it is encapsulated and converted into a supplementary enhancement information frame, and written as a video frame into the position corresponding to the moment of receiving the station logo information in the video stream channel, so that the station logo information can be stored in the corresponding video stream, and the accuracy of the appearance time of the station logo information is guaranteed. When the picture sequence switching instruction is received, the reconstruction of the receiving channel corresponding to the picture channel is realized based on the picture sequence switching instruction, and the picture channel is realized by changing the receiving channel to perceive and completely record the real-time changes of the recording area, thereby improving the recording integrity and consistency.
[0091] Embodiment 3
[0092] Figure 3 A schematic diagram of the structure of a video file generating device provided in Embodiment 3 of the present invention is shown in FIG. Figure 3 As shown, the video file generating device includes a channel building module 31, a data receiving module 32 and a video file generating module 33.
[0093] Among them, the channel construction module 31 is used to construct the picture channel and the receiving channel corresponding to each picture channel according to the recording area indication information; the data receiving module 32 is used to receive the code stream data and station logo information corresponding to each picture channel through each receiving channel; the video file generation module 33 is used to merge the corresponding code stream data and station logo information and write them into the audio and video stream corresponding to the picture channel to generate a video file in an advanced streaming format containing each picture channel.
[0094] The technical solution of the embodiment of the present invention, when recording a video conference, constructs corresponding picture channels for different locations that need to be recorded in the video conference based on the generation requirements of the ASF format file and the recording area indication information, thereby realizing the separate preservation of multiple different audio and video streams corresponding to different areas, and at the same time, during the recording process, the corresponding station logo information is preserved for each picture channel, and the association relationship between the station logo information and different picture channels and the bit stream data in the picture channels is constructed, so that the necessary factors required to construct a complete recorded picture are stored in the generated video file in the advanced streaming format, thereby ensuring the integrity and accuracy of the recorded content and improving the consistency between the generated video file and the content presented in the actual recording process.
[0095] Optionally, the channel construction module 31 includes:
[0096] A picture channel construction unit, used to determine at least one conference area to be recorded according to the recording area indication information, and to construct a corresponding picture channel for each conference area to be recorded;
[0097] A receiving channel construction unit is used to determine the video source information corresponding to each conference area to be recorded according to the recording area indication information, and to construct a receiving channel corresponding to each screen channel according to each video source information and the corresponding relationship between each conference area to be recorded and each screen channel;
[0098] Each picture channel includes a video stream channel and an audio stream channel.
[0099] Optionally, the video file generation module 33 includes:
[0100] A video stream writing unit, used for writing the video code stream data in the corresponding code stream data into the video stream channel in the picture channel;
[0101] The audio stream writing unit is used to convert the audio code stream data in the corresponding code stream data into a code stream format, and write the converted audio code stream data into the audio stream channel in the picture channel;
[0102] The station logo writing unit is used to encapsulate the station logo information into a supplementary enhancement information frame when receiving the station logo information, and write the supplementary enhancement information frame into the video stream channel in the picture channel;
[0103] The file generating unit is used to generate a video file in an advanced streaming format including each picture channel.
[0104] Optionally, the video file generating device further includes: a channel reconstruction module, specifically used for:
[0105] When the corresponding bitstream data and station logo information are merged and written into the audio and video stream corresponding to the picture channel, if a picture sequence switching instruction is received, the receiving channels corresponding to each picture channel are reconstructed according to the picture sequence switching instruction, and the step of receiving the bitstream data and station logo information corresponding to each picture channel through each receiving channel is returned.
[0106] Optionally, the video file generating device further includes: a file transcoding module, which is used to generate the video file in the advanced streaming format,
[0107] Reading each group of frames in the video file in the advanced streaming format in sequence; wherein a set of frames located at the same position in different channels of the video file in the advanced streaming format is a group of frames;
[0108] For each group of frames, determining the frame type of each frame according to the frame information of each frame in the group of frames, determining the frame whose frame type is an audio frame type as an audio frame, and determining the frame whose frame type is a video frame type as a video frame;
[0109] Decoding each audio frame to determine the timestamp of each audio frame, mixing the decoded audio frames according to the timestamp of each audio frame, and determining the audio data to be written;
[0110] Decoding the video frames that are supplementary enhancement information frames in each video frame into station logo information, and updating the current station logo set according to the station logo information;
[0111] Decoding the video frames that are video data frames in each video frame into color space data, and synthesizing the screen according to the timestamp of each color space data, each color space data and the current logo set, to determine the video data to be written;
[0112] The audio data to be written and the video data to be written are encoded respectively and written into a file in MP4 format to generate a video file in MP4 format.
[0113] The process of synthesizing the image according to the timestamp of each color space data, each color space data and the current logo set to determine the video data to be written includes:
[0114] The color space data whose timestamp difference among the color space data is less than or equal to the preset timestamp threshold is used as the color space data to be synthesized;
[0115] The previous frame of color space data corresponding to the color space data whose timestamp difference in each color space data is greater than a preset timestamp threshold is used as the color space data to be synthesized;
[0116] Performing screen synthesis on the color space data to be synthesized to determine a synthesized screen;
[0117] Each current logo in the current logo set is added to the composite picture, and the video data to be written is determined.
[0118] The video file generation device provided in the embodiment of the present invention can execute the video file generation method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0119] Embodiment 4
[0120] Figure 4A schematic diagram of the structure of a video file generation device provided for Embodiment 4 of the present invention. The video file generation device 40 may be intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The video file generation device 40 may also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or claimed herein.
[0121] like Figure 4 As shown, the video file generating device 40 includes at least one processor 41, and a memory connected to the at least one processor 41, such as a read-only memory (ROM) 42, a random access memory (RAM) 43, etc., wherein the memory stores a computer program that can be executed by the at least one processor, and the processor 41 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 42 or the computer program loaded from the storage unit 48 to the random access memory (RAM) 43. In the RAM 43, various programs and data required for the operation of the video file generating device 40 can also be stored. The processor 41, the ROM 42, and the RAM 43 are connected to each other through a bus 44. An input / output (I / O) interface 45 is also connected to the bus 44.
[0122] Multiple components in the video file generation device 40 are connected to the I / O interface 45, including: an input unit 46, such as a keyboard, a mouse, etc.; an output unit 47, such as various types of displays, speakers, etc.; a storage unit 48, such as a disk, an optical disk, etc.; and a communication unit 49, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 49 allows the video file generation device 40 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0123] The processor 41 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 41 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 41 executes the various methods and processes described above, such as a video file generation method.
[0124] In some embodiments, the video file generation method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 48. In some embodiments, part or all of the computer program may be loaded and / or installed on the video file generation device 40 via the ROM 42 and / or the communication unit 49. When the computer program is loaded into the RAM 43 and executed by the processor 41, one or more steps of the video file generation method described above may be performed. Alternatively, in other embodiments, the processor 41 may be configured to execute the video file generation method in any other appropriate manner (e.g., by means of firmware).
[0125] Optionally, an embodiment of the present invention further provides a computer program product, including a computer program, which, when executed by a processor, implements the method for generating a video file provided in any embodiment of the present invention.
[0126] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0127] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0128] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0129] To provide interaction with a user, the systems and techniques described herein may be implemented on a video file generation device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball), through which the user can provide input to the video file generation device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0130] The systems and techniques described herein can be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0131] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0132] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0133] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for generating a video file, characterized in that: include: Constructing picture channels and receiving channels corresponding to the picture channels according to the recording area indication information; Receiving the code stream data and station logo information corresponding to each of the picture channels through each of the receiving channels; The corresponding code stream data and station logo information are merged and written into the audio and video stream corresponding to the picture channel to generate a video recording file in an advanced streaming format containing each of the picture channels.
2. The method according to claim 1, characterized in that The step of constructing picture channels according to the recording area indication information, and receiving channels corresponding to the picture channels, includes: Determine at least one conference area to be recorded according to the recording area indication information, and construct a corresponding picture channel for each conference area to be recorded; Determine the video source information corresponding to each of the conference areas to be recorded according to the recording area indication information, and construct a receiving channel corresponding to each of the picture channels according to the video source information and the corresponding relationship between each of the conference areas to be recorded and each of the picture channels; Each of the picture channels includes a video stream channel and an audio stream channel.
3. The method according to claim 2, characterized in that The corresponding code stream data and station logo information are merged and written into the audio and video stream corresponding to the picture channel, including: Writing the video code stream data in the corresponding code stream data into the video stream channel in the picture channel; Convert the audio code stream data in the corresponding code stream data into a code stream format, and write the converted audio code stream data into the audio stream channel in the picture channel; When the station logo information is received, the station logo information is encapsulated into a supplementary enhancement information frame, and the supplementary enhancement information frame is written into the video stream channel in the picture channel.
4. The method according to any one of claims 1 to 3, characterized in that When the corresponding code stream data and station logo information are merged and written into the audio and video stream corresponding to the picture channel, it also includes: If a picture sequence switching instruction is received, the receiving channels corresponding to the picture channels are reconstructed according to the picture sequence switching instruction, and the step of receiving the code stream data and station logo information corresponding to the picture channels through the receiving channels is returned to be executed.
5. The method according to any one of claims 1 to 3, characterized in that: After generating the video file in the advanced streaming format, the method further includes: Reading each group of frames in the video file in the advanced streaming format in sequence; wherein a set of frames located at the same position in different channels of the video file in the advanced streaming format is a group of frames; For each group of frames, determine the frame type of each frame according to the frame information of each frame in the group of frames, determine the frame whose frame type is an audio frame type as an audio frame, and determine the frame whose frame type is a video frame type as a video frame; Decoding each of the audio frames to determine a timestamp of each of the audio frames, mixing each of the decoded audio frames according to the timestamp of each of the audio frames, and determining audio data to be written; Decoding the video frames that are supplementary enhancement information frames in the video frames into station logo information, and updating the current station logo set according to the station logo information; Decoding the video frames that are video data frames in the video frames into color space data, and performing picture synthesis according to the timestamp of each color space data, each color space data and the current logo set to determine the video data to be written; The audio data to be written and the video data to be written are respectively encoded and written into a file in MP4 format, so as to generate a video file in MP4 format.
6. The method according to claim 5, characterized in that The step of synthesizing the picture according to the timestamp of each color space data, each color space data and the current logo set to determine the video data to be written includes: The color space data whose timestamp difference among the color space data is less than or equal to a preset timestamp threshold is used as the color space data to be synthesized; Using the previous frame of color space data corresponding to the color space data whose timestamp difference in each of the color space data is greater than the preset timestamp threshold as the color space data to be synthesized; Performing picture synthesis on the color space data to be synthesized to determine a synthesized picture; Each current logo in the current logo set is added to the composite picture to determine the video data to be written.
7. A video file generating device, characterized in that: include: A channel construction module, used to construct a picture channel and a receiving channel corresponding to each picture channel according to the recording area indication information; A data receiving module, used for receiving the code stream data and station logo information corresponding to each of the picture channels through each of the receiving channels; The video file generation module is used to merge the corresponding code stream data and station logo information and write them into the audio and video stream corresponding to the picture channel to generate a video file in an advanced streaming format containing each of the picture channels.
8. A video file generation device, characterized in that: include: at least one processor; and a memory communicatively coupled to the at least one processor; The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the video file generation method according to any one of claims 1 to 6.
9. A storage medium containing computer executable instructions, characterized in that: The computer executable instructions are used to execute the video file generation method according to any one of claims 1 to 6 when executed by a computer processor.
10. A computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the method for generating a video file according to any one of claims 1 to 6 is implemented.
