A method for optimizing the real-time video smoothness of 4G devices

Through the collaborative work between the client and the device, the video encoding parameters of 4G devices are monitored and adjusted in real time, and the problem of video lag in the 4G environment is solved, and the video fluency optimization that automatically adapts to network changes is achieved, improving the user experience.

CN120017903BActive Publication Date: 2025-06-13SHENZHEN XINRUISHI TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510466136.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-04-15
Publication Date
2025-06-13
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 automatic optimization of real-time video fluency of 4G devices without user intervention, solves the problem of playback lag caused by insufficient network bandwidth, and improves the user's viewing experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120017903B_ABST
    Figure CN120017903B_ABST
Patent Text Reader

Abstract

The present invention relates to the technical fields of 4G network access, camera devices, etc., and provides a method for optimizing the real-time video smoothness of 4G devices. By collaborating between the client and the device side, a real-time bandwidth detection and dynamic matching mechanism of encoding parameters is constructed. Compared with the prior art that relies on users to manually switch the clarity, the method for optimizing the real-time video smoothness of 4G devices uses the statistical thread of the client to monitor the download rate in real time and upload the bandwidth information to the device side; the device side automatically selects appropriate encoding parameters according to the preset encoding strategy table to adapt to the current network bandwidth. This process does not require user intervention and realizes fully automatic and adaptive adjustment of picture quality and bit rate, thereby solving the problem of playback jamming caused by insufficient network bandwidth in the 4G environment and improving the user viewing experience.
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 devices, etc., and particularly relates to a method for optimizing the real-time video smoothness of 4G devices. Background Art

[0002] When a user connects a mobile phone APP to a camera device, if the device uses a wired network, smooth playback can be achieved when the network is normal. However, when the device uses a 4G card to connect to the network, since the amount of video data per second is higher than the network transmission bandwidth, it will cause the video played on the user's mobile phone APP to freeze. Usually, when users encounter freezing, they will manually select a low-definition mode to relieve the freezing problem, or manually select a low-resolution bitrate to relieve the freezing problem. Whether manually selecting a low-definition mode or selecting low-resolution playback, it requires manual operation by the user; when the device switches to a wired network, or when the 4G network signal strength and bandwidth increase, the user needs 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 smoothness of 4G devices mainly relies on manual selection by the user. When playing the video of a 4G camera device 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 for improving the real-time video smoothness of 4G devices mainly relies on manual selection by the user. When playing the video of a 4G camera device in real time, the prior art cannot automatically adapt to the device network or bandwidth, resulting in a reduced user experience of the device. Summary of the Invention

[0004] Aiming at the deficiencies of the above prior art, the present invention provides a method for optimizing the real-time video smoothness of 4G devices, so as to automatically adapt to the device network or bandwidth when playing the video of a 4G camera device in real time and improve the user experience of the device.

[0005] The method for optimizing the real-time video smoothness of 4G devices provided by the present invention is applied to the real-time video transmission between a camera device connected through a mobile network and a client, and includes:

[0006] 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, receives streaming media data packets containing audio and video data and bandwidth policy identifiers, adds the audio and video data to the cache queue after parsing the data packets, and at the same time parses the bandwidth policy identifiers 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 frame number limit defined by the policy item, all P frames to I frames are deleted from the end of the queue to ensure delay control and smoothness;

[0007] The statistics thread calculates the current download rate based on the length of the received audio-visual data and the corresponding time interval, and uploads the current download rate to the camera device in real time through the P2P protocol;

[0008] 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 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 cache frame number; the sending thread encodes the real-time audio-visual data using the policy item N, and sends it to the client after encapsulation.

[0009] Further, when initializing, the client performs the following operations: clears the current audio-visual cache queue; initializes the first memory variable A for recording the cumulative length of audio-visual data to 0; initializes the second memory variable B for recording 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 includes the GOP frame number, number of reference key frames, frame rate, bit rate, image sharpness, and upper limit of cache frame number under the corresponding bandwidth level, which is used for subsequent matching with the camera device bandwidth policy and cache queue management.

[0010] Further, in the play thread of the client, it parses the received streaming media packet header, obtains the video frame type information and the used bandwidth policy identifier, selects the corresponding policy item N by comparing the bandwidth policy identifier with the preset policy table items; if the number of audio-visual frames in the current cache queue exceeds the maximum number of frames set in the policy item N, delete all P frames at the end of the queue until the end is an I frame to ensure subsequent decoding continuity and smooth playback.

