Virtual digital human file stream pushing method and system

By obtaining virtual digital human files and using FFmpeg's API calls to create an encoder, the problems of low resolution and low code rate in the existing technology are solved, and the details of virtual digital humans are accurately presented in high-end or professional scenarios are improved, and the user experience is improved.

CN119697454APending Publication Date: 2025-03-25GUANGDONG KAMFU TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411864774.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-18
Publication Date
2025-03-25

AI Technical Summary

Technical Problem

The existing virtual digital human file streaming technology has problems with low resolution and low code rate, which leads to the inability to accurately present the exquisite appearance and delicate expression of virtual digital humans in high-end or professional scenarios, affecting the user experience.

Method used

By obtaining the virtual digital human file, determining the context information and the corresponding encoder based on the file, binding and determining the encoding parameters, encoding to obtain the encoded data packet, and inputting it to the preset push stream address for push streaming. The specific steps include using FFmpeg's API call to create an encoder, registering and finding the encoder, creating context information, setting encoding parameters, encoding files, and completing the pushing process through FFmpeg's reception and pushing flow methods.

Benefits of technology

It improves the resolution and bit rate of the push-through object when pushing the stream, and can accurately present the details of virtual digital people in high-end or professional scenarios, improving the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119697454A_ABST
    Figure CN119697454A_ABST
Patent Text Reader

Abstract

The invention provides a virtual digital person file stream pushing method and system, and the method comprises the steps: firstly obtaining a virtual digital person file, and determining context information and a corresponding encoder based on the virtual digital person file; then the context information is bound with a corresponding encoder, and encoding parameters are determined; then inputting the virtual digital person file into a corresponding encoder for encoding so as to obtain an encoded data packet; according to the method, parameters such as the resolution ratio, the frame rate, the code rate and the stream pushing address of stream pushing are defined through the stream configuration class in codes, then the stream media stream pushing object is initialized, the method in the library is called in the stream pushing frame, and pushing of the video stream and the audio stream is completed. Therefore, the resolution and the code rate of the stream pushing object during stream pushing can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of data streaming, and in particular relates to a method and system for streaming virtual digital human files. Background Art

[0002] As the field of artificial intelligence (AI) shows explosive growth, real-time interactive virtual digital humans have become one of the most watched technology applications. In the field of Internet entertainment, virtual digital human anchors have begun to emerge. They can interact with the audience in real time, greatly enhancing the audience's sense of participation and entertainment experience. The online customer service industry has also gradually introduced virtual digital humans to answer users' questions in a more vivid way and improve the quality of customer service. These wide-ranging application scenarios show that virtual digital humans have gradually become an important human-computer interaction medium, and their visual presentation effect is one of the key factors that determine the user experience.

[0003] The digital human services currently available on the market have obvious limitations, and their resolutions are mostly concentrated around 1K. This works well when used on mobile devices, but when digital humans are displayed on large-screen devices, such as high-definition display screens at large commercial events, cinema-level projection equipment, or large screens in high-end conference rooms, low resolution will cause serious blurring of the image, and the exquisite appearance and delicate expressions of the originally designed virtual digital humans cannot be accurately presented. In some professional scenarios that require extremely high details, such as displaying the microstructure of the human body in medical teaching and displaying high-precision work models in the field of art design, the details lost by digital humans at a resolution of 1K will cause deviations in information transmission, seriously affecting users' understanding and acceptance of the content, thereby greatly limiting the further expansion and application of digital humans in high-end and professional scenarios.

[0004] In summary, the streaming of virtual digital humans in the prior art has a series of problems such as low resolution and low bit rate. Summary of the invention

[0005] In order to solve the above technical problems, the present invention provides a virtual digital human file streaming method and system, which are used to solve the technical problems raised in the prior art, so as to reduce the user's time cost and ensure that the user can find the target terminal in the shortest time.

[0006] In a first aspect, an embodiment of the present invention provides the following technical solution, a method for streaming a virtual digital human file, comprising:

[0007] Acquire a virtual digital human file, and determine context information and a corresponding encoder based on the virtual digital human file;

[0008] Binding the context information to the corresponding encoder and determining encoding parameters;

[0009] Inputting the virtual digital human file into a corresponding encoder for encoding to obtain an encoded data packet;

[0010] The encoded data packet is input into a preset streaming address for streaming.

