Video transmission method, device, storage medium and equipment
By using pre-trained generative adversarial networks and message queue technology in video transmission, the problem of slow video transmission speed in the existing technology is solved, efficient video frame encoding and decoding is achieved, and the video transmission speed and bandwidth utilization are significantly improved.
Patent Information
- Application Number
- CN202211101542.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-09
- Publication Date
- 2024-09-10
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing video transmission methods consume a lot of computing resources and time in the encoding and decoding process, and the H.246 format file compression capability is limited, resulting in a reduction in video transmission speed.
Use pre-trained generative adversarial networks to generate streaming computing jobs, encode and decode video frames through message queues, and use the convolution kernel parameters of the generative adversarial network to generate streaming algorithm logic to achieve efficient transmission of real-time videos and avoid encoding and time consumption in the decoding process.
It effectively saves bandwidth, improves data transmission efficiency, and significantly increases video transmission speed.
Smart Images

Figure CN115567720B
Abstract
Description
Technical Field
[0001] The present application relates to the field of big data, and in particular to a video transmission method, apparatus, storage medium and device. Background Art
[0002] Currently, real-time video is often transmitted in the H.246 encoding format, that is, the file is first encoded according to the H.246 specification, and then decoded to restore the original image after the data is transmitted.
[0003] However, in the existing transmission method, encoding and decoding are required before and after data transmission, which consumes a lot of computing resources and time costs. In addition, the file compression capability of the H.246 format is limited, and the compressed package occupies a large amount of memory, which will take up a large amount of transmission data, increase bandwidth consumption, and cause the video transmission speed to decrease.
[0004] Therefore, how to improve the video transmission speed has become an urgent problem to be solved in this field. Summary of the invention
[0005] The present application provides a video transmission method, apparatus, storage medium and device, the purpose of which is to improve the video transmission speed.
[0006] In order to achieve the above objectives, this application provides the following technical solutions:
[0007] A video transmission method, comprising:
[0008] Based on the parameters of the generative network in the pre-trained generative adversarial network and the data source for generating real-time video, a first streaming computing job is generated; the real-time video includes a video frame sequence; the video frame sequence includes multiple video frames, and each of the video frames is sorted in order from the front to the back according to the playback time; the first streaming computing job is used to: encode each of the video frames generated by the data source to obtain the encoded data of each of the video frames;
[0009] Based on the parameters of the generative network in the generative adversarial network and the receiver of the real-time video, a second streaming computing job is generated; the second streaming computing job is used to: decode each of the encoded data to obtain the real-time video, and send the real-time video to the receiver;
[0010] Identify the first stream computing job as a message producer of a pre-built message queue, and identify the second stream computing job as a message consumer of the message queue;
[0011] The message producer is controlled to send each encoded data to the message queue, and the message consumer is controlled to obtain each encoded data from the message queue.
[0012] Optionally, the training process of the generative adversarial network includes:
[0013] Marking the multiple high-resolution images obtained in advance as sample images;
[0014] Obtaining a generative network and a discriminative network of a preset generative adversarial network; the generative network includes an encoder and a decoder;
[0015] Taking the sample image as input of the encoder, and using the encoder to extract resolution features from the sample image to obtain a resolution feature vector;
[0016] Taking the resolution feature vector as the input of the decoder, and using the decoder to fuse the resolution feature vector to obtain the target image output by the generation network;
[0017] The target image and the sample image are input into the discriminant network, and the difference between the resolution of the target image and the resolution of the sample image is used as the training target. The loss function of the discriminant network and the various parameters of the generative network are continuously adjusted until the value of the loss function of the discriminant network is less than a preset threshold, and it is determined that the generative adversarial network training is completed.
[0018] Optionally, the parameters of the generated network include convolution kernel parameters of the generated network and parameters of an encoder included in the generated network;
[0019] The generating network parameters in the pre-trained generative adversarial network and the data source for generating real-time video are used to generate a first streaming computing job, including:
[0020] Extracting convolution kernel parameters of the generative network from the pre-trained generative adversarial network, and generating streaming algorithm logic based on the convolution kernel parameters;
[0021] The parameters of the encoder are extracted from the generative adversarial network, and the parameters of the encoder and the data source for generating real-time video are used as video encoding operators and substituted into the streaming algorithm logic to obtain a first streaming computing job.
[0022] Optionally, the parameters of the generated network include convolution kernel parameters of the generated network and parameters of a decoder included in the generated network;
[0023] The generating a second streaming computing job based on the parameters of the generated network in the generated adversarial network and the receiver of the real-time video includes:
[0024] Extracting convolution kernel parameters of the generative network from the pre-trained generative adversarial network, and generating streaming algorithm logic based on the convolution kernel parameters;
[0025] The parameters of the decoder are extracted from the generative adversarial network, and the parameters of the decoder and the receiver of the real-time video are used as video decoding operators and substituted into the streaming algorithm logic to obtain a second streaming computing job.
[0026] Optionally, controlling the message producer to send each encoded data to the message queue, and controlling the message consumer to obtain each encoded data from the message queue, includes:
[0027] After the message producer obtains the video frame sequence generated by the data source, the message producer is controlled to encode each video frame in the video frame sequence to obtain the encoded data of each video frame, and the encoded data of each video frame in the video frame sequence is sent to the message queue in sequence from front to back;
[0028] The message consumer is controlled to obtain each encoded data from the message queue in a first-in-first-out order, and decode each encoded data to obtain the real-time video, and then send the real-time video to the recipient.
[0029] A video transmission device, comprising:
[0030] A first job generating unit is used to generate a first streaming computing job based on parameters of a generating network in a generative adversarial network obtained by pre-training and a data source for generating a real-time video; the real-time video includes a video frame sequence; the video frame sequence includes a plurality of video frames, and each of the video frames is sorted in order from front to back according to the playback time; the first streaming computing job is used to: encode each of the video frames generated by the data source to obtain encoded data of each of the video frames;
[0031] A second job generating unit is used to generate a second streaming computing job based on the parameters of the generating network in the generating adversarial network and the receiver of the real-time video; the second streaming computing job is used to: decode each of the encoded data to obtain the real-time video, and send the real-time video to the receiver;
[0032] an identification unit, used to identify the first stream computing job as a message producer of a pre-built message queue, and to identify the second stream computing job as a message consumer of the message queue;
[0033] A control unit is used to control the message producer to send each encoded data to the message queue, and control the message consumer to obtain each encoded data from the message queue.
[0034] Optionally, the first job generating unit is specifically used for:
[0035] Marking the multiple high-resolution images obtained in advance as sample images;
[0036] Obtaining a generative network and a discriminative network of a preset generative adversarial network; the generative network includes an encoder and a decoder;
[0037] Taking the sample image as input of the encoder, and using the encoder to extract resolution features from the sample image to obtain a resolution feature vector;
[0038] Taking the resolution feature vector as the input of the decoder, and using the decoder to fuse the resolution feature vector to obtain the target image output by the generation network;
[0039] The target image and the sample image are input into the discriminant network, and the difference between the resolution of the target image and the resolution of the sample image is used as the training target. The loss function of the discriminant network and the various parameters of the generative network are continuously adjusted until the value of the loss function of the discriminant network is less than a preset threshold, and it is determined that the generative adversarial network training is completed.
[0040] Optionally, the parameters of the generated network include convolution kernel parameters of the generated network and parameters of an encoder included in the generated network;
[0041] The first job generating unit is specifically used for:
[0042] Extracting convolution kernel parameters of the generative network from the pre-trained generative adversarial network, and generating streaming algorithm logic based on the convolution kernel parameters;
[0043] The parameters of the encoder are extracted from the generative adversarial network, and the parameters of the encoder and the data source for generating real-time video are used as video encoding operators and substituted into the streaming algorithm logic to obtain a first streaming computing job.
[0044] A computer-readable storage medium includes a stored program, wherein the program executes the video transmission method.
[0045] A video transmission device, comprising: a processor, a memory and a bus; the processor and the memory are connected via the bus;
[0046] The memory is used to store a program, and the processor is used to run the program, wherein the video transmission method is executed when the program is run.
[0047] The technical solution provided by the present application generates a first streaming computing job based on the parameters of the generated network in the generative adversarial network obtained by pre-training, and the data source for generating real-time video. A second streaming computing job is generated based on the parameters of the generated network in the generative adversarial network and the receiver of the real-time video. The first streaming computing job is identified as a message producer of a pre-built message queue, and the second streaming computing job is identified as a message consumer of the message queue. The message producer is controlled to send each encoded data to the message queue, and the message consumer is controlled to obtain each encoded data from the message queue. The present application uses the parameters of the generated network in the generative adversarial network obtained by training to generate the first streaming computing job and the second streaming computing job, and based on the message queue, the first streaming computing job and the second streaming computing job, the effective transmission of real-time video is realized. Compared with the prior art, there is no need to spend time encoding and decoding the real-time video, and the encoded data of the video frame is used as the transmission unit, which can effectively save bandwidth and improve data transmission efficiency, so that the video transmission speed is effectively improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, 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 application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0049] Figure 1a A schematic diagram of a flow chart of a video transmission method provided in an embodiment of the present application;
[0050] Figure 1b A schematic diagram of a flow chart of a video transmission method provided in an embodiment of the present application;
[0051] Figure 1c A schematic diagram of a generated network provided in an embodiment of the present application;
[0052] Figure 2 A schematic diagram of another video transmission method provided in an embodiment of the present application;
[0053] Figure 3 A schematic diagram of the architecture of a video transmission device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0054] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0055] like Figure 1a and Figure 1b FIG. 1 is a flow chart of a video transmission method provided in an embodiment of the present application, comprising the following steps:
[0056] S101: Mark multiple high-resolution images acquired in advance as sample images.
[0057] A web crawler tool may be used to fetch a plurality of high-resolution images from the Internet. Specifically, the formats of the images may be unified into the same image format, such as jpg format.
[0058] S102: Obtain a generative network and a discriminative network of a preset generative adversarial network.
[0059] Among them, the generation network adopts an encoder-decoder structure, that is, the generation network includes an encoder and a decoder.
[0060] It should be noted that the encoder is used for a residual module for downsampling, and the residual module includes multiple convolutional layers. Specifically, the number of convolutional layers in the residual module can be set by technical personnel according to actual conditions.
[0061] In addition, the decoder includes a residual module for upsampling, and the residual module includes multiple convolutional layers. Specifically, the number of convolutional layers in the residual module can be set by technicians according to actual conditions.
[0062] In the embodiment of the present application, the preset generative adversarial network can be specifically a super-resolution generative adversarial network. Specifically, the encoder and decoder shown in the generative network in the super-resolution generative adversarial network can be referred to. Figure 1c shown.
[0063] Generally speaking, a generative network is a neural network similar to an encoder and decoder. It convolves and pools the original image to obtain a highly abstract feature sequence, and restores it to the original image size through operations such as convolution / deconvolution. The parameters are continuously optimized through training, so that the restored image has the effects of denoising, deblurring, and super-resolution restoration.
[0064] The discriminant network is a neural network used for detection, specifically for detecting the visual resolution of an image. When the image looks clear, the discriminant network score is high, and vice versa. The generative network and the discriminant network are trained simultaneously, promoting each other to finally obtain a generative network that can improve the visual resolution of the image.
[0065] S103: taking the sample image as input of the encoder, and using the encoder to extract resolution features of the sample image to obtain a resolution feature vector.
[0066] S104: Using the resolution feature vector as the input of the decoder, and using the decoder to fuse the resolution feature vector to obtain a target image output by the generation network.
[0067] S105: Input the target image and the sample image into the discriminant network, and use the difference between the resolution of the target image and the resolution of the sample image as the training target, and continuously adjust the loss function of the discriminant network and various parameters of the generative network until the value of the loss function of the discriminant network is less than a preset threshold, and determine that the generative adversarial network training is completed.
[0068] Among them, the specific type of loss function can be set by technical personnel according to actual conditions.
[0069] It should be noted that the various parameters include the convolution kernel parameters of the generated network, the parameters of the encoder, and the parameters of the decoder.
[0070] S106: Extracting convolution kernel parameters of the generative network from the trained generative adversarial network, and generating streaming algorithm logic based on the convolution kernel parameters of the generative network.
[0071] Among them, the streaming algorithm is used to process streaming data, and the real-time video shown in the embodiment of the present application can be regarded as streaming data.
[0072] S107: Extract the parameters of the encoder from the trained generative adversarial network, and use the parameters of the encoder and the data source for generating real-time video as video encoding operators, and substitute them into the streaming algorithm logic to obtain a first streaming computing job.
[0073] The first stream computing job may be used to encode the real-time video generated by the data source to obtain encoded data of the real-time video.
[0074] It should be noted that the real-time video includes a video frame sequence, which includes multiple video frames, and each video frame is sorted in order from the beginning to the end of the playback time. The so-called video frame is actually an image.
[0075] S108: Extract the parameters of the decoder from the trained generative adversarial network, and substitute the parameters of the decoder and the receiver of the real-time video into the streaming algorithm logic as the video decoding operator to obtain the second streaming computing job.
[0076] The second streaming computing job may be used to decode the encoded data to obtain real-time video, and send the real-time video to a receiver.
[0077] S109: Identify the first stream computing job as a message producer of a pre-built message queue, and identify the second stream computing job as a message consumer of the message queue.
[0078] Among them, the message producer and the message consumer jointly subscribe to the same topic of the message queue, that is, the message producer will send the video frame generated by itself to the same topic, and the message consumer will obtain the video frame from the same topic.
[0079] It should be noted that the message queue may specifically be a Kafka queue.
[0080] S110: After the message producer obtains the video frame sequence generated by the data source, the message producer is controlled to encode each video frame in the video frame sequence to obtain the encoded data of each video frame, and the encoded data of each video frame in the video frame sequence is sent to the message queue in sequence from front to back.
[0081] S111: Control the message consumer to obtain each encoded data from the message queue in a first-in-first-out order, decode each encoded data, obtain the real-time video, and then send the real-time video to the receiver.
[0082] Based on the above process shown in S101-S111, this embodiment can achieve the following beneficial effects:
[0083] 1. It takes advantage of streaming algorithm logic and message queues to ensure that real-time video will not lose data during data transmission.
[0084] 2. Use generative adversarial networks to improve the image visual quality of real-time videos and enhance the user's viewing experience.
[0085] 3. By combining generative adversarial networks with streaming algorithm logic, effective integration of computing resources on the big data platform can be achieved.
[0086] 4. In the process of real-time video data transmission, only highly abstracted feature data (i.e., the encoded data of the video frame) is transmitted, and the data volume is small, which effectively saves bandwidth and improves data transmission efficiency, thereby effectively improving the video transmission speed.
[0087] To summarize, this embodiment uses the parameters of the generative network in the generative adversarial network obtained through training to generate a first streaming computing job and a second streaming computing job, and based on the message queue, the first streaming computing job and the second streaming computing job, realizes the effective transmission of real-time video. Compared with the prior art, there is no need to spend time encoding and decoding the real-time video, and using the encoded data of the video frame as the transmission unit can effectively save bandwidth and improve data transmission efficiency, so that the video transmission speed is effectively improved.
[0088] It should be noted that S101 mentioned in the above embodiment is an optional implementation of the video transmission method shown in the embodiment of the present application. In addition, S112 mentioned in the above embodiment is also an optional implementation of the video transmission method shown in the embodiment of the present application. To this end, the process mentioned in the above embodiment can be summarized as follows: Figure 2 The method shown.
[0089] like Figure 2 FIG. 1 is a flow chart of another video transmission method provided in an embodiment of the present application, comprising the following steps:
[0090] S201: Generate a first streaming computing job based on parameters of a generative network in a pre-trained generative adversarial network and a data source for generating real-time video.
[0091] Among them, the real-time video includes a video frame sequence; the video frame sequence includes multiple video frames, and each video frame is sorted in order from front to back according to the playback time; the first streaming computing job is used to: encode each video frame generated by the data source to obtain the encoded data of each video frame.
[0092] S202: Generate a second streaming computing job based on the parameters of the generative network in the generative adversarial network and the receiver of the real-time video.
[0093] The second streaming computing job is used to decode each encoded data to obtain real-time video, and send the real-time video to a receiver.
[0094] S203: Identify the first stream computing job as a message producer of a pre-built message queue, and identify the second stream computing job as a message consumer of the message queue.
[0095] S204: Control the message producer to send each encoded data to the message queue, and control the message consumer to obtain each encoded data from the message queue.
[0096] To summarize, this embodiment uses the parameters of the generative network in the generative adversarial network obtained through training to generate a first streaming computing job and a second streaming computing job, and based on the message queue, the first streaming computing job and the second streaming computing job, realizes the effective transmission of real-time video. Compared with the prior art, there is no need to spend time encoding and decoding the real-time video, and using the encoded data of the video frame as the transmission unit can effectively save bandwidth and improve data transmission efficiency, so that the video transmission speed is effectively improved.
[0097] It should be noted that the video transmission method provided by the present invention can be used in the fields of artificial intelligence, blockchain, distributed computing, cloud computing, big data, the Internet of Things, mobile Internet, network security, chips, virtual reality, augmented reality, holographic technology, quantum computing, quantum communication, quantum measurement, digital twins, or finance. The above is only an example and does not limit the application field of the video transmission method provided by the present invention.
[0098] The video transmission method provided by the present invention can be used in the financial field or other fields, for example, it can be used in transaction application scenarios in the financial field. Other fields are any fields other than the financial field, for example, the power field. The above is only an example and does not limit the application field of the video transmission method provided by the present invention.
[0099] Corresponding to the video transmission method provided in the above-mentioned embodiment of the present application, the embodiment of the present application also provides a video transmission device.
[0100] like Figure 3 FIG. 1 is a schematic diagram of the architecture of a video transmission device provided in an embodiment of the present application, including:
[0101] The first job generation unit 100 is used to generate a first streaming computing job based on the parameters of the generation network in the pre-trained generative adversarial network and the data source for generating real-time video; the real-time video includes a video frame sequence; the video frame sequence includes multiple video frames, and each video frame is sorted in order from front to back according to the playback time; the first streaming computing job is used to: encode each video frame generated by the data source to obtain encoded data of each video frame.
[0102] Optionally, the first job generation unit 100 is specifically used to: identify multiple high-resolution images obtained in advance as sample images; obtain a preset generative adversarial network generation network and a discriminant network; the generation network includes an encoder and a decoder; use the sample image as the input of the encoder, and use the encoder to extract resolution features of the sample image to obtain a resolution feature vector; use the resolution feature vector as the input of the decoder, and use the decoder to fuse the resolution feature vector to obtain a target image output by the generation network; input the target image and the sample image into the discriminant network, and use the difference between the resolution of the target image and the resolution of the sample image as the training target, and continuously adjust the loss function of the discriminant network and various parameters of the generation network until the value of the loss function of the discriminant network is less than a preset threshold, and it is determined that the training of the generation adversarial network is completed.
[0103] The parameters of the generated network include the convolution kernel parameters of the generated network and the parameters of the encoder contained in the generated network.
[0104] The first job generation unit 100 is specifically used to: extract the convolution kernel parameters of the generative network from the pre-trained generative adversarial network, and generate the streaming algorithm logic based on the convolution kernel parameters; extract the parameters of the encoder from the generative adversarial network, and substitute the parameters of the encoder and the data source for generating real-time video as the video encoding operator into the streaming algorithm logic to obtain the first streaming computing job.
[0105] The parameters of the generated network include the convolution kernel parameters of the generated network and the parameters of the decoder included in the generated network.
[0106] The first job generation unit 100 is specifically used to: extract the convolution kernel parameters of the generative network from the pre-trained generative adversarial network, and generate the streaming algorithm logic based on the convolution kernel parameters; extract the parameters of the decoder from the generative adversarial network, and substitute the parameters of the decoder and the receiver of the real-time video as the video decoding operator into the streaming algorithm logic to obtain a second streaming computing job.
[0107] The second job generation unit 200 is used to generate a second streaming computing job based on the parameters of the generation network in the generative adversarial network and the receiver of the real-time video; the second streaming computing job is used to: decode each encoded data to obtain the real-time video, and send the real-time video to the receiver.
[0108] The identification unit 300 is used to identify the first stream computing job as a message producer of a pre-built message queue, and to identify the second stream computing job as a message consumer of the message queue.
[0109] The control unit 400 is used to control the message producer to send each encoded data to the message queue, and control the message consumer to obtain each encoded data from the message queue.
[0110] Optionally, the control unit 400 is specifically used to: after the message producer obtains the video frame sequence generated by the data source, control the message producer to encode each video frame in the video frame sequence to obtain the encoded data of each video frame, and send the encoded data of each video frame in the video frame sequence to the message queue in order from front to back; control the message consumer to obtain each encoded data from the message queue in a first-in-first-out order, decode each encoded data to obtain real-time video, and then send the real-time video to the recipient.
[0111] To summarize, this embodiment uses the parameters of the generative network in the generative adversarial network obtained through training to generate a first streaming computing job and a second streaming computing job, and based on the message queue, the first streaming computing job and the second streaming computing job, realizes the effective transmission of real-time video. Compared with the prior art, there is no need to spend time encoding and decoding the real-time video, and using the encoded data of the video frame as the transmission unit can effectively save bandwidth and improve data transmission efficiency, so that the video transmission speed is effectively improved.
[0112] The present application also provides a computer-readable storage medium, which includes a stored program, wherein the program executes the video transmission method provided by the present application.
[0113] The present application also provides a video transmission device, including: a processor, a memory and a bus. The processor and the memory are connected via a bus, the memory is used to store programs, and the processor is used to run programs, wherein when the program is run, the video transmission method provided by the present application is executed, including the following steps:
[0114] Based on the parameters of the generative network in the pre-trained generative adversarial network and the data source for generating real-time video, a first streaming computing job is generated; the real-time video includes a video frame sequence; the video frame sequence includes multiple video frames, and each of the video frames is sorted in order from the front to the back according to the playback time; the first streaming computing job is used to: encode each of the video frames generated by the data source to obtain the encoded data of each of the video frames;
[0115] Based on the parameters of the generative network in the generative adversarial network and the receiver of the real-time video, a second streaming computing job is generated; the second streaming computing job is used to: decode each of the encoded data to obtain the real-time video, and send the real-time video to the receiver;
[0116] Identify the first stream computing job as a message producer of a pre-built message queue, and identify the second stream computing job as a message consumer of the message queue;
[0117] The message producer is controlled to send each encoded data to the message queue, and the message consumer is controlled to obtain each encoded data from the message queue.
[0118] Specifically, based on the above embodiment, the training process of the generative adversarial network includes:
[0119] Marking the multiple high-resolution images obtained in advance as sample images;
[0120] Obtaining a generative network and a discriminative network of a preset generative adversarial network; the generative network includes an encoder and a decoder;
[0121] Taking the sample image as input of the encoder, and using the encoder to extract resolution features from the sample image to obtain a resolution feature vector;
[0122] Taking the resolution feature vector as the input of the decoder, and using the decoder to fuse the resolution feature vector to obtain the target image output by the generation network;
[0123] The target image and the sample image are input into the discriminant network, and the difference between the resolution of the target image and the resolution of the sample image is used as the training target. The loss function of the discriminant network and the various parameters of the generative network are continuously adjusted until the value of the loss function of the discriminant network is less than a preset threshold, and it is determined that the generative adversarial network training is completed.
[0124] Specifically, based on the above embodiment, the parameters of the generating network include convolution kernel parameters of the generating network and parameters of the encoder included in the generating network;
[0125] The generating network parameters in the pre-trained generative adversarial network and the data source for generating real-time video are used to generate a first streaming computing job, including:
[0126] Extracting convolution kernel parameters of the generative network from the pre-trained generative adversarial network, and generating streaming algorithm logic based on the convolution kernel parameters;
[0127] The parameters of the encoder are extracted from the generative adversarial network, and the parameters of the encoder and the data source for generating real-time video are used as video encoding operators and substituted into the streaming algorithm logic to obtain a first streaming computing job.
[0128] Specifically, based on the above embodiment, the parameters of the generating network include convolution kernel parameters of the generating network and parameters of a decoder included in the generating network;
[0129] The generating a second streaming computing job based on the parameters of the generated network in the generated adversarial network and the receiver of the real-time video includes:
[0130] Extracting convolution kernel parameters of the generative network from the pre-trained generative adversarial network, and generating streaming algorithm logic based on the convolution kernel parameters;
[0131] The parameters of the decoder are extracted from the generative adversarial network, and the parameters of the decoder and the receiver of the real-time video are used as video decoding operators and substituted into the streaming algorithm logic to obtain a second streaming computing job.
[0132] Specifically, based on the above embodiment, controlling the message producer to send each encoded data to the message queue, and controlling the message consumer to obtain each encoded data from the message queue includes:
[0133] After the message producer obtains the video frame sequence generated by the data source, the message producer is controlled to encode each video frame in the video frame sequence to obtain the encoded data of each video frame, and the encoded data of each video frame in the video frame sequence is sent to the message queue in sequence from front to back;
[0134] The message consumer is controlled to obtain each encoded data from the message queue in a first-in-first-out order, and decode each encoded data to obtain the real-time video, and then send the real-time video to the recipient.
[0135] If the functions described in the method of the embodiment of the present application are implemented in the form of software functional units and sold or used as independent products, they can be stored in a storage medium readable by a computing device. Based on this understanding, the part of the embodiment of the present application that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computing device (which can be a personal computer, server, mobile computing device or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard disks, read-only memories, random access memories, magnetic disks or optical disks.
[0136] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0137] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A video transmission method, characterized in that: include: Generate a first streaming computing job based on parameters of a generative network in a pre-trained generative adversarial network and a data source for generating real-time video; The real-time video includes a video frame sequence; the video frame sequence includes multiple video frames, and each of the video frames is sorted in order from front to back according to the playback time; the first streaming computing job is used to: encode each of the video frames generated by the data source to obtain encoded data of each of the video frames; The training process of the generative adversarial network includes: marking a plurality of high-resolution images obtained in advance as sample images; obtaining a preset generative adversarial network generative network and a discriminant network; the generative network includes an encoder and a decoder; taking the sample image as the input of the encoder, and using the encoder to extract the resolution feature of the sample image to obtain a resolution feature vector; taking the resolution feature vector as the input of the decoder, and using the decoder to fuse the resolution feature vector to obtain a target image output by the generative network; inputting the target image and the sample image into the discriminant network, and taking the difference between the resolution of the target image and the resolution of the sample image as the training target, continuously adjusting the loss function of the discriminant network and various parameters of the generative network, until the value of the loss function of the discriminant network is less than a preset threshold, and determining that the training of the generative adversarial network is completed; Based on the parameters of the generative network in the generative adversarial network and the receiver of the real-time video, a second streaming computing job is generated; the second streaming computing job is used to: decode each of the encoded data to obtain the real-time video, and send the real-time video to the receiver; Identify the first stream computing job as a message producer of a pre-built message queue, and identify the second stream computing job as a message consumer of the message queue; The message producer is controlled to send each encoded data to the message queue, and the message consumer is controlled to obtain each encoded data from the message queue.
2. The method according to claim 1, characterized in that The parameters of the generated network include convolution kernel parameters of the generated network and parameters of the encoder included in the generated network; The generating network parameters in the pre-trained generative adversarial network and the data source for generating real-time video are used to generate a first streaming computing job, including: Extracting convolution kernel parameters of the generative network from the pre-trained generative adversarial network, and generating streaming algorithm logic based on the convolution kernel parameters; The parameters of the encoder are extracted from the generative adversarial network, and the parameters of the encoder and the data source for generating real-time video are used as video encoding operators and substituted into the streaming algorithm logic to obtain a first streaming computing job.
3. The method according to claim 1, characterized in that: The parameters of the generated network include convolution kernel parameters of the generated network and parameters of a decoder included in the generated network; The generating a second streaming computing job based on the parameters of the generated network in the generated adversarial network and the receiver of the real-time video includes: Extracting convolution kernel parameters of the generative network from the pre-trained generative adversarial network, and generating streaming algorithm logic based on the convolution kernel parameters; The parameters of the decoder are extracted from the generative adversarial network, and the parameters of the decoder and the receiver of the real-time video are used as video decoding operators and substituted into the streaming algorithm logic to obtain a second streaming computing job.
4. The method according to claim 1, characterized in that The controlling the message producer to send each encoded data to the message queue, and controlling the message consumer to obtain each encoded data from the message queue, comprises: After the message producer obtains the video frame sequence generated by the data source, the message producer is controlled to encode each video frame in the video frame sequence to obtain the encoded data of each video frame, and the encoded data of each video frame in the video frame sequence is sent to the message queue in sequence from front to back; The message consumer is controlled to obtain each encoded data from the message queue in a first-in-first-out order, and decode each encoded data to obtain the real-time video, and then send the real-time video to the recipient.
5. A video transmission device, characterized in that: include: A first job generating unit is used to generate a first streaming computing job based on parameters of a generating network in a generative adversarial network obtained by pre-training and a data source for generating a real-time video; the real-time video includes a video frame sequence; the video frame sequence includes a plurality of video frames, and each of the video frames is sorted in order from front to back according to the playback time; the first streaming computing job is used to: encode each of the video frames generated by the data source to obtain encoded data of each of the video frames; The process of the first job generation unit for training the generative adversarial network is as follows: a plurality of high-resolution images obtained in advance are all identified as sample images; a generative network and a discriminative network of a preset generative adversarial network are obtained; the generative network includes an encoder and a decoder; the sample image is used as the input of the encoder, and the encoder is used to extract the resolution feature of the sample image to obtain a resolution feature vector; The resolution feature vector is used as the input of the decoder, and the resolution feature vector is fused by the decoder to obtain the target image output by the generative network; the target image and the sample image are input into the discriminant network, and the difference between the resolution of the target image and the resolution of the sample image is used as the training target, and the loss function of the discriminant network and various parameters of the generative network are continuously adjusted until the value of the loss function of the discriminant network is less than a preset threshold, and it is determined that the generative adversarial network training is completed; A second job generating unit is used to generate a second streaming computing job based on the parameters of the generating network in the generating adversarial network and the receiver of the real-time video; the second streaming computing job is used to: decode each of the encoded data to obtain the real-time video, and send the real-time video to the receiver; an identification unit, used to identify the first stream computing job as a message producer of a pre-built message queue, and to identify the second stream computing job as a message consumer of the message queue; A control unit is used to control the message producer to send each encoded data to the message queue, and control the message consumer to obtain each encoded data from the message queue.
6. The device according to claim 5, characterized in that The parameters of the generated network include convolution kernel parameters of the generated network and parameters of the encoder included in the generated network; The first job generating unit is specifically used for: Extracting convolution kernel parameters of the generative network from the pre-trained generative adversarial network, and generating streaming algorithm logic based on the convolution kernel parameters; The parameters of the encoder are extracted from the generative adversarial network, and the parameters of the encoder and the data source for generating real-time video are used as video encoding operators and substituted into the streaming algorithm logic to obtain a first streaming computing job.
7. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein the program, when executed by a processor, implements the video transmission method according to any one of claims 1 to 4.
8. A video transmission device, characterized in that: include: processor, memory, and bus; The processor is connected to the memory via the bus; The memory is used to store programs, and the processor is used to run programs, wherein the program executes the video transmission method according to any one of claims 1 to 4 when running.
