Video tracking device, method, video playback device, method and electronic device

By accurately determining the preset switching time and video tracking time, the problem of unstable picture during video switching is solved, the stability and smoothness of video playback are achieved, and the picture jitter and stuttering are avoided.

CN115550689BActive Publication Date: 2025-07-04HAINING ESWIN IC DESIGN CO LTD +1
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211160738.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-22
Publication Date
2025-07-04
Estimated Expiration
2042-09-22

AI Technical Summary

Technical Problem

In the prior art, the video switching method is prone to causing problems such as shaking and lag in the video screen, especially during the video switching process, the stability and smoothness of the screen cannot be guaranteed.

Method used

Through the preset switching time determination module and the video tracking time determination module, the video tracking time is accurately determined, ensuring that the original video stream is played first during the video switching process and switch to the target video stream after the preset time, avoiding the video screen disappearing, jittering and stuttering.

Benefits of technology

It improves the stability and smoothness of video images, reduces the screen, shaking and stuttering of video images, and ensures the stability of the playback system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115550689B_ABST
    Figure CN115550689B_ABST
Patent Text Reader

Abstract

Embodiments of the present application disclose a video tracking device, method, video playback device, method, and electronic device, relating to the field of computer technology. In this device, a preset switching time determination module is configured to receive a video stream switching instruction indicating to switch the original video stream to a target video stream, and determine the preset switching time of the electronic device; wherein the preset switching time is the reserved duration of the electronic device when performing video stream switching; a video tracking time determination module is configured to determine the video tracking time according to the preset switching time and the unit playback time of the original video stream; so as to play the original video stream within the video tracking time and play the target video stream after the video tracking time ends. By applying the video tracking device provided in the embodiments of the present application, it is possible to improve the stability and smoothness of video images during video switching and reduce the occurrence of situations such as video screen freeze, jitter, and stuttering.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technologies, and in particular, to a video tracking device, a method, a video playback device, a method, an electronic device, and a computer storage medium. Background Art

[0002] During the playback of multimedia files, video switching scenarios often occur, such as switching the audio source or video source, or switching scenarios such as video clarity or video frame rate. In the switching scenario, pauses or black screens are usually used for switching, and only when switching in the porch area (invalid area) can smooth audio-visual switching be ensured.

[0003] However, during video switching, if switching is performed in the blank area (valid area, such as the key frame area) by means of pauses or black screens, it is easy to reduce the playback effect of the video picture, such as video picture jitter, screen freezing, stuttering, etc., and even cause the system of the playback device to freeze, resulting in the video picture being unable to return to normal, etc. Therefore, in the related art, there are defects in the audio-visual switching method. Summary of the Invention

[0004] Embodiments of this application provide a video tracking device to solve the problem that the video switching method in the related art easily reduces the playback effect of the video picture.

[0005] Correspondingly, embodiments of this application also provide a video tracking method, a video playback device, a video playback method, an electronic device, and a computer-readable storage medium to illustrate the implementation of the above video tracking device.

[0006] On the one hand, a video tracking device is provided, and the device includes:

[0007] A preset switching time determination module, configured to receive a video stream switching instruction indicating to switch the original video stream to the target video stream, and determine the preset switching time of the electronic device; wherein, the preset switching time is the reserved duration when the electronic device performs video stream switching;

[0008] A video tracking time determination module, configured to determine the video tracking time according to the preset switching time and the unit playback time of the original video stream, so as to play the original video stream within the video tracking time and play the target video stream after the video tracking time ends.

[0009] On the other hand, a video playback device is provided, and the device includes:

[0010] A video tracking device is configured to receive a video stream switching instruction indicating to switch an original video stream to a target video stream, and determine a preset switching time of an electronic device; and determine a video tracking time according to the preset switching time and a unit playing time of the original video stream; wherein the preset switching time is a reserved duration when the electronic device performs video stream switching.

[0011] A caching device is configured to cache the original video stream and the target video stream.

[0012] A video playing device is configured to play the original video stream within the video tracking time, and play the target video stream after the video tracking time ends.

[0013] On the other hand, a video tracking method is provided, which includes:

[0014] Receiving a video stream switching instruction indicating to switch an original video stream to a target video stream, and determining a preset switching time of the electronic device; wherein the preset switching time is a reserved duration when the electronic device performs video stream switching.

[0015] Determining a video tracking time according to the preset switching time and a unit playing time of the original video stream, so as to play the original video stream within the video tracking time, and play the target video stream after the video tracking time ends.

[0016] On the other hand, a video playing method is provided, which includes:

[0017] Receiving a video stream switching instruction indicating to switch an original video stream to a target video stream, and determining a preset switching time of the electronic device; determining a video tracking time according to the preset switching time and a unit playing time of the original video stream; wherein the preset switching time is a reserved duration when the electronic device performs video stream switching.

[0018] Obtaining and playing the original video stream within the video tracking time, and obtaining and playing the target video stream after the video tracking time ends.

[0019] On the other hand, an embodiment of the present application provides an electronic device, including a processor and a memory, which are interconnected;

[0020] The memory is configured to store a computer program;

[0021] The processor is configured to execute the video tracking method or the video playing method provided by the embodiment of the present application when calling the computer program.

[0022] On the other hand, an embodiment of the present application provides a computer-readable storage medium storing a computer program, which is executed by a processor to implement the video tracking method or video playing method provided by the embodiment of the present application.

[0023] In the embodiment of the present application, by receiving a video stream switching instruction indicating to switch the original video stream to the target video stream, determining a preset switching time of the electronic device, and accurately determining the video tracking time according to the preset switching time and the unit playing time of the original video stream, so that the original video stream is played within the video tracking time, and the target video stream is played after the video tracking time ends. It is possible to improve the stability and smoothness of the video image during the switching process and reduce the occurrence of situations such as video screen freeze, jitter, and stuttering. Moreover, the application process of this device is simple, and it is not necessary to determine the blank area and porch area of the original video stream or the target video stream, and it is possible to switch from any time point of the original video stream to the target video. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] To more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings required to be used in the embodiments. Obviously, the following described drawings are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.

[0025] Figure 1 Shows a schematic structural diagram of a video tracking device provided by an embodiment of the present application;

[0026] Figure 2 Shows a schematic application scenario diagram of a video tracking device provided by an embodiment of the present application;

[0027] Figure 3 Shows a schematic diagram of a video playing time sequence provided by an embodiment of the present application;

[0028] Figure 4 Shows another schematic diagram of a video playing time sequence provided by an embodiment of the present application;

[0029] Figure 5 Shows a schematic structural diagram of a video playing device provided by an embodiment of the present application;

[0030] Figure 6 Shows a schematic flowchart of a video tracking method provided by an embodiment of the present application;

[0031] Figure 7 Shows a schematic flowchart of a video playing method provided by an embodiment of the present application;

[0032] Figure 8 The structural schematic diagram of the electronic device provided by the embodiment of the present application is shown. Detailed implementation manners

[0033] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.

[0034] Figure 1 The structural schematic diagram of a video tracking device provided by the embodiment of the present application is shown. This device can be applied to any electronic device, and this electronic device can be a client or a server.