[0011] Compared with the prior art, the beneficial effects of the present application are as follows: the present invention first obtains a virtual digital human file, and determines context information and a corresponding encoder based on the virtual digital human file; then binds the context information to the corresponding encoder and determines encoding parameters; then inputs the virtual digital human file into the corresponding encoder for encoding to obtain an encoded data packet; finally, inputs the encoded data packet into a preset streaming address for streaming. In the code, the present invention first uses a stream configuration class to define streaming resolution, frame rate, bit rate, streaming address and other parameters, then initializes a streaming media streaming object, and calls a method in a library in a streaming framework to complete the push of video and audio streams, thereby improving the resolution and bit rate of the streaming object when pushing.

[0012] Preferably, the step of determining context information and a corresponding encoder based on the virtual digital human file comprises:

[0013] Create an encoder based on FFmpeg API calls;

[0014] Using a preset registration method to perform API registration on the virtual digital human file, and using an encoder search method to determine the encoder corresponding to the virtual digital human file according to the name of the encoder;

[0015] Create a context AVCodecContext according to the encoder information of the corresponding encoder to obtain context information.

[0016] Preferably, the preset registration method is an avcodec_register_all method, and the encoder search method is an avcodec_find_encoder_by_name method.

[0017] Preferably, in the step of binding the context information with the corresponding encoder and determining the encoding parameters, when the virtual digital human file is a video frame file, the corresponding encoder is a video frame encoder, and the encoding parameters include at least video frame width, video frame height, video stream frame rate, video stream bit rate, and streaming address; when the virtual digital human file is an audio file, the corresponding encoder is an audio encoder, and the encoding parameters include at least audio sampling rate, bit rate, number of channels, and streaming address.

[0018] Preferably, the step of inputting the virtual digital human file into a corresponding encoder for encoding to obtain an encoded data packet comprises:

[0019] Use an opening tool to open the corresponding encoder and input the virtual digital human file into the corresponding encoder;

[0020] Applying for file storage space in a corresponding encoder according to the virtual digital human file, wherein the file storage space is used to store the virtual digital human file;

[0021] Sending the virtual digital human file stored in the file storage space to the corresponding encoder through a preset sending method;

[0022] The virtual digital human file is encoded by FFmpeg's internal encoding to obtain an encoded data packet.

[0023] Preferably, the opening tool is avcodec_open2, and the preset sending method is avcodec_send_frame method.

[0024] Preferably, the step of inputting the encoded data packet into a preset streaming address for streaming is specifically as follows:

[0025] The encoded data packet is received through a preset receiving method in FFmpeg, and the encoded data packet is pushed to a preset streaming address through a preset streaming method, wherein the preset receiving method is the avcodec_receive_packet method, and the preset streaming method is the av_interleaved_write_frame method.

[0026] In a second aspect, an embodiment of the present invention provides the following technical solution: a virtual digital human file streaming system, the system comprising:

[0027] An acquisition module, used to acquire a virtual digital human file, and determine context information and a corresponding encoder based on the virtual digital human file;

[0028] A binding module, used to bind the context information to a corresponding encoder and determine encoding parameters;

[0029] An encoding module, used for inputting the virtual digital human file into a corresponding encoder for encoding to obtain an encoded data packet;

[0030] The streaming module is used to input the encoded data packet into a preset streaming address for streaming.

[0031] In a third aspect, an embodiment of the present invention provides the following technical solution: a computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned virtual digital human file streaming method when executing the computer program.

[0032] In a fourth aspect, an embodiment of the present invention provides the following technical solution: a computer-readable storage medium having a computer program stored thereon, and the computer program, when executed by a processor, implements the above-mentioned virtual digital human file streaming method. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. 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 paying creative labor.

[0034] Figure 1 A flowchart of a method for streaming virtual digital human files provided by an embodiment of the present invention;

[0035] Figure 2 A structural block diagram of a virtual digital human file streaming system provided by an embodiment of the present invention;

[0036] Figure 3 A schematic diagram of the hardware structure of a computer device provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0037] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the embodiments of the present invention, and should not be construed as limiting the present invention.

[0038] Embodiment 1

[0039] In the first embodiment of the present invention, Figure 1 As shown, a method for streaming a virtual digital human file includes:

[0040] S1. Obtain a virtual digital human file, and determine context information and a corresponding encoder based on the virtual digital human file;