[0011] Further, after receiving the audio-visual data length update signal, the statistics thread in the client records two time points before and after receiving respectively, calculates the download rate within the receiving interval and writes it into the second memory variable B, and at the same time encapsulates and uploads the rate information of the download rate within the receiving interval to the camera device through the P2P channel for the bandwidth policy adjustment decision of the camera device.

[0012] Further, during the initialization phase, the camera device presets a corresponding table of bandwidth levels and encoding policies. Each bandwidth level in the corresponding table corresponds to a set of encoding parameters. The set of encoding parameters includes: GOP frame number, number of reference key frames, frame rate, bit rate, image sharpness, and upper limit of cache frame number; after receiving the download rate reported by the client through the bitstream adaptation thread, the device matches the policy item closest to the rate in the table of the corresponding table as the currently effective encoding policy.

[0013] Furthermore, during the encoding parameter adjustment process, the camera device adjusts each parameter in the following priority order: first, extend the GOP length; second, increase the number of reference key frames; then, reduce the frame rate and bit rate; next, reduce the image sharpness; and finally, reduce the overall bit rate. Through the above priority strategy, the image quality is maximally maintained, and the video playback smoothness is preferentially ensured when the image quality cannot be maintained.

[0014] 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 packet header of the streaming media data packet. The streaming media data packet includes a frame type flag, audio and video data, and a policy identifier field, which are used by the client playback thread to identify and match the corresponding policy items.

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

[0016] Furthermore, the sending thread of the camera device supports managing multiple P2P connections simultaneously. Each connection corresponds to an independent client session, a corresponding download rate record, and an encoding policy matching module. Different clients dynamically adapt to the optimal encoding policy according to their network environments, realizing the optimization of multi-user differential video smoothness.

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

[0018] Compared with the prior art, the beneficial effects of the present invention are as follows:

[0019] The present invention provides a method for optimizing the real-time video fluency of 4G devices. In this method, 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, receives streaming media data packets containing audio and video data and bandwidth policy identifiers, adds the audio and video data to the cache queue after parsing the data packets, and at the same time parses the bandwidth policy identifiers 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 frame number limit defined by the policy item, all P frames from the end of the queue are deleted until the I frame 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 in real time through the P2P protocol; after receiving the download rate uploaded by the client, the camera device, by the bitstream adaptation thread, automatically matches and switches to the policy item N closest to the current rate according to the locally preset bandwidth level and coding policy table, and the policy item N includes GOP length, number of reference key frames, frame rate, bit rate, image sharpness, and cache frame number limit; the sending thread encodes the real-time audio and video using the policy item N, encapsulates it, and sends it to the client. This method requires no user intervention and realizes full-automatic and adaptive adjustment of image quality and bit rate, thus solving the problem of playback jitter caused by insufficient network bandwidth in the 4G environment and improving the user viewing experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of the present invention. The schematic embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation to the present invention. Some specific embodiments of the present invention will be described in detail hereinafter with reference to the drawings in an exemplary rather than restrictive manner. The same reference numerals in the drawings denote the same or similar components or parts. Those skilled in the art should understand that these drawings are not necessarily drawn to scale. In the drawings:

[0021] Figure 1 is a schematic flow chart of the method for optimizing the real-time video fluency of 4G devices in an embodiment of the present invention;

[0022] Figure 2 is a schematic state diagram when the bandwidth level and policy table are dynamically configured in an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0023] In order to enable those skilled in the art to better understand the solution of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

[0024] See Figure 1 - Figure 2 Figure 1 - Figure 2 , an 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 the 4G device is applied to the real-time video transmission between a camera device connected through a mobile network and a client, and includes the following steps:

[0025] S101. The client establishes a playback thread and a statistical thread. The playback thread connects to the camera device through the P2P protocol and requests real-time preview, receives streaming media data packets containing audio and video data and bandwidth policy identifiers, adds the audio and video data to the cache queue after parsing the data packets, and at the same time parses the bandwidth policy identifiers 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 frame number limit defined by the policy item, all P frames from the end of the queue are deleted until the I frame to ensure latency control and fluency; among them, the I frame refers to the key frame or self-encoded frame. The I frame does not depend on other frames and can be decoded independently. It is the anchor point for playback or fast-forward jump. The P frame refers to the predicted frame. The P frame only records the changes from the previous frame and needs to depend on the previous I frame or P frame for decoding.