[0035] It should be noted that the above client (which can also be referred to as a user terminal or user equipment (User Equipment, UE)) can be a smart phone, a tablet computer, a notebook computer, a desktop computer, etc. When this method is applied to the client, it can be specifically applied to the audio and video player application or the audio and video plugin of this client. Taking video tracking through this client as an example, a to-be-played signal can be obtained from a video signal sending end, the video tracking time can be obtained by processing the to-be-played signal, and on the video playing end, the processed to-be-played signal can be played based on the video tracking time, thus realizing the playing process of the video stream. The video signal sending end and the video playing end can be different modules of the same electronic device.

[0036] The above server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers. It can also be a cloud server or server cluster providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms.

[0037] Those skilled in the art should understand that the above clients and servers are only examples. Other existing or future possible terminals or servers that can be applied to the present application should also be included within the protection scope of the present application and are hereby incorporated by reference.

[0038] As Figure 1 shown, the device 10 includes:

[0039] A switching time determination module 110, configured to receive a video stream switching instruction indicating to switch an original video stream to a target video stream, and determine a preset switching time of the electronic device; wherein the preset switching time is a reserved duration when the electronic device performs video stream switching.

[0040] During video processing, as long as there are two video streams with different corresponding video parameters at the video signal sending end, these two video streams can be regarded as different. Among them, the video parameters can be the parameters of the present application for both, for example, the picture of each frame (i.e., the video picture), the clarity of the video itself, and the frame rate during video playback.

[0041] Both the original video stream and the target video stream provided by the embodiments of the present application can be video signals obtained from a video signal sending end. For example, the original video stream and the target video stream can be two video streams with the same video picture but different clarity or frame rate, or two video streams with the same clarity and frame rate but different video pictures.

[0042] The video stream switching instruction can be initiated by a user. For example, when the user is watching a video, by triggering a clarity adjustment control in the video playback interface to adjust the clarity of the video, a video stream switching instruction to switch the clarity of the same video from the first clarity to the second clarity is initiated, where the video stream with the first clarity is the original video stream, and the video stream with the second clarity is the target video stream.

[0043] The video stream switching instruction can also be generated by the electronic device based on a detection result. For example, when the electronic device detects that the original video stream has ended, a video stream switching instruction to switch to the target video stream is initiated. Or, during video playback, when the electronic device detects that the broadband rate is less than a set value, a video stream switching instruction to switch from a higher clarity of the same video to a lower clarity is initiated, where the video stream with the higher clarity is the original video stream, and the video stream with the lower clarity is the target video stream.

[0044] The preset switching time is a reserved duration when the electronic device performs video stream switching, and this reserved duration can include the duration of obtaining the switched video stream (i.e., the target video stream) and the duration required to switch the video stream before switching (the original video stream) to the target video stream.

[0045] This preset switching time can be determined according to the device parameters of different electronic devices. For different electronic devices, their corresponding preset switching times may be different.

[0046] Due to the reserved duration when an electronic device performs video stream switching, after the original video stream finishes playing, it will inevitably pass through a preset switching time before playing the target video stream. Since there is no actual video picture during the preset switching time, the video picture will disappear (i.e., the screen will go black) during the preset switching time.

[0047] The tracking time determination module 120 is configured to determine the video tracking time according to the preset switching time and the unit playing time of the original video stream, so as to play the original video stream within the video tracking time and play the target video stream after the video tracking time ends.

[0048] The unit playing time of the original video stream can be the playing time granularity of the original video stream. For example, the playing duration of each frame image in the original video stream can be determined as the unit playing time of the original video stream.

[0049] The unit playing time of the target video stream can be the playing time granularity of the target video stream. For example, the playing duration of each frame image in the target video stream can be determined as the unit playing time of the target video stream.

[0050] During the video playback process, images are usually displayed in the form of line scanning and field scanning. After the field scanning or line scanning ends, a pulse signal will be generated to re-perform the field scanning or line scanning.

[0051] Under ideal circumstances, after the original video stream finishes playing, the target video stream will be directly played. The pulse signal when triggering the playback of the target video stream (i.e., the pulse signal before the unit playing time of the target video stream) refers to the first pulse signal generated after playing the original video stream (i.e., the pulse signal after the unit playing time of the original video stream).

[0052] If the target video stream is directly played after the original video stream finishes playing and after passing through the preset switching time, the pulse signal when triggering the playback of the target video stream refers to the second pulse signal generated after passing through the preset switching time (i.e., the pulse signal after the preset switching time).

[0053] Among them, if the second pulse signal is the same as the first pulse signal, smooth switching of the video picture can be achieved.

[0054] If the second pulse signal is different from the first pulse signal, even if a picture appears, there will be situations such as video picture jitter and stuttering. In view of this, in the embodiments of the present application,

[0055] Since the playback information of the target video stream has not been obtained before the preset switching time ends, after determining the preset switching time, in order to ensure that the picture can be played normally, the image corresponding to the unit playback time of the original video stream (for example, the last frame image of the original video stream) can be repeatedly played, and the playback duration corresponding to the last frame image of the original video stream (i.e., the unit playback time of the original video stream) is used as the start part of the video tracking time, and it is determined whether the second pulse signal is consistent with the first pulse signal, so as to determine the video tracking time based on this result.

[0056] After the preset switching time ends, the playback information of the target video stream can be obtained. At this time, if the second pulse signal is not consistent with the first pulse signal, it is necessary to further determine the video tracking time to make the third pulse signal after the video tracking time consistent with the fourth pulse signal after playing the target video stream, so as to achieve a smooth switch. At this time, the video tracking time includes the unit playback time of the original video stream and the total playback duration of the image to be tracked determined after the original video stream.

[0057] When playing according to the video tracking time determined by this device, in order to ensure that the picture can be played normally and further avoid visual chaos during video switching, the image corresponding to the unit playback time of the original video stream (for example, the last frame image in the original video stream) can be repeatedly played within the video tracking time, and the target video stream can be played after the video tracking time ends, which can accurately control the video playback picture and avoid situations such as the video picture disappearing, shaking, and freezing.

[0058] Since in the embodiment of this application, it is necessary to control that the original video stream is played all the time before the video tracking time ends, and the switched target video stream will be played after the video tracking time ends. The switching process can be regarded as tracking the target video stream to achieve the purpose of playing the target video stream as soon as possible. Then, this switching process can be called a video tracking process, the time required for the switching process is called the video tracking time, and the preset switching time and the target video stream are regarded as the images to be tracked.

[0059] In an embodiment of the present application, by receiving a video stream switching instruction indicating to switch the original video stream to the target video stream, determining a preset switching time of the electronic device, and based on the preset switching time, the unit playback time of the original video stream, and the unit playback time of the target video stream, accurately determining the video tracking time, so as to play the original video stream within the video tracking time and play the target video stream after the video tracking time ends. It is possible to improve the stability and smoothness of the video image during the switching process, avoid situations such as the disappearance, jitter, and freezing of the video picture, ensure the stability of the playback system, and improve the video playback effect. Moreover, the application process of this device is simple, and it is not necessary to determine the blank area and porch area of the original video stream or the target video stream, and it is possible to switch from any time point of the original video stream to the target video.