[0041] Specifically, for the entire streaming process, based on the FFmpeg API call, an h264_nvenc encoder is built using C++, and the input virtual digital human file is encoded before being pushed. After the process is implemented, the C++ code is written according to the pybind11 specification, and finally the Python library is generated after compilation, and finally the generated library is called in the conda virtual environment.

[0042] Wherein, the step S1 comprises:

[0043] S11. Create an encoder based on FFmpeg API calls.

[0044] S12, using a preset registration method to perform API registration on the virtual digital human file, and using an encoder search method to determine the encoder corresponding to the virtual digital human file according to the name of the encoder;

[0045] Specifically, if the virtual digital human file is a video file, the corresponding encoder is the video frame encoder. If the virtual digital human file is an audio file, the corresponding encoder is the acc audio encoder. After registration, the corresponding encoder needs to be found. Since GPU hardware encoding is required for acceleration, the encoder name "h264_nvenc" is used with the avcodec_find_encoder_by_name method to find the required encoder object.

[0046] Among them, the preset registration method is the avcodec_register_all method, which is a function in the FFmpeg library for registering all codecs, parsers and bitstream filters. The avcodec_find_encoder_by_name method is a function in the FFmpeg library for finding and returning the corresponding encoder according to the specified encoder name. Specifically, the avcodec_find_encoder_by_name function traverses all registered encoders, tries to find the one that matches the given name, and returns a pointer to the encoder (AVCodec structure). If no matching encoder is found, NULL is returned.

[0047] S13. Create a context AVCodecContext according to the encoder information of the corresponding encoder to obtain context information.

[0048] S2. Binding the context information to the corresponding encoder and determining encoding parameters;

[0049] Specifically, in step S2, when the virtual digital human file is a video frame file, the corresponding encoder is a video frame encoder, and the encoding parameters include at least video frame width, video frame height, video stream frame rate, video stream bit rate, and streaming address; when the virtual digital human file is an audio file, the corresponding encoder is an audio encoder, and the encoding parameters include at least audio sampling rate, bit rate, number of channels, and streaming address;

[0050] Specifically, after creating the encoding, you need to create a context information based on the information of the encoder, and then bind the encoder to the context information. After binding, you need to set the corresponding encoding parameters. The parameters will be passed in at the final application, so in the C++ implementation, these parameters will be obtained through the input parameter method. In high-resolution video stream encoding, important parameters such as video frame width, video frame height, video stream frame rate, video stream bit rate, and streaming address are mainly used. In the audio encoding process, audio sampling rate, bit rate, number of channels, and streaming address are used.

[0051] S3, inputting the virtual digital human file into a corresponding encoder for encoding to obtain an encoded data packet;

[0052] Wherein, the step S3 comprises:

[0053] S31, using an opening tool to open a corresponding encoder and inputting the virtual digital human file into the corresponding encoder;

[0054] The opening tool is avcodec_open2, which is specifically a function in the FFmpeg library for initializing the codec context to prepare for encoding or decoding. After finding the appropriate codec and configuring the parameters of the codec context, the codec is opened by calling avcodec_open2.

[0055] S32, applying for a file storage space in a corresponding encoder according to the virtual digital human file, wherein the file storage space is used to store the virtual digital human file;

[0056] Specifically, for video frame data, the file storage space is used to store the video frame data of each frame, and similarly, the same is true for audio data.

[0057] S33, sending the virtual digital human file stored in the file storage space to the corresponding encoder through a preset sending method;

[0058] Among them, the preset sending method is the avcodec_send_frame method. In the encoding process of FFmpeg, there is usually an original video frame input frame from a camera or a file, and it is hoped to convert it into an encoded bit stream, that is, compressed video data. The avcodec_send_frame method receives such an input frame and sends it to the encoder for processing.

[0059] S34, encoding the virtual digital human file through the internal encoding of FFmpeg to obtain an encoded data packet.

[0060] S4: input the encoded data packet into a preset streaming address for streaming.

[0061] Wherein, the step S4 is specifically as follows:

[0062] The encoded data packet is received by a preset receiving method in FFmpeg, and the encoded data packet is pushed to a preset push stream address by a preset push stream method, wherein the preset receiving method is an avcodec_receive_packet method, and the preset push stream method is an av_interleaved_write_frame method;

