Video outflow method, system, camera and computer device
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHENZHEN JOOAN TECH CO LTD
- Filing Date
- 2026-07-03
- Publication Date
- 2026-08-04
AI Technical Summary
以IPC摄像头为例,由于其第二编码流的关键帧数据量较大,在弱网环境下传输耗时较长,导致客户端需要等待数秒甚至更长时间才能显示首帧画面,用户体验较差
[0030] The video streaming method, system, camera, and computer device of this application configure at least two encoded streams and respond to user requests for video streams with high video encoding parameter values corresponding to the second encoded stream. First, a key frame with a small data volume is sent with the first encoded stream, enabling the client to quickly decode and display the first frame in a weak network environment, thereby significantly shortening the first frame output time. At the same time, by monitoring network transmission quality and switching to the second encoded stream when preset conditions are met, the image quality is improved while ensuring fast image output, achieving a dynamic balance between image quality and network adaptability. It also avoids the power waste caused by stuttering, frame dropping, and repeated retries due to blindly pushing high bitrates, and has good compatibility and deployment convenience.
Smart Images

Figure CN122513604A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of video transmission technology, and in particular to a video outflow method, system, camera, and computer device. Background Technology
[0002] In the field of video transmission, video source devices (such as IPC cameras) are widely used in security monitoring, video doorbells, and other scenarios. Users establish a real-time video connection with the video source device through a client to view the live feed.
[0003] In existing transmission schemes, the following approach is typically used: when a user selects a high resolution, the video stream is directly encoded and pushed at that resolution. Taking an IPC camera as an example, because the keyframe data volume of its second encoded stream is large, the transmission time is long in weak network environments, causing the client to wait for several seconds or even longer to display the first frame, resulting in a poor user experience. Summary of the Invention
[0004] Therefore, it is necessary to provide a video streaming method, system, camera, and computer device to address the aforementioned technical problems.
[0005] A video outgoing method, the method comprising:
[0006] Configure at least two encoded streams, the at least two encoded streams including a first encoded stream and a second encoded stream, wherein at least one video encoding parameter value of the first encoded stream is lower than the corresponding video encoding parameter value of the second encoded stream, and the video encoding parameters include resolution and bitrate;
[0007] Receive a video stream request, the video stream request indicating a desired target video encoding parameter value, and the target video encoding parameter value being the video encoding parameter value of the second encoded stream;
[0008] In response to the video stream request, a first video stream is sent to the client using the first encoded stream until it is determined that the current network transmission quality meets preset conditions, and a second video stream is sent to the client using the second encoded stream.
[0009] Specifically, the client decodes and outputs the first displayable video frame based on the first keyframe of the first video stream, and the client decodes and outputs the displayable video frame corresponding to the target video encoding parameter value based on the second keyframe of the second video stream. The preset condition is that the current network transmission quality meets the condition of supporting the transmission of the second keyframe of the second video stream.
[0010] In another embodiment, it further includes: in response to the video stream request, sending a first video stream to the client in the first preset detection window using the first encoded stream;
[0011] When the first preset detection window ends and the current network transmission quality meets the preset conditions, the second video stream is sent to the client using the second encoded stream.
[0012] In another embodiment, after switching to the second encoded stream to send the video stream, the method further includes:
[0013] If the second preset detection window ends and the network transmission quality does not meet the conditions for maintaining the transmission of the second encoded stream, the system switches to the first encoded stream to send the video stream.
[0014] In another embodiment, it further includes:
[0015] If the first preset detection window ends and the current network transmission quality does not meet the preset conditions, the first video stream will continue to be sent to the client using the first encoded stream.
[0016] In another embodiment, while maintaining the transmission of video streams to the client using the first encoded stream, a message indicating insufficient network transmission quality is sent to the client.
[0017] In another embodiment, after the client decodes and outputs the first displayable video frame based on the first keyframe of the first video stream, it further includes:
[0018] Obtain network monitoring data, including packet loss rate and available bandwidth;
[0019] Based on the network monitoring data, the current network transmission quality is determined.
[0020] A video outgoing system, the system comprising:
[0021] An encoding module is used to configure at least two encoded streams, the at least two encoded streams including a first encoded stream and a second encoded stream, wherein at least one video encoding parameter value of the first encoded stream is lower than the corresponding video encoding parameter value of the second encoded stream, and the video encoding parameters include resolution and bitrate;
[0022] The instruction receiving module is used to receive a video stream request, wherein the video stream request indicates a desired target video encoding parameter value, and the target video encoding parameter value is the video encoding parameter value of the second encoded stream;
[0023] The output module is configured to respond to the video stream request by sending a first video stream to the client using the first encoded stream, and then sending a second video stream to the client using the second encoded stream when it is determined that the current network transmission quality meets preset conditions.
[0024] Specifically, the client decodes and outputs the first displayable video frame based on the first keyframe of the first video stream, and the client decodes and outputs the displayable video frame corresponding to the target video encoding parameter value based on the second keyframe of the second video stream. The preset condition is that the current network transmission quality meets the condition of supporting the transmission of the second keyframe of the second video stream.
[0025] In another embodiment, it further includes:
[0026] The network monitoring module is used to obtain network monitoring data, including packet loss rate and available bandwidth.
[0027] Based on the network monitoring data within the preset detection window, the current network transmission quality is determined.
[0028] A camera, comprising the video output system described in any of the above embodiments.
[0029] A computer device includes a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the video outgoing method described in any of the above embodiments.
[0030] The video streaming method, system, camera, and computer device of this application configure at least two encoded streams and respond to user requests for video streams with high video encoding parameter values corresponding to the second encoded stream. First, a key frame with a small data volume is sent with the first encoded stream, enabling the client to quickly decode and display the first frame in a weak network environment, thereby significantly shortening the first frame output time. At the same time, by monitoring network transmission quality and switching to the second encoded stream when preset conditions are met, the image quality is improved while ensuring fast image output, achieving a dynamic balance between image quality and network adaptability. It also avoids the power waste caused by stuttering, frame dropping, and repeated retries due to blindly pushing high bitrates, and has good compatibility and deployment convenience. Attached Figure Description
[0031] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0032] Figure 1 This is a flowchart illustrating a video outgoing method in one embodiment;
[0033] Figure 2 This is a flowchart illustrating the video outgoing method in another embodiment;
[0034] Figure 3 This is a schematic diagram of the module connections of a video outgoing system in one embodiment;
[0035] Figure 4 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0036] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0037] It should be noted that the terms "first," "second," etc., used in this application can be used to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish between the first concept and the second concept. The terms "comprising" and "having," and any variations thereof, used in this application, are intended to cover non-exclusive inclusion. The term "multiple" used in this application refers to two or more. The term "and / or" used in this application refers to one of the embodiments, or any combination of multiple embodiments.
[0038] This application proposes a video outflow method, such as... Figure 1 As shown, it includes steps 101, 102 and 103.
[0039] Step 101: Configure at least two encoded streams, the at least two encoded streams including a first encoded stream and a second encoded stream, wherein at least one video encoding parameter value of the first encoded stream is lower than the corresponding video encoding parameter value of the second encoded stream, and the video encoding parameters include resolution and bitrate.
[0040] In some embodiments, the resolution of the first encoded stream can be 640×360, and the bitrate can be 200-500kbps; the resolution of the second encoded stream can be 1920×1080 or 2560×1440, and the bitrate can be 1-4Mbps. In this case, the resolution and bitrate of the first encoded stream are both lower than those of the second encoded stream.
[0041] In other embodiments, the first and second encoded streams may also use the same resolution, differing only in bitrate. For example, both the first and second encoded streams may have a resolution of 1920×1080, but the bitrate of the first encoded stream may be 200-500kbps, while the bitrate of the second encoded stream may be 2-4Mbps. In this example, although the two encoded streams have the same resolution, because the bitrate of the first encoded stream is lower, the data size of its keyframes will be smaller than that of the keyframes in the second encoded stream, thus reducing the time required for the client to receive and decode the first frame.
[0042] Step 102: Receive a video stream request, wherein the video stream request indicates the desired target video encoding parameter value, and the target video encoding parameter value is the video encoding parameter value of the second encoded stream.
[0043] In some embodiments, the video stream request originates from a user who, through a client such as a mobile app or web application, selects desired target video encoding parameter values and triggers the video stream request. For example, the target video encoding parameter values might include a resolution of 1920×1080 and a bitrate of 2Mbps, corresponding to the video encoding parameter values of a second encoded stream. The client then sends the video stream request to the camera, which performs the next step.
[0044] Step 103: In response to the video stream request, send a first video stream to the client using the first encoded stream, until it is determined that the current network transmission quality meets the preset conditions, then send a second video stream to the client using the second encoded stream.
[0045] Specifically, the client decodes and outputs the first displayable video frame based on the first keyframe of the first video stream, and the client decodes and outputs the displayable video frame corresponding to the target video encoding parameter value based on the second keyframe of the second video stream. The preset condition is that the current network transmission quality meets the condition of supporting the transmission of the second keyframe of the second video stream.
[0046] At a resolution of 640×360 and a bitrate of 200-500kbps, the data size of a keyframe is between 5-20kB. Since the data size of the first keyframe in the first encoded stream is smaller than that of the second keyframe in the second encoded stream, the time required for the client to receive and decode the first frame is shorter, resulting in a faster client response time. Within a short period after a user sends a video stream request, the client can obtain the first displayable video frame decoded and output based on the first keyframe of the first video stream.
[0047] If the network transmission quality meets the preset conditions, such as the data transmission rate being sufficient to support the key frame transmission of the second video stream within a certain time, the camera switches to the second encoded stream and sends the second video stream to the client. The client decodes the key frames of the second encoded stream and outputs the displayable video image with the corresponding target video encoding parameter values, thereby providing a higher quality image.
[0048] This embodiment configures at least two encoded streams and responds to user requests for video streams with high video encoding parameter values corresponding to the second encoded stream. It first sends keyframes with a smaller data volume using the first encoded stream, enabling the client to quickly decode and display the first frame in a weak network environment. This reduces the first frame output time from 2-5 seconds to within 0.3-0.8 seconds. Simultaneously, by monitoring network transmission quality and switching to the second encoded stream when preset conditions are met, it improves image quality while ensuring fast output, achieving a dynamic balance between image quality and network adaptability. It also avoids power waste caused by stuttering, frame drops, and repeated retries due to blindly pushing high bitrates, exhibiting good compatibility and ease of deployment.
[0049] In another embodiment, step 103 includes:
[0050] In response to the video stream request, a first video stream is sent to the client in the first preset detection window using the first encoded stream.
[0051] Upon receiving a video stream request, the camera immediately begins sending the video stream to the client using the first encoded stream, and the start time of this transmission process is used as the start time of a preset detection window. Within this preset detection window, the camera continuously sends the video stream using the first encoded stream, allowing the client to quickly receive and decode the first keyframe for display.
[0052] When the first preset detection window ends and the current network transmission quality meets the preset conditions, the second video stream is sent to the client using the second encoded stream.
[0053] When the first preset detection window ends and the current network transmission quality meets preset conditions (such as the data transmission rate being sufficient to support the keyframe transmission of the second encoded stream), the camera sends a second video stream to the client in the second encoded stream to provide the user with a second video stream with higher image quality and / or higher bit rate.
[0054] This embodiment sets up a detection window, judges the network transmission quality within the detection window, and decides whether to switch to the second encoding stream based on the judgment result of the network transmission after the window ends. This can avoid stuttering caused by switching too early or delay in image quality improvement caused by switching too late.
[0055] In another embodiment, after switching to the second encoded stream to send the video stream, the method further includes:
[0056] If the second preset detection window ends and the network transmission quality does not meet the conditions for maintaining the transmission of the second encoded stream, switch to the first encoded stream to send the first video stream.
[0057] After switching to the second encoded video stream, a second preset detection window is set up. Within this window, the camera continuously monitors the network transmission quality. At the end of the second preset detection window, if the current network transmission quality is poor, such as if the data transmission rate is insufficient to transmit video frames from the second encoded stream, the camera retransmits the first video stream to the client using the first encoded stream to avoid stuttering and ensure smooth video transmission.
[0058] This embodiment, by setting up another detection window, can continuously check the network transmission quality while the camera is transmitting video streams at higher resolution and / or higher bitrate, so as to achieve rapid switching of video streams in the event of network fluctuations or reduced bandwidth usage, thereby improving the user experience.
[0059] In another embodiment, the method further includes:
[0060] If the first preset detection window ends and the current network transmission quality does not meet the preset conditions, the first video stream will continue to be sent to the client using the first encoded stream.
[0061] When the first preset detection window ends and the current network transmission quality does not meet preset conditions (e.g., the data transmission rate is insufficient to support the transmission of keyframes in the second encoded stream), the camera continues to send the first video stream to the client using the first encoded stream. Under poor network transmission quality conditions, forcibly switching to the second encoded stream to send the second video stream to the client would cause difficulties for the client in receiving the keyframes of the larger second encoded stream, resulting in transmission stuttering. Therefore, maintaining the first video stream sent to the client using the first encoded stream when the network transmission quality does not meet preset conditions ensures smooth video playback.
[0062] This embodiment maintains the transmission of the first video stream to the client using the first encoded stream even when the network transmission quality is confirmed to be poor at the end of the first preset detection window. This ensures the continuity of video transmission under different network transmission quality conditions, avoids stuttering, and improves the user experience.
[0063] In another embodiment, the method further includes:
[0064] While maintaining the transmission of the first video stream to the client using the first encoded stream, a message indicating insufficient network transmission quality is sent to the client.
[0065] When the first preset detection window ends and the current network transmission quality does not meet the preset conditions, the camera continues to send the first video stream to the client using the first encoded stream. In this case, the camera also sends a network transmission quality insufficiency warning to the client via the signaling channel. This warning informs the user that the current network conditions cannot support stable transmission of high-resolution video streams. For example, the warning could be a text message such as "The current network transmission quality is poor; it is recommended to reduce the resolution," or a yellow or red network symbol displayed on the client's user interface. After receiving this warning, the user can choose to maintain the current viewing resolution, manually reduce the requested resolution, or wait for the network to improve before attempting to switch to a higher resolution again, depending on their network conditions.
[0066] This embodiment sends a prompt message to the client when the network transmission quality is insufficient, enabling users to understand the current network status and the reason for the image quality limitation in real time, and to take corresponding actions accordingly, thereby improving the interactivity and user experience of the system in weak network environments.
[0067] In another embodiment, such as Figure 2 As shown, the method also includes steps 201 and 202.
[0068] Step 201: Obtain network monitoring data, which includes packet loss rate and available bandwidth.
[0069] The camera can obtain network monitoring data by receiving feedback from the client. This network monitoring data includes packet loss rate and available bandwidth. Packet loss rate refers to the proportion of data packets not received by the client within a certain period of time, relative to the total number of data packets sent by the camera. A higher packet loss rate indicates poorer network transmission stability and reliability. Available bandwidth refers to the maximum data transmission rate that the network can support within a certain period of time, which can be obtained by dividing the total amount of data actually received by the duration. Higher available bandwidth indicates that the network can support higher resolution and / or higher bitrate video stream transmission.
[0070] Step 202: Based on the network monitoring data, determine the current network transmission quality.
[0071] Optionally, a threshold can be set for the packet loss rate. For example, a packet loss rate higher than 10% is considered high. Similarly, a threshold can be set for the available bandwidth. For example, available bandwidth below 100kbps is considered low. The judgment of network transmission quality can be based on the simultaneous satisfaction of both a high packet loss rate and low available bandwidth, indicating that the network transmission quality does not meet the preset conditions, i.e., the switch to the second encoding stream cannot be made. Alternatively, either a high packet loss rate or low available bandwidth is sufficient to determine that the network transmission quality does not meet the preset conditions. This embodiment does not impose any limitations on this.
[0072] This embodiment simultaneously obtains packet loss rate and available bandwidth, and comprehensively judges network transmission quality based on data within a preset detection window. It can assess network conditions from the perspectives of stability and transmission rate. Compared with judgment based on a single indicator, it improves the accuracy and reliability of switching decisions and avoids stuttering or delays in image quality improvement caused by misjudgment.
[0073] It is understood that, in addition to packet loss rate and bandwidth, those skilled in the art can also judge network transmission quality through other parameters, such as round-trip time (RTT). The above parameters are merely illustrative examples, and this application is not limited thereto. Any parameter that can reflect network transmission quality can be applied to the technical solution of this application, and can be flexibly selected and combined according to the actual application scenario.
[0074] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages in other steps. It is understood that the steps in different embodiments can be freely combined as needed, and all non-contradictory solutions formed by such combinations are within the scope of protection of this application.
[0075] Based on the same inventive concept, this application also provides a video outflow system for implementing the video outflow method described above. The solution provided by this system is similar to the implementation described in the above method; therefore, the specific limitations in one or more video outflow system embodiments provided below can be found in the limitations of the video outflow method described above, and will not be repeated here.
[0076] In one exemplary embodiment, such as Figure 3 As shown, a video output system is provided, including: an encoding module 301, an instruction receiving module 302, and an output module 303.
[0077] The encoding module 301 is used to configure at least two encoding streams, the at least two encoding streams including a first encoding stream and a second encoding stream, wherein at least one video encoding parameter value of the first encoding stream is lower than the corresponding video encoding parameter value of the second encoding stream, and the video encoding parameters include resolution and bitrate.
[0078] The instruction receiving module 302 is used to receive a video stream request, wherein the video stream request indicates a desired target video encoding parameter value, and the target video encoding parameter value is the video encoding parameter value of the second encoded stream.
[0079] Output module 303 is used to respond to the video stream request by sending a first video stream to the client using the first encoded stream, and then sending a second video stream to the client using the second encoded stream when the current network transmission quality meets preset conditions;
[0080] Specifically, the client decodes and outputs the first displayable video frame based on the first keyframe of the first video stream, and the client decodes and outputs the displayable video frame corresponding to the target video encoding parameter value based on the second keyframe of the second video stream. The preset condition is that the current network transmission quality meets the condition of supporting the transmission of the second keyframe of the second video stream.
[0081] As an optional embodiment, when the instruction receiving module 302 receives a video stream request for 1080p resolution video sent by a user through a client, the encoding module 301 provides a first encoded stream (e.g., resolution 640×360, bitrate 200-500kbps) and a second encoded stream (e.g., resolution 1920×1080, bitrate 1-4Mbps). In response to this request, the output module 303 first obtains the first encoded stream from the encoding module 301 and sends the first video stream to the client using the first encoded stream, with the first frame being a keyframe. During the transmission of the first video stream, the system continuously monitors the current network transmission quality. When it determines that the current network transmission quality meets preset conditions, the output module 303 switches to obtaining the second encoded stream from the encoding module and sends the second video stream to the client using the second encoded stream. Thus, the client can first decode and display the first frame based on the first video stream for rapid image output, and then decode and display the high-resolution image based on the second video stream, achieving improved image quality.
[0082] This embodiment configures at least two encoded streams through an encoding module. The instruction receiving module receives user requests for a high-resolution video stream corresponding to the second encoded stream. The output module first sends the video stream using the first encoded stream, enabling the client to quickly receive and display the first frame, achieving instant playback even in weak network environments. Once the network transmission quality meets preset conditions, it switches to the second encoded stream, improving image quality. Furthermore, through a modular system architecture design, encoding configuration, instruction receiving, and stream output are handled by different modules, facilitating system maintenance and expansion.
[0083] In another embodiment, the video outgoing system further includes:
[0084] The network monitoring module is used to obtain network monitoring data, including packet loss rate and available bandwidth, and to determine the current network transmission quality based on the network monitoring data within the preset detection window.
[0085] Each module in the aforementioned video streaming system can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of a computer device in hardware form or independent of it, or stored in the memory of the computer device in software form, so that the processor can call and execute the corresponding operations of each module.
[0086] This application also proposes a camera that includes the video outflow system described in any of the above embodiments.
[0087] In some embodiments, the camera can be a network camera (IP camera, IPC), such as a security surveillance camera, a video doorbell, a smart baby monitor, etc. The camera includes an image sensor, an image processing chip, and a network communication module. The image processing chip or processor integrates the encoding module, instruction receiving module, and output module of the aforementioned video streaming system. Its specific functional implementation can be referred to in any of the foregoing embodiments for the video streaming method, and will not be repeated here.
[0088] In one exemplary embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 4As shown, the computer device includes a processor, memory, input / output interfaces, a communication interface, a display unit, and an input device. The processor, memory, and input / output interfaces are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interfaces. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The input / output interfaces are used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, Near Field Communication (NFC), or other technologies. When the computer program is executed by the processor, it implements a video streaming method. The display unit is used to form a visually visible image and can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of the computer device can be a touch layer covering the display screen, or buttons, trackballs, or touchpads set on the casing of the computer device, or external keyboards, touchpads, or mice, etc.
[0089] Those skilled in the art will understand that Figure 4 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0090] In one exemplary embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the method described above.
[0091] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the above-described method.
[0092] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the methods described above.
[0093] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.
[0094] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0095] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A method for video streaming, the method comprising: The method includes: Configure at least two encoded streams, the at least two encoded streams including a first encoded stream and a second encoded stream, wherein at least one video encoding parameter value of the first encoded stream is lower than the corresponding video encoding parameter value of the second encoded stream, and the video encoding parameters include resolution and bitrate; Receive a video stream request, the video stream request indicating a desired target video encoding parameter value, and the target video encoding parameter value being the video encoding parameter value of the second encoded stream; In response to the video stream request, a first video stream is sent to the client using the first encoded stream until it is determined that the current network transmission quality meets preset conditions, and a second video stream is sent to the client using the second encoded stream. Specifically, the client decodes and outputs the first displayable video frame based on the first keyframe of the first video stream, and the client decodes and outputs the displayable video frame corresponding to the target video encoding parameter value based on the second keyframe of the second video stream. The preset condition is that the current network transmission quality meets the condition of supporting the transmission of the second keyframe of the second video stream.
2. The method of claim 1, wherein, The step of sending a first video stream to the client with the first encoded stream in response to the video stream request, until it is determined that the current network transmission quality meets the preset conditions, and then sending a second video stream to the client with the second encoded stream, includes: sending a first video stream to the client with the first encoded stream in response to the video stream request within a first preset detection window; When the first preset detection window ends and the current network transmission quality meets the preset conditions, the second video stream is sent to the client using the second encoded stream.
3. The method of claim 2, wherein, After sending the second video stream to the client using the second encoded stream, the method further includes: When the second preset network transmission quality detection window ends and the network transmission quality does not meet the conditions for maintaining the transmission of the second encoded stream, the system switches to the first encoded stream to send the video stream.
4. The method of claim 2, wherein, Also includes: If the first preset detection window ends and the current network transmission quality does not meet the preset conditions, the first video stream will continue to be sent to the client using the first encoded stream.
5. The method of claim 4, wherein, While maintaining the transmission of video stream to the client using the first encoded stream, a message indicating insufficient network transmission quality is sent to the client.
6. The method of claim 1, wherein, Also includes: Obtain network monitoring data, including packet loss rate and available bandwidth; Based on the network monitoring data, the current network transmission quality is determined.
7. A video streaming system, characterized by, The system includes: An encoding module is used to configure at least two encoded streams, the at least two encoded streams including a first encoded stream and a second encoded stream, wherein at least one video encoding parameter value of the first encoded stream is lower than the corresponding video encoding parameter value of the second encoded stream, and the video encoding parameters include resolution and bitrate; The instruction receiving module is used to receive a video stream request, wherein the video stream request indicates a desired target video encoding parameter value, and the target video encoding parameter value is the video encoding parameter value of the second encoded stream; The output module is configured to respond to the video stream request by sending a first video stream to the client using the first encoded stream, and then sending a second video stream to the client using the second encoded stream when it is determined that the current network transmission quality meets preset conditions. Specifically, the client decodes and outputs the first displayable video frame based on the first keyframe of the first video stream, and the client decodes and outputs the displayable video frame corresponding to the target video encoding parameter value based on the second keyframe of the second video stream. The preset condition is that the current network transmission quality meets the condition of supporting the transmission of the second keyframe of the second video stream.
8. The system of claim 7, wherein, Also includes: The network monitoring module is used to obtain network monitoring data, including packet loss rate and available bandwidth. Based on the network monitoring data, the current network transmission quality is determined.
9. A camera, characterized by Includes the video outgoing system as described in any one of claims 7-8. 10.A computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the computer device is configured to perform the method according to any one of claims 1-8. When the processor executes the computer program, it implements the video outflow method according to any one of claims 1-6.