A video switching method and a video switching system
By setting a main pane and a companion pane in the video playback terminal, caching keyframes and playing them directly during transitions, the problem of long video transition times is solved, achieving a fast and smooth video transition experience.
Patent Information
- Application Number
- CN202211574766.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-08
- Publication Date
- 2026-08-25
- Estimated Expiration
- 2042-12-08
AI Technical Summary
Existing video switching methods are time-consuming and prone to stuttering when switching between surveillance videos, which affects the user experience.
The video playback terminal's pane is used as the main pane. At least one level of companion panes is determined, and the stream to be played is played in the main pane. At the same time, the keyframes of the cached streams in the companion panes are cached. When a switching command is received, the cached keyframes are played directly to achieve fast switching.
It reduces the latency of monitoring video switching, improves the user experience, and enhances the smoothness of video switching.
Smart Images

Figure CN116016847B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of video surveillance technology, and in particular to a video switching method and a video switching system. Background Technology
[0002] With the continuous development of video surveillance technology, users can now switch between multiple surveillance devices in real time using a single video playback terminal. However, the conventional method for switching between surveillance videos involves first disconnecting the video playback terminal from the current device, then establishing a connection between the video playback terminal and the surveillance device from which the next video will be played to obtain the video data and play it accordingly. This method requires disconnecting the video playback terminal from the current monitoring device and then establishing a connection between the video playback terminal and the monitoring device from which the switching operation is performed each time a switch is initiated. After establishing the connection, the corresponding data is obtained, resulting in a lengthy switching process and a tendency to stutter, thus impacting the user experience. Summary of the Invention
[0003] The main technical problem addressed by this application is to provide a video switching method and system that can improve the switching speed of surveillance videos and enhance the user experience.
[0004] To address the aforementioned technical problems, this application provides a video switching method, comprising: using the current pane of a video playback terminal as the main pane, and determining at least one level of companion panes corresponding to the main pane; wherein the video playback terminal includes multiple panes connected end-to-end, and each pane corresponds to at least one video capture device; acquiring the bitstream to be played corresponding to the main pane and playing the bitstream to be played in the main pane, acquiring the bitstream to be cached corresponding to the companion pane, and caching at least keyframes in the bitstream to be cached; wherein the bitrate of the bitstream to be played is greater than or equal to the bitstream to be cached; in response to receiving a switching instruction, using the companion pane corresponding to the switching instruction as the target companion pane, playing at least the cached keyframes in the target companion pane, updating the target companion pane to the main pane, and returning to the step of determining at least one level of companion panes corresponding to the main pane.
[0005] To address the aforementioned technical problems, another technical solution adopted in this application is: providing a video switching method, comprising: in response to a video playback terminal having determined a main pane and at least one corresponding layer of companion panes, a server corresponding to the video playback terminal sends a stream to be played to the main pane and a stream to be cached corresponding to the layer to the companion panes; wherein the video playback terminal includes multiple panes connected end-to-end, each pane corresponding to at least one video acquisition device, and the bitrate of the stream to be played is greater than or equal to the stream to be cached; the video playback terminal determines the main pane and at least one corresponding layer of companion panes based on the method described in the above technical solution.
[0006] To solve the above-mentioned technical problems, another technical solution adopted in this application is: to provide a video switching system, the video switching system including a memory and a processor coupled to each other, the processor storing program instructions, the processor being used to execute the program instructions to implement the video stream switching method described in any of the above technical solutions.
[0007] The beneficial effects of this application are as follows: Unlike existing technologies, the video switching method proposed in this application uses the currently displayed pane on the video playback terminal as the main pane, and determines the companion pane based on the main pane. The companion pane is the pane that the video playback terminal will play after the user performs a corresponding switching operation. Furthermore, while the video playback terminal displays the main pane, it acquires the video data of the monitoring video corresponding to the companion pane. This allows the terminal to directly decode the data of the companion pane corresponding to the user's switching command upon receiving the command, enabling rapid playback of the corresponding monitoring video. This reduces the latency of monitoring video switching and enhances the user experience. Attached Figure Description
[0008] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. Wherein:
[0009] Figure 1 This is a flowchart illustrating one implementation method of the video switching method of this application;
[0010] Figure 2 This is a schematic diagram of step S101 corresponding to one embodiment;
[0011] Figure 3 This is a schematic diagram of step S101 corresponding to another embodiment;
[0012] Figure 4This is a flowchart illustrating step S102 corresponding to one embodiment.
[0013] Figure 5 This is a schematic diagram of step S103 corresponding to one embodiment;
[0014] Figure 6 This is a flowchart of an implementation method following step S1023;
[0015] Figure 7 This is a flowchart illustrating another embodiment of the video switching method of this application;
[0016] Figure 8 This is a flowchart illustrating step S302 corresponding to one implementation method;
[0017] Figure 9 This is a schematic diagram of one embodiment of the video switching device of this application;
[0018] Figure 10 This is a schematic diagram of one embodiment of the video switching system of this application. Detailed Implementation
[0019] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.
[0020] Please see Figure 1 , Figure 1 This is a flowchart illustrating one embodiment of the video switching method of this application. The execution subject in this method is a video playback terminal, specifically including:
[0021] S101: Using the current pane of the video playback terminal as the main pane, determine at least one level of companion panes corresponding to the main pane. The video playback terminal includes multiple panes connected end-to-end, and each pane corresponds to at least one video capture device.
[0022] In one embodiment, the implementation process of step S101 includes: in response to the video playback terminal having a corresponding binding relationship with multiple video acquisition devices, the video playback terminal forms multiple panes according to the bound video acquisition devices, and uses the pane displayed on the screen of the video playback terminal at the current moment as the main pane.
[0023] Specifically, each of the multiple panes corresponds to at least one video capture device for playing the surveillance video captured by that device. The panes are arranged in a preset order and connected end-to-end, allowing different panes to be displayed on the video playback terminal based on user switching commands. Each time a switching command is executed, the video playback terminal switches the current pane to the pane adjacent to it. The multiple panes can be arranged according to the numerical order of the corresponding video capture devices.
[0024] It should be noted that if video capture devices are added or removed, or if they go online or offline in actual application, the corresponding panes will be added or removed from the order of the panes.
[0025] In addition, in this embodiment, the video playback terminal can be a mobile phone, personal computer, or tablet; when the video playback terminal has a touch screen function, the user can trigger the switching command by swiping the screen; or, when the video playback terminal is a personal computer or other device, the user can trigger the switching command by clicking the mouse or clicking the corresponding button.
[0026] In a specific implementation scenario, please refer to Figure 2 , Figure 2 This is a schematic diagram of one implementation method corresponding to step S101. Specifically, when video playback terminal A is bound to 8 video acquisition devices, and the screen of video playback terminal A can only play one monitoring video at a time, video playback terminal A generates 8 panes (i.e., ...) based on the 8 video acquisition devices. Figure 2 The eight panes (numbered "1" to "8") are arranged sequentially, with each pane used to play the surveillance video captured by the corresponding video acquisition device. Pane 1 is currently displayed on video playback terminal A and is designated as the main pane.
[0027] Alternatively, in another implementation scenario, please refer to Figure 3 , Figure 3 This is a schematic diagram illustrating step S101 in another implementation. Specifically, when the screen of video playback terminal B can play two surveillance videos at a time, multiple panes are determined based on the multiple video acquisition devices bound to video playback terminal B. Each pane corresponds to two video acquisition devices. Of course, in other scenarios, the number of video acquisition devices corresponding to each pane can be determined according to the actual situation.
[0028] Additionally, it should be noted that in practical applications, user accounts can be pre-set and bound to multiple video capture devices. The video playback terminal can then play the surveillance videos captured by the corresponding video capture devices by logging into the user account.
[0029] Furthermore, at least one level of companion panes is determined based on the main pane. Specifically, in this embodiment, the current pane of the video playback terminal is taken as the main pane, the two panes adjacent to the main pane are taken as first-level companion panes, and the panes adjacent to each first-level companion pane but far from the main pane are taken as second-level companion panes. That is, in response to the video playback terminal displaying the main pane at the current moment, the first-level companion panes are the panes that the video playback terminal will display after receiving a switching command once; the second-level companion panes are the panes that the video playback terminal will display after receiving the same switching command twice consecutively. By setting the first-level companion panes, it is helpful to cache the data corresponding to the first-level panes when the video playback terminal displays the main pane, so that when switching from the main pane to the corresponding first-level pane, the cached data can be played directly, thereby improving the smoothness of video switching; by setting the second-level companion panes, it is helpful to improve the smoothness of continuous switching.
[0030] To facilitate understanding, use Figure 2 To illustrate, in response to pane 1 being the main pane, panes 2 and 8, which are adjacent to pane 1, are designated as first-level companion panes; pane 3, which is adjacent to pane 2 and far from the main pane, is designated as a second-level companion pane; and pane 7, which is adjacent to pane 8 and far from the main pane, is designated as a second-level companion pane.
[0031] Optionally, in other embodiments, the number of levels of the partner panes determined in step S101 can be other. For example, the corresponding first-level partner panes can be determined only based on the main pane; or, after determining the first-level and second-level partner panes, the panes adjacent to each second-level partner pane and far from the main pane can be used as third-level partner panes.
[0032] Alternatively, in other embodiments, in response to the fact that most users are accustomed to swiping in one direction to switch videos when watching videos on their mobile phones, when the video playback terminal mentioned in this embodiment is a mobile phone, the companion pane can be determined only on one side of the main pane in step S101.
[0033] S102: Obtain the playable bitstream corresponding to the main pane and play it in the main pane; obtain the cached bitstream corresponding to the partner pane and cache at least the keyframes in the cached bitstream. The bitrate of the playable bitstream is greater than or equal to that of the cached bitstream.
[0034] In one embodiment, prior to step S102, the method includes: in response to determining the main pane and partner panes in step S101, establishing a transmission channel between the main pane and each partner pane and the cloud server. Specifically, in response to the inclusion of a first-level partner pane and a second-level partner pane, the transmission channel between the main pane and the cloud server is designated as the main channel, the transmission channel between the first-level partner pane and the cloud server is designated as the first channel, and the transmission channel between the second-level partner pane and the cloud server is designated as the second channel.
[0035] Further, please refer to Figure 4 , Figure 4 This is a flowchart illustrating step S102 in one embodiment. Specifically, step S102 includes:
[0036] S1021: Obtain the main channel corresponding to the main pane, use the main channel to obtain the bitstream to be played corresponding to the main pane, and play the bitstream to be played in the main pane.
[0037] In one embodiment, step S1021 includes: in response to a user opening a corresponding app on the video playback terminal or switching from another interface of the video playback terminal to the monitoring video playback interface, the video playback terminal receives a monitoring video playback request. At this time, the main pane in the video playback terminal obtains the corresponding stream to be played from the cloud server using the main channel. This stream to be played is generated based on the monitoring video captured by the video capture device corresponding to the main pane, and the format of the stream to be played is a first stream, which can be the main stream.
[0038] Furthermore, the video playback terminal decodes the obtained bitstream to be played in order to play the corresponding surveillance video. This embodiment improves the clarity of the surveillance images played by the video playback terminal by setting the format of the bitstream to be played as the main bitstream.
[0039] S1022: Obtain the first channel corresponding to the first-level partner pane, use the first channel to obtain the first bitstream to be cached corresponding to the first-level partner pane, and cache at least the keyframes in the first bitstream to be cached in the first-level partner pane.
[0040] In one embodiment, step S1022 includes: obtaining a first channel between the first-level partner pane and the cloud server, and using the first channel to obtain a corresponding first buffered bitstream from the cloud server, wherein the first buffered bitstream is generated based on the surveillance video captured by the video capture device corresponding to the first partner pane.
[0041] Specifically, the format of the first buffered bitstream includes one of the following: a first bitstream, a second bitstream, a third bitstream, and a subset of keyframes. When the format of the first buffered bitstream is a subset of keyframes, the video playback terminal obtains the keyframes at corresponding times every preset interval, which can be set according to actual needs.
[0042] In this context, the first bitstream can be the main bitstream, the second bitstream can be a sub-bitstream, and the third bitstream is distinct from both the first main bitstream and the sub-bitstream. Furthermore, the bitrate of the first bitstream is greater than that of the second bitstream, and the bitrate of the second bitstream is greater than that of the third bitstream.
[0043] Furthermore, when the format of the first buffered bitstream is one of the first, second, and third bitstreams, after the video playback terminal obtains the first buffered bitstream in real time, it can directly buffer the obtained first buffered bitstream; or, it can extract the keyframe corresponding to the latest moment from the real-time obtained first buffered bitstream and only save the latest keyframe, that is, after extracting the keyframe of the current moment, it can delete the keyframes corresponding to moments before the current moment. Alternatively, when the format of the first buffered bitstream is a partial keyframe, the video playback terminal can buffer all the obtained keyframes or only buffer the keyframe of the latest moment. In response to buffering the first buffered bitstream to help play the corresponding monitoring video directly according to the first buffered bitstream during video switching, thereby reducing the time consumption of video switching and improving the smoothness of video switching; or, in response to buffering only the corresponding keyframes according to the first buffered bitstream, it helps to reduce the consumption of storage resources while improving the smoothness of video switching.
[0044] S1023: Obtain the second channel corresponding to the second-level partner pane, use the second channel to obtain the second buffered bitstream corresponding to the second-level partner pane, and buffer at least the keyframes in the second buffered bitstream in the second-level partner pane.
[0045] In one embodiment, step S1023 includes: acquiring a second channel between the second-level partner pane and the cloud server, and using the second channel to obtain a corresponding second buffered bitstream from the cloud server. This second buffered bitstream is generated based on surveillance video captured by the video capture device corresponding to the second partner pane. The format of the second buffered bitstream includes a third bitstream or a portion of keyframes.
[0046] Furthermore, after the video playback terminal obtains the second buffered bitstream in real time, it directly buffers the obtained second buffered bitstream; or, it only buffers the latest keyframe from the first buffered bitstream. The specific process can be referred to step S1022 above, and will not be elaborated here. By obtaining the corresponding second buffered bitstream and at least buffering the corresponding keyframes, the smoothness of video switching can be improved subsequently based on the buffered second buffered bitstream or keyframes.
[0047] S103: In response to receiving a switching instruction, the step of taking the partner pane corresponding to the switching instruction as the target partner pane, playing at least the cached keyframes in the target partner pane, updating the target partner pane to the main pane, and returning to the step of determining at least one level of partner panes corresponding to the main pane.
[0048] In one embodiment, step S103 includes: in response to receiving a switching instruction and the switching instruction corresponding to a first-level partner pane, taking the first-level partner pane corresponding to the switching instruction as the target partner pane, playing at least a cached keyframe in the target partner pane, and switching the main pane corresponding to the switching instruction from the main channel to the first channel.
[0049] Specifically, in response to receiving only one switching instruction, the pane corresponding to the switching instruction is the first-level partner pane adjacent to the current main pane, and the first-level partner pane is taken as the target partner pane.
[0050] Furthermore, in response to obtaining the first buffered bitstream corresponding to the first-level partner pane through the first channel in step S102, the first buffered bitstream is decoded to play the corresponding monitoring video on the screen of the video playback terminal. Alternatively, in response to obtaining the corresponding keyframe based on the first buffered bitstream, the keyframe is decoded to play the keyframe. By playing the buffered keyframe during video switching, stuttering during video switching can be effectively avoided.
[0051] Furthermore, after the target partner pane has played at least the cached keyframes, it is updated to the main pane; that is, after executing the switching command, the video playback terminal uses the currently displayed target partner pane as the main pane. Additionally, the target partner pane corresponding to the one before the switching command is switched from the first channel to the main channel. At this point, after the target partner pane has played at least the cached keyframes, it acquires the corresponding stream to be played in real time through the main channel and plays the stream in the target partner pane. The stream to be played is the main stream.
[0052] Furthermore, after completing the switching instruction, the main pane corresponding to the previous switch is switched from the main channel to the first channel, and the main pane corresponding to the current switch is switched from the first channel to the main channel. Then, steps S101 to S102 are re-executed to determine at least one level of partner pane based on the current main pane and to obtain the data to be cached corresponding to the partner pane.
[0053] In one specific implementation, please refer to Figure 5 , Figure 5 This is a schematic diagram of an embodiment corresponding to step S103. Specifically, as shown... Figure 5As shown in Figure a, in response to the video playback terminal C being a mobile phone, multiple panes (c1 to c7) are determined based on the video capture device bound to the video playback terminal C, and these panes are sequentially ordered and connected end-to-end. The main pane c1 is currently displayed on the screen of the video playback terminal C, and based on the main pane c1, there are first-level partner panes c2 and c7, as well as second-level partner panes c3 and c6. In response to the user performing a rightward swipe operation on the video playback terminal C, a switching command is generated based on this operation. The target partner pane corresponding to this switching command is the first-level partner pane c2.
[0054] Furthermore, the first buffered bitstream corresponding to the first-level partner pane c2 is obtained through the first channel, and the monitoring video corresponding to the first-level partner pane c2 is played on the screen of the video playback terminal C based on the first buffered bitstream to complete the switching command. That is, at this time, pane c2 is the main pane, panes c3 and c1 are the first-level partner panes, and panes c4 and c7 are the second-level partner panes. For details, please refer to [reference needed]. Figure 5 Figure b. Additionally, after completing the switching command, the main pane c1 corresponding to the previous switch is switched from the main channel to the first channel, and the main pane c2 corresponding to the current switch is switched from the first channel to the main channel.
[0055] In another embodiment, in response to receiving a switching instruction that corresponds to a second-level partner pane, the second-level partner pane corresponding to the switching instruction is used as the target partner pane, at least the cached keyframes are played in the target partner pane, and the main pane corresponding to the switching instruction is switched from the main channel to the second channel.
[0056] Specifically, in response to receiving two consecutive identical switching commands, the pane corresponding to the switching command is the second-level partner pane, and the second-level partner pane is used as the target partner pane.
[0057] Further, in response to obtaining the second buffered bitstream corresponding to the second-level partner pane through the second channel in step S102, the second buffered bitstream is decoded to play the corresponding monitoring video on the screen of the video playback terminal; or, in response to obtaining the corresponding keyframe based on the second buffered bitstream, the keyframe is decoded to play the keyframe.
[0058] Furthermore, after completing the switching instruction, the main pane corresponding to the previous switch is switched from the main channel to the second channel, and the main pane corresponding to the current switch is switched from the second channel to the main channel; and at least one level of partner pane is determined based on the current main pane, and the data to be cached corresponding to the partner pane is obtained.
[0059] The video switching method proposed in this application uses the currently displayed pane on the video playback terminal as the main pane and determines the companion pane based on the main pane. The companion pane is the pane that the video playback terminal will play after the user performs a corresponding switching operation. Furthermore, while the video playback terminal displays the main pane, it acquires the video data of the monitoring video corresponding to the companion pane. This allows the terminal to directly decode the data of the companion pane corresponding to the user's switching command upon receiving the command, enabling rapid playback of the corresponding monitoring video. This reduces the latency of monitoring video switching and enhances the user experience.
[0060] In another implementation, please refer to Figure 6 , Figure 6 This is a flowchart illustrating an implementation method following step S1023. In response to the companion pane including a first-level companion pane and a second-level companion pane, after step S1023, the following steps are included:
[0061] S201: In response to the failure to receive a switching instruction after the response time has expired, the keep-alive signaling corresponding to the first-level partner pane is obtained using the first channel, and the acquisition of the first buffered bitstream is suspended, and the second channel is closed.
[0062] Specifically, a corresponding response time is set. If no switching instruction is received within the main pane displayed on the video playback terminal within the response time, a keep-alive signal is automatically generated and obtained using the corresponding first channel. Based on the obtained keep-alive signal, the acquisition of the first buffered stream is paused, and the second channel is closed; that is, while pausing the acquisition of the first buffered stream, the first channel between the established first-level partner pane and the cloud server is maintained, and the acquisition of the second buffered stream is paused while the second channel is closed. This response time can be set according to actual needs, such as 1 minute or 2 minutes. If no switching instruction is received within the response time, the user is assumed not to need to switch the monitoring video temporarily. Obtaining the corresponding keep-alive signal reduces resource consumption and ensures the playback quality of the monitoring video in the main pane.
[0063] Optionally, in other embodiments, in response to exceeding the response time without obtaining a switching instruction, a format adjustment instruction is automatically generated, and the corresponding first channel and / or second channel is used to obtain the corresponding format adjustment instruction to adjust the format of the first buffered bitstream and / or the second buffered bitstream, thereby reducing the resource consumption of transmitting the corresponding buffered bitstream through the first channel and / or the second channel. For example, in response to not obtaining a format adjustment instruction, the video playback terminal uses the first channel to obtain the first bitstream corresponding to the first-level partner pane and uses the second channel to obtain the second bitstream corresponding to the second-level partner pane. After adjustment based on the above format adjustment instruction, the first channel is used to obtain the second bitstream corresponding to the first-level partner pane, and the second channel is used to obtain the third bitstream corresponding to the second-level partner pane. Alternatively, after adjustment based on the above format adjustment instruction, the first channel obtains a portion of the keyframes corresponding to the first-level partner pane, while the second channel is closed.
[0064] S202: In response to obtaining the operation command in the main pane, use the first channel to obtain the first buffered bitstream after the response time, and use at least the keyframes in the first buffered bitstream after the response time to update the earliest timing keyframe in the first-level partner pane.
[0065] Specifically, in response to step S201, upon obtaining an operation instruction in the main pane, the first buffered bitstream after the response duration is obtained using the first channel, and the obtained first buffered bitstream after the response duration is buffered; or, the latest keyframe is obtained from the obtained first buffered bitstream after the response duration, and the earliest keyframe in the first-level partner pane is updated using the latest keyframe. The operation instruction may be generated based on the user touching the screen or clicking a button, etc.
[0066] In another implementation, please refer to Figure 7 , Figure 7 This is a flowchart illustrating another embodiment of the video switching method of this application. In this embodiment, the method specifically includes:
[0067] S301: The video playback terminal uses the current pane as the main pane and determines at least one level of companion panes corresponding to the main pane.
[0068] Specifically, the pane currently displayed on the screen of the video playback terminal is taken as the main pane, and the corresponding first-level and second-level companion panes are determined based on the main pane. The method for determining the first-level and second-level companion panes can be found in [reference needed]. Figure 1 Step S101 will not be described in detail here.
[0069] S302: In response to the video playback terminal having determined the main pane and its corresponding at least one level of companion panes, the server corresponding to the video playback terminal sends the stream to be played to the main pane and the stream to be buffered corresponding to the level to the companion panes. The video playback terminal includes multiple panes connected end-to-end, each pane corresponding to at least one video capture device, and the bitrate of the stream to be played is greater than or equal to that of the stream to be buffered.
[0070] Please see Figure 8 , Figure 8 This is a flowchart illustrating step S302 in one embodiment. Step S302 specifically includes:
[0071] S3021: The server corresponding to the video playback terminal sends the stream to be played to the main pane.
[0072] Specifically, in this embodiment, multiple video capture devices are connected to a cloud server, and the cloud server is used to acquire the surveillance videos captured by each video capture device. The cloud server can process the acquired surveillance videos to generate corresponding bitstreams with different bitrates. For example, any one of the first, second, and third bitstreams mentioned in the above embodiment. The cloud server can adjust the bitrate by setting different frame rates and resolutions.
[0073] Furthermore, in response to the binding relationship between the video playback terminal and multiple video capture devices, the cloud server connects to the corresponding video playback terminal to send the generated bitstream to the video playback terminal. Since the video playback terminal includes multiple panes, corresponding transmission channels are established between the main pane and each partner pane and the cloud server.
[0074] In one implementation scenario, the cloud server uses the main channel to send the corresponding playback stream to the main pane, so that the video playback terminal can play the corresponding monitoring video in the main pane based on the obtained playback stream. The specific process can be referred to the corresponding implementation method described above.
[0075] S3022: Send the cached bitstream corresponding to the level to the partner pane.
[0076] In one embodiment, step S3022 includes: sending the buffered bitstream corresponding to the level to the partner pane based on the performance conditions corresponding to the partner pane. The performance conditions include at least one of the following: the processing power of the video playback terminal, the network performance of the network to which the video playback terminal is connected, and the bandwidth performance of the video acquisition device corresponding to the partner pane.
[0077] Specifically, the network performance connected to the video playback terminal is positively correlated with the corresponding network transmission speed; the bandwidth performance of the video capture device is positively correlated with the bandwidth of the video capture device itself, meaning the more data the video capture device transmits per second to the cloud server, the better its bandwidth performance. The cloud server obtains the performance score corresponding to the partner pane and, based on this performance score, uses the transmission channel between the cloud server and the partner pane to send the cached bitstream corresponding to the level to the partner pane. For example, if the performance score is within the first range and the performance condition corresponding to the partner pane is determined to be good, a higher-quality cached bitstream, such as the first or second bitstream, is sent to the partner pane; if the performance score is within the second range and the performance condition corresponding to the partner pane is determined to be average, a lower-quality cached bitstream, such as the third bitstream, is sent to the partner pane; if the performance score is within the third range and the performance condition corresponding to the partner pane is determined to be poor, a lower-quality cached bitstream, such as some keyframes, is sent to the partner pane. The values in the first range are greater than the values in the second range, and the values in the second range are greater than the values in the third range; these values can be specifically set according to actual conditions.
[0078] Furthermore, the process of obtaining the performance score includes: obtaining a first score based on the processing power of the video playback terminal, a second score based on the network performance to which the video playback terminal is connected, and a third score based on the bandwidth performance of the video capture device corresponding to the partner pane. The performance score is obtained based on at least one of the first, second, and third scores. Specifically, the stronger the processing power of the video playback terminal, the higher the first score; the faster the network transmission speed of the video playback terminal, the higher the second score; and the larger the bandwidth of the video capture device corresponding to the partner pane, the higher the third score.
[0079] Furthermore, corresponding weight values are assigned to the first score, second score, and third score respectively, and the sum of the products of the first score, second score, and third score with their respective weights is taken as the corresponding performance score. Alternatively, any one of the first score, second score, and third score can be used as the performance score. Or, the performance score can be determined based on any two of the first score, second score, and third score.
[0080] Optionally, in another embodiment, in response to the companion pane including a first-level companion pane and a second-level companion pane, the first-level companion pane is located on both sides of the main pane and adjacent to the main pane, and the second-level companion pane is located on the side of the first-level companion pane away from the main pane and adjacent to the first-level companion pane, step S3022 includes:
[0081] Based on the performance conditions corresponding to the first-level partner pane, send at least one of a first buffered bitstream and a keep-alive signaling to the first-level partner pane; based on the performance conditions corresponding to the second-level partner pane, send at least one of a second buffered bitstream and a keep-alive signaling to the second-level partner pane.
[0082] Specifically, the performance conditions corresponding to the first-level partner pane are analyzed. When the performance conditions of the first-level partner pane are good, the cloud server uses the first channel to send the corresponding first buffered bitstream to the first-level partner pane; or, when the performance conditions of the second-level partner pane are poor, the cloud server sends a keep-alive signal to the first-level partner pane, that is, it maintains the first channel between the cloud server and the first-level partner pane and suspends the sending of the corresponding first buffered bitstream to the first-level partner pane. Similarly, the performance conditions corresponding to the second-level partner pane are analyzed, and one of the following is used: sending the second buffered bitstream and a keep-alive signal to the second-level partner pane using the second channel, as described above.
[0083] The format of the first buffered bitstream includes one of a first bitstream, a second bitstream, a third bitstream, and some keyframes. The format of the second buffered bitstream includes the third bitstream or some keyframes. Furthermore, the bitrate of the first bitstream is greater than that of the second bitstream, and the bitrate of the second bitstream is greater than that of the third bitstream.
[0084] S303: The video playback terminal obtains the bitstream to be played corresponding to the main pane and plays the bitstream to be played in the main pane, obtains the bitstream to be cached corresponding to the partner pane, and caches at least the keyframes in the bitstream to be cached.
[0085] Specifically, the video playback terminal decodes the stream to be played corresponding to the main pane to play the corresponding monitoring video, and obtains the streams to be cached corresponding to each level of partner pane, and caches at least the corresponding keyframes. The detailed implementation process can be found in the corresponding implementation methods described above, and will not be elaborated upon here.
[0086] S304: In response to the video playback terminal receiving a switching instruction, the step of taking the partner pane corresponding to the switching instruction as the target partner pane, playing at least the cached keyframes in the target partner pane, updating the target partner pane to the main pane, and returning to the step of determining at least one level of partner pane corresponding to the main pane.
[0087] Specifically, based on the switching command, the current main pane is switched to the target partner pane corresponding to the switching command, and at least the corresponding keyframe is played, and the target partner pane is updated to the main pane. The detailed implementation process can be found in the corresponding implementation method described above, and will not be elaborated upon here.
[0088] Further, return to step S301, which involves determining at least one level of companion panes corresponding to the main pane.
[0089] Please see Figure 9 , Figure 9 This is a schematic diagram of the structure of one embodiment of the video switching device of this application. The video switching device includes a first processing module 10, an acquisition module 20 and a second processing module 30 that are coupled to each other.
[0090] Specifically, the first processing module 10 is used to take the current pane of the video playback terminal as the main pane and determine at least one level of companion panes corresponding to the main pane. The video playback terminal includes multiple panes connected end-to-end, and each pane corresponds to at least one video capture device.
[0091] The acquisition module 20 is used to acquire the playable bitstream corresponding to the main pane and play the playable bitstream in the main pane, acquire the cacheable bitstream corresponding to the partner pane, and cache at least the keyframes in the cacheable bitstream. The bitrate of the playable bitstream is greater than or equal to that of the cacheable bitstream.
[0092] The second processing module 30 is configured to, in response to receiving a switching instruction, take the partner pane corresponding to the switching instruction as the target partner pane, play at least the cached keyframes in the target partner pane, update the target partner pane to the main pane, and return to the steps of determining at least one level of partner panes corresponding to the main pane.
[0093] Please see Figure 10 , Figure 10 This is a schematic diagram of the structure of one embodiment of the video switching system of this application. The video switching system includes a memory 40 and a processor 50 coupled to each other. The processor 50 stores program instructions and is used to execute the program instructions to implement the video switching method in any of the above embodiments. Specifically, the processor 50 may also be called a CPU (Central Processing Unit). The processor 50 may be an integrated circuit chip with signal processing capabilities. The processor 50 may also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. The general-purpose processor may be a microprocessor or any conventional processor. In addition, the processor 50 may be implemented by an integrated circuit chip.
[0094] It should be noted that the units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0095] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0096] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the methods of various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0097] The above description is merely an embodiment of this application and does not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.
Claims
1. A video switching method, characterized in that, The method includes: The current pane of the video playback terminal is taken as the main pane, and at least one companion pane of a certain level corresponding to the main pane is determined; wherein, the video playback terminal includes multiple panes connected end to end, and each pane corresponds to at least one video acquisition device; The process involves obtaining the playable bitstream corresponding to the main pane and playing it in the main pane; obtaining the cacheable bitstream corresponding to the partner pane and caching at least the keyframes in the cacheable bitstream; wherein the bitrate of the playable bitstream is greater than or equal to that of the cacheable bitstream, the format of the playable bitstream is a first bitstream, and the format of the cacheable bitstream includes one of a first bitstream, a second bitstream, a third bitstream, and some keyframes; the bitrate of the first bitstream is greater than that of the second bitstream, and the bitrate of the second bitstream is greater than that of the third bitstream. In response to receiving a switching instruction, the partner pane corresponding to the switching instruction is selected as the target partner pane, at least the cached keyframes are played in the target partner pane, the target partner pane is updated as the main pane, and the process returns to the step of determining at least one level of partner panes corresponding to the main pane; The process of determining the partner panes includes: taking the current pane of the video playback terminal as the main pane, taking the two panes adjacent to the main pane as first-level partner panes, and taking the panes adjacent to each of the first-level partner panes and far away from the main pane as second-level partner panes.
2. The video switching method according to claim 1, characterized in that, The steps of obtaining the playable bitstream corresponding to the main pane and playing the playable bitstream in the main pane, obtaining the cacheable bitstream corresponding to the companion pane, and caching at least the keyframes in the cacheable bitstream include: Obtain the main channel corresponding to the main pane, use the main channel to obtain the bitstream to be played corresponding to the main pane, and play the bitstream to be played in the main pane. Obtain the first channel corresponding to the first-level partner pane, use the first channel to obtain the first bitstream to be cached corresponding to the first-level partner pane, and cache at least the keyframes in the first bitstream to be cached in the first-level partner pane; Obtain the second channel corresponding to the second-level partner pane, use the second channel to obtain the second bitstream to be cached corresponding to the second-level partner pane, and cache at least the keyframes in the second bitstream to be cached in the second-level partner pane.
3. The video switching method according to claim 2, characterized in that, The format of the stream to be played is a first stream. The format of the first stream to be cached includes one of a first stream, a second stream, a third stream, and some keyframes. The format of the second stream to be cached includes the third stream or some keyframes. The bitrate of the first stream is greater than that of the second stream, and the bitrate of the second stream is greater than that of the third stream.
4. The video switching method according to claim 2, characterized in that, The step of obtaining the second channel corresponding to the second-level partner pane, obtaining the second buffered bitstream corresponding to the second-level partner pane using the second channel, and caching at least the keyframes in the second buffered bitstream in the second-level partner pane includes: If the switching instruction is not received within the response time, the keep-alive signaling corresponding to the first-level partner pane is obtained using the first channel, and the acquisition of the first buffered bitstream is paused, while the second channel is closed. In response to obtaining the operation instruction in the main pane, the first buffered bitstream after the response duration is obtained using the first channel, and the earliest keyframe in the first-level partner pane is updated using at least the keyframes in the first buffered bitstream after the response duration.
5. The video switching method according to claim 2, characterized in that, The step of responding to receiving a switching instruction by designating the partner pane corresponding to the switching instruction as the target partner pane and playing at least the cached keyframes in the target partner pane includes: In response to receiving the switching instruction and the switching instruction corresponding to the first-level partner pane, the first-level partner pane corresponding to the switching instruction is taken as the target partner pane, at least the cached keyframe is played in the target partner pane, and the main pane corresponding to the switching instruction before the switching instruction is switched from the main channel to the first channel; In response to receiving the switching instruction and the switching instruction corresponding to the second-level partner pane, the second-level partner pane corresponding to the switching instruction is taken as the target partner pane, at least the cached keyframes are played in the target partner pane, and the main pane corresponding to the switching instruction before the switching instruction is switched from the main channel to the second channel.
6. A video switching method, characterized in that, The method includes: In response to the video playback terminal having determined the main pane and its corresponding at least one level of companion panes, the server corresponding to the video playback terminal sends the stream to be played to the main pane and sends the stream to be cached corresponding to the level to the companion pane; wherein, the video playback terminal includes multiple panes connected end to end, each pane corresponds to at least one video acquisition device, and the bitrate of the stream to be played is greater than or equal to the stream to be cached; the video playback terminal is used to execute the method of any one of claims 1-5.
7. The video switching method according to claim 6, characterized in that, Sending the buffered bitstream corresponding to the level to the partner pane includes: Based on the performance conditions corresponding to the buddy pane, a buffered bitstream corresponding to the level is sent to the buddy pane; wherein, the performance conditions include at least one of the following: the processing performance of the video playback terminal, the network performance of the network to which the video playback terminal is connected, and the bandwidth performance of the video acquisition device corresponding to the buddy pane.
8. The video switching method according to claim 7, characterized in that, The companion pane includes a first-level companion pane and a second-level companion pane. The first-level companion pane is located on both sides of the main pane and is adjacent to the main pane. The second-level companion pane is located on the side of the first-level companion pane away from the main pane and is adjacent to the first-level companion pane. The step of sending the cached bitstream corresponding to the level to the partner pane based on the performance conditions corresponding to the partner pane includes: Based on the performance conditions corresponding to the first-level partner pane, send at least one of a first buffered bitstream and a keep-alive signaling to the first-level partner pane; based on the performance conditions corresponding to the second-level partner pane, send at least one of a second buffered bitstream and a keep-alive signaling to the second-level partner pane. The format of the first bitstream to be cached includes one of a first bitstream, a second bitstream, a third bitstream, and a portion of keyframes; the format of the second bitstream to be cached includes the third bitstream or a portion of keyframes; wherein, the bitrate of the first bitstream is greater than that of the second bitstream, and the bitrate of the second bitstream is greater than that of the third bitstream.
9. A video switching system, characterized in that, The system includes a memory and a processor coupled to each other, the processor storing program instructions, the processor being used to execute the program instructions to implement the video switching method of any one of claims 1-5 or 6-8.
Citation Information
Patent Citations
Live stream seamless switching method and device
CN107979777A
Playing method and device of video player, electronic equipment and storage medium
CN114401444A