[0063] Among them, avcodec_receive_packet is a function in the FFmpeg library that is used to receive encoded data packets from the encoder. This is one of a pair of functions used in conjunction with avcodec_send_frame. Together, they implement the input and output of the encoding process. In the FFmpeg API, the encoding and decoding process is designed as a two-end operation: data is fed into one end, and the encoded data packets are sent to the decoder through the avcodec_send_packet function, while the decoded information is output from the other end and received using the avcodec_receive_packet function. The av_interleaved_write_frame method is used to write the data packets (AVPacket) into the output container format and ensure that these data packets are correctly interleaved according to the timestamps, that is, arranged in chronological order. This is very important when processing multimedia files, because the data packets of the audio and video streams need to be arranged in the correct order so that the player can decode and present them synchronously.

[0064] It should be noted that the virtual digital human file streaming method provided by the present invention is specifically integrated in the python module, and it interacts with C++, integrates the pybind11 library for Python binding, and encapsulates the encoding process of the above two different types of virtual digital human files into a streaming module and introduces its header file into the module, which defines the core streaming media logic base class Streamer and its configuration class StreamerConfig, StreamerConfig class: used to allow users to initialize the configuration object and read and write its properties, including video resolution size, frame rate, bit rate, encoding configuration file, number of audio channels, sampling rate and RTMP server address, etc.; PythonStreamer class: PythonStreamer inherited from the Streamer base class is the core of the entire module. It overloads several key methods that receive numpy arrays from Python as parameters and convert them into a format suitable for use by the underlying C++ logic. Among them: the stream_frame method is responsible for the streaming of video frames, and the stream_frame_audio method is used for the streaming of audio frames. Each method obtains the pointer to the original data by obtaining buffer_info, and calls the corresponding method in the base class to complete the actual data stream operation. Finally, the C++ code is compiled into a python library that can be used in the conda environment through pybind11. It is necessary to complete the writing of CMakeLists.txt according to the requirements of pybind11, and finally use cmake to complete the generation and installation of the python library. In CMakeLists, it is necessary to set the C++ standard first and then set the conda environment address to be installed. Since ffmpeg (a version that supports gpu) needs to be used, several dynamic libraries avcodec.lib, avformat.lib, avutil.lib, and swscale.lib required by ffmpeg need to be introduced in CMakeLists, and the module name is defined and linked to the PCL library. Finally, Cmake completes the compilation and installation of the python library.

[0065] In actual use, you only need to enter the conda environment where the python library is installed, and use the stream configuration class in the code to define the resolution, frame rate, bit rate, streaming address and other parameters of the push stream, and then initialize the streaming media push stream object, and call the library method in the push stream framework: stream_frame method or stream_frame_audio method to complete the push of video stream and audio stream.

[0066] The virtual digital human file streaming method provided in the first embodiment of the present invention first obtains the virtual digital human file, and determines the context information and the corresponding encoder based on the virtual digital human file; then binds the context information to the corresponding encoder and determines the encoding parameters; then inputs the virtual digital human file into the corresponding encoder for encoding to obtain an encoded data packet; finally, inputs the encoded data packet into a preset streaming address for streaming. In the code, the present invention first uses the stream configuration class to define the streaming resolution, frame rate, bit rate, streaming address and other parameters, then initializes the streaming media streaming object, and calls the method in the library in the streaming framework to complete the pushing of the video stream and the audio stream, thereby improving the resolution and bit rate of the streaming object when pushing the stream.

[0067] Embodiment 2

[0068] like Figure 2 As shown, in the second embodiment of the present invention, a virtual digital human file streaming system is provided, and the system includes:

[0069] An acquisition module 1 is used to acquire a virtual digital human file and determine context information and a corresponding encoder based on the virtual digital human file;

[0070] Binding module 2, used to bind the context information with the corresponding encoder and determine encoding parameters;

[0071] The encoding module 3 is used to input the virtual digital human file into a corresponding encoder for encoding to obtain an encoded data packet;

[0072] A streaming module 4, used for inputting the encoded data packet into a preset streaming address for streaming;

[0073] The acquisition module 1 comprises:

[0074] Create a submodule for creating an encoder based on FFmpeg API calls;

[0075] A registration submodule, used to perform API registration on the virtual digital human file using a preset registration method, and determine the encoder corresponding to the virtual digital human file using an encoder search method according to the name of the encoder;

