Method for optimizing real-time video fluency of 4G equipment

Through the collaborative work between the client and the device, the download rate is monitored and uploaded in real time, and the encoding parameters are automatically adjusted according to the preset strategy table, which solves the problem of stuttering video playback of 4G devices, and realizes automatic adaptive image quality and code rate adjustment, improving user experience.

CN120017903AActive Publication Date: 2025-05-16SHENZHEN XINRUISHI TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510466136.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-15
Publication Date
2025-05-16
Estimated Expiration
2045-04-15

AI Technical Summary

Technical Problem

In the prior art, 4G devices have lagged videos due to insufficient network or bandwidth during real-time video playback. Users need to manually select low definition or low resolution to alleviate lags, and they cannot automatically adapt to network changes, reducing user experience.

Method used

Through the coordinated work of the client and the camera equipment, a playback thread and statistical thread are established, the download rate is monitored in real time and uploaded to the device side. The device side automatically matches and switches to the policy item closest to the current rate according to the preset bandwidth level and the encoding policy table, and adjusts the encoding parameters to adapt to the current network bandwidth.

Benefits of technology

It realizes fully automatic adaptive image quality and code rate adjustment of 4G devices during real-time video playback, solves the problem of playback lag caused by insufficient network bandwidth, and improves user viewing experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120017903A_ABST
    Figure CN120017903A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of 4G network access, camera equipment and the like, and provides a method for optimizing real-time video fluency of 4G equipment, which is characterized in that a real-time bandwidth detection and coding parameter dynamic matching mechanism is constructed through cooperation of a client side and an equipment side. According to the method for optimizing the real-time video fluency of the 4G equipment, the downloading rate is monitored in real time through a statistical thread of a client side, and bandwidth information is uploaded to an equipment side; and the equipment end automatically selects a proper coding parameter according to a preset coding strategy table so as to adapt to the current network bandwidth. The process does not need user intervention, and full-automatic adaptive image quality and code rate adjustment is realized, so that the problem of playing lagging caused by insufficient network bandwidth in a 4G environment is solved, and the watching experience of a user is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical fields of 4G network access, camera equipment, etc., and in particular to a method for optimizing the real-time video fluency of a 4G device. Background Art

[0002] When a user uses a mobile phone APP to connect to a camera device, if the device uses a wired network, it can play smoothly when the network is normal. If the device uses a 4G card to connect to the network, the amount of video data per second is higher than the network transmission bandwidth, which will cause the video to be played on the user's mobile phone APP to freeze. Usually, when users encounter freezes, they will manually select a low-definition mode to alleviate the freeze problem, or they can manually select a low-resolution bit rate to alleviate the freeze problem. Whether it is manually selecting a low-definition mode or selecting low-resolution playback, manual operation is required by the user; when the device is switched to a wired network, or when the 4G network signal strength and bandwidth are increased, the user is required to manually switch the clarity or resolution again to restore high-quality playback. It can be seen that in the prior art, the method for improving the real-time video fluency of 4G devices mainly relies on manual selection by users. When playing 4G camera device videos in real time, the prior art cannot automatically adapt to the device network or bandwidth, resulting in a reduced user experience of the device.

[0003] In summary, in the prior art, the method of improving the real-time video fluency of 4G devices mainly relies on manual selection by users. When playing the video of the 4G camera device in real time, the prior art cannot automatically adapt to the device network or bandwidth, resulting in a decrease in the user experience of the device. Summary of the invention

[0004] In view of the deficiencies in the above-mentioned prior art, the present invention provides a method for optimizing the real-time video fluency of 4G devices, so as to automatically adapt to the device network or bandwidth when playing the video of the 4G camera device in real time, thereby improving the user experience of the device.