[0026] S102. The statistical 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;

[0027] S103. 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 by the bitstream adaptation thread according to the locally preset bandwidth level and encoding policy table. The policy item N includes GOP length, number of reference key frames, frame rate, bit rate, image sharpness, and upper limit of the number of cached frames; the sending thread uses the policy item N to encode the real-time audio and video, and after encapsulation, sends it to the client. Among them, the policy item N refers to a set of bandwidth and encoding control parameters used by the camera device to encode and send real-time audio and video data.

[0028] It should be noted that in this embodiment, the method for optimizing the real-time video fluency of the 4G device collaborates between the client and the device side to construct a real-time bandwidth detection and dynamic matching mechanism for encoding parameters. Compared with the prior art that relies on users to manually switch the clarity, the method for optimizing the real-time video fluency of the 4G device uses the statistical thread of the client to monitor the download rate in real time and uploads the bandwidth information to the device side; the device side automatically selects appropriate encoding parameters according to the preset encoding policy table to adapt to the current network bandwidth. This process does not require user intervention, realizes fully automatic and adaptive adjustment of image quality and bit rate, thereby solving the problem of playback jitter caused by insufficient network bandwidth in the 4G environment and improving the user viewing experience.

[0029] 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.

[0030] 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.

[0031] 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.

[0032] 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.

[0033] 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.

[0034] 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.

[0035] In some preferred embodiments, after receiving the streaming media data packet, the playback thread of the client parses the policy identification field included in the streaming media data packet, compares it with a preset policy table, obtains the current usage policy item N, and accordingly calls corresponding parameters in the cache queue management, frame culling mechanism, and decoding process, so as to improve the cache control accuracy and playback decoding efficiency. It should be noted that in this embodiment, by comparing the local preset table entries, the client can immediately obtain the current policy parameters, guide the cache length judgment, P-frame culling, and decoded frame recombination processes, thereby improving the adaptation ability of the decoding link. Even when the network conditions change suddenly, it can still quickly adjust the cache mechanism and decoding rhythm, prevent delay accumulation or screen freeze phenomena, and can effectively improve the video playback stability and decoding accuracy.

[0036] In some preferred embodiments, the sending thread of the camera device supports managing multiple P2P connections simultaneously. Each connection corresponds to an independent client session, a corresponding download rate record, and an encoding policy matching module. Different clients dynamically adapt to the optimal encoding policy according to their network environments, realizing the optimization of multi-user differential video smoothness. It should be noted that in this embodiment, by independently maintaining the policy matching and rate record modules for each connection, the device can configure the optimal encoding parameters for each client according to the bandwidth status uploaded by different clients, avoiding image quality sacrifice or resource waste under a unified encoding policy, thereby improving the device's processing ability for concurrent access and enhancing the intelligent level of encoding resource allocation on the device side.

[0037] In some preferred embodiments, the client automatically starts the playback thread and the statistics thread according to the current access network type, and real-time monitors the download rate, 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 need for users to manually adjust network adaptation parameters. In this embodiment, the playback policy is automatically adjusted according to environmental changes without user participation, realizing plug-and-play and seamless switching, and at the same time improving the playback continuity and startup speed in a weak network environment.

[0038] In some preferred embodiments, when the camera device starts the sending thread for the first time and has not received the client download rate, it uses the default policy for encoding. When the download rate is received, it immediately performs policy matching and switching, and supports real-time update of the policy to adapt to the bandwidth fluctuations in the 4G network and improve the real-time responsiveness. It should be noted that in this embodiment, by using the default policy for initial encoding, it is ensured that the device can stably output video in a data-free state. After receiving the client feedback, the policy is immediately adjusted, enabling the system to have the hot start ability, thereby avoiding long waiting times for the first connection or the problem of empty frames, improving the stability of the first connection of the device, and enhancing the robustness of the device startup.

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

[0040] The above embodiments are only preferred specific embodiments 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 those skilled in the art within the technical scope disclosed by the present invention should be covered by the protection scope of the present invention. The protection scope of the present invention should be subject to 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