[0076] The context submodule is used to create a context AVCodecContext according to the encoder information of the corresponding encoder to obtain context information.

[0077] The encoding module 3 includes:

[0078] An input submodule, used to use an opening tool to open a corresponding encoder and input the virtual digital human file into the corresponding encoder;

[0079] A storage submodule, used to apply for a file storage space in a corresponding encoder according to the virtual digital human file, wherein the file storage space is used to store the virtual digital human file;

[0080] A sending submodule, used for sending the virtual digital human file stored in the file storage space to the corresponding encoder through a preset sending method;

[0081] The encoding submodule is used to encode the virtual digital human file through the internal encoding of FFmpeg to obtain an encoded data packet.

[0082] The streaming module 4 is specifically used for:

[0083] The encoded data packet is received through a preset receiving method in FFmpeg, and the encoded data packet is pushed to a preset streaming address through a preset streaming method, wherein the preset receiving method is the avcodec_receive_packet method, and the preset streaming method is the av_interleaved_write_frame method.

[0084] In some other embodiments of the present invention, the embodiments of the present invention provide the following technical solutions: a computer, comprising a memory 102, a processor 101, and a computer program stored in the memory 102 and executable on the processor 101; when the processor 101 executes the computer program, the virtual digital human file streaming method as described above is implemented.

[0085] Specifically, the processor 101 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiment of the present invention.

[0086] Among them, the memory 102 may include a large capacity memory for data or instructions. By way of example and not limitation, the memory 102 may include a hard disk drive (HDD), a floppy disk drive, a solid state drive (SSD), a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive, or a combination of two or more of these. Where appropriate, the memory 102 may include a removable or non-removable (or fixed) medium. Where appropriate, the memory 102 may be inside or outside a data processing device. In a specific embodiment, the memory 102 is a non-volatile memory. In a specific embodiment, the memory 102 includes a read-only memory (ROM) and a random access memory (RAM). Where appropriate, the ROM may be a mask-programmed ROM, a programmable ROM (Programmable Read-Only Memory, PROM for short), an erasable PROM (ErasableProgrammable Read-Only Memory, EPROM for short), an electrically erasable PROM (Electrically ErasableProgrammable Read-Only Memory, EEPROM for short), an electrically alterable ROM (ElectricallyAlterable Read-Only Memory, EAROM for short) or a flash memory (FLASH) or a combination of two or more of these. Under appropriate circumstances, the RAM can be a static random access memory (SRAM) or a dynamic random access memory (DRAM), wherein the DRAM can be a fast page mode dynamic random access memory (FPMDRAM), an extended data output dynamic random access memory (EDODRAM), a synchronous dynamic random access memory (SDRAM), etc.

[0087] The memory 102 may be used to store or cache various data files that need to be processed and / or used for communication, as well as possible computer program instructions executed by the processor 101 .

[0088] The processor 101 implements the above-mentioned virtual digital human file streaming method by reading and executing the computer program instructions stored in the memory 102.

[0089] In some embodiments, the computer may further include a communication interface 103 and a bus 100. Figure 3 As shown, the processor 101, the memory 102, and the communication interface 103 are connected via a bus 100 and communicate with each other.

[0090] The communication interface 103 is used to implement communication between the modules, devices, units and / or equipment in the embodiment of the present invention. The communication interface 103 can also implement data communication with other components such as: external devices, image / data acquisition equipment, databases, external storage, and image / data processing workstations.

[0091] The bus 100 includes hardware, software or both, and couples the components of the computer device to each other. The bus 100 includes but is not limited to at least one of the following: a data bus, an address bus, a control bus, an expansion bus, and a local bus. By way of example and not limitation, bus 100 may include an Accelerated Graphics Port (AGP) or other graphics bus, an Extended Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), a Hyper Transport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an InfiniBand interconnect, a Low Pin Count (LPC) bus, a memory bus, a Micro Channel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local Bus (VLB) bus, or other suitable buses or a combination of two or more of the above. Where appropriate, bus 100 may include one or more buses. Although embodiments of the present invention describe and illustrate a particular bus, the present invention contemplates any suitable bus or interconnect.

[0092] The computer can execute the virtual digital human file streaming method of the present invention based on the virtual digital human file streaming system obtained, thereby realizing the virtual digital human file streaming.