[0005] The method for optimizing the real-time video fluency of a 4G device provided by the present invention is applied to real-time video transmission between a camera device and a client connected via a mobile network, comprising: The client establishes a playback thread and a statistics thread. The playback thread connects to the camera device through the P2P protocol and requests real-time preview. It receives streaming data packets containing audio and video data and bandwidth policy identifiers. After parsing the data packets, it adds the audio and video data to the cache queue. At the same time, it parses the bandwidth policy identifier to select the corresponding local policy item N, and determines and manages the number of cached frames. If the number of cached frames exceeds the upper limit of the number of frames specified by the policy item, all P frames to I frames are deleted from the end of the queue to ensure delay control and smoothness. The statistics thread calculates the current download rate based on the length of the received audio and video data and the corresponding time interval, and uploads the current download rate to the camera device in real time through the P2P protocol; After receiving the download rate uploaded by the client, the camera device automatically matches and switches to the policy item N closest to the current rate based on the locally preset bandwidth level and encoding strategy table by the bitstream adaptation thread. The policy item N includes GOP length, number of reference key frames, frame rate, bit rate, image sharpness and upper limit of cached frames. The sending thread encodes the real-time audio and video using policy item N, and sends it to the client after packaging.

[0006] Furthermore, the client performs the following operations during initialization: clears the current audio and video cache queue; initializes a first memory variable A for recording the accumulated audio and video data length to 0; initializes a second memory variable B for recording the current download rate to 0; and presets a set of local bandwidth levels and policy tables, wherein each policy item in the policy table corresponds to a bandwidth level and includes the number of GOP frames, the number of reference key frames, the frame rate, the bit rate, the image sharpness and the upper limit of the number of cache frames under the corresponding bandwidth level, which are used for subsequent matching with the bandwidth policy of the camera device and cache queue management.

[0007] Furthermore, the client parses the received streaming media packet header in the playback thread, obtains the video frame type information and the bandwidth policy identifier used, and selects the corresponding policy item N by comparing the bandwidth policy identifier with the preset policy table item; if the number of audio and video frames in the current cache queue exceeds the maximum number of frames set in the policy item N, all P frames at the end of the queue are deleted until the end is an I frame, so as to ensure the subsequent decoding continuity and playback smoothness.

[0008] Furthermore, after receiving the audio and video data length update signal, the statistical thread in the client records the two time points before and after the reception, calculates the download rate within the receiving interval and writes it into the second memory variable B, and at the same time encapsulates the rate information of the download rate within the receiving interval through the P2P channel and uploads it to the camera device for the bandwidth strategy adjustment decision of the camera device.

[0009] Furthermore, the camera device presets a bandwidth level and encoding strategy correspondence table during the initialization phase, wherein each bandwidth level in the correspondence table corresponds to a set of encoding parameters, and the set of encoding parameters includes: GOP frame number, number of reference key frames, frame rate, bit rate, image sharpness and upper limit of cached frames; after the device receives the download rate reported by the client through the bitstream adaptation thread, it matches the policy item closest to the rate in the table of the correspondence table as the currently effective encoding strategy.

[0010] Furthermore, during the encoding parameter adjustment process, the camera device adjusts the parameters in sequence according to the following priority: first, extend the GOP length, then increase the number of reference key frames, then reduce the frame rate and bit rate, then reduce the image sharpness, and finally reduce the overall bit rate; through the priority strategy, the image quality is maintained to the maximum extent, and the smoothness of the video playback is prioritized when the image quality cannot be maintained.

[0011] Furthermore, after encoding the audio and video data, the sending thread of the camera device encapsulates the bandwidth policy identifier used for encoding in the header of the streaming media data packet. The streaming media data packet includes a frame type tag, audio and video data and a policy identifier field for the client playback thread to identify and match the corresponding policy item.

[0012] Furthermore, after receiving the streaming media data packet, the playback thread of the client parses the policy identification field contained in the streaming media data packet and compares it with the preset policy table to obtain the currently used policy item N, and accordingly calls corresponding parameters in the cache queue management, frame removal mechanism and decoding process to improve the cache control accuracy and playback decoding efficiency.

[0013] Furthermore, the sending thread of the camera device supports the simultaneous management of multiple P2P connections, each connection corresponds to an independent client session and a corresponding download rate record and encoding strategy matching module. Different clients dynamically adapt the optimal encoding strategy according to their network environment to achieve differentiated video fluency optimization for multiple users.

[0014] Furthermore, the client automatically starts a playback thread and a statistics thread according to the current access network type, monitors the download rate in real time, and automatically selects appropriate playback parameters through a local policy matching mechanism.