[0060] As an example application scenario, as Figure 2 shown, when performing a video switching operation, the source video stream (i.e., the src_video original video stream and the playback video stream) can be obtained from the video signal sending end (i.e., the source end), and the obtained source video stream is cached in the buffer 230 (for example Figure 2 shown as DRAM (dynamic random access memory)). The timing generator 210 (i.e., timing_gen, the video tracking device provided in the embodiment of the present application) receives the video stream switching instruction, determines the video tracking time based on the preset switching time and the unit playback time of the original video stream, and sends the video tracking time to the video tracker 220 (i.e., IP_tracking), so that the video tracker 220 plays the target-end video stream (i.e., dest_video) according to the video tracking time. Specifically, within the video tracking time, the original video stream is obtained from the buffer 230 and played, and after the video tracking time ends, the target video stream is obtained from the buffer 230 and played).

[0061] Among them, when there is no need to perform a video switching operation, the video tracker 220 can also directly obtain the video stream from the source end and play the video stream at the target end.

[0062] In a possible implementation manner, when the above-mentioned video tracking time determination module 120 determines the video tracking time according to the preset switching time and the unit playback time of the original video stream, it can be used for:

[0063] Determine the video tracking method according to the first time difference between the preset switching time and the unit playback time of the original video stream, and determine the video tracking time corresponding to the video tracking method.

[0064] As described above, if the second pulse signal generated after the preset switching time is the same as the first pulse signal generated after the unit playing time of the original video stream, smooth switching can be achieved, and the preset switching time or the unit playing time of the repeated original video stream can be directly used as the video tracking time. If they are not the same, it is necessary to re-determine the video tracking time to make the third pulse signal after the video tracking time the same as the first pulse signal to ensure smooth switching.

[0065] In this implementation method, the first time difference between the preset switching time and the unit playing time of the original video stream can be determined to make the second pulse signal generated after the preset switching time the same as the first pulse signal generated after the unit playing time of the original video stream, so as to determine whether to continue tracking. When it is necessary to continue tracking, the corresponding video tracking time can be further determined based on this video tracking method.

[0066] In this way, the video tracking method and the video tracking time can be accurately determined.

[0067] Specifically, when the above-mentioned video tracking time determination module 120 determines the video tracking method according to the first time difference between the preset switching time and the unit playing time of the original video stream, it can be used for:

[0068] Determine the first time difference between the preset switching time and the unit playing time of the original video stream;

[0069] When the first time difference is less than the preset switching threshold, determine the video tracking method as the first tracking method;

[0070] When the first time difference is greater than or equal to the preset switching threshold, determine the video tracking method as the second tracking method;

[0071] Among them, in the first tracking method, the playing duration of each frame of the image to be tracked decreases in turn; in the second tracking method, the playing duration of each frame of the image to be tracked increases in turn.

[0072] The preset switching threshold can be determined according to the actual situation. For example, it can be determined according to the device parameters of the electronic device and the user's requirements for video switching. Among them, the smaller the preset switching threshold, the closer the corresponding video switching effect is to the ideal state, and the smoother the switching is.

[0073] When the first time difference is less than the preset switching threshold, that is, the gap between the preset switching time and the unit playing time of the original video stream is small. When the first time difference is greater than or equal to the preset switching threshold, that is, the gap between the preset switching time and the unit playing time of the original video stream is large.

[0074] Among them, when the first time difference is 0, the unit playback time of the original video stream can be directly used as the time to be tracked, and video playback is performed according to this time to be tracked. For example, the last frame image of the original video stream is repeatedly played, and after the repeated playback ends, the target video stream is played.

[0075] To more clearly represent the tracking process, the following uses Figure 3 and Figure 4 The timing diagram shown as an example to illustrate the video tracking process:

[0076] In Figure 3 and Figure 4 It is assumed that after the original video stream finishes playing, a preset switching time can be directly connected, and after the preset switching time, the target video stream can be directly connected. By inserting the timing corresponding to the preset switching time total1 after the timing corresponding to the unit playback time total0 of the original video stream respectively, and repeating the timing corresponding to the unit playback time total2 of the target video stream after the timing corresponding to the preset switching time total1, the source-end timing diagram src_vs, that is, the playback timing diagram under ideal conditions, can be represented.

[0077] After the timing corresponding to the unit playback time total0 of the original video stream, the timing corresponding to the unit playback time total0 of the original video stream is repeated (in the embodiments of the present application, this repeated timing is also regarded as a part of the tracking process, that is, the time to be tracked includes the unit playback time of the repeated original video stream), and after the repeated timing, the real tracking timing is connected to represent the playback-end timing diagram (that is, the target-end timing diagram) dest_vs, that is, the playback timing diagram in the actual situation.

[0078] Among them, in the target-end timing diagram, each total_track can be regarded as a frame of image to be tracked. And the video frame where total0 is repeated in the target-end timing diagram and the video frame where total1 is located in the source-end timing diagram are regarded as corresponding video frames one by one, and the video frame where total_track0 is located in the target-end timing diagram and the first video frame where total2 is located in the source-end timing diagram are regarded as corresponding video frames one by one.

[0079] As an example, such as Figure 3As shown, in the first tracking mode, the first time difference is less than the preset switching threshold. During the corresponding tracking process, while ensuring that the number of images to be tracked (i.e., the images corresponding to each unit playback time at the target end) is the same as the number of images being tracked (i.e., the images corresponding to each unit playback time at the source end), it is "easier" for the target end to track the corresponding images to be tracked at the source end, that is, the target video stream. It is possible to control the video frames at the target end to correspond one by one with the video frames at the source end from the perspective of successively reducing the gap between the playback duration of each image to be tracked and the unit playback time of the target video stream, and successively shortening the playback duration of each image to be tracked (such as Figure 3 shown as total0>total_track0>total_track1, and the time lengths corresponding to total0, total_track0, and total_track1 decrease successively), so as to accelerate the consistency of the third pulse signal and the fourth pulse signal after the image to be tracked.

[0080] Since the video tracking time required by the first tracking mode may be short, the first tracking mode can also be called "tracking fast".

[0081] As another example, as Figure 4 shown, in the second tracking mode, the first time difference is greater than or equal to the preset switching threshold. During the corresponding tracking process, while ensuring that the number of images to be tracked is the same as the number of images being tracked, it is "difficult" for the target end to track the corresponding target video stream at the source end. Then, from the perspective of successively increasing the gap between the playback duration of each image to be tracked and the unit playback time of the target video stream, it is possible to control the number of images to be tracked to be less than the number of images being tracked, so as to further track the next frame of the target video stream corresponding one by one at the source end, that is, successively increasing the playback duration of the images to be tracked (such as Figure 4 shown as total0<total_track0<total_track1, and the time lengths corresponding to total0, total_track0, and total_track1 increase successively), so that the last image to be tracked exceeds the unit playback time of one frame of the target video stream, thereby making the third pulse signal and the fourth pulse signal after the image to be tracked consistent. Among them, in this implementation, in order to minimize the tracking time as much as possible, the number of images to be tracked can be controlled to be the number of images being tracked - 1.

