CN116761023A - Video transmission method between different devices - Google Patents

Video transmission method between different devices Download PDF

Info

Publication number
CN116761023A
CN116761023A CN202310818358.4A CN202310818358A CN116761023A CN 116761023 A CN116761023 A CN 116761023A CN 202310818358 A CN202310818358 A CN 202310818358A CN 116761023 A CN116761023 A CN 116761023A
Authority
CN
China
Prior art keywords
video
transmission
encoding
algorithm
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310818358.4A
Other languages
Chinese (zh)
Inventor
沈祥荣
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Weike Terminal Technology Dongguan Co ltd
Original Assignee
Weike Terminal Technology Dongguan Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Weike Terminal Technology Dongguan Co ltd filed Critical Weike Terminal Technology Dongguan Co ltd
Priority to CN202310818358.4A priority Critical patent/CN116761023A/en
Publication of CN116761023A publication Critical patent/CN116761023A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/234Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs
    • H04N21/2343Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs involving reformatting operations of video signals for distribution or compliance with end-user requests or end-user device requirements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/234Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs
    • H04N21/2347Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs involving video stream encryption
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs
    • H04N21/44008Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving operations for analysing video streams, e.g. detecting features or characteristics in the video stream
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs
    • H04N21/4402Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs
    • H04N21/4405Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving video stream decryption

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

The application relates to the technical field of video transmission and provides a video transmission method among different devices, which comprises the steps of carrying out preset partitioning on a video frame to be transmitted, dividing a frame image of the video to be transmitted into a plurality of grids with uniform size, partitioning the grids according to the pixel value in each grid, dividing the grids into a plurality of areas, numbering each area, setting a coding file format, including parameters such as resolution, compression ratio, frame rate and the like of the video frame, coding the selected area by utilizing a video coding algorithm, generating local coding data, carrying out independent transmission on each local coding data, controlling the transmission bandwidth by carrying out transmission rate and allocation of bandwidth, enabling the local coding information to be transmitted in a specified time, sending the local coding information to a receiving end, carrying out verification and technical inspection on the local coding information after the local coding information is received, independently decoding each local coding information by using a corresponding decoding algorithm after confirming no errors, splicing the decoded local coding information according to the original position, carrying out full-color adjustment on video frames or carrying out full-color adjustment on video frames after the video frame is subjected to different local coding rates, and the full-color adjustment mode is carried out.

Description