[0015] Compared with the prior art, the present invention has the following beneficial effects: The present invention provides a method for optimizing the real-time video fluency of a 4G device. In the method, a client establishes a play thread and a statistics thread. The play thread connects to a camera device through a P2P protocol and requests real-time preview, receives a streaming media data packet containing audio and video data and a bandwidth policy identifier, adds the audio and video data to a cache queue after parsing the data packet, and simultaneously parses the bandwidth policy identifier to select a corresponding local policy item N, and determines and manages the number of cached frames; if the number of cached frames exceeds the upper limit of the number of frames defined by the policy item, all P frames to I frames are deleted from the end of the queue to ensure delay control and fluency; the statistics thread calculates the current download rate based on the length of the received audio and video data and the corresponding time interval, and uploads the current download rate to the camera device through the P2P protocol in real time; after receiving the download rate uploaded by the client, the camera device automatically matches and switches to the policy item N closest to the current rate according to the locally preset bandwidth level and encoding policy table by the code stream adaptation thread, wherein the policy item N includes GOP length, the number of reference key frames, frame rate, code rate, image sharpness and the upper limit of the number of cached frames; the sending thread encodes the real-time audio and video using the policy item N, and sends it to the client after encapsulation. This method does not require user intervention and achieves fully automatic adaptive picture quality and bit rate adjustment, thereby solving the playback stuttering problem caused by insufficient network bandwidth in the 4G environment and improving the user viewing experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of the present invention. The exemplary embodiments of the present invention and their description are used to explain the present invention and do not constitute an improper limitation of the present invention. Some specific embodiments of the present invention will be described in detail in an exemplary and non-restrictive manner with reference to the drawings. The same reference numerals in the drawings indicate the same or similar components or parts. It should be understood by those skilled in the art that these drawings are not necessarily drawn to scale. In the drawings: Figure 1 It is a flow chart of a method for optimizing the real-time video fluency of a 4G device according to an embodiment of the present invention; Figure 2 It is a state diagram of the dynamic configuration of bandwidth level and policy table in the embodiment of the present invention. DETAILED DESCRIPTION

[0017] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiment of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiment of the present invention. Obviously, the described embodiment is only an embodiment of a part of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work should fall within the scope of protection of the present invention.

[0018] See also Figure 1-Figure 2 The embodiment of the present invention provides a method for optimizing the real-time video fluency of a 4G device. The method for optimizing the real-time video fluency of a 4G device is applied to real-time video transmission between a camera device and a client connected via a mobile network, and includes the following steps: S101. The client establishes a playback thread and a statistics thread. The playback thread connects to the camera device through the P2P protocol and requests real-time preview. It receives streaming data packets containing audio and video data and bandwidth policy identifiers. After parsing the data packets, the audio and video data are added to the cache queue. At the same time, the bandwidth policy identifier is parsed to select the corresponding local policy item N, and the number of cached frames is determined and managed. If the number of cached frames exceeds the upper limit of the number of frames specified by the policy item, all P frames to I frames are deleted from the end of the queue to ensure delay control and smoothness. Among them, I frames refer to key frames or self-encoded frames. I frames do not depend on other frames and can be decoded independently. They are anchor points for playback or fast-forward jumps. P frames refer to predicted frames. P frames only record changes with previous frames and need to rely on previous I frames or P frames for decoding.

[0019] S102, the statistics thread calculates the current download rate based on the length of the received audio and video data and the corresponding time interval, and uploads the current download rate to the camera device in real time through the P2P protocol; S103, after receiving the download rate uploaded by the client, the video camera device automatically matches and switches to the policy item N closest to the current rate according to the locally preset bandwidth level and encoding policy table by the bitstream adaptation thread, wherein the policy item N includes GOP length, number of reference key frames, frame rate, bit rate, image sharpness and upper limit of cached frames; the sending thread encodes the real-time audio and video using the policy item N, and sends it to the client after packaging. Among them, the policy item N refers to a bandwidth and encoding control parameter set used by the video camera device to encode and send real-time audio and video data.