[0082] Since the video tracking time required by the second tracking mode may be long, the second tracking mode can also be called "tracking slow".

[0083] In this way, based on the relationship between the first time difference between the preset switching time and the unit playback time of the original video stream and the preset switching threshold, different tracking methods are selected, which can improve the tracking efficiency and reduce the tracking time while taking into account the stability of the tracking process.

[0084] In a possible implementation, when determining the video tracking time corresponding to the video tracking method, the above-mentioned video tracking time determination module 120 can be used for:

[0085] Based on the video tracking method, determine the tracking time of the next frame image of the image to be tracked;

[0086] In the case where the tracking time of the next frame image of the image to be tracked is less than or equal to the tracking threshold, determine the end of the video tracking time;

[0087] Among them, the tracking threshold is less than the preset switching threshold.

[0088] The tracking time of the next frame image of the image to be tracked, that is, the time interval between the next frame image and the unit playback time of the target video stream after the tracking of the image to be tracked ends.

[0089] The tracking threshold track_thr can be determined according to the actual situation. The smaller the tracking threshold, the smoother the switching process and the more it can meet the actual needs. For example, the tracking threshold track_thr can be set to 4ms.

[0090] Considering that in the actual process, it may not be possible to ensure that the time interval with the target video stream is 0 after the tracking of the image to be tracked ends, that is, the tracking time of the next frame image of the image to be tracked is 0.

[0091] By setting the tracking threshold, when the tracking time of the next frame image of the image to be tracked is less than or equal to the tracking threshold, the tracking is ended to play the target video stream, which can effectively improve the tracking efficiency while taking into account the tracking accuracy.

[0092] Specifically, the tracking time of the next frame image of the image to be tracked can be determined by the following method:

[0093] Optionally, when determining the tracking time of the next frame image of the image to be tracked, the above-mentioned video tracking time determination module 120 can be used for:

[0094] Determine the tracking time of the first frame of the image to be tracked as the preset switching time;

[0095] According to the unit playback time of the original video stream, determine the playback duration of the first frame of the image to be tracked;

[0096] Determine the tracking time of the next frame of image according to the playback duration of each frame of the image to be tracked and the tracking time of the image to be tracked.

[0097] The tracking time of the next frame of the image to be tracked is the untracked time of the next frame of the target video stream relative to the video frame corresponding to the image to be tracked in the source video stream after the playback of the image to be tracked is completed.

[0098] Before the preset switching time ends, if the target video stream has not been obtained yet, regard the preset switching time as the first frame of the image to be tracked, and regard the target video stream after the preset switching time as the other images to be tracked.

[0099] It can be understood that in both the first tracking method and the second tracking method, the preset switching time can be regarded as the untracked time of the first frame of the image to be tracked at the target end relative to the corresponding video frame in the source video stream. The unit playback time of the original video stream is the playback duration of the first frame of the image to be tracked.

[0100] It should be noted that after determining the tracking time of the next frame of image each time, it is necessary to first determine whether to stop video tracking based on this tracking time to avoid the situation of continuous tracking, which may lead to a long tracking time and affect the user experience.

[0101] Among them, if the difference between the playback duration of the image to be tracked and the tracking time of the image to be tracked is 0, that is, the third pulse signal and the fourth pulse signal after the image to be tracked are the same, there is no need to determine a new image to be tracked again, and the target video stream can be directly played.

[0102] For example, for the first frame of the image to be tracked, if the preset switching time (the tracking time of the first frame of the image to be tracked) is the same as the unit playback time of the original video stream (the playback duration of the first frame of the image to be tracked), the difference between the two (that is, the difference between the unit playback time of the original video stream and the preset switching time total0 - total1) is 0, which means that only one frame of the image to be tracked is required in the current tracking process, and the tracking time of the next frame of the image to be tracked is 0.

[0103] If the difference between the playback duration of the image to be tracked and the tracking time of the image to be tracked is not 0, that is, the third pulse signal and the fourth pulse signal after the image to be tracked are different, it is necessary to determine a new image to be tracked (that is, the next frame of image) again until the third pulse signal and the fourth pulse signal after the new image to be tracked are the same before the target video stream can be played.

[0104] Through the above method, the tracking time of the next frame of each frame of the image to be tracked can be accurately determined, which is convenient for further determining whether to stop video tracking.

[0105] In the case where a new image to be tracked needs to be determined again, the tracking time of the next frame image can be determined in the following manner:

[0106] Optionally, when the above video tracking time determination module 120 determines the tracking time of the next frame image according to the playing duration of each frame of the image to be tracked and the tracking time of the image to be tracked, it can be used for:

[0107] Based on the playing duration of each frame of the image to be tracked and the tracking time of the image to be tracked, determine the tracked time of the next frame image;

[0108] According to the tracked time of the next frame image and the unit playing time of the target video stream, determine the tracking time of the next frame image.

[0109] The tracked time of the next frame image of the image to be tracked, that is, the difference between the playing duration of the image to be tracked and the tracking time of the image to be tracked. Specifically, that is, after the playing of the image to be tracked ends, the duration exceeding the tracking time of the image to be tracked.

[0110] In this implementation manner, the image to be tracked corresponding to the new image to be tracked is an image in the target video stream. As recorded above, as Figure 3 shown, in the first tracking manner, except for the first frame of the image to be tracked, each frame of the image to be tracked corresponds one-to-one with the corresponding image to be tracked (i.e., the target video stream). The tracking time indicates how much time is still needed after the current image to be tracked finishes playing to reach the end time of the current frame of the target video stream. Then, the difference between the playing duration of the image to be tracked and the tracking time of the image to be tracked (i.e., the tracked time distance of the next frame image) can be determined first, and then, based on the unit playing time of the target video stream, subtract this difference total2 - distance to obtain the tracking time of the next frame image.

[0111] As Figure 4 shown, in the second tracking manner, except for the first frame of the image to be tracked, the image to be tracked corresponding to each frame of the image to be tracked (i.e., the target video stream) should be the next frame of the image to be tracked at the source end. The tracking time indicates how much time is still needed to reach the start time of the next frame of the target video stream. The difference between the playing duration of the image to be tracked and the tracking time of the image to be tracked (i.e., the tracked time distance of the next frame image) can be determined first, and then, based on 2 times the unit playing time of the target video stream, subtract this difference =total2 + phase to obtain the tracking time of the next frame image.

[0112] Through the above method, the tracking time of the next frame image of each frame of the image to be tracked can be accurately determined.

[0113] Optionally, the above video tracking time determination module 120 can also be used to determine the playing duration of the image to be tracked based on the following method:

[0114] In the first tracking method, according to the tracking time of the image to be tracked and the preset minimum tracking duration, the playing duration of each frame of the image to be tracked except the first frame is determined;

[0115] In the second tracking method, according to the tracking time of the image to be tracked and the preset maximum tracking duration, the playing duration of each frame of the image to be tracked except the first frame is determined.