[0093] In some further embodiments of the present invention, in combination with the above-mentioned virtual digital human file streaming method, the embodiments of the present invention provide the following technical solutions: a storage medium having a computer program stored thereon, and the computer program implements the above-mentioned virtual digital human file streaming method when executed by a processor.

[0094] Those skilled in the art will appreciate that the logic and / or steps represented in the flowchart or otherwise described herein, for example, may be considered as an ordered list of executable instructions for implementing logical functions, and may be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in conjunction with such instruction execution systems, devices or apparatuses. For purposes of this specification, a "computer-readable medium" may be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in conjunction with such instruction execution systems, devices or apparatuses.

[0095] More specific examples of readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk case (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be a paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, deciphering or, if necessary, processing in another suitable manner, and then stored in a computer memory.

[0096] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, a plurality of steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or a combination thereof: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0097] The technical features of the above-described embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above-described embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0098] The above-mentioned embodiments only express several implementation methods of the present invention, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for ordinary technicians in this field, several variations and improvements can be made without departing from the concept of the present invention, and these all belong to the protection scope of the present invention. Therefore, the protection scope of the patent of the present invention shall be subject to the attached claims.

Claims

1. A method for streaming virtual digital human files, characterized in that: include: Acquire a virtual digital human file, and determine context information and a corresponding encoder based on the virtual digital human file; Binding the context information to the corresponding encoder and determining encoding parameters; Inputting the virtual digital human file into a corresponding encoder for encoding to obtain an encoded data packet; The encoded data packet is input into a preset streaming address for streaming.

2. The method for streaming virtual digital human files according to claim 1, characterized in that: The step of determining context information and a corresponding encoder based on the virtual digital human file comprises: Create an encoder based on FFmpeg API calls; Using a preset registration method to perform API registration on the virtual digital human file, and using an encoder search method to determine the encoder corresponding to the virtual digital human file according to the name of the encoder; Create a context AVCodecContext according to the encoder information of the corresponding encoder to obtain context information.

3. The method for streaming virtual digital human files according to claim 2, characterized in that: The preset registration method is the avcodec_register_all method, and the encoder search method is the avcodec_find_encoder_by_name method.

4. The method for streaming virtual digital human files according to claim 1, characterized in that: In the step of binding the context information with the corresponding encoder and determining the encoding parameters, when the virtual digital human file is a video frame file, the corresponding encoder is a video frame encoder, and the encoding parameters include at least video frame width, video frame height, video stream frame rate, video stream bit rate, and streaming address; when the virtual digital human file is an audio file, the corresponding encoder is an audio encoder, and the encoding parameters include at least audio sampling rate, bit rate, number of channels, and streaming address.

5. The method for streaming virtual digital human files according to claim 1, characterized in that: The step of inputting the virtual digital human file into a corresponding encoder for encoding to obtain an encoded data packet comprises: Use an opening tool to open the corresponding encoder and input the virtual digital human file into the corresponding encoder; Applying for file storage space in a corresponding encoder according to the virtual digital human file, wherein the file storage space is used to store the virtual digital human file; Sending the virtual digital human file stored in the file storage space to the corresponding encoder through a preset sending method; The virtual digital human file is encoded by FFmpeg's internal encoding to obtain an encoded data packet.

6. The method for streaming virtual digital human files according to claim 5, characterized in that: The opening tool is avcodec_open2, and the preset sending method is the avcodec_send_frame method.

7. The method for streaming virtual digital human files according to claim 1, characterized in that: The step of inputting the encoded data packet into the preset streaming address for streaming is specifically as follows: The encoded data packet is received through a preset receiving method in FFmpeg, and the encoded data packet is pushed to a preset streaming address through a preset streaming method, wherein the preset receiving method is the avcodec_receive_packet method, and the preset streaming method is the av_interleaved_write_frame method.

8. A virtual digital human file streaming system, characterized in that: include: An acquisition module, used to acquire a virtual digital human file, and determine context information and a corresponding encoder based on the virtual digital human file; A binding module, used to bind the context information to a corresponding encoder and determine encoding parameters; An encoding module, used for inputting the virtual digital human file into a corresponding encoder for encoding to obtain an encoded data packet; The streaming module is used to input the encoded data packet into a preset streaming address for streaming.

9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method for streaming a virtual digital human file is implemented as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method for streaming a virtual digital human file is implemented.