Video transmission method between different devices
Technical Field
The application relates to the technical field of video transmission, in particular to a method for video transmission between different devices.
Background
In the current video transmission process, although various fast and convenient video transmission technologies exist, the quality loss caused by signal loss and compression in the transmission process causes the degradation of video transmission quality, so that the watching experience and application effect of users are affected.
Disclosure of Invention
The application provides a method for video transmission between different devices, which solves the problem of rapid and convenient video transmission between different devices in the related technology.
The technical scheme of the application is as follows:
the application provides a video transmission method between different devices, which comprises the following steps:
dividing video data into a plurality of areas according to pictures, compressing and storing different areas by adopting different parameters, preferentially transmitting the high-quality areas with high-quality parameters during transmission, then transmitting the medium-quality areas with medium-quality parameters, and finally transmitting the low-quality areas with low-quality parameters;
the video transmission method between different devices comprises the following steps:
step a, carrying out preset partition on a video frame to be transmitted, dividing a frame image of the video to be transmitted into a plurality of grids with uniform sizes, partitioning according to the pixel values in each grid, dividing the grids into a plurality of areas, numbering each area, and marking each area as A respectively 1 ,A 2 ,A 3 ,……,A n The A is carried out 1 ,A 2 ,A 3 ,……,A n Selecting, setting an encoding file format, including parameters such as resolution, compression ratio, frame rate and the like of a video frame, and encoding a selected region by utilizing a video encoding algorithm to generate local encoding data;
step B, numbering and marking the coded data according to time sequence, and respectively marking as B 1 ,B 2 ,B 3 ,……,B n Checking whether adjacent numbers are continuous or not, if not, respectively and independently transmitting each piece of local coding data, controlling the transmission bandwidth by the transmission rate and the distribution of the bandwidth, enabling the local coding information to be transmitted in a specified time, and transmitting the local coding information to a receiving end;
c, after receiving the local coding information, checking the checksum technology of the transmission data of the local coding information, after confirming that the error is free, independently decoding each local coding information by using a corresponding decoding algorithm, splicing the decoded local coding information according to the original position, filling gaps among different local codes by using a frame inserting mode or an image restoration algorithm, and adjusting the frame rate, the contrast and the color of the spliced video to obtain a complete video frame;
as a further improvement of the present application, the method for partitioning the video frame to be sent specifically includes:
selecting a whole video from the video to be sent as a video image, selecting one or more pixel points from the video image as seed points, defining each adjacent pixel point of the seed points as a 'neighborhood', traversing all pixel points in the neighborhood of each seed point, judging whether the pixel points are similar to the pixel values of the seed points or not, adding the pixel point into the area where the seed points are located if the merging condition is met, marking the pixel point as accessed, and continuously executing the step if the pixel points which are not accessed exist in the neighborhood;
in all the areas, non-accessed pixel points similar to the pixel values in the neighborhood of the seed points are found, the new pixel points can become new seed points, for each new seed point, all the pixel points in the neighborhood of the new seed point are traversed, whether the pixel values of the new seed point are similar to the pixel values of the seed points or not is judged, if the merging condition is met, the pixel point is added into the area where the seed point is located, the pixel point is marked as accessed until all the pixel points are accessed, the finally obtained image segmentation result is a plurality of connected areas consisting of a plurality of different areas, each connected area represents a different color or texture, and each connected area is marked with a number;
as a further improvement of the present application, the encoding process of the local area adopts an h.264 video encoding algorithm, and the specific algorithm is:
installing an H.264 coding library, converting a video file to be coded into a specific format by using a video format conversion tool HandBrand, converting the video file into avi or mp4, transmitting the converted video file to the H.264 coding library, configuring parameters of an encoder before coding operation, and controlling the H.264 coding library to configure the code rate, the frame rate, the resolution and the GOP size of the encoder;
through ffmpeg-i input.mp4-c: v libx264-b: v300k-s640×480-c: a acc-ba128koutput.mp4 sets the code rate to 300kbps so that the video file has standard definition image quality with resolution set to 640 x 480, wherein-c: v denotes the encoder of video encoding, here the h.264 encoder libx264 is used; a denotes an encoder for audio encoding, here aac; a denotes the audio bit rate, 128k denotes the bit rate of 128kbps; input.avi and output.mp4 represent input and output filenames, respectively, by ffmpeg-i input.mp4-c: v libx264-g15-c: a acc-b: a128k output.mp4, the GOP is set to 15, the smaller GOP size can ensure the video quality, but the complexity during encoding is higher and the file volume is larger, and the larger GOP size can reduce the complexity and the file volume during encoding, but the video quality can be influenced, and the encoded file is saved after encoding is completed;
as a further improvement of the present application, the local coding information is transmitted according to the JPEG video transmission standard, and the specific transmission mode is:
according to the JPEG standard, dividing the video image to be transmitted into n 8x8 pixel blocks, subtracting the average value in the block from the pixel value in each 8x8 pixel block, defining a quantization matrix Q, setting the coefficient of the quantization matrix Q as a non-negative integer, performing discrete cosine transform on each 8x8 pixel block to obtain the frequency domain coefficient of each block, dividing the frequency domain coefficient by the quantization matrix Q, compressing the high frequency coefficient, reserving the low frequency coefficient, wherein the corresponding coefficient in the quantization matrix is a non-negative integer, the quantization result is not accurate, sequentially flattening the quantization result of each block into a one-dimensional array to obtain compressed data, minimizing the size of the data through entropy coding, performing entropy decoding on the data, reducing the quantization result, and performing inverse quantization to obtain the final frequency domain coefficient and transmission;
as a further improvement of the present application, the partitioning and encoding process may be performed in combination, i.e. each region is encoded at the same time as the partitioning, in a specific manner:
dividing a video image to be transmitted into blocks with the size of 8x8, dividing the blocks into areas with the size of 8x8, traversing character strings to be encoded, recording the occurrence frequency of each character, using a Huffman tree algorithm to construct a tree, taking the occurrence frequency of each character as the weight of each leaf node, comparing the weight of each leaf node, selecting two smallest nodes as a group, constructing a new father node, the weight of the father node is the sum of the weights of the two leaf nodes, repeating the above processes until all nodes form a complete Huffman tree with a root node as a root, starting from the root node, going leftwards to be 0, going rightwards to be 1, forming a path from the root node to each leaf node, wherein the path of each leaf node corresponds to one code, namely, no code is the prefix of the other code, using a generated code dictionary, converting each character in the original character string into the corresponding code, generating a coded JPEG data stream, storing the coded data stream in the image data stream, and splicing the coded data streams together to obtain the coded JPEG data stream;
as a further improvement of the application, the determination of the partitioning algorithm is based on the characteristics of the video data and transmission condition factors, specifically:
compression encoding of video data generally involves compression techniques in three aspects, SPATIAL (SPATIAL), TEMPORAL (temp), and FREQUENCY (FREQUENCY), for which there is a great correlation between frames in a video sequence, based on which compression of SPATIAL redundancy and TEMPORAL redundancy is achieved by processing the video sequence, so that determination of a partitioning algorithm requires consideration of these characteristics of the video data, transmission condition factors;
when transmitting video data, the video data needs to be divided into smaller and relatively independent segments to be processed, and compressed by using a proper algorithm so as to reduce the bandwidth and storage cost required by transmission, the video partitioning algorithm determines how to divide the video into smaller segments, selects which compression algorithms to process, and reassembles the segments to generate a final video stream;
determining the factors of the partition algorithm in various aspects such as the characteristics of video data, the complexity of encoding and decoding processing, the data transmission rate, the storage requirement and the like, wherein the optimization of the partition algorithm can improve the compression quality and the encoding efficiency of the video, so that different application requirements can be better met;
as a further improvement of the application, the partitioning algorithm can be further adjusted and optimized to adapt to different video contents and equipment requirements, and the specific method is as follows:
the size of the subareas determines the number and the size of the areas in the video image, different subarea scales can be selected for different video contents and equipment requirements, small-scale subareas are adopted for some video contents needing high definition so as to retain more detail information, and larger-scale subareas can be adopted for some video contents needing to be transmitted under lower bandwidth so as to reduce the requirement of transmission bandwidth;
when encoding different partitions, different compression algorithms can be selected according to the content in the partition, some basic compression algorithms can be used for relatively simple video content, and for video content containing more complex information, higher level compression algorithms are required;
the size and the number of the quantization matrix have great influence on the compression quality and the image quality, different video contents and equipment requirements are properly adjusted according to actual conditions, video contents with high compression ratio are encoded by adopting a stricter quantization matrix, and video contents with better visual quality are encoded by adopting a relatively loose quantization matrix, when the video contents are encoded, different partitions can be encoded by adopting different compression algorithms and quantization matrices, and therefore, proper optimization is required in the subsequent fragment splicing process. In order to avoid the problems of splicing errors and the like, some characteristic points can be marked on each partition to serve as reference points for splicing;
as a further improvement of the present application, the transmitted local coding information may be encrypted and decrypted, and the specific method is as follows:
according to the actual demand, selecting proper encryption algorithm and key length, encrypting the local coding information by adopting the selected encryption algorithm, generating an encrypted data stream, transmitting the encrypted data stream to a receiving end, decrypting the encrypted data by adopting the same encryption algorithm by the receiving end, recovering the original local coding information, and carrying out the encryption and decryption processing.
The working principle and the beneficial effects of the application are as follows:
1. the application provides a simple, quick and direct video transmission method, which avoids complex conversion and processing steps.
2. The application utilizes the existing transmission interface, does not need additional hardware and software support, and improves the transmission efficiency and reliability.
3. The application is suitable for video transmission requirements of different types of equipment and different occasions, and has high universality and practicability.
Drawings
The application will be described in further detail with reference to the drawings and the detailed description.
FIG. 1 is a flow chart of the present application
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described in the following in conjunction with the embodiments of the present application, and it is obvious that the described embodiments are only some embodiments of the present application, but not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
Referring to fig. 1, the present application provides a video transmission method between different devices, which includes dividing video data into a plurality of regions according to a frame, compressing and storing different regions by different parameters, preferentially transmitting a high-quality region by using high-quality parameters during transmission, then transmitting a medium-quality region by using medium-quality parameters, and finally transmitting a low-quality region by using low-quality parameters.
The video transmission method between different devices comprises the following steps:
step a, carrying out preset partition on a video frame to be transmitted, dividing a frame image of the video to be transmitted into a plurality of grids with uniform sizes, partitioning according to the pixel values in each grid, dividing the grids into a plurality of areas, numbering each area, and marking each area as A respectively 1 ,A 2 ,A 3 ,……,A n The A is carried out 1 ,A 2 ,A 3 ,……,A n Selecting, setting an encoding file format, including parameters such as resolution, compression ratio, frame rate and the like of a video frame, and encoding a selected region by utilizing a video encoding algorithm to generate local encoding data;
step B, numbering and marking the coded data according to time sequence, and respectively marking as B 1 ,B 2 ,B 3 ,……,B n Checking whether adjacent numbers are continuous or not, if not, transmitting each local code data separately by comparingThe transmission rate and allocation of the bandwidth control the transmission bandwidth, so that the local coding information can be transmitted in a specified time, and the local coding information is sent to a receiving end;
and c, after the receiving end receives the local coding information, checking the checksum technology of the transmission data of the local coding information, independently decoding each local coding information by using a corresponding decoding algorithm after confirming no errors, splicing the decoded local coding information according to the original position, filling gaps among different local codes by using a frame inserting mode or an image restoration algorithm, and adjusting the frame rate, the contrast and the color of the spliced video to obtain a complete video frame.
In one possible design, the method for partitioning the video frame to be sent specifically includes:
selecting a whole video from the video to be sent as a video image, selecting one or more pixel points from the video image as seed points, defining each adjacent pixel point of the seed points as a 'neighborhood', traversing all pixel points in the neighborhood of each seed point, judging whether the pixel points are similar to the pixel values of the seed points or not, adding the pixel point into the area where the seed points are located if the merging condition is met, marking the pixel point as accessed, and continuously executing the step if the pixel points which are not accessed exist in the neighborhood;
in all the areas, the unviewed pixel points similar to the pixel values in the neighborhood of the seed points are found, the new pixel points can become new seed points, for each new seed point, all the pixel points in the neighborhood of the new seed point are traversed, whether the pixel values of the new pixel points are similar to the pixel values of the seed points or not is judged, if the merging condition is met, the pixel point is added into the area where the seed point is located, the pixel point is marked as accessed until all the pixel points are accessed, the finally obtained image segmentation result is a plurality of connected areas consisting of a plurality of different areas, each connected area represents a different color or texture, and each connected area is marked with a number.
Further, the above method for determining whether the pixel values of the pixel point and the seed point are similar is as follows:
the pixel values of the pixel to be filled are compared to the pixel values of the seed point pixel within a range around the current pixel point, and are considered similar if there are a sufficient number of pixel values that are similar.
In one possible design, the h.264 video coding algorithm is adopted in the local region coding process, and the specific algorithm is as follows:
installing an H.264 coding library, converting a video file to be coded into a specific format by using a video format conversion tool HandBrand, converting the video file into avi or mp4, transmitting the converted video file to the H.264 coding library, configuring parameters of an encoder before coding operation, and controlling the H.264 coding library to configure the code rate, the frame rate, the resolution and the GOP size of the encoder;
through ffmpeg-i input.mp4-c: v libx264-b: v300k-s640×480-c: a acc-ba128koutput.mp4 sets the code rate to 300kbps so that the video file has standard definition image quality with resolution set to 640 x 480, wherein-c: v denotes the encoder of video encoding, here the h.264 encoder libx264 is used; a denotes an encoder for audio encoding, here aac; a denotes the audio bit rate, 128k denotes the bit rate of 128kbps; input.avi and output.mp4 represent input and output filenames, respectively, by ffmpeg-i input.mp4-c: v libx264-g15-c: a acc-b: a128k output.mp4, set GOP to 15, smaller GOP size can guarantee video quality, but complexity and file volume are higher when encoding, and larger GOP size can reduce complexity and file volume when encoding, but can affect video quality, after encoding is completed, the encoded file is saved.
In one possible design, the local coding information is transmitted according to the JPEG video transmission standard, and the specific transmission mode is:
according to the JPEG standard, dividing the video image to be transmitted into n 8x8 pixel blocks, subtracting the average value in the block from the pixel value in each 8x8 pixel block, defining a quantization matrix Q, setting the coefficient of the quantization matrix Q as a non-negative integer, performing discrete cosine transform on each 8x8 pixel block to obtain the frequency domain coefficient of each block, dividing the frequency domain coefficient by the quantization matrix Q, compressing the high frequency coefficient while retaining the low frequency coefficient, wherein the corresponding coefficient in the quantization matrix is a non-negative integer, the quantization result is not accurate, sequentially flattening the quantization result of each block into a one-dimensional array to obtain compressed data, minimizing the size of the data through entropy encoding, performing entropy decoding on the data, reducing the quantization result, and then performing inverse quantization to obtain the final frequency domain coefficient and transmission.
In a preferred technical scheme of the application, in the quantization matrix, the method for sequentially flattening the quantization result of each block into a one-dimensional array comprises the following steps:
in image and video encoding and decoding, quantization matrices are used for quantization of coefficients after Discrete Cosine Transform (DCT), thereby achieving image and video compression. In general, for each pixel block in an image or video, a coefficient matrix after DCT transformation needs to be quantized according to a rule of a quantization matrix, and finally, the quantized coefficient is flattened into a one-dimensional array.
Further, how the compressed data is entropy encoded to minimize the size of the data:
entropy coding is a technique that can minimize compressed data. The basic idea of entropy coding is to encode a character or combination with a higher probability of occurrence using a shorter bit pattern, encode a character or combination with a lower probability of occurrence using a longer bit pattern, which is usually referred to as generating an entropy coding table based on the input data itself, calculate the probability of occurrence of different symbols in the input data, construct a probability model based on the probabilities, map each different symbol to a unique code using the probability model, map the symbols occurring at high frequencies to codes with a short code, map the input data to codes of symbols with a long code, splice all codes to a binary string, write the resulting code string to a file, and write the corresponding file header information according to the agreed coding pattern.
In one possible design, the partitioning and encoding process may be performed in combination, i.e., each region is encoded at the same time as the partitioning, in a manner that:
the method comprises the steps of dividing a video image to be transmitted into blocks with 8x8, dividing the blocks into areas with 8x8, traversing character strings to be encoded, recording the occurrence frequency of each character, using a Huffman tree algorithm to construct a tree, taking the occurrence frequency of each character as the weight of each leaf node, comparing the weight of each leaf node, selecting two smallest nodes as a group, constructing a new father node, wherein the weight is the sum of the weights of the two leaf nodes, repeating the above processes until all nodes form a complete Huffman tree with a root node as a root, starting from the root node, going leftwards to be 0, going rightwards to be 1, forming a path from the root node to each leaf node, wherein the path of each leaf node corresponds to one code, namely, no code is the prefix of the other code, using a generated code dictionary, converting each character in the original character string into the corresponding code, generating a coded JPEG data stream, storing the coded data stream in the image data stream, and splicing the coded data streams together to obtain the coded JPEG data stream.
In one possible design, the determination of the partitioning algorithm is based on the characteristics of the video data, and transmission condition factors, specifically:
compression encoding of video data generally involves compression techniques in three aspects, SPATIAL (SPATIAL), TEMPORAL (temp), and FREQUENCY (FREQUENCY), for which there is a great correlation between frames in a video sequence, based on which compression of SPATIAL redundancy and TEMPORAL redundancy is achieved by processing the video sequence, so that determination of a partitioning algorithm requires consideration of these characteristics of the video data, transmission condition factors;
when video data is transmitted, the video data is required to be divided into smaller and relatively independent segments to be processed, the video data is compressed by using a proper algorithm, the bandwidth and the storage cost required by transmission are reduced, the video partitioning algorithm determines how to divide the video into smaller segments, which compression algorithms are selected to be processed, and the segments are recombined to generate a final video stream;
the partition algorithm is determined by considering various factors such as the characteristics of video data, the complexity of encoding and decoding processing, the data transmission rate, the storage requirement and the like, and the compression quality and the encoding efficiency of the video can be improved by optimizing the partition algorithm.
In a preferred technical scheme of the application, the method for determining the partition algorithm needs to consider the characteristics of video data, the complexity of encoding and decoding processing and the data transmission rate is as follows:
according to the resolution, frame rate, color space and compression format characteristics of video, how to design a partitioning algorithm to maximally utilize local and global redundancy of video and reduce data redundancy in compression is needed, the design of the partitioning algorithm also needs to consider complexity of compression/decompression processing and time overhead of encoding and decoding, in a video transmission scene, data transmission rate is an important factor, how to minimize data transmission time is needed, proper partition size should be set according to the data transmission rate, so that data can be transmitted on a network more efficiently, in addition, dynamic adjustment is needed in the transmission process based on network environment changes, transmission delay and data loss are reduced, user experience is an important index in the video transmission scene, and how to cooperate with different scenes and devices in the design of the partitioning algorithm is also needed, so that quality and stability of video display are improved.
In one possible design, the partitioning algorithm may be further adjusted and optimized to adapt to different video content and equipment requirements, by the following specific methods:
the size of the subareas determines the number and the size of the areas in the video image, different subarea scales can be selected for different video contents and equipment requirements, small-scale subareas are adopted for some video contents needing high definition so as to retain more detail information, and larger-scale subareas can be adopted for some video contents needing to be transmitted under lower bandwidth so as to reduce the requirement of transmission bandwidth;
when encoding different partitions, different compression algorithms can be selected according to the content in the partition, some basic compression algorithms can be used for relatively simple video content, and for video content containing more complex information, higher level compression algorithms are required;
the size and the number of the quantization matrix have great influence on the compression quality and the image quality, different video contents and equipment requirements are properly adjusted according to actual conditions, video contents with high compression ratio are encoded by adopting a stricter quantization matrix, and video contents with better visual quality are encoded by adopting a relatively loose quantization matrix, when the video contents are encoded, different partitions can be encoded by adopting different compression algorithms and quantization matrices, and therefore, proper optimization is required in the subsequent fragment splicing process. In order to avoid the problems of splicing errors and the like, some characteristic points can be marked on each partition to serve as reference points for splicing;
in one possible design, the transmitted locally encoded information may be encrypted and decrypted by the following specific methods:
according to the actual demand, selecting proper encryption algorithm and key length, encrypting the local coding information by adopting the selected encryption algorithm, generating an encrypted data stream, transmitting the encrypted data stream to a receiving end, decrypting the encrypted data by adopting the same encryption algorithm by the receiving end, recovering the original local coding information, and carrying out the encryption and decryption processing.
Further, the above method for selecting the encryption algorithm and the key length is as follows:
for symmetric encryption, AES is one of the most commonly used encryption algorithms at present, security and efficiency can be well balanced, for asymmetric encryption, RSA is one of the more commonly used algorithms, SHA-2 is one of the more commonly used hash functions at present, and it may be very useful to verify file integrity or encryption password storage;
for symmetric encryption algorithms, the key length 128 bits of the AES algorithm is typically already sufficiently secure. If a higher level of protection is required, a 256 bit key length may be selected, for asymmetric encryption algorithms, such as the RSA algorithm, it is generally recommended to select a key length of 2048 bits or more, for hash functions, such as SHA-2, a shorter hash value may provide sufficient security in most cases, and 256 bits or more are recommended.
The foregoing description of the preferred embodiments of the application is not intended to be limiting, but rather is intended to cover all modifications, equivalents, alternatives, and improvements that fall within the spirit and scope of the application.