[0020] It should be noted that in this embodiment, the method for optimizing the real-time video fluency of 4G devices is to build a real-time bandwidth detection and encoding parameter dynamic matching mechanism through the collaboration between the client and the device. Compared with the prior art that relies on the user to manually switch the definition, the method for optimizing the real-time video fluency of 4G devices monitors the download rate in real time through the client's statistical thread and uploads the bandwidth information to the device; the device automatically selects appropriate encoding parameters to adapt to the current network bandwidth according to the preset encoding strategy table. This process does not require user intervention, and realizes fully automatic adaptive picture quality and bit rate adjustment, thereby solving the playback jamming problem caused by insufficient network bandwidth in the 4G environment and improving the user viewing experience.

[0021] In some preferred embodiments, the client performs the following operations during initialization: clear the current audio and video cache queue; initialize the first memory variable A used to record the accumulated audio and video data length to 0; initialize the second memory variable B used to record the current download rate to 0; and preset a set of local bandwidth levels and policy tables, each policy item in the policy table corresponds to a bandwidth level, and contains the number of GOP frames, the number of reference key frames, the frame rate, the bit rate, the image sharpness and the upper limit of the cache frame number under the corresponding bandwidth level, which are used for subsequent matching with the bandwidth strategy of the camera device and cache queue management. It should be noted that in order to ensure that the client has bandwidth adaptive capabilities, it is necessary to clear the cache in the initialization stage to prevent residual data interference; at the same time, set the variables for accumulating the length of received data and the current download rate, which provides a basis for the subsequent statistical thread to calculate the download rate. In addition, by presetting the bandwidth policy table, the client can quickly match the corresponding policy parameters according to the received policy identifier, realize the cache management and frame culling mechanism of the playback thread, thereby improving the system startup efficiency and ensuring the basis for the automatic adjustment function of the bandwidth policy.

[0022] In some preferred embodiments, the client parses the received streaming media packet header in the playback thread, obtains the video frame type information and the bandwidth policy identifier used, and selects the corresponding policy item N by comparing the bandwidth policy identifier with the preset policy table item; if the number of audio and video frames in the current cache queue exceeds the maximum number of frames set in policy item N, all P frames at the end of the queue are deleted until the tail is an I frame, so as to ensure the continuity of subsequent decoding and the smoothness of playback. It should be noted that in the case of bandwidth limitation, caching too many P frames will lead to accumulated delays and increased decoding pressure. In this embodiment, by identifying the maximum number of cache frames allowed in the policy, once it is exceeded, the redundant P frames are immediately deleted until the last I frame, thereby reducing delays while ensuring decoding integrity, ensuring smooth playback in a weak network environment, improving decoding efficiency and system response speed, and avoiding freezes caused by too many redundant frames occupying memory.

[0023] In some preferred embodiments, after receiving the audio and video data length update signal, the statistical thread in the client respectively records the two time points before and after the reception, calculates the download rate within the receiving interval and writes it into the second memory variable B, and at the same time, the rate information of the download rate within the receiving interval is encapsulated and uploaded to the camera device through the P2P channel for the bandwidth policy adjustment decision of the camera device. It should be noted that compared with the static network status judgment method, this embodiment realizes accurate bandwidth evaluation by dynamically capturing the time and length of received data, which helps the device end to perform more detailed encoding parameter matching. At the same time, the policy linkage path between the client and the device end is opened through the upload mechanism to ensure that the encoding parameters are updated in time with the bandwidth changes, thereby improving the policy adaptation response speed.

[0024] In some preferred embodiments, the camera device presets a bandwidth level and encoding strategy correspondence table during the initialization phase, wherein each bandwidth level in the correspondence table corresponds to a set of encoding parameters, and the set of encoding parameters includes: GOP frame number, reference key frame number, frame rate, bit rate, image sharpness and cache frame number upper limit; after the device receives the download rate reported by the client through the bitstream adaptation thread, it matches the policy item closest to the rate in the table of the correspondence table as the current effective encoding strategy. It should be noted that in this embodiment, by presetting a multi-level bandwidth strategy and parameter table, the device can dynamically select encoding parameters according to the rate fed back by the client, avoiding the use of a fixed encoding mode, thereby providing a structured and scalable parameter management mechanism. Each parameter in the strategy (GOP, key frame, frame rate, bit rate, etc.) is a key factor affecting the encoding efficiency and image quality smoothness. By constructing a mapping relationship in advance, the efficiency of strategy selection is improved.

