Video processing method, device, equipment and storage medium
By monitoring video playback events and calculating the time difference, the problem of occasional occurrence of video players is solved, ensuring that the flash-through video can be played normally and improve the user experience.
Patent Information
- Application Number
- CN202110948040.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-08-18
- Publication Date
- 2025-05-16
- Estimated Expiration
- 2041-08-18
AI Technical Summary
The problem of the underlying existing video player causes a flash of video to end directly when the video is first played, seriously affecting the user's viewing experience.
By monitoring the play method call event and stop callback event of the target video, the timestamps t1 and t2 are recorded, the time difference is calculated and whether it is less than the preset time threshold. If it is less than the threshold, continue playing the video to avoid responding to unnecessary stop callback events.
Effectively identify and solve the problem of occasional emergence in the underlying video player, avoiding flashes of type videos directly ending when they are played for the first time, and improving the user's experience of watching videos.
Smart Images

Figure CN115708358B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of data processing, and in particular to a video processing method, device, equipment and storage medium. Background Art
[0002] With the continuous development of Internet short video technology, people's demand for video types has become more and more diverse, and the fleeting video type has emerged. As the name suggests, the fleeting video type refers to a video type that only supports one playback for each user (except the video author).
[0003] At present, due to occasional problems at the bottom layer of the video player, when users watch a flash-by video for the first time, the video ends immediately after it starts, and the user is directly shown the destroyed state of the flash-by video, which seriously affects the user's video viewing experience. Summary of the invention
[0004] In order to solve the above technical problems or at least partially solve the above technical problems, the present disclosure provides a video processing method, which can solve the problem of flashing type videos ending as soon as they start to play due to occasional problems in the underlying layer of the above video player, thereby improving the user's experience of watching videos.
[0005] In a first aspect, the present disclosure provides a video processing method, the method comprising:
[0006] If it is determined that the target video belongs to a preset video type, then when a play method call event for the target video is detected, the current timestamp t1 is recorded; wherein the preset video type is a video type that supports only one playback for each user;
[0007] When a stop callback event corresponding to the play method call event is detected, the current timestamp t2 is recorded;
[0008] Calculating the time difference between t2 and t1, and determining whether the time difference is less than a preset time threshold;
[0009] If it is determined that the time difference is less than the preset time threshold, the target video continues to be played.
[0010] In an optional implementation manner, the method further includes:
[0011] If it is determined that the time difference is not less than the preset time threshold, the preset destruction state of the target video is displayed.
[0012] In an optional implementation manner, after continuing to play the target video, the method further includes:
[0013] When a replay event for the target video is detected, the preset destruction state of the target video is displayed.
[0014] In an optional implementation manner, the method further includes:
[0015] When a stop callback event corresponding to the play method call event is detected, the current user's playback record for the target video is reported to the server; wherein the playback record is used to update the current user's playback status for the target video on the server.
[0016] In an optional implementation, the preset time threshold is a value within a range of 0.1 seconds to 0.2 seconds.
[0017] In an optional implementation, if it is determined that the target video belongs to a preset video type, then when a play method call event for the target video is detected, before recording the current timestamp t1, the method further includes:
[0018] When a play triggering operation for a target video is detected, it is determined whether the target video belongs to a preset video type.
[0019] In a second aspect, the present disclosure provides a video processing device, the device comprising:
[0020] A first recording module is used to record a current timestamp t1 when it is determined that the target video belongs to a preset video type and a play method call event for the target video is detected; wherein the preset video type is a video type that is played only once for each user;
[0021] The second recording module is used to record the current timestamp t2 when a stop callback event corresponding to the play method call event is detected;
[0022] A calculation module, used to calculate the time difference between the t2 and the t1, and determine whether the time difference is less than a preset time threshold;
[0023] The continue playing module is used to continue playing the target video when it is determined that the time difference is less than the preset time threshold.
[0024] In a third aspect, the present disclosure provides a computer-readable storage medium, wherein the computer-readable storage medium stores instructions, and when the instructions are executed on a terminal device, the terminal device implements the above method.
[0025] In a fourth aspect, the present disclosure provides a device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above method when executing the computer program.
[0026] In a fifth aspect, the present disclosure provides a computer program product, wherein the computer program product comprises a computer program / instructions, and the computer program / instructions implement the above method when executed by a processor.
[0027] Compared with the prior art, the technical solution provided by the embodiments of the present disclosure has the following advantages:
[0028] The disclosed embodiment provides a video processing method. When it is determined that the target video belongs to a flash-by type video, the play method call event for the target video is monitored, and when the play method call event for the target video is monitored, the timestamp t1 is recorded. Then, when the stop callback event corresponding to the play method call event is monitored, the timestamp t2 is recorded, the time difference between the timestamp t2 and the timestamp t1 is calculated, and it is determined whether the time difference is less than the preset time threshold. Furthermore, when it is determined that the time difference is less than the preset time threshold, the stop callback event is not responded to, and the target video continues to be played. The disclosed embodiment identifies the occasional problem at the bottom layer of the above-mentioned video player by recording the time difference between the stop callback event and the play method call event for the target video, and avoids the phenomenon that the flash-by type video ends as soon as it starts to be broadcast due to the occasional problem by not responding to the stop callback event in the occasional problem and continuing to play the target video. The user's experience of watching the video is improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0030] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0031] Figure 1 A flowchart of a video processing method provided by an embodiment of the present disclosure;
[0032] Figure 2 A schematic diagram of a preset destruction state of a target video provided by an embodiment of the present disclosure;
[0033] Figure 3A schematic diagram of the structure of a video processing device provided by an embodiment of the present disclosure;
[0034] Figure 4 A schematic diagram of the structure of a video processing device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0035] In order to more clearly understand the above-mentioned objectives, features and advantages of the present disclosure, the scheme of the present disclosure will be further described below. It should be noted that the embodiments of the present disclosure and the features in the embodiments can be combined with each other without conflict.
[0036] In the following description, many specific details are set forth to facilitate a full understanding of the present disclosure, but the present disclosure may also be implemented in other ways different from those described herein; it is obvious that the embodiments in the specification are only part of the embodiments of the present disclosure, rather than all of the embodiments.
[0037] The occasional problem at the bottom layer of the video player mentioned in this disclosure refers to the video player immediately returning a stop callback event after calling the play method. This occasional problem occurs particularly in the IOS system.
[0038] Since some processing logic in flash-by videos is implemented based on stop callback events, for example, during the playback of flash-by videos, once a stop callback event is detected, the playback of the video ends and the destroyed state of the video is directly displayed. Therefore, the occasional problem at the bottom layer of the above video player will cause the playback of flash-by videos to end immediately when users watch them for the first time, and the destroyed state will be directly displayed to users, seriously affecting the user's viewing experience.
[0039] To this end, the embodiment of the present disclosure provides a video processing method. Specifically, when it is determined that the target video belongs to a flash-by type video, the play method call event for the target video is monitored, and when the play method call event for the target video is monitored, the timestamp t1 is recorded. Then, when the stop callback event corresponding to the play method call event is monitored, the timestamp t2 is recorded, the time difference between the timestamp t2 and the timestamp t1 is calculated, and it is determined whether the time difference is less than the preset time threshold. Furthermore, when it is determined that the time difference is less than the preset time threshold, the stop callback event is not responded to, and the target video continues to be played.
[0040] It can be seen that the embodiment of the present disclosure identifies the occasional problem at the bottom layer of the above-mentioned video player by recording the time difference between the stop callback event and the play method calling event for the target video, and avoids the phenomenon that the video of the flashing type ends as soon as it starts to be played due to the occasional problem by not responding to the stop callback event in the occasional problem and continuing to play the target video, thereby improving the user's video viewing experience.
[0041] Based on this, the present disclosure provides a video processing method, referring to Figure 1 , is a flowchart of a video processing method provided by an embodiment of the present disclosure, the method comprising:
[0042] S101: If it is determined that the target video belongs to a preset video type, when a play method call event for the target video is detected, a current timestamp t1 is recorded.
[0043] The preset video type is a video type that supports playing only once for each user.
[0044] In the disclosed embodiment, the play method calling event refers to an event that triggers the target video to start playing by calling the play method. Specifically, monitoring the play method calling event for the target video may include monitoring the call event of the play method for the target video.
[0045] In practical applications, when a play trigger operation for a target video is detected, it is first determined whether the target video belongs to a preset video type, wherein the preset video type may also be referred to as a flash video type. Specifically, it may be determined whether the target video belongs to a preset video type by a video type identifier of the target video.
[0046] If it is determined that the target video is a flashing video type, in order to avoid the occasional event at the bottom layer of the video player affecting the user's video viewing experience, the disclosed embodiment can monitor the play method call event for the target video. Once the play method call event for the target video is monitored, the current timestamp t1 is recorded for subsequent identification of whether the occasional event at the bottom layer of the video player occurs.
[0047] For video types whose processing logic does not rely on the stop callback event, no special processing is required for the occasional events at the bottom layer of the above video player. Specifically, if it is determined that the target video does not belong to the type of video that flashes by, it is not necessary to record the timestamp of the target video's play method call event.
[0048] S102: When a stop callback event corresponding to the play method call event is detected, the current timestamp t2 is recorded.
[0049] For the video playback logic, the play method call event and the stop callback event usually appear in pairs. When the play method call event for the target video is detected, it means that the target video starts playing, and then the stop callback event for the target video can be monitored. Specifically, monitoring the stop callback event for the target video can include monitoring the call event of the stop method for the target video.
[0050] In the disclosed embodiment, when a stop callback event corresponding to a play method call event for a target video is detected, the current timestamp t2 is recorded for subsequent identification of whether the occasional event at the bottom layer of the above-mentioned video player occurs.
[0051] S103: Calculate the time difference between the t2 and the t1, and determine whether the time difference is less than a preset time threshold.
[0052] The characteristic of the underlying occasional problem of the video player immediately returning the stop callback event after calling the play method is that the time difference between calling the play method and returning the stop callback event is short, usually a time difference of tens of milliseconds. In the normal video playback process, the time difference between calling the play method and returning the stop callback event is much greater than a time difference of tens of milliseconds. Based on this difference, the inventors thought of using the time difference between calling the play method and returning the stop callback event to identify the underlying occasional problem of the above video player.
[0053] In the disclosed embodiment, after recording the two timestamps t1 corresponding to the play method call event and t2 corresponding to the stop callback event, the time difference between t2 and t1 is calculated. Since the size of the time difference can be used to identify the underlying occasional problem of the above-mentioned video player, the disclosed embodiment determines whether the time difference is less than a preset time threshold to identify whether the underlying occasional problem of the above-mentioned video player is currently occurring.
[0054] It is worth noting that, because the time difference between calling the play method and returning the stop callback event in the underlying occasional problem of the above-mentioned video player is usually at the level of tens of milliseconds, while in the normal video playback process, the time difference between calling the play method and returning the stop callback event is much greater than the time difference of tens of milliseconds. For this reason, the embodiment of the present disclosure can predetermine the preset time threshold as any value in the range of 0.1 seconds to 0.2 seconds, for example, the preset time threshold is 0.2 seconds, so as to identify whether the underlying occasional problem of the above-mentioned video player is currently occurring.
[0055] S104: If it is determined that the time difference is less than the preset time threshold, continue to play the target video.
[0056] In the disclosed embodiment, after calculating the time difference between t1 corresponding to the play method call event for the target video and t2 corresponding to the stop callback event, it is determined whether the time difference is less than the preset time threshold to identify whether the underlying occasional problem of the above-mentioned video player is currently occurring.
[0057] If it is determined that the time difference is less than the preset time threshold, it means that the underlying occasional problem of the above-mentioned video player is currently occurring. At this time, you can continue to play the target video without responding to the currently monitored stop callback event, thereby avoiding the user's video viewing experience being affected by the underlying occasional problem of the above-mentioned video player.
[0058] In an optional implementation, if it is determined that the time difference is not less than a preset time threshold, it can be considered that the currently monitored stop callback event does not belong to the underlying occasional problem of the above-mentioned video player. For this reason, the disclosed embodiment can be processed based on the processing logic of the flash-type video.
[0059] In an optional implementation, a stop callback event for the target video can also be monitored when the target video is finished playing. At this time, if it is determined that the time difference between t1 corresponding to the play method call event for the target video and t2 corresponding to the stop callback event is not less than a preset time threshold, the preset destruction state of the target video can be displayed to prompt the user that the target video has finished playing and does not support replay.
[0060] like Figure 2 FIG. 1 is a schematic diagram of a preset destruction state of a target video provided by an embodiment of the present disclosure. A mask is displayed on the playback page of the target video, and a prompt message "Only viewable once, the work has been destroyed" is displayed on the mask, which can prompt the user that the target video has been played and cannot be played again.
[0061] In the video processing method provided by the embodiment of the present disclosure, when it is determined that the target video belongs to a flash-by type video, the play method call event for the target video is monitored, and when the play method call event for the target video is monitored, the timestamp t1 is recorded. Then, when the stop callback event corresponding to the play method call event is monitored, the timestamp t2 is recorded, the time difference between the timestamp t2 and the timestamp t1 is calculated, and it is determined whether the time difference is less than the preset time threshold. Furthermore, when it is determined that the time difference is less than the preset time threshold, the stop callback event is not responded to, and the target video continues to be played. The embodiment of the present disclosure identifies the occasional problem at the bottom layer of the above-mentioned video player by recording the time difference between the stop callback event and the play method call event for the target video, and by not responding to the stop callback event in the occasional problem and continuing to play the target video, it avoids the phenomenon that the flash-by type video ends as soon as it starts due to the occasional problem, thereby improving the user's experience of watching videos.
[0062] In actual applications, in certain video playback scenarios, the video will automatically replay after the playback ends. Based on the characteristic that the flash-by video type in the disclosed embodiment only supports one playback for each user, the disclosed embodiment can directly display the preset destruction state of the video when a replay event for the flash-by type video is detected, thereby avoiding replaying the video.
[0063] Specifically, based on the above embodiments, the disclosed embodiments monitor the replay event for the target video after determining that the time difference between t1 corresponding to the play method call event for the target video and t2 corresponding to the stop callback event is less than a preset time threshold and continuing to play the target video.
[0064] If a replay event for the target video is detected, the replay time is not responded to, but the preset destruction state of the target video is displayed to ensure the user's viewing experience of the flash-by type video.
[0065] In addition, in the disclosed embodiment, if a stop callback event is detected for the target video, it means that the target video is in the played state for the current user. In order to ensure the user's viewing experience of the flash-by type video, the client can report the current user's play record for the target video to the server, so that the server can update the current user's played state for the target video based on the play record, thereby ensuring that the next time the current user triggers the playback of the target video, the destruction state can be directly displayed to the user, thereby ensuring the playback effect of the flash-by type video. Specifically, based on the content in the above embodiment, when the client detects the stop callback event corresponding to the play method call event for the target video, the current user's play record for the target video is reported to the server; wherein, the play record is used to update the current user's played state for the target video on the server side.
[0066] Based on the same inventive concept as the above method embodiment, the present disclosure also provides a video processing device, referring to Figure 3 , is a schematic diagram of the structure of a video processing device provided by an embodiment of the present disclosure, the device comprising:
[0067] The first recording module 301 is used to record a timestamp t1 when it is determined that the target video belongs to a preset video type and a play method call event for the target video is detected; wherein the preset video type is a video type that is played only once for each user;
[0068] The second recording module 302 is used to record the timestamp t2 when a stop callback event corresponding to the play method call event is detected;
[0069] The calculation module 303 is used to calculate the time difference between the timestamp t2 and the timestamp t1, and determine whether the time difference is less than a preset time threshold;
[0070] The continue playing module 304 is used to continue playing the target video when it is determined that the time difference is less than the preset time threshold.
[0071] In an optional implementation, the device further includes:
[0072] The first display module is used to display the preset destruction state of the target video when it is determined that the time difference is not less than the preset time threshold.
[0073] In an optional implementation, the device further includes:
[0074] The second display module is used to display the preset destruction state of the target video when a replay event for the target video is detected.
[0075] In an optional implementation, the device further includes:
[0076] The reporting module is used to report the current user's playback record for the target video to the server when a stop callback event corresponding to the play method call event is detected; wherein the playback record is used to update the current user's playback status for the target video on the server.
[0077] In an optional implementation, the preset time threshold is a value within a range of 0.1 seconds to 0.2 seconds.
[0078] In an optional implementation, the device further includes:
[0079] The determination module is used to determine whether the target video belongs to a preset video type when a play trigger operation for the target video is detected.
[0080] In the video processing device provided by the embodiment of the present disclosure, when it is determined that the target video belongs to a flash-by type video, the play method call event for the target video is monitored, and when the play method call event for the target video is monitored, the timestamp t1 is recorded. Then, when the stop callback event corresponding to the play method call event is monitored, the timestamp t2 is recorded, the time difference between the timestamp t2 and the timestamp t1 is calculated, and it is determined whether the time difference is less than the preset time threshold. Furthermore, when it is determined that the time difference is less than the preset time threshold, the stop callback event is not responded to, and the target video continues to be played. The embodiment of the present disclosure identifies the occasional problem at the bottom layer of the above-mentioned video player by recording the time difference between the stop callback event and the play method call event for the target video, and by not responding to the stop callback event in the occasional problem and continuing to play the target video, it avoids the phenomenon that the flash-by type video ends as soon as it starts due to the occasional problem, thereby improving the user's experience of watching videos.
[0081] In addition to the above-mentioned method and apparatus, the embodiments of the present disclosure further provide a computer-readable storage medium, in which instructions are stored. When the instructions are executed on a terminal device, the terminal device implements the video processing method described in the embodiments of the present disclosure.
[0082] The embodiment of the present disclosure further provides a computer program product, which includes a computer program / instructions. When the computer program / instructions are executed by a processor, the video processing method described in the embodiment of the present disclosure is implemented.
[0083] In addition, the present disclosure also provides a video processing device, see Figure 4 As shown, it may include:
[0084] Processor 401, memory 402, input device 403 and output device 404. The number of processors 401 in the video processing device can be one or more. Figure 4 In some embodiments of the present disclosure, the processor 401, the memory 402, the input device 403 and the output device 404 may be connected via a bus or other means, wherein: Figure 4 The example of connecting through bus is taken in the following.
[0085] The memory 402 can be used to store software programs and modules. The processor 401 executes various functional applications and data processing of the video processing device by running the software programs and modules stored in the memory 402. The memory 402 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, at least one application required for a function, etc. In addition, the memory 402 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. The input device 403 can be used to receive input digital or character information, and generate signal input related to user settings and function control of the video processing device.
[0086] Specifically in this embodiment, the processor 401 will load the executable files corresponding to the processes of one or more applications into the memory 402 according to the following instructions, and the processor 401 will run the applications stored in the memory 402, thereby realizing various functions of the above-mentioned video processing device.
[0087] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0088] The above description is only a specific embodiment of the present disclosure, so that those skilled in the art can understand or implement the present disclosure. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present disclosure. Therefore, the present disclosure will not be limited to the embodiments described herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A video processing method, characterized in that: The method comprises: If it is determined that the target video belongs to a preset video type, then when a play method call event for the target video is detected, the current timestamp t1 is recorded; wherein the preset video type is a video type that supports only one playback for each user; When a stop callback event corresponding to the play method call event is detected, the current timestamp t2 is recorded; Calculating the time difference between t2 and t1, and determining whether the time difference is less than a preset time threshold; If it is determined that the time difference is less than the preset time threshold, the target video continues to be played.
2. The method according to claim 1, characterized in that The method further comprises: If it is determined that the time difference is not less than the preset time threshold, the preset destruction state of the target video is displayed.
3. The method according to claim 1, characterized in that After continuing to play the target video, the method further includes: When a replay event for the target video is detected, the preset destruction state of the target video is displayed.
4. The method according to claim 1, characterized in that: The method further comprises: When a stop callback event corresponding to the play method call event is detected, the current user's playback record for the target video is reported to the server; wherein the playback record is used to update the current user's playback status for the target video on the server.
5. The method according to claim 1, characterized in that The preset time threshold is a value within a range of 0.1 seconds to 0.2 seconds.
6. The method according to claim 1, characterized in that If it is determined that the target video belongs to the preset video type, then when a play method call event for the target video is detected, before recording the current timestamp t1, the method further includes: When a play triggering operation for a target video is detected, it is determined whether the target video belongs to a preset video type.
7. A video processing device, characterized in that: The device comprises: A first recording module is used to record a current timestamp t1 when it is determined that the target video belongs to a preset video type and a play method call event for the target video is detected; wherein the preset video type is a video type that is played only once for each user; The second recording module is used to record the current timestamp t2 when a stop callback event corresponding to the play method call event is detected; A calculation module, used to calculate the time difference between the t2 and the t1, and determine whether the time difference is less than a preset time threshold; The continue playing module is used to continue playing the target video when it is determined that the time difference is less than the preset time threshold.
8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores instructions, and when the instructions are executed on a terminal device, the terminal device implements the method according to any one of claims 1 to 6.
9. A device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the method according to any one of claims 1 to 6 is implemented.
10. A computer program product, characterized in that The computer program product comprises a computer program / instruction, and when the computer program / instruction is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Video processing method and device, electronic equipment and storage medium
CN111526385A
Player-based play method and device
US20170163703A1
Cited By
Video processing method and apparatus, and device and storage medium
US12477177B2