Claims (8)

1. The video transmission method between different devices is characterized in that video data is divided into a plurality of areas according to pictures, different areas are compressed and stored by adopting different parameters, the high-quality areas adopting high-quality parameters are preferentially transmitted during transmission, then the medium-quality areas adopting medium-quality parameters are transmitted, and finally the low-quality areas adopting low-quality parameters are transmitted;
the video transmission method between different devices comprises the following steps:
step a, carrying out preset partition on a video frame to be transmitted, dividing a frame image of the video to be transmitted into a plurality of grids with uniform sizes, partitioning according to the pixel values in each grid, dividing the grids into a plurality of areas, numbering each area, and marking each area as A respectively 1 ,A 2 ,A 3 ,……,A n The A is carried out 1 ,A 2 ,A 3 ,……,A n Selecting, setting an encoding file format, including parameters such as resolution, compression ratio, frame rate and the like of a video frame, and encoding a selected region by utilizing a video encoding algorithm to generate local encoding data;
step b, encoding the codeThe data are numbered and marked according to time sequence and respectively marked as B 1 ,B 2 ,B 3 ,……,B n Checking whether adjacent numbers are continuous or not, if not, respectively and independently transmitting each piece of local coding data, controlling the transmission bandwidth by the transmission rate and the distribution of the bandwidth, enabling the local coding information to be transmitted in a specified time, and transmitting the local coding information to a receiving end;
and c, after the receiving end receives the local coding information, checking the checksum technology of the transmission data of the local coding information, independently decoding each local coding information by using a corresponding decoding algorithm after confirming no errors, splicing the decoded local coding information according to the original position, filling gaps among different local codes by using a frame inserting mode or an image restoration algorithm, and adjusting the frame rate, the contrast and the color of the spliced video to obtain a complete video frame.
2. The method for video transmission between different devices according to claim 1, wherein the video frames to be transmitted are subjected to a partitioning algorithm, and the specific method is as follows:
selecting a whole video from the video to be sent as a video image, selecting one or more pixel points from the video image as seed points, defining each adjacent pixel point of the seed points as a 'neighborhood', traversing all pixel points in the neighborhood of each seed point, judging whether the pixel points are similar to the pixel values of the seed points or not, adding the pixel point into the area where the seed points are located if the merging condition is met, marking the pixel point as accessed, and continuously executing the step if the pixel points which are not accessed exist in the neighborhood;
in all the areas, the unviewed pixel points similar to the pixel values in the neighborhood of the seed points are found, the new pixel points can become new seed points, for each new seed point, all the pixel points in the neighborhood of the new seed point are traversed, whether the pixel values of the new pixel points are similar to the pixel values of the seed points or not is judged, if the merging condition is met, the pixel point is added into the area where the seed point is located, the pixel point is marked as accessed until all the pixel points are accessed, the finally obtained image segmentation result is a plurality of connected areas consisting of a plurality of different areas, each connected area represents a different color or texture, and each connected area is marked with a number.
3. The method for video transmission between different devices according to claim 1, wherein the encoding process of the local area adopts an h.264 video encoding algorithm, and the specific algorithm is:
installing an H.264 coding library, converting a video file to be coded into a specific format by using a video format conversion tool HandBrand, converting the video file into avi or mp4, transmitting the converted video file to the H.264 coding library, configuring parameters of an encoder before coding operation, and controlling the H.264 coding library to configure the code rate, the frame rate, the resolution and the GOP size of the encoder;
through ffmpeg-input.mp4-c: vlibx264-b: v300k-s640×480-c: aacc-ba128koutput.mp4 sets the code rate to 300kbps so that the video file has standard definition image quality and resolution to 640 x 480, where-c: v denotes the encoder of video encoding, here the h.264 encoder libx264; a denotes an encoder for audio encoding, here aac; a denotes the audio bit rate, 128k denotes the bit rate of 128kbps; input.avi and output.mp4 represent input and output filenames, respectively, by ffmpeg-input.mp 4-c: vlibx264-g15-c: aacc-b: the GOP is set to 15 at a128koutput.mp4, the smaller GOP size can ensure video quality, but the complexity in encoding is higher and the file size is larger, and the larger GOP size can reduce the complexity and the file size in encoding, but the video quality can be affected, and after encoding is completed, the encoded file is saved.
4. The transmission method between different devices according to claim 1, wherein the locally encoded information is transmitted according to a JPEG video transmission standard, and the specific transmission mode is:
according to the JPEG standard, dividing the video image to be transmitted into n 8x8 pixel blocks, subtracting the average value in the block from the pixel value in each 8x8 pixel block, defining a quantization matrix Q, setting the coefficient of the quantization matrix Q as a non-negative integer, performing discrete cosine transform on each 8x8 pixel block to obtain the frequency domain coefficient of each block, dividing the frequency domain coefficient by the quantization matrix Q, compressing the high frequency coefficient while retaining the low frequency coefficient, wherein the corresponding coefficient in the quantization matrix is a non-negative integer, the quantization result is not accurate, sequentially flattening the quantization result of each block into a one-dimensional array to obtain compressed data, minimizing the size of the data through entropy encoding, performing entropy decoding on the data, reducing the quantization result, and then performing inverse quantization to obtain the final frequency domain coefficient and transmission.
5. The method for video transmission between different devices according to claim 1, wherein the partitioning and encoding processes can be performed in combination, that is, each region is encoded while partitioning, specifically by:
the method comprises the steps of dividing a video image to be transmitted into blocks with 8x8, dividing the blocks into areas with 8x8, traversing character strings to be encoded, recording the occurrence frequency of each character, using a Huffman tree algorithm to construct a tree, taking the occurrence frequency of each character as the weight of each leaf node, comparing the weight of each leaf node, selecting two smallest nodes as a group, constructing a new father node, wherein the weight is the sum of the weights of the two leaf nodes, repeating the above processes until all nodes form a complete Huffman tree with a root node as a root, starting from the root node, going leftwards to be 0, going rightwards to be 1, forming a path from the root node to each leaf node, wherein the path of each leaf node corresponds to one code, namely, no code is the prefix of the other code, using a generated code dictionary, converting each character in the original character string into the corresponding code, generating a coded JPEG data stream, storing the coded data stream in the image data stream, and splicing the coded data streams together to obtain the coded JPEG data stream.
6. The method for video transmission between different devices according to claim 1, wherein the determination of the partitioning algorithm is based on characteristics of video data and transmission condition factors, specifically:
compression encoding of video data generally involves compression techniques in three aspects, SPATIAL (SPATIAL), TEMPORAL (temp), and FREQUENCY (FREQUENCY), for which there is a great correlation between frames in a video sequence, based on which compression of SPATIAL redundancy and TEMPORAL redundancy is achieved by processing the video sequence, so that determination of a partitioning algorithm requires consideration of these characteristics of the video data, transmission condition factors;
when transmitting video data, the video data needs to be divided into smaller and relatively independent segments to be processed, and compressed by using a proper algorithm so as to reduce the bandwidth and storage cost required by transmission, the video partitioning algorithm determines how to divide the video into smaller segments, selects which compression algorithms to process, and reassembles the segments to generate a final video stream;
the partition algorithm is determined by considering various factors such as the characteristics of video data, the complexity of encoding and decoding processing, the data transmission rate, the storage requirement and the like, and the compression quality and the encoding efficiency of the video can be improved by optimizing the partition algorithm, so that different application requirements can be better met.
7. The method for video transmission between different devices according to claim 1, wherein the partitioning algorithm can be further adjusted and optimized to adapt to different video contents and device requirements, and the specific method is as follows:
the size of the subareas determines the number and the size of the areas in the video image, different subarea scales can be selected for different video contents and equipment requirements, small-scale subareas are adopted for some video contents needing high definition so as to retain more detail information, and larger-scale subareas can be adopted for some video contents needing to be transmitted under lower bandwidth so as to reduce the requirement of transmission bandwidth;
when encoding different partitions, different compression algorithms can be selected according to the content in the partition, some basic compression algorithms can be used for relatively simple video content, and for video content containing more complex information, higher level compression algorithms are required;
the size and the numerical value of the quantization matrix have great influence on the compression quality and the image quality, different video contents and equipment requirements are properly adjusted according to actual conditions, video contents with high compression ratio are encoded by adopting a stricter quantization matrix, and video contents with better visual quality are encoded by adopting a relatively loose quantization matrix, when the video contents are encoded, different partitions can be encoded by adopting different compression algorithms and quantization matrices, and therefore, proper optimization is required in the subsequent fragment splicing process; in order to avoid the problems of splicing errors and the like, some characteristic points can be marked on each partition to serve as reference points for splicing.
8. The method for video transmission between different devices according to claim 1, wherein the transmitted locally encoded information can be encrypted and decrypted, and the specific method is as follows:
according to the actual demand, selecting proper encryption algorithm and key length, encrypting the local coding information by adopting the selected encryption algorithm, generating an encrypted data stream, transmitting the encrypted data stream to a receiving end, decrypting the encrypted data by adopting the same algorithm by the receiving end, recovering the original local coding information, and carrying out the encryption and decryption processing.
CN202310818358.4A 2023-07-04 2023-07-04 Video transmission method between different devices Pending CN116761023A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310818358.4A CN116761023A (en) 2023-07-04 2023-07-04 Video transmission method between different devices

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310818358.4A CN116761023A (en) 2023-07-04 2023-07-04 Video transmission method between different devices