[0025] In some preferred embodiments, during the encoding parameter adjustment process, the camera device adjusts each parameter in sequence according to the following priority: first, extend the GOP length, then increase the number of reference key frames, then reduce the frame rate and bit rate, then reduce the image sharpness, and finally reduce the overall bit rate; through the priority strategy, the image quality is maintained to the maximum extent, and the smoothness of video playback is prioritized when the image quality cannot be maintained. It should be noted that in this embodiment, the bit rate can be minimized by giving priority to extending the GOP and increasing the number of reference frames, which are low-quality influencing measures; if it is still insufficient, the frame rate and image sharpness are further reduced, and finally the image quality is sacrificed in exchange for smoothness. This step-by-step concession mechanism enables the device to retain the image quality to the greatest extent while ensuring the smoothness of playback, avoiding severe blur or distortion of the video under weak networks, and is a systematic optimization of the video quality control dimension, thereby improving the intelligent perception and responsiveness of the system.

[0026] In some preferred embodiments, after encoding the audio and video data, the sending thread of the camera device encapsulates the bandwidth policy identifier used for encoding in the header of the streaming data packet. The streaming data packet includes a frame type tag, audio and video data, and a policy identifier field for the client playback thread to use to identify and match the corresponding policy item. It should be noted that in this embodiment, by embedding the current bandwidth policy identifier into the streaming media header, the client can parse the policy content in a decoupled manner and use it synchronously, no longer relying on the device notification mechanism, effectively reducing policy errors and communication overhead, thereby enhancing the accuracy and real-time nature of client policy execution, ensuring that the client playback logic is always consistent with the device encoding strategy, and improving the overall system collaboration efficiency.

[0027] In some preferred embodiments, after receiving the streaming media data packet, the playback thread of the client parses the policy identification field contained in the streaming media data packet, and compares it with the preset policy table to obtain the currently used policy item N, and accordingly calls the corresponding parameters in the cache queue management, frame removal mechanism and decoding process to improve the cache control accuracy and playback decoding efficiency. It should be noted that in this embodiment, by comparing the local preset table items, the client can immediately obtain the current policy parameters, guide the cache length judgment, P frame removal and decoding frame reorganization process, thereby improving the adaptability of the decoding link, and can still quickly adjust the cache mechanism and decoding rhythm when the network conditions suddenly change, prevent delay accumulation or screen distortion, and effectively improve the stability of video playback and decoding accuracy.

[0028] In some preferred embodiments, the sending thread of the camera device supports the simultaneous management of multiple P2P connections, each connection corresponds to an independent client session and a corresponding download rate recording and encoding strategy matching module, and different clients dynamically adapt to the optimal encoding strategy according to their network environment to achieve multi-user differentiated video fluency optimization. It should be noted that in this embodiment, by independently maintaining a strategy matching and rate recording module for each connection, the device can configure the optimal encoding parameters for each client according to the bandwidth status of the upload, avoiding the sacrifice of image quality or waste of resources under a unified encoding strategy, thereby improving the device's processing capability for concurrent access and improving the intelligent level of encoding resource allocation on the device side.

[0029] In some preferred embodiments, the client automatically starts the playback thread and the statistics thread according to the current access network type, monitors the download rate in real time, and automatically selects appropriate playback parameters through the local policy matching mechanism. It should be noted that the client can automatically trigger the playback and statistics threads according to the access network type (4G, wired, Wi-Fi), reducing the user's manual adjustment of network adaptation parameters. In this embodiment, the playback strategy is automatically adjusted according to environmental changes without user participation, achieving plug-and-play and seamless switching, while improving the playback continuity and startup speed in a weak network environment.