[0116] In the first tracking method, since it is necessary to sequentially reduce the playing duration of each frame of the image to be tracked to avoid the tracking time being too short and lower than the minimum playing strength of the electronic device, a preset minimum tracking duration can be set to accurately determine the actual playing duration of each frame of the image to be tracked.

[0117] Specifically: for each frame of the image to be tracked except the first frame, when the tracking time of the image to be tracked is less than or equal to the preset minimum tracking duration, the playing duration of the image to be tracked is determined to be the preset minimum tracking duration. When the tracking time of the image to be tracked is greater than the preset minimum tracking duration, the playing duration of the image to be tracked is determined to be the tracking time of the image to be tracked.

[0118] In the second tracking method, since it is necessary to sequentially increase the playing duration of each frame of the image to be tracked to avoid the tracking duration being too long and exceeding the maximum playing granularity of the electronic device, making it difficult to meet the tracking requirements, a preset maximum tracking duration can be set to accurately determine the actual playing duration of each frame of the image to be tracked. Among them, the specific values of the minimum tracking duration and the maximum tracking duration can be determined according to the device parameters of the electronic device.

[0119] Specifically: for each frame of the image to be tracked except the first frame, when the tracking time of the image to be tracked is greater than or equal to the preset maximum tracking duration, the playing duration of the image to be tracked is determined to be the preset maximum tracking duration. When the tracking time of the image to be tracked is less than the preset minimum tracking duration, the playing duration of the image to be tracked is determined to be the tracking time of the image to be tracked.

[0120] Such as Figure 3In the shown "chase faster" process (the first tracking method), after the above-mentioned tracking process, the next frame of the last frame of the image to be tracked total_track1 still requires distance2 to reach the end time of the playback of the target video stream, and distance2 is less than the tracking threshold track_thr, which can be regarded as the last frame of the image to be tracked total_track1 catching up with the target video stream.

[0121] As Figure 4 In the shown "chase slower" process (the second tracking method), after the above-mentioned tracking process, the time when the next frame of the last frame of the image to be tracked total_track1 exceeds the next frame of the target video stream is phase2, and phase2 is less than the tracking threshold track_thr, which can be regarded as the last frame of the image to be tracked total_track1 catching up with the target video stream.

[0122] Through the above method, the playback duration of each frame of the image to be tracked can be accurately determined, laying a foundation for determining the tracked time of the next frame of each frame of the image to be tracked, facilitating the further determination of the tracking time of the next frame of the image, and whether to end the tracking process.

[0123] Based on the same principle as the video tracking device provided in the embodiments of the present application, a video playback device that can apply the above video tracking device is also provided in the embodiments of the present application. Figure 5 The structure diagram of a video playback device provided in the embodiments of the present application is shown. As Figure 5 shown, the device 50 includes:

[0124] A video tracking device 510, configured to receive a video stream switching instruction indicating to switch the original video stream to the target video stream, and determine the preset switching time of the electronic device; determine the video tracking time according to the preset switching time and the unit playback time of the original video stream; wherein, the preset switching time is the reserved duration when the electronic device performs video stream switching;

[0125] A caching device 520, configured to cache the original video stream and the target video stream;

[0126] A video playback device 530, configured to obtain and play the original video stream from the caching device within the video tracking time, and obtain and play the target video stream from the caching device after the video tracking time ends.

[0127] In a possible implementation manner, when the above video tracking device 510 determines the video tracking time according to the preset switching time and the unit playback time of the original video stream, it is specifically configured to:

[0128] Determine the video tracking method according to the first time difference between the preset switching time and the unit playing time of the original video stream, and determine the video tracking time corresponding to the video tracking method.

[0129] In a possible implementation manner, when the above-mentioned video tracking device 510 determines the video tracking method according to the first time difference between the preset switching time and the unit playing time of the original video stream, it is specifically used for:

[0130] Determine the first time difference between the preset switching time and the unit playing time of the original video stream;

[0131] In the case where the first time difference is less than the preset switching threshold, determine that the video tracking method is the first tracking method;

[0132] In the case where the first time difference is greater than or equal to the preset switching threshold, determine that the video tracking method is the second tracking method;

[0133] Among them, in the first tracking method, the playing duration of each frame of the image to be tracked decreases in sequence; in the second tracking method, the playing duration of each frame of the image to be tracked increases in sequence.

[0134] In a possible implementation manner, when the above-mentioned video tracking device 510 determines the video tracking time corresponding to the video tracking method, it is specifically used for:

[0135] Based on the video tracking method, determine the tracking time of the next frame of the image to be tracked;

[0136] In the case where the tracking time of the next frame of the image is less than or equal to the tracking threshold, determine that the video tracking time ends;

[0137] Among them, the tracking threshold is less than the preset switching threshold.

[0138] In a possible implementation manner, when the above-mentioned video tracking device 510 determines the tracking time of the next frame of the image to be tracked, it is specifically used for:

[0139] Determine the preset switching time as the tracking time of the first frame of the image to be tracked;

[0140] According to the unit playing time of the original video stream, determine the playing duration of the first frame of the image to be tracked;

[0141] According to the playing duration of each frame of the image to be tracked and the tracking time of the image to be tracked, determine the tracking time of the next frame of the image.

[0142] In a possible implementation manner, when the above-mentioned video tracking device 510 determines the tracking time of the next frame of the image according to the playing duration of each frame of the image to be tracked and the tracking time of the image to be tracked, it is specifically used for:

[0143] Based on the playing duration of each frame of the image to be tracked and the tracking time of the image to be tracked, determine the tracked time of the next frame of the image;

[0144] According to the tracked time of the next frame of the image and the unit playing time of the target video stream, determine the tracking time of the next frame of the image.

[0145] In a possible implementation, the above video tracking device 510 can also be used to determine the playing duration of the image to be tracked based on the following method:

[0146] In the first tracking method, according to the tracking time of the image to be tracked and the preset minimum tracking duration, determine the playing duration of each frame of the image to be tracked except the first frame of the image to be tracked;

[0147] In the second tracking method, according to the tracking time of the image to be tracked and the preset maximum tracking duration, determine the playing duration of each frame of the image to be tracked except the first frame of the image to be tracked.

[0148] In the embodiments of the present application, by receiving a video stream switching instruction indicating to switch the original video stream to the target video stream, determining the preset switching time of the electronic device, and according to the preset switching time, the unit playing time of the original video stream and the unit playing time of the target video stream, accurately determining the video tracking time, and playing the original video stream within the video tracking time and playing the target video stream after the video tracking time ends, it is possible to improve the stability and smoothness of the video image during the switching process, avoid situations such as the disappearance, jitter, and freezing of the video picture, ensure the stability of the playback system, and improve the video playback effect. Moreover, through this method, it is not necessary to determine the blank area and porch area of the original video stream or the target video stream, and it is possible to switch from any time point of the original video stream to the target video.

[0149] For the detailed functions of the video tracking device in the video playback device of the embodiments of the present application, reference can specifically be made to the detailed function descriptions of the various modules of the video tracking device shown above, which will not be elaborated here.

[0150] Based on the same principle as the video tracking device provided in the embodiments of the present application, a video tracking method corresponding to the above video tracking device is also provided in the embodiments of the present application, as Figure 6 shown, and the method includes:

[0151] Step S610: Receive a video stream switching instruction indicating to switch the original video stream to the target video stream, and determine the preset switching time of the electronic device; where the preset switching time is the reserved duration of the electronic device during video stream switching.

[0152] Step S620: Determine the video tracking time according to the preset switching time and the unit playing time of the original video stream, so as to play the original video stream within the video tracking time and play the target video stream after the video tracking time ends.

[0153] In a possible implementation manner, the above-mentioned determining the video tracking time according to the preset switching time and the unit playing time of the original video stream includes:

[0154] Determine the video tracking method according to the first time difference between the preset switching time and the unit playing time of the original video stream, and determine the video tracking time corresponding to the video tracking method.

[0155] In a possible implementation manner, the above-mentioned determining the video tracking method according to the first time difference between the preset switching time and the unit playing time of the original video stream includes:

[0156] Determine the first time difference between the preset switching time and the unit playing time of the original video stream;

[0157] In the case where the first time difference is less than the preset switching threshold, determine the video tracking method as the first tracking method;

[0158] In the case where the first time difference is greater than or equal to the preset switching threshold, determine the video tracking method as the second tracking method;

[0159] Among them, in the first tracking method, the playing duration of each frame of the image to be tracked decreases in turn; in the second tracking method, the playing duration of each frame of the image to be tracked increases in turn.

[0160] In a possible implementation manner, the above-mentioned determining the video tracking time corresponding to the video tracking method includes:

[0161] Based on the video tracking method, determine the tracking time of the next frame of the image to be tracked;

[0162] In the case where the tracking time of the next frame of the image is less than or equal to the tracking threshold, determine that the video tracking time ends;

[0163] Among them, the tracking threshold is less than the preset switching threshold.

[0164] In a possible implementation manner, the above-mentioned determining the tracking time of the next frame of the image to be tracked includes:

[0165] Determine the preset switching time as the tracking time of the first frame of the image to be tracked;

[0166] According to the unit playing time of the original video stream, determine the playing duration of the first frame of the image to be tracked;

[0167] Determine the tracking time of the next frame image according to the playing duration of each frame of the image to be tracked and the tracking time of the image to be tracked.

[0168] In a possible implementation manner, the above determining the tracking time of the next frame image according to the playing duration of each frame of the image to be tracked and the tracking time of the image to be tracked includes:

[0169] Based on the playing duration of each frame of the image to be tracked and the tracking time of the image to be tracked, determine the tracked time of the next frame image;

[0170] According to the tracked time of the next frame image and the unit playing time of the target video stream, determine the tracking time of the next frame image.

[0171] In a possible implementation manner, the above method further includes:

[0172] Determine the playing duration of the image to be tracked based on the following method:

[0173] In the first tracking mode, according to the tracking time of the image to be tracked and the preset minimum tracking duration, determine the playing duration of each frame of the image to be tracked except the first frame of the image to be tracked;

[0174] In the second tracking mode, according to the tracking time of the image to be tracked and the preset maximum tracking duration, determine the playing duration of each frame of the image to be tracked except the first frame of the image to be tracked.

[0175] The steps in the methods of the embodiments of the present application correspond to the actions performed by the respective modules in the above video tracking device. For the specific implementation process of each step in this method, reference may be made to the detailed function descriptions of the respective modules of the device shown in the foregoing text, which will not be elaborated here.

[0176] In the embodiments of the present application, by receiving a video stream switching instruction indicating to switch the original video stream to the target video stream, determine the preset switching time of the electronic device, and accurately determine the video tracking time according to the preset switching time, the unit playing time of the original video stream, and the unit playing time of the target video stream, so as to play the original video stream within the video tracking time and play the target video stream after the video tracking time ends. It is possible to improve the stability and smoothness of the video image during the switching process, avoid situations such as the disappearance, jitter, and freezing of the video picture, ensure the stability of the playback system, and improve the video playback effect. Moreover, through this method, it is not necessary to determine the blank area and porch area of the original video stream or the target video stream, and it is possible to switch from any time point of the original video stream to the target video.

[0177] Based on the same principle as the video playback device provided in the embodiments of the present application, a video playback method corresponding to the above video playback device is also provided in the embodiments of the present application. As Figure 7 shown, the method includes:

[0178] Step S710: Receive a video stream switching instruction indicating to switch the original video stream to the target video stream, and determine the preset switching time of the electronic device; determine the video tracking time according to the preset switching time, the unit playback time of the original video stream, and the unit playback time of the target video stream; wherein, the preset switching time is the reserved duration when the electronic device performs video stream switching;

[0179] Step S720: Obtain and play the original video stream within the video tracking time, and obtain and play the target video stream after the video tracking time ends.

[0180] In a possible implementation manner, the above determining the video tracking time according to the preset switching time and the unit playback time of the original video stream includes:

[0181] Determine the video tracking method according to the first time difference between the preset switching time and the unit playback time of the original video stream, and determine the video tracking time corresponding to the video tracking method.

[0182] In a possible implementation manner, the above determining the video tracking method according to the first time difference between the preset switching time and the unit playback time of the original video stream includes:

[0183] Determine the first time difference between the preset switching time and the unit playback time of the original video stream;

[0184] In the case where the first time difference is less than the preset switching threshold, determine the video tracking method as the first tracking method;

[0185] In the case where the first time difference is greater than or equal to the preset switching threshold, determine the video tracking method as the second tracking method;

[0186] Wherein, in the first tracking method, the playback duration of each frame of the image to be tracked decreases in sequence; in the second tracking method, the playback duration of each frame of the image to be tracked increases in sequence.

[0187] In a possible implementation manner, the above determining the video tracking time corresponding to the video tracking method includes:

[0188] Based on the video tracking method, determine the tracking time of the next frame of the image to be tracked;

[0189] In the case where the tracking time of the next frame of the image is less than or equal to the tracking threshold, determine that the video tracking time ends;

[0190] Among them, the tracking threshold is less than the preset switching threshold.

[0191] In a possible implementation, determining the tracking time of the next frame image of the image to be tracked includes:

[0192] Determining the preset switching time as the tracking time of the first frame of the image to be tracked;

[0193] Determining the playing duration of the first frame of the image to be tracked according to the unit playing time of the original video stream;

[0194] Determining the tracking time of the next frame image according to the playing duration of each frame of the image to be tracked and the tracking time of the image to be tracked.

[0195] In a possible implementation, determining the tracking time of the next frame image according to the playing duration of each frame of the image to be tracked and the tracking time of the image to be tracked includes:

[0196] Determining the tracked time of the next frame image based on the playing duration of each frame of the image to be tracked and the tracking time of the image to be tracked;

[0197] Determining the tracking time of the next frame image according to the tracked time of the next frame image and the unit playing time of the target video stream.

[0198] In a possible implementation, the above method further includes:

[0199] Determining the playing duration of the image to be tracked based on the following method:

[0200] In the first tracking method, determining the playing duration of each frame of the image to be tracked except the first frame according to the tracking time of the image to be tracked and the preset minimum tracking duration;

[0201] In the second tracking method, determining the playing duration of each frame of the image to be tracked except the first frame according to the tracking time of the image to be tracked and the preset maximum tracking duration.

[0202] The steps in the methods of the embodiments of the present application correspond to the actions performed by each module in the above video playing device. For the specific implementation process of each step in this method, reference may be made to the detailed function descriptions of each module of the device shown in the foregoing text, which will not be elaborated here.

[0203] In the embodiments of the present application, by receiving a video stream switching instruction indicating to switch the original video stream to the target video stream, determining the preset switching time of the electronic device, and based on the preset switching time, the unit playing time of the original video stream, and the unit playing time of the target video stream, accurately determining the video tracking time, playing the original video stream within the video tracking time, and playing the target video stream after the video tracking time ends, it is possible to improve the stability and smoothness of the video image during the switching process, avoid situations such as the disappearance, jitter, and freezing of the video picture, ensure the stability of the playback system, and improve the video playback effect. Moreover, by this method, it is not necessary to determine the blank area and porch area of the original video stream or the target video stream, and it is possible to switch from any time point of the original video stream to the target video.

[0204] Based on the same principle as the video playback method and device provided in the embodiments of the present application, an electronic device (such as a server) is also provided in the embodiments of the present application. The electronic device may include a memory, a processor, and a computer program stored on the memory. The processor executes the above computer program to implement the video tracking method or video playback method provided in any optional embodiment of the present application.

[0205] See Figure 8 , Figure 8 shows a schematic structural diagram of the electronic device provided in the embodiments of the present application. As Figure 8 shown, the electronic device 8000 in this embodiment may include: a processor 8001, a network interface 8004, and a memory 8005. In addition, the above electronic device 8000 may further include: an object interface 8003 and at least one communication bus 8002. Among them, the communication bus 8002 is used to realize the connection and communication between these components. Among them, the object interface 8003 may include a display screen (Display) and a keyboard (Keyboard). Optionally, the object interface 8003 may further include a standard wired interface and a wireless interface. The network interface 8004 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface). The memory 8005 may be a high-speed RAM memory or a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory 8005 may also be at least one storage device located far from the aforementioned processor 8001. As Figure 8 shown, the memory 8005, as a computer-readable storage medium, may include an operating system, a network communication module, an object interface module, and a device control application program.

[0206] In Figure 8In the electronic device 8000 shown, the network interface 8004 can provide network communication functions; the object interface 8003 is mainly used to provide an input interface for the object; and the processor 8001 can be used to call the device control application program stored in the memory 8005 to implement:

[0207] In some possible implementation manners, the above-mentioned processor 8001 is used for:

[0208] It should be understood that in some possible implementation manners, the above-mentioned processor 8001 may be a central processing unit (CPU), and this processor may also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or this processor may also be any conventional processor, etc. The memory may include a read-only memory and a random access memory, and provide instructions and data to the processor. A part of the memory may also include a non-volatile random access memory. For example, the memory may also store information about the device type.

[0209] In specific implementation, the above-mentioned electronic device 8000 can execute the implementation manners provided in each of the above Figure 6 or Figure 7 through its built-in various functional modules. For the specific implementation manners provided in each step, reference may be made to the implementation manners provided in each of the above steps, which will not be elaborated here.

[0210] The embodiment of the present application also provides a computer-readable storage medium, which stores a computer program and is executed by a processor to implement Figure 6 or Figure 7 the methods provided in each of the steps. For the specific implementation manners provided in each step, reference may be made to the implementation manners provided in each of the above steps, which will not be elaborated here.

[0211] The above computer-readable storage medium may be an internal storage unit of the video tracking device or the electronic device provided in any of the foregoing embodiments, such as the hard disk or memory of the electronic device. The computer-readable storage medium may also be an external storage device of the electronic device, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the electronic device. The above computer-readable storage medium may further include magnetic disks, optical disks, read-only memory (ROM), or random access memory (RAM), etc. Further, the computer-readable storage medium may include both the internal storage unit and the external storage device of the electronic device. The computer-readable storage medium is used to store the computer program and other programs and data required by the electronic device. The computer-readable storage medium may also be used to temporarily store the data that has been output or is to be output.

[0212] An embodiment of the present application provides a computer program product, which includes a computer program, and the above computer program is executed by a processor Figure 6 or Figure 7 the method provided by each step in

[0213] The terms "first", "second", etc. in the claims, the description, and the drawings of the present application are used to distinguish different objects, rather than to describe a specific order.

[0214] In addition, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or electronic device that includes a series of steps or units is not limited to the listed steps or units, but optionally further includes steps or units not listed, or optionally further includes other steps or units inherent to these processes, methods, products, or electronic devices.

[0215] Referring to "embodiment" herein means that a specific feature, structure, or characteristic described in connection with the embodiment may be included in at least one embodiment of the present application. The phrase shown in various positions in the description does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment mutually exclusive with other embodiments. Those skilled in the art will explicitly and implicitly understand that the embodiments described herein may be combined with other embodiments. The term "and / or" used in the description and claims of the present application refers to any combination and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0216] Those of ordinary skill in the art can realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described according to functions in the above description. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of this application.

[0217] The above-disclosed are only the preferred embodiments of this application, and thus cannot be used to limit the scope of rights of this application. Therefore, equivalent changes made according to the claims of this application still fall within the scope covered by this application.

Claims

1. A video tracking device, characterized in that, Including: A preset switching time determination module, configured to receive a video stream switching instruction indicating to switch the original video stream to the target video stream, and determine a preset switching time of the electronic device; wherein, the preset switching time is the reserved duration of the electronic device during video stream switching; A video tracking time determination module, configured to determine a video tracking time according to the preset switching time, the unit playing time of the original video stream, and the unit playing time of the target video stream, so as to play the original video stream within the video tracking time and play the target video stream after the video tracking time ends; When the video tracking time determination module determines the video tracking time according to the preset switching time, the unit playing time of the original video stream, and the unit playing time of the target video stream, it is configured to: Determine a first time difference between the preset switching time and the unit playing time of the original video stream; In the case that the first time difference is less than a preset switching threshold, determine that the video tracking mode is the first tracking mode; In the case that the first time difference is greater than or equal to the preset switching threshold, determine that the video tracking mode is the second tracking mode; Wherein, in the first tracking mode, the playing duration of each frame of the image to be tracked decreases in sequence; in the second tracking mode, the playing duration of each frame of the image to be tracked increases in sequence; Based on the video tracking mode, determine the preset switching time as the tracking time of the first frame of the image to be tracked; According to the unit playing time of the original video stream, determine the playing duration of the first frame of the image to be tracked; Based on the playing duration of each frame of the image to be tracked and the tracking time of the image to be tracked, determine the tracked time of the next frame of the image; According to the tracked time of the next frame of the image and the unit playing time of the target video stream, determine the tracking time of the next frame of the image; In the case that the tracking time of the next frame of the image is less than or equal to a tracking threshold, determine that the video tracking time ends; Wherein, the tracking threshold is less than the preset switching threshold.