Publications (1)

Publication Number Publication Date
CN116761023A true CN116761023A (en) 2023-09-15

Family

ID=87953201

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310818358.4A Pending CN116761023A (en) 2023-07-04 2023-07-04 Video transmission method between different devices

Country Status (1)

Country Link
CN (1) CN116761023A (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102438144A (en) * 2011-11-22 2012-05-02 苏州科雷芯电子科技有限公司 Video transmission method
KR20180113868A (en) * 2017-04-07 2018-10-17 주식회사 에스원 Image Reencoding Method based on Decoding Data of Image of Camera and System thereof
JP2020058014A (en) * 2018-09-28 2020-04-09 株式会社リコー Video processing apparatus, video conference system, video processing method, and program
CN113052859A (en) * 2021-04-20 2021-06-29 哈尔滨理工大学 Super-pixel segmentation method based on self-adaptive seed point density clustering
CN115767098A (en) * 2022-10-21 2023-03-07 华中科技大学 Machine vision-oriented end-edge collaborative video coding method and video transmission system
CN116016990A (en) * 2022-12-28 2023-04-25 杭州海康威视数字技术股份有限公司 Encoding and decoding method and device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102438144A (en) * 2011-11-22 2012-05-02 苏州科雷芯电子科技有限公司 Video transmission method
KR20180113868A (en) * 2017-04-07 2018-10-17 주식회사 에스원 Image Reencoding Method based on Decoding Data of Image of Camera and System thereof
JP2020058014A (en) * 2018-09-28 2020-04-09 株式会社リコー Video processing apparatus, video conference system, video processing method, and program
CN113052859A (en) * 2021-04-20 2021-06-29 哈尔滨理工大学 Super-pixel segmentation method based on self-adaptive seed point density clustering
CN115767098A (en) * 2022-10-21 2023-03-07 华中科技大学 Machine vision-oriented end-edge collaborative video coding method and video transmission system
CN116016990A (en) * 2022-12-28 2023-04-25 杭州海康威视数字技术股份有限公司 Encoding and decoding method and device

Similar Documents

Publication Publication Date Title
US6512836B1 (en) Systems and methods for etching digital watermarks
CN114631320A (en) Apparatus and method for performing Artificial Intelligence (AI) encoding and AI decoding on image
CN104159109B (en) Bit rate control method and system based on VBR Video coding
Zhang et al. Compressing encrypted images with auxiliary information
US10237576B2 (en) 3D-HEVC depth video information hiding method based on single-depth intra mode
US20030190042A1 (en) Data process apparatus and method therefor
JP2004242287A (en) Information processing method and apparatus, computer program, and computer readable storage medium
JP4270469B2 (en) Encoding apparatus and encoding method
JP2007526507A (en) Method for generating data describing scalable media
CN108370443B (en) Data compression
JP2007534230A (en) Method for scaling progressively encrypted scalable data sequences
CN111327786B (en) Robust steganography method based on social network platform
Slobodyanyuk et al. Approach to Coding with Improved Integrity of Video Information for Transmission in Wireless Infocommunication Networks
Xu et al. Reversible data hiding scheme based on VQ prediction and adaptive parametric binary tree labeling for encrypted images
US6771831B2 (en) Data compression method and system using globally optimal scalar quantization
US20200036994A1 (en) Motion compensation techniques for video
KR100989686B1 (en) A method and a device for processing bit symbols generated by a data source, a computer readable medium, a computer program element
CN116761023A (en) Video transmission method between different devices
WO2001050769A1 (en) Method and apparatus for video compression using multi-state dynamical predictive systems
CN112715029A (en) AI encoding apparatus and operating method thereof, and AI decoding apparatus and operating method thereof
JP3434088B2 (en) Image data conversion device and its inverse conversion device
KR101500300B1 (en) Selective Low-Power Video Codec with Interaction Between Encoder and Decoder, and an Encoding/Decoding Method Thereof
Hung et al. New irregular sampling coding method for transmitting images progressively
CN115834926B (en) Video encryption method based on H.265 entropy coding binarization
US10505713B2 (en) Compression and/or encryption of a file

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination