Video carousel method, device, computer equipment and storage medium
By sending a new video source data acquisition request to the server before the video polling cycle, and continuing to play the current video source data before receiving the keyframe of the new video source data, the black screen caused by the inability to obtain the keyframe of the new video source data is solved. Problem, continuous playback of video windows is realized and user experience is improved.
Patent Information
- Application Number
- CN202211057797.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-31
- Publication Date
- 2025-02-18
- Estimated Expiration
- 2042-08-31
AI Technical Summary
In the prior art, due to the inability to obtain keyframes of new video source data in time, the video window cannot play video normally, resulting in black screen problems, affecting the user experience.
During the first preset time before the video polling cycle is reached, a new video source data acquisition request is sent to the server; before receiving the keyframe of the new video source data sent by the server, the current video source data continues to play in the current video window; When a keyframe of the new video source data is received, the video source data played in the current video window is replaced with the new video source data.
When switching between new and old video sources, it is realized to avoid the black screen problem caused by the inability to obtain the keyframes of new video sources in time, so that the video window always plays video data and improves the user experience.
Smart Images

Figure CN115412682B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of video carousel, and in particular to a video carousel method, device, computer equipment and storage medium. Background Art
[0002] Video carousel is a commonly used function in video conferencing and video surveillance systems. Due to the limitations of display size and video preprocessing equipment performance, the number of windows used to play video source data is generally limited. Therefore, when the number of video sources is greater than the total number of windows that can be used to play video sources, video carousel will be used to enable all video source data to be played.
[0003] However, when the old video source is replaced with the new one in the current products with video carousel function, the video window has a certain probability of black screen for a period of time, resulting in a poor user experience. The main reason for this problem is that during the carousel replacement process, the key frame of the new video source data has a certain probability of taking a long time to obtain, so before this, the video window cannot play the video normally, and a black screen problem occurs, which does not improve the user experience. Summary of the invention
[0004] Based on this, it is necessary to provide a video carousel method, device, computer equipment and storage medium to address the above technical problems, so as to solve the problem in the prior art that the video window cannot play the video normally and a black screen appears due to the inability to obtain the key frames of the new video source data in time.
[0005] The present application is implemented as follows: in a first aspect, a video carousel method is provided, comprising:
[0006] When the first preset time before the video polling cycle is reached, a new video source data acquisition request is sent to the server;
[0007] Before receiving a key frame of new video source data sent by the server, continue playing the current video source data in the current video window;
[0008] Before receiving the key frame of the new video source data sent by the server, the currently playing video source data continues to be played in the current video window.
[0009] In one embodiment, after the current video window continues to play the current video source data, the method includes:
[0010] When the key frame of the new video source data is still not received within the second preset time before the next video polling cycle, the new video source data is re-added to the carousel waiting queue of the next video polling cycle, and the current video source continues to be played in the current video window.
[0011] In one embodiment, replacing the current video source data played in the current video window with the new video source data includes:
[0012] Start the video carousel and count the total number of video source data to be played in the carousel waiting queue;
[0013] Determine the starting replacement window and the rotation order according to the total number of the video source data to be rotated and the total number of windows that can currently play the video source;
[0014] Extracting preset video sources to be played from the carousel waiting queue in batches;
[0015] Determine the window of the video source to be replaced according to the starting replacement window, the carousel order and the number of the video sources to be played;
[0016] According to the starting replacement window and the carousel sequence, the original video source played in the window of the video source to be replaced is replaced with the video source to be played in sequence.
[0017] In one embodiment, the total number of the video source data to be played in a carousel is n, and determining the carousel order according to the total number of the video source data to be played in a carousel includes:
[0018] When the total number n is greater than the total number m of windows that can play video sources, replacement is performed starting from the first window that can play video sources;
[0019] When the total number n is less than the total number m of windows of the playable video source, replacement is performed starting from m-n+1 windows;
[0020] When the total number n is 0, the video carousel is stopped.
[0021] In one embodiment, the replacing the original video source played in the window of the to-be-replaced video source with the to-be-replaced video source in sequence according to the starting replacement window and the carousel sequence comprises:
[0022] After all the video source data waiting to be played in the carousel waiting queue are replaced and played, the total consumed time t of replacement playback is calculated;
[0023] When the total consumed time t is greater than the duration of the video polling cycle, a new round of video carousel is started;
[0024] When the total consumed time t is less than the duration of the video polling cycle, the next carousel cycle is waited for to start the video carousel.
[0025] In one embodiment, extracting preset video sources to be played from the carousel waiting queue in batches includes:
[0026] When the current video source data quantity in the carousel waiting queue is less than the extracted preset number of to-be-played video sources, all the to-be-played video sources in the carousel waiting queue are extracted.
[0027] In one embodiment, when the video source to be played cannot be played normally, the original video source continues to be played in the window of the video source to be replaced;
[0028] The to-be-played video source is added again to the carousel waiting queue of the next carousel cycle.
[0029] In a second aspect, a video carousel device is provided, comprising:
[0030] A new video data acquisition request sending unit, used for sending a new video source data acquisition request to the server within a first preset time before the video polling cycle is reached;
[0031] A playing unit, configured to continue playing the currently playing video source data in the current video window before receiving a key frame of new video source data sent by the server;
[0032] A replacement unit is used to replace the current video source data played in the current video window with the new video source data when a key frame of the new video source data is received.
[0033] In a third aspect, a computer device is provided, comprising a memory, a processor, and computer-readable instructions stored in the memory and executable on the processor, wherein the processor implements the steps of the video carousel method described above when executing the computer-readable instructions.
[0034] In a fourth aspect, a readable storage medium is provided, wherein the readable storage medium stores computer-readable instructions, and when the computer-readable instructions are executed by a processor, the steps of the video carousel method described above are implemented.
[0035] The above-mentioned video carousel method, device, computer equipment and storage medium, the method of which is implemented, includes: when the first preset time before the video polling cycle is reached, sending a request for obtaining new video source data to the server; before receiving the key frame of the new video source data sent by the server, continuing to play the video source data currently being played in the current video window; when the key frame of the new video source data is received, replacing the current video source data played by the current video window with the new video source data. In an embodiment of the present application, when switching between the new and old video sources in carousel, when the key frame of the new video source data requested from the server cannot be obtained in time, the video source data that is currently being played can continue to be played in the current video window until the key frame of the new video source data is obtained, and then the video source data currently being played in the current video window is replaced, so as to realize the carousel switching between the new and old video sources, and avoid the problem of black screen caused by the failure to obtain the new video source in time, so that the window can always play video data, improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.
[0037] Figure 1 is a schematic diagram of an application environment of a video carousel method in one embodiment of the present invention;
[0038] Figure 2 A schematic diagram of a video carousel method according to an embodiment of the present invention Figure 1 ;
[0039] Figure 3 A schematic diagram of a video carousel method according to an embodiment of the present invention Figure 2 ;
[0040] Figure 4 The video carousel method according to one embodiment of the present invention is schematically shown in the flow chart. Figure 3 ;
[0041] Figure 5 is a structural schematic diagram of a video carousel device in one embodiment of the present invention;
[0042] Figure 6 is a schematic diagram of a computer device in one embodiment of the present invention. DETAILED DESCRIPTION
[0043] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0044] The video carousel method provided in this embodiment can be applied to Figure 1 In an application environment, a client communicates with a server, and a display communicates with a server. The client includes but is not limited to various personal computers, laptops, smart phones, and tablet computers. The display may be a display, which may include multiple video windows, and may be used to present multiple video images in turn through a mixed screen mode. The server may be implemented by an independent server or a server cluster consisting of multiple servers.
[0045] In one embodiment, if Figure 2 As shown, a video carousel method is provided, comprising the following steps:
[0046] In step S110, when the first preset time before the video polling cycle is reached, a new video source data acquisition request is sent to the server;
[0047] In an embodiment of the present application, the first preset time may be a specific time point, exemplarily 5 seconds before the video polling cycle, or may be a specific time range, such as 5 seconds to 10 seconds before the video polling cycle.
[0048] In an embodiment of the present application, the new video source data may include different video source data collected by multiple different terminal devices, or may include video source data collected by one terminal device.
[0049] In an embodiment of the present application, within the first preset time before the video polling cycle, a request for obtaining new video source data may be sent to the server, and the server may receive video data collected by different clients as new video source data. Taking a video conference scenario as an example, the server may be connected to multiple clients and collect video data of different participants or venues in real time as new video source data.
[0050] Furthermore, audio data corresponding to each new video source data can also be obtained.
[0051] In an embodiment of the present application, the acquisition request may also include video data collected by the client that needs to be displayed in this polling cycle. For example, the acquisition request may include the identifier of client A, and the server may pass the video source data collected by client A to the display for display.
[0052] In step S120, before receiving the key frame of the new video source data sent by the server, the currently playing video source data continues to be played in the current video window;
[0053] In the embodiment of the present application, due to the influence of network delay, video decoding, key frame response time, etc., the key frame of the new video source data cannot be obtained in time, and when requesting new video source data from the server, the current playback window will stop playing the video source data currently being played, resulting in a black screen in the current playback window. Therefore, before receiving the key frame of the new video source data sent by the server, the current video source data continues to be played in the current video window, that is, there is no need to stop the video source data being played in the current video window. The phenomenon of automatic switching freeze or black screen when the video screen is polled is overcome, so that the polling screen switches smoothly and improves the user experience.
[0054] In an embodiment of the present application, after the current video window continues to play the currently played video source data, the method includes:
[0055] When the key frame of the new video source data is still not received within the second preset time before the next video polling cycle, the new video source data is re-added to the carousel waiting queue of the next video polling cycle, and the current video source continues to be played in the current video window.
[0056] Specifically, if no key frame of new video data is received within the second preset time before the next video polling cycle, the replacement of the new video data can be abandoned, and the new video source data sent by the server can be re-added to the carousel waiting queue, and the currently playing video source data can continue to be played in the current video window.
[0057] Furthermore, the new video source data may be placed in a carousel waiting queue in a specific polling cycle according to the actual acquisition time of the new video source data and the video polling cycle in which the actual acquisition time is located. Each polling cycle may correspond to a carousel waiting queue.
[0058] The second preset time may be a specific time point, for example, 5 seconds before the next video polling cycle arrives, or may be a specific time range, for example, 5 seconds to 10 seconds before the next video polling cycle arrives.
[0059] In step S130, when a key frame of the new video source data is received, the current video source data played in the current video window is replaced with the new video source data.
[0060] In an embodiment of the present application, when a key frame of new video source data is received, the current video source data played in the current video window is replaced with the new video source data, thereby ensuring that there is available video data when the polling screen switches, avoiding freezes or black screens.
[0061] See also Figure 2 In an embodiment of the present application, replacing the current video source data played in the current video window with the new video source data includes:
[0062] Start the video carousel and count the total number of video source data to be played in the carousel waiting queue;
[0063] Determine the starting replacement window and the rotation order according to the total number of the video source data to be rotated and the total number of windows that can currently play the video source;
[0064] Extracting preset video sources to be played from the carousel waiting queue in batches;
[0065] Determine the window of the video source to be replaced according to the starting replacement window, the carousel order and the number of the video sources to be played;
[0066] According to the starting replacement window and the carousel sequence, the original video source played in the window of the video source to be replaced is replaced with the video source to be played in sequence.
[0067] In an embodiment of the present application, the video source data to be carouseled in the carousel waiting queue may include the new video source data requested from the server. Specifically, after obtaining the new video source data, the obtained new video source data can be added to the carousel waiting queue of this video polling cycle in sequence according to preset rules, so as to replace the video played in the corresponding window.
[0068] The preset rules may include the order of obtaining new video source data, the priority order of playback, etc.
[0069] In the embodiment of the present application, the carousel order can be the carousel direction, such as replacing from left to right, or replacing from right to left, etc. Each window can be coded accordingly, such as 01, 02, 03, etc., and can be replaced in the order of small to large codes, or in the order of large to small codes, which can be set according to actual conditions.
[0070] In an embodiment of the present application, after starting the video carousel, the total number n of video sources to be rotated in the current carousel waiting queue can be counted, and then the starting replacement window can be determined based on the total number n of video sources to be rotated and the window m of the currently playable video source. Then, a preset number of video sources, such as x, can be extracted from the video sources to be rotated in the current carousel waiting queue in batches, and then starting from the starting replacement window, the video sources currently being played in the window of the video source to be replaced are replaced in turn according to the carousel order, thereby avoiding the impact of playing multiple video source data at the same time and parsing multiple new video source data in the cache on the system load.
[0071] Different video sources can be replaced in different windows, and one window can only replace one video source.
[0072] In an embodiment of the present application, the total number of the video source data to be played in a carousel is n, and determining the carousel order according to the total number of the video source data to be played in a carousel includes:
[0073] When the total number n is greater than the total number m of windows that can play video sources, replacement is performed starting from the first window that can play video sources;
[0074] When the total number n is less than the total number m of windows of the playable video source, replacement is performed starting from m-n+1 windows;
[0075] When the total number n is 0, the video carousel is stopped.
[0076] In the embodiment of the present application, the total number of video source data to be played in rotation is n, and the total number of windows that can play video sources is m. When the total number n is greater than the total number m of windows that can play video sources, replacement can be started from the first window that can play video sources; when the total number n is less than the total number m of windows that can play video sources, replacement can be started from m-n+1 windows; when the total number n is 0, there is no need to play video rotation, and the video rotation can be stopped at this time.
[0077] Among them, the first window that can play video sources can be the window with the smallest number that can play video sources. For example, when the windows that can currently play video sources can include 01, 05, 08, etc., then the window No. 01 can be the first window that can play video sources.
[0078] In an embodiment of the present application, the replacing of the original video source played in the window of the video source to be replaced with the video source to be played in sequence according to the starting replacement window and the carousel order includes:
[0079] After all the video source data waiting to be played in the carousel waiting queue have been replaced and played, calculate the total consumption duration t of the replacement playback;
[0080] When the total consumption duration t is greater than the duration of the video polling period, start a new round of video carousel;
[0081] When the total consumption duration t is less than the duration of the video polling period, wait for the next carousel period and then start the video carousel.
[0082] Specifically, the total consumption duration t is the time spent on replacing and playing all the video source data waiting to be played in the carousel waiting queue. When this time is greater than the duration of the current video polling period, immediately start a new round of video carousel. If it is less than the duration of the current video polling period, the remaining un-replaced video source data to be played can be put into the waiting carousel queue for the next polling period and wait for the next polling period to start the video carousel.
[0083] See Figure 4 , in an embodiment of the present application, the extracting a preset number of video sources to be played from the carousel waiting queue in batches includes:
[0084] When the number of current video source data in the carousel waiting queue is less than the preset number of video sources to be played extracted, extract all the video sources to be played in the carousel waiting queue.
[0085] Specifically, if the number of current video source data in the carousel waiting queue is y, which is less than the number x of the preset video sources to be played extracted, that is, y < x, then all the video source data y in the carousel waiting queue can be extracted without batch replacement.
[0086] In an embodiment of the present application, the replacing the original video source played in the window of the video source to be replaced and played with the video source to be played in sequence includes:
[0087] When the video source to be played cannot be played normally, continue to play the original video source in the window of the video source to be replaced and played;
[0088] Add the video source to be played back to the carousel waiting queue for the next carousel period.
[0089] Specifically, if the extracted video source to be played cannot be played normally, it will not be replaced, and the original video source being played will continue to be played in the window of the video source to be replaced. At the same time, the unplayable video source to be played can be added to the carousel waiting queue of the next carousel cycle to wait for the next replacement playback. This avoids replacing the unplayable video source, causing freezes or black screens, and affecting the user experience.
[0090] The above-mentioned video carousel method includes: sending a request to obtain new video source data to the server within the first preset time before reaching the video polling cycle; continuing to play the video source data currently being played in the current video window before receiving the key frame of the new video source data sent by the server; and replacing the current video source data played in the current video window with the new video source data when the key frame of the new video source data is received. In an embodiment of the present application, when performing a carousel switch between the old and new video sources, when the key frame of the new video source data requested from the server cannot be obtained in time, the video source data currently being played can continue to be played in the current video window until the key frame of the new video source data is obtained, and then the video source data currently being played in the current video window is replaced to realize the carousel switch between the old and new video sources, and avoid the problem of a black screen caused by the failure to obtain the new video source in time, so that the window can always play video data, thereby improving the user experience.
[0091] It should be understood that the order of execution of the steps in the above embodiment does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention.
[0092] In one embodiment, a video playback device is provided, which corresponds one-to-one to the video playback method in the above embodiment. Figure 5 As shown, the video playback device includes a new video data acquisition request sending unit 10, a playback unit 20 and a replacement unit 30. The functional modules are described in detail as follows:
[0093] A new video data acquisition request sending unit 10 is used to send a new video source data acquisition request to the server within a first preset time before the video polling cycle is reached;
[0094] The playing unit 20 is used to continue playing the currently playing video source data in the current video window before receiving the key frame of the new video source data sent by the server;
[0095] The replacement unit 30 is used to replace the current video source data played in the current video window with the new video source data when receiving the key frame of the new video source data.
[0096] In one embodiment, the device further includes: a processing unit, configured to:
[0097] When the key frame of the new video source data is still not received within the second preset time before the next video polling cycle, the new video source data is re-added to the carousel waiting queue of the next video polling cycle, and the current video source continues to be played in the current video window.
[0098] In one embodiment, the replacement unit 30 is further configured to:
[0099] Start the video carousel and count the total number of video source data to be played in the carousel waiting queue;
[0100] Determine the starting replacement window and the rotation order according to the total number of the video source data to be rotated and the total number of windows that can currently play the video source;
[0101] Extracting preset video sources to be played from the carousel waiting queue in batches;
[0102] Determine the window of the video source to be replaced according to the starting replacement window, the carousel order and the number of the video sources to be played;
[0103] According to the starting replacement window and the carousel sequence, the original video source played in the window of the video source to be replaced is replaced with the video source to be played in sequence.
[0104] In one embodiment, the total number of the video source data to be played in a carousel is n, and the replacement unit 30 is further used to:
[0105] When the total number n is greater than the total number m of windows that can play video sources, replacement is performed starting from the first window that can play video sources;
[0106] When the total number n is less than the total number m of windows of the playable video source, replacement is performed starting from m-n+1 windows;
[0107] When the total number n is 0, the video carousel is stopped.
[0108] In one embodiment, the replacement unit 30 is further configured to:
[0109] After all the video source data waiting to be played in the carousel waiting queue are replaced and played, the total consumed time t of replacement playback is calculated;
[0110] When the total consumed time t is greater than the duration of the video polling cycle, a new round of video carousel is started;
[0111] When the total consumed time t is less than the duration of the video polling cycle, the next carousel cycle is waited for to start the video carousel.
[0112] In one embodiment, the replacement unit 30 is further configured to:
[0113] When the current video source data quantity in the carousel waiting queue is less than the extracted preset number of to-be-played video sources, all the to-be-played video sources in the carousel waiting queue are extracted.
[0114] In one embodiment, the replacement unit 30 is further configured to:
[0115] When the video source to be played cannot be played normally, continue to play the original video source in the window of the video source to be replaced;
[0116] The to-be-played video source is added again to the carousel waiting queue of the next carousel cycle.
[0117] In an embodiment of the present application, when performing a carousel switching between old and new video sources, when the key frame of the new video source data requested from the server cannot be obtained in time, the video source data that is currently being played can continue to be played in the current video window until the key frame of the new video source data is obtained, and then the video source data that is currently being played in the current video window is replaced to achieve a carousel switching between the old and new video sources. In addition, the black screen problem caused by the failure to obtain the new video source in time can be avoided, so that the window can always play video data, thereby improving the user experience.
[0118] For the specific definition of the video playback device, please refer to the definition of the video playback method above, which will not be repeated here. Each module in the above video playback device can be implemented in whole or in part by software, hardware and a combination thereof. The above modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0119] In one embodiment, a computer device is provided. The computer device may be a terminal device, and its internal structure diagram may be as follows: Figure 6 As shown. The computer device includes a processor, a memory, and a network interface connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a readable storage medium. The readable storage medium stores computer-readable instructions. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer-readable instructions are executed by the processor, a video carousel method is implemented. The readable storage medium provided in this embodiment includes a non-volatile readable storage medium and a volatile readable storage medium.
[0120] A computer device includes a memory, a processor, and computer-readable instructions stored in the memory and executable on the processor. When the processor executes the computer-readable instructions, the steps of the video carousel method described above are implemented.
[0121] A readable storage medium stores computer-readable instructions, and when the computer-readable instructions are executed by a processor, the steps of the above-mentioned video carousel method are implemented.
[0122] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing related hardware through computer-readable instructions, and the computer-readable instructions can be stored in a non-volatile readable storage medium or a volatile readable storage medium. When the computer-readable instructions are executed, they may include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0123] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.
[0124] The embodiments described above are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included in the protection scope of the present invention.
Claims
1. A video carousel method, characterized in that: The method comprises: When the first preset time before the video polling cycle is reached, a new video source data acquisition request is sent to the server; Before receiving the key frame of the new video source data sent by the server, continue to play the currently playing video source data in the current video window; When a key frame of the new video source data is received, the current video source data played in the current video window is replaced with the new video source data; The replacing the current video source data played in the current video window with the new video source data includes: Start the video carousel, count the total number of video source data to be played in the carousel waiting queue; determine the starting replacement window and the carousel order according to the total number of video source data to be played and the total number of windows that can currently play the video source, wherein the carousel order is determined by the following method: When the total number n is greater than the total number m of windows that can play video sources, replacement is performed starting from the first window that can play video sources; When the total number n is less than the total number m of windows of the playable video source, replacement is performed starting from m-n+1 windows; When the total number n is 0, the video carousel is stopped; Extracting preset video sources to be played from the carousel waiting queue in batches; Determine the window of the video source to be replaced according to the starting replacement window, the carousel order and the number of the video sources to be played; Starting from the starting replacement window, the original video source played in the window of the video source to be replaced is replaced with the video source to be played in sequence according to the carousel sequence; wherein each window has a corresponding code, and the replacement is performed in the order of the codes from small to large or in the order of the codes from large to small; or the carousel sequence includes a carousel direction, and the replacement is performed in the order from left to right or in the order from right to left, different video sources can be replaced in different windows, and one window can only replace one video source; After all the video source data waiting to be played in the carousel waiting queue are replaced and played, the total consumed time t of replacement playback is calculated; When the total consumed time t is greater than the duration of the video polling cycle, a new round of video carousel is started; When the total consumed time t is less than the duration of the video polling cycle, the next carousel cycle is waited for and the video carousel is started again, wherein the replaced video source is put back into the waiting sequence for the next cycle video carousel. If the new video source cannot be played, no replacement is performed and the new video source is added to the waiting sequence for the next cycle video carousel.
2. The video carousel method according to claim 1, characterized in that: After the current video window continues to play the currently played video source data, the method includes: When the key frame of the new video source data is not received within the second preset time before the next video polling cycle, the new video source data is re-added to the carousel waiting queue of the next video polling cycle, and the current video source data continues to be played in the current video window.
3. The video carousel method according to claim 1, characterized in that: The step of extracting preset video sources to be played from the carousel waiting queue in batches includes: When the current video source data quantity in the carousel waiting queue is less than the extracted preset number of to-be-played video sources, all the to-be-played video sources in the carousel waiting queue are extracted.
4. The video carousel method according to claim 1, characterized in that: The step of sequentially replacing the original video source played in the window of the video source to be replaced with the video source to be played includes: When the video source to be played cannot be played normally, continue to play the original video source in the window of the video source to be replaced; The to-be-played video source is added again to the carousel waiting queue of the next carousel cycle.
5. A video carousel device, characterized in that: The device comprises: A new video data acquisition request sending unit, used for sending a new video source data acquisition request to the server within a first preset time before the video polling cycle is reached; A playback unit, configured to continue playing the currently played video source data in the current video window before receiving a key frame of the new video source data sent by the server; a replacement unit, configured to replace the current video source data played in the current video window with the new video source data when a key frame of the new video source data is received; The replacement unit is further used for: Start the video carousel and count the total number of video source data to be played in the carousel waiting queue; Determine the starting replacement window and the rotation order according to the total number of the video source data to be rotated and the total number of windows that can currently play the video source; Extracting preset video sources to be played from the carousel waiting queue in batches; The window of the video source to be replaced is determined according to the starting replacement window, the carousel order and the number of the video sources to be played, wherein the carousel order is determined in the following manner: When the total number n is greater than the total number m of windows that can play video sources, replacement is performed starting from the first window that can play video sources; When the total number n is less than the total number m of windows of the playable video source, replacement is performed starting from m-n+1 windows; When the total number n is 0, the video carousel is stopped; Starting from the starting replacement window, the original video source played in the window of the video source to be replaced is replaced with the video source to be played in sequence according to the carousel sequence; wherein each window has a corresponding code, and the replacement is performed in the order of the codes from small to large or in the order of the codes from large to small; or the carousel sequence includes a carousel direction, and the replacement is performed in the order from left to right or in the order from right to left, different video sources can be replaced in different windows, and one window can only replace one video source; After all the video source data waiting to be played in the carousel waiting queue are replaced and played, the total consumed time t of replacement playback is calculated; When the total consumed time t is greater than the duration of the video polling cycle, a new round of video carousel is started; When the total consumed time t is less than the duration of the video polling cycle, the next carousel cycle is waited for and the video carousel is started again, wherein the replaced video source is put back into the waiting sequence for the next cycle video carousel. If the new video source cannot be played, no replacement is performed and the new video source is added to the waiting sequence for the next cycle video carousel.
6. A computer device comprising a memory, a processor, and computer-readable instructions stored in the memory and executable on the processor, characterized in that: When the processor executes the computer-readable instructions, the steps of the video carousel method according to any one of claims 1 to 4 are implemented.
7. A readable storage medium storing computer-readable instructions, characterized in that: When the computer-readable instructions are executed by a processor, the steps of the video carousel method according to any one of claims 1 to 4 are implemented.
Citation Information
Patent Citations
Polling playing method and device for articulated naturality web monitoring video stream
CN110740295A
Video stream carousel method and device of video conference system based on cascade framework
CN110913165A