2. The device according to claim 1, wherein The video tracking time determination module is further configured to determine the playing duration of the image to be tracked based on the following method: In the first tracking mode, according to the tracking time of the image to be tracked and a preset minimum tracking duration, determine the playing duration of each frame of the image to be tracked except the first frame of the image to be tracked; In the second tracking mode, according to the tracking time of the image to be tracked and a preset maximum tracking duration, determine the playing duration of each frame of the image to be tracked except the first frame of the image to be tracked.

3. A video playback device, characterized in that, Including: A video tracking device, configured to receive a video stream switching instruction indicating to switch the original video stream to the target video stream, and determine a preset switching time of the electronic device; Determine a video tracking time according to the preset switching time, the unit playing time of the original video stream, and the unit playing time of the target video stream; wherein, the preset switching time is the reserved duration of the electronic device during video stream switching; A caching device, configured to cache the original video stream and the target video stream; A video playback device is configured to obtain and play the original video stream from the cache device during the video tracking time, and obtain and play the target video stream from the cache device after the video tracking time ends; The video tracking device determines the video tracking time according to the preset switching time, the unit playback time of the original video stream, and the unit playback time of the target video stream, including: Determine a first time difference between the preset switching time and the unit playback time of the original video stream; When the first time difference is less than the preset switching threshold, determine that the video tracking mode is the first tracking mode; When the first time difference is greater than or equal to the preset switching threshold, determine that the video tracking mode is the second tracking mode; Wherein, in the first tracking mode, the playback duration of each frame of the image to be tracked decreases sequentially; in the second tracking mode, the playback duration of each frame of the image to be tracked increases sequentially; Based on the video tracking mode, determine the tracking time of the first frame of the image to be tracked as the preset switching time; Determine the playback duration of the first frame of the image to be tracked according to the unit playback time of the original video stream; Based on the playback duration of each frame of the image to be tracked and the tracking time of the image to be tracked, determine the tracked time of the next frame of the image; Determine the tracking time of the next frame of the image according to the tracked time of the next frame of the image and the unit playback time of the target video stream; When the tracking time of the next frame of the image is less than or equal to the tracking threshold, determine that the video tracking time ends; Wherein, the tracking threshold is less than the preset switching threshold.

4. The video playback device according to claim 3, characterized in that, The video tracking device is further configured to determine the playback duration of the image to be tracked based on the following method: In the first tracking mode, determine the playback duration of each frame of the image to be tracked except the first frame of the image to be tracked according to the tracking time of the image to be tracked and the preset minimum tracking duration; In the second tracking mode, determine the playback duration of each frame of the image to be tracked except the first frame of the image to be tracked according to the tracking time of the image to be tracked and the preset maximum tracking duration.

5. A video tracking method, characterized in that, The method includes: Receiving a video stream switching instruction indicating to switch the original video stream to the target video stream, and determining the preset switching time of the electronic device; wherein, the preset switching time is the reserved duration of the electronic device when performing video stream switching; Determine the video tracking time according to the preset switching time, the unit playback time of the original video stream, and the unit playback time of the target video stream, so as to play the original video stream during the video tracking time and play the target video stream after the video tracking time ends; The determining the video tracking time according to the preset switching time, the unit playback time of the original video stream, and the unit playback time of the target video stream includes: Determine a first time difference between the preset switching time and the unit playback time of the original video stream; When the first time difference is less than the preset switching threshold, determine that the video tracking mode is the first tracking mode; When the first time difference is greater than or equal to the preset switching threshold, determine that the video tracking mode is the second tracking mode; Among them, in the first tracking mode, the playing durations of each frame of the images to be tracked decrease in sequence; in the second tracking mode, the playing durations of each frame of the images to be tracked increase in sequence; Based on the video tracking mode, determine the preset switching time as the tracking time of the first frame of the images to be tracked; According to the unit playing time of the original video stream, determine the playing duration of the first frame of the images to be tracked; Based on the playing duration of each frame of the images to be tracked and the tracking time of the images to be tracked, determine the tracked time of the next frame of the image; According to the tracked time of the next frame of the image and the unit playing time of the target video stream, determine the tracking time of the next frame of the image; When the tracking time of the next frame of the image is less than or equal to the tracking threshold, determine that the video tracking time ends; Among them, the tracking threshold is less than the preset switching threshold.

6. The video tracking method according to claim 5, wherein, The method further includes: Determine the playing duration of the images to be tracked based on the following method: In the first tracking mode, according to the tracking time of the images to be tracked and the preset minimum tracking duration, determine the playing duration of each frame of the images to be tracked except the first frame of the images to be tracked; In the second tracking mode, according to the tracking time of the images to be tracked and the preset maximum tracking duration, determine the playing duration of each frame of the images to be tracked except the first frame of the images to be tracked.

7. A video playing method, characterized in that, The method includes: Receive a video stream switching instruction indicating to switch the original video stream to the target video stream, and determine the preset switching time of the electronic device; according to the preset switching time, the unit playing time of the original video stream, and the unit playing time of the target video stream, determine the video tracking time; where the preset switching time is the reserved duration of the electronic device when performing video stream switching; Obtain and play the original video stream within the video tracking time, and obtain and play the target video stream after the video tracking time ends; The determining the video tracking time according to the preset switching time, the unit playing time of the original video stream, and the unit playing time of the target video stream includes: Determine the first time difference between the preset switching time and the unit playing time of the original video stream; When the first time difference is less than the preset switching threshold, determine that the video tracking mode is the first tracking mode; When the first time difference is greater than or equal to the preset switching threshold, determine that the video tracking mode is the second tracking mode; Among them, in the first tracking mode, the playing durations of each frame of the images to be tracked decrease in sequence; in the second tracking mode, the playing durations of each frame of the images to be tracked increase in sequence; Based on the video tracking mode, determine the preset switching time as the tracking time of the first frame of the images to be tracked; According to the unit playing time of the original video stream, determine the playing duration of the first frame of the images to be tracked; Determine the tracked time of the next-frame image based on the playback duration of each frame of the image to be tracked and the time to be tracked of the image to be tracked; Determine the time to be tracked of the next-frame image according to the tracked time of the next-frame image and the unit playback time of the target video stream; Determine that the video tracking time ends when the time to be tracked of the next-frame image is less than or equal to the tracking threshold; Wherein, the tracking threshold is less than the preset switching threshold.

8. The video playing method according to claim 7, wherein The method further includes: Determine the playback duration of the image to be tracked based on the following method: In the first tracking method, determine the playback duration of each frame of the image to be tracked except the first-frame image to be tracked according to the time to be tracked of the image to be tracked and the preset minimum tracking duration; In the second tracking method, determine the playback duration of each frame of the image to be tracked except the first-frame image to be tracked according to the time to be tracked of the image to be tracked and the preset maximum tracking duration.

9. An electronic device, characterized in that, Comprising a processor and a memory, the processor and the memory are connected to each other; The memory is used for storing a computer program; The processor is configured to execute the method according to any one of claims 5 to 8 when calling the computer program.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 5 to 8 is implemented.

Citation Information

Patent Citations

  • Video stream seamless switching method and device

    CN109246462A