[0030] In some preferred embodiments, when the camera device starts the sending thread for the first time and has not yet received the client download rate, it uses the default strategy for encoding, and immediately matches and switches the strategy after receiving the download rate, and supports real-time update of the strategy to adapt to bandwidth fluctuations under the 4G network and improve real-time responsiveness. It should be noted that in this embodiment, by using the default strategy for initial encoding, it is ensured that the device can stably output video in a data-free state, and the strategy is adjusted immediately after receiving client feedback, so that the system has hot start capability, thereby avoiding long waiting time for the first connection or the occurrence of empty frame problems, improving the stability of the device's first connection, and enhancing the robustness of the device startup.

[0031] In some preferred embodiments, the bandwidth level and policy table support dynamic configuration and expansion, and the parameter value ranges in the policy item N include GOP of 25 to 80 frames, the number of reference key frames of 1 to 2, the frame rate of 20 to 30 frames per second, the bit rate of 256KB to 2048KB, the image sharpness of 5 to 10, and the number of cached frames of 3 to 10 frames, so as to meet the video encoding and playback requirements in different scenarios and different network conditions. It should be noted that in this embodiment, by supporting the dynamic addition and deletion of policy items and controlling the parameter interval, it can adapt to more complex application environments in the future (such as ultra-high definition, low-latency live broadcast, etc.), thereby improving the long-term adaptability and software upgrade capabilities of the system. Among them, the bandwidth levels may include 2048KB, 1536KB, 1024KB, 768KB, 512KB, 256KB, etc. Preferably, when the bandwidth level and policy table are dynamically configured, refer to Figure 2 When the bandwidth level is 2048KB, the GOP is 25 frames, the number of reference key frames is 1, the frame rate is 30 frames per second, the bit rate is 2048KB, the image sharpness is 10, and the number of cached frames is 3 frames; when the bandwidth level is 1536KB, the GOP is 25 frames, the number of reference key frames is 1, the frame rate is 25 frames per second, the bit rate is 1536KB, the image sharpness is 10, and the number of cached frames is 5 frames; when the bandwidth level is 1024KB, the GOP is 25 frames, the number of reference key frames is 1, the frame rate is 25 frames per second, the bit rate is 1024KB, the image sharpness is 10, and the number of cached frames is 5 frames. The number of frames is 5; when the bandwidth level is 768KB, the GOP is 40 frames, the number of reference key frames is 1, the frame rate is 25 frames per second, the bit rate is 768KB, the image sharpness is 8, and the number of cached frames is 8; when the bandwidth level is 512KB, the GOP is 40 frames, the number of reference key frames is 1, the frame rate is 25 frames per second, the bit rate is 512KB, the image sharpness is 8, and the number of cached frames is 8; when the bandwidth level is 256KB, the GOP is 80 frames, the number of reference key frames is 2, the frame rate is 20 frames per second, the bit rate is 256KB, the image sharpness is 5, and the number of cached frames is 8.

[0032] The above embodiments are only preferred specific implementation modes of the present invention, and the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by any technician familiar with the technical field within the technical scope disclosed by the present invention should be covered within the protection scope of the present invention. The protection scope of the present invention should be based on the protection scope of the claims.

Claims

1. A method for optimizing the real-time video fluency of 4G devices, characterized in that: The method for optimizing the real-time video fluency of a 4G device is applied to real-time video transmission between a camera device and a client connected via a mobile network, and includes: The client establishes a playback thread and a statistics thread. The playback thread connects to the camera device through the P2P protocol and requests real-time preview. It receives streaming data packets containing audio and video data and bandwidth policy identifiers. After parsing the data packets, it adds the audio and video data to the cache queue. At the same time, it parses the bandwidth policy identifier to select the corresponding local policy item N, and determines and manages the number of cached frames. If the number of cached frames exceeds the upper limit of the number of frames specified by the policy item, all P frames to I frames are deleted from the end of the queue to ensure delay control and smoothness. The statistics thread calculates the current download rate based on the length of the received audio and video data and the corresponding time interval, and uploads the current download rate to the camera device in real time through the P2P protocol; After receiving the download rate uploaded by the client, the camera device automatically matches and switches to the policy item N closest to the current rate based on the locally preset bandwidth level and encoding strategy table by the bitstream adaptation thread. The policy item N includes GOP length, number of reference key frames, frame rate, bit rate, image sharpness and upper limit of cached frames. The sending thread encodes the real-time audio and video using policy item N, and sends it to the client after packaging.

2. The method for optimizing the real-time video fluency of 4G devices according to claim 1, characterized in that: The client performs the following operations upon initialization: clears the current audio and video cache queue; initializes a first memory variable A for recording the accumulated audio and video data length to 0; initializes a second memory variable B for recording the current download rate to 0; and presets a set of local bandwidth levels and policy tables, wherein each policy item in the policy table corresponds to a bandwidth level and includes the number of GOP frames, the number of reference key frames, the frame rate, the bit rate, the image sharpness and the upper limit of the number of cache frames under the corresponding bandwidth level, which are used for subsequent matching with the bandwidth policy of the camera device and cache queue management.

3. The method for optimizing the real-time video fluency of 4G devices according to claim 1, characterized in that: In the playback thread, the client parses the received streaming media packet header, obtains the video frame type information and the bandwidth policy identifier used, and selects the corresponding policy item N by comparing the bandwidth policy identifier with the preset policy table item; if the number of audio and video frames in the current cache queue exceeds the maximum number of frames set in the policy item N, all P frames at the end of the queue are deleted until the end is an I frame, so as to ensure the subsequent decoding continuity and playback smoothness.

4. The method for optimizing the real-time video fluency of 4G devices according to claim 2, characterized in that: After receiving the audio and video data length update signal, the statistical thread in the client records the two time points before and after the reception, calculates the download rate within the receiving interval and writes it into the second memory variable B. At the same time, the rate information of the download rate within the receiving interval is encapsulated and uploaded to the camera device through the P2P channel for the bandwidth strategy adjustment decision of the camera device.

5. The method for optimizing the real-time video fluency of 4G devices according to claim 1, characterized in that: The camera device presets a bandwidth level and encoding strategy correspondence table in the initialization stage, each bandwidth level in the correspondence table corresponds to a set of encoding parameters, and the set of encoding parameters includes: GOP frame number, reference key frame number, frame rate, bit rate, image sharpness and cache frame number upper limit; after the device receives the download rate reported by the client through the bit stream adaptation thread, it matches the policy item closest to the rate in the table of the correspondence table as the currently effective encoding strategy.

6. The method for optimizing the real-time video fluency of 4G devices according to claim 1, characterized in that: During the encoding parameter adjustment process, the camera device adjusts the parameters in sequence according to the following priority: first, extend the GOP length, then increase the number of reference key frames, then reduce the frame rate and bit rate, then reduce the image sharpness, and finally reduce the overall bit rate; through the priority strategy, the image quality is maintained to the maximum extent, and the smoothness of video playback is prioritized when the image quality cannot be maintained.

7. The method for optimizing the real-time video fluency of 4G devices according to claim 1, characterized in that: After encoding the audio and video data, the sending thread of the camera device encapsulates the bandwidth policy identifier used for encoding in the header of the streaming data packet. The streaming data packet includes a frame type tag, audio and video data and a policy identifier field for the client playback thread to identify and match the corresponding policy item.

8. The method for optimizing the real-time video fluency of 4G devices according to claim 1, characterized in that: After receiving the streaming media data packet, the playback thread of the client parses the policy identification field contained in the streaming media data packet and compares it with the preset policy table to obtain the currently used policy item N, and accordingly calls corresponding parameters in the cache queue management, frame removal mechanism and decoding process to improve cache control accuracy and playback decoding efficiency.

9. The method for optimizing the real-time video fluency of 4G devices according to claim 1, characterized in that: The sending thread of the camera device supports the simultaneous management of multiple P2P connections. Each connection corresponds to an independent client session and a corresponding download rate record and encoding strategy matching module. Different clients dynamically adapt the optimal encoding strategy according to their network environment to achieve differentiated video fluency optimization for multiple users.

10. The method for optimizing the real-time video fluency of 4G devices according to claim 1, characterized in that: The client automatically starts the playback thread and the statistics thread according to the current access network type, monitors the download rate in real time, and automatically selects appropriate playback parameters through a local policy matching mechanism.

Citation Information

Patent Citations

  • Video transition method, video concentration method and electronic equipment

    CN118555422A

  • Method for wirelessly transmitting content from a source device to a sink device

    US20150179130A1