Video frame positioning method, video frame positioning device and computer storage medium

By storing the video stream into two video source objects during browser video playback and obtaining video frame data information to locate the current playback frame, the problem of inaccurate frame location in browser videos is solved, achieving precise positioning and frame switching while saving performance.

CN116248954BActive Publication Date: 2026-11-27ZHEJIANG DAHUA TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211637836.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-17
Publication Date
2026-11-27
Estimated Expiration
2042-12-17

AI Technical Summary

Technical Problem

In existing technologies, browsers cannot accurately locate any frame in a video when playing it, making it impossible to perform precise video frame operations.

Method used

By storing the video stream into the first video source object and the second video source object respectively, the data information of the unplayed video frame data at the time corresponding to the pause command is obtained, and the current playing frame number at the time corresponding to the pause command is located in the second video source object based on the data information. The current playing frame is accurately located using methods such as reverse addition.

Benefits of technology

It enables precise positioning of the current playback frame in a video when only one video stream is being pulled, reducing positioning errors and supporting frame switching.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116248954B_ABST
    Figure CN116248954B_ABST
Patent Text Reader

Abstract

The application discloses a video frame positioning method, a video frame positioning device and a computer storage medium. The video frame positioning method comprises the following steps: acquiring a video stream of a video to be played, and storing the video stream into a first video source object and a second video source object respectively, wherein the video stream comprises all video frame data of the video to be played; playing the video to be played according to the video frame data in the first video source object; in response to a pause instruction, acquiring data information of unplayed video frame data of the first video source object at a time corresponding to the pause instruction; and positioning a current playing frame number at the time corresponding to the pause instruction among all video frame data in the second video source object based on the data information. Through the above method, the video stream is pulled only once and stored into two video source objects, and the data information of the two video source objects at the pause time is acquired, so that the video frame at the pause time can be positioned accurately.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of video playback, and in particular to a video frame positioning method, a video frame positioning device, and a computer storage medium. Background Technology

[0002] With the continuous development of the internet, the data transmitted over the network is no longer limited to text and graphics, but is gradually transitioning to multimedia formats such as audio and video. Online video playback has evolved from initially using video players to encrypt and decrypt raw videos to a "click-to-watch" format, meaning real-time playback within the browser. When playing videos in a browser, browser playback methods that are less dependent on device performance are typically used; for example, the video component is a common browser playback method.

[0003] In one application scenario, when a user plays a video in real time using a browser, the conventional browser playback method parses the video stream internally, allowing only basic operations such as pause and fast forward. Because it cannot access specific frames of the video, it cannot accurately locate any particular frame. Summary of the Invention

[0004] The main technical problem addressed by this application is how to accurately locate video frames in a playing video. To this end, this application provides a video frame positioning method, a video frame positioning device, and a computer storage medium.

[0005] To address the aforementioned technical problems, this application provides a video frame positioning method, comprising: acquiring a video stream of a video to be played, and storing the video stream in a first video source object and a second video source object respectively, wherein the video stream contains all video frame data of the video to be played; playing the video to be played based on the video frame data in the first video source object; responding to a pause command, acquiring data information of unplayed video frame data of the first video source object at the time corresponding to the pause command; and locating the current playing frame number at the time corresponding to the pause command in all video frame data within the second video source object based on the data information.

[0006] The data information refers to the storage volume of the video frame data.

[0007] Before playing the video to be played based on the video frame data in the first video source object, the method further includes: obtaining the volume change of the first video source object and the second video source object when each video frame data is stored in the first video source object and the second video source object; and determining the storage volume of each video frame data based on the volume change.

[0008] The process of locating the current playback frame number corresponding to the pause command in all video frame data within the second video source object based on data information includes: performing reverse addition on the video frame data within the second video source object based on video information, so that the data information of the video frame data after reverse addition is the same as the data information of the unplayed video frame data; obtaining the video frame corresponding to the reverse addition result; and obtaining the previous frame of the video frame to locate the current playback frame number corresponding to the pause command.

[0009] The process includes, after locating the current playback frame number corresponding to the pause command in all video frame data within the second video source object based on data information, the process further includes: obtaining the frame in the video frame data that corresponds to the current playback frame number plus or minus one, and playing the frame to achieve the switching between the upper and lower frames of the video to be played.

[0010] Before acquiring the video stream of the video to be played and storing the video stream into the first video source object and the second video source object respectively, the process also includes: creating the first video source object and the second video source object; creating a video tag, which is used to play the video, and setting the source file address of the video tag to the first video source object.

[0011] The process of obtaining the video stream of the video to be played and storing the video stream into a first video source object and a second video source object respectively includes: obtaining the video stream of the video to be played and copying it to obtain a first video stream and a second video stream; storing the first video stream into the first video source object for playing the video to be played; and storing the second video stream into the second video source object.

[0012] To solve the above-mentioned technical problems, another technical solution adopted in this application is: providing a video frame positioning device, which includes a storage module, a playback module, an acquisition module, and a positioning module; wherein, the storage module is used to acquire the video stream of the video to be played and store the video stream into a first video source object and a second video source object respectively, wherein the video stream contains all video frame data of the video to be played; the playback module is used to play the video to be played according to the video frame data in the first video source object; the pause module is used to, in response to a pause command, acquire data information of the unplayed video frame data of the first video source object at the time corresponding to the pause command; the positioning module is used to locate the current playing frame number at the time corresponding to the pause command in all video frame data in the second video source object based on the data information.

[0013] To solve the above-mentioned technical problems, another technical solution adopted in this application is: to provide a video frame positioning device, which includes a processor and a memory, the memory being coupled to the processor, the memory storing program data, and the processor executing the program data to implement the above-mentioned video frame positioning method.

[0014] To solve the above-mentioned technical problems, another technical solution adopted in this application is to provide a computer-readable storage medium that stores program data, which, when executed, is used to implement the above-mentioned video frame positioning method.

[0015] The beneficial effects of this application are as follows: Unlike existing technologies, the video frame positioning method provided in this application is applied to a video frame positioning device. The video frame positioning device acquires the video stream of the video to be played and stores the video stream in a first video source object and a second video source object, respectively. The video stream contains all video frame data of the video to be played. The video to be played is played based on the video frame data in the first video source object. In response to a pause command, the device acquires data information of the unplayed video frame data of the first video source object at the time corresponding to the pause command. Based on this data information, the current playing frame number at the time corresponding to the pause command is located within all video frame data in the second video source object. Through this method, compared to conventional video frame positioning methods, this application, by pulling only one video stream and storing it in two video source objects, and by acquiring the data information of the video frame data when the video is paused to locate the currently playing frame in the video, can accurately locate the position of the current frame in the video and achieve frame switching based on this position. This video frame localization method locates the current playback frame by acquiring data information from the video frame data. It can accurately locate the position of the current playback frame while saving performance by only pulling one video stream, and reduces the error compared with conventional video localization methods. Attached Figure Description

[0016] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0017] in:

[0018] Figure 1 This is a flowchart illustrating the first embodiment of the video frame positioning method provided in this application;

[0019] Figure 2 This is a schematic diagram illustrating the process of implementing the video frame positioning method using the video frame positioning device provided in this application.

[0020] Figure 3 This is a flowchart illustrating the second embodiment of the video frame positioning method provided in this application;

[0021] Figure 4 This is a schematic diagram of the structure of the first embodiment of the video frame positioning device provided in this application;

[0022] Figure 5 This is a schematic diagram of the structure of the second embodiment of the video frame positioning device provided in this application;

[0023] Figure 6 This is a schematic diagram of an embodiment of the computer-readable storage medium provided in this application. Detailed Implementation

[0024] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of the embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.

[0025] The video frame positioning method provided in this application is mainly applied to video playback in browsers. Currently, browser pages are primarily built using HTML5 technology. HTML (HyperText Markup Language) is a language used to describe web content.

[0026] See Figure 1 and Figure 2 , Figure 1 This is a flowchart illustrating the first embodiment of the video frame positioning method provided in this application; Figure 2 This is a schematic diagram illustrating the process of implementing the video frame positioning method using the video frame positioning device provided in this application.

[0027] Step 11: Obtain the video stream of the video to be played, and store the video stream into the first video source object and the second video source object respectively. The video stream contains all the video frame data of the video to be played.

[0028] Specifically, before acquiring the video stream of the video to be played and storing the video stream into the first video source object and the second video source object respectively, the video frame positioning device first creates the first video source object and the second video source object, which are used to store the video frame data of the video to be played.

[0029] Specifically, the video frame positioning device also creates a video tag and sets the source file address of the video tag to the first video source object for video playback. The purpose of the video tag is to embed video elements in the HTML page.

[0030] Specifically, users can select the video to be played on the display interface of the video frame positioning device and click the play video button to start playback. After receiving the video playback command from the user, the video frame positioning device begins acquiring the video stream of the video to be played. A video stream refers to the transmission of video data, which can be used for real-time playback of audio, video, and other multimedia over the internet without downloading or waiting. This video frame positioning device only needs to acquire one video stream, thus saving device performance.

[0031] Specifically, after acquiring the video stream of the video to be played, the video frame positioning device copies the video frame data in the acquired video stream into two copies, resulting in a first video stream and a second video stream. These are then stored in a first video source object and a second video source object, respectively. The first video source object is used for playing the video, and the second video source object is used to calculate the storage volume of the played data frames. The first video source object and the second video source object can be interchanged, and this is not a limitation.

[0032] Optionally, the data information is the storage volume of the video frame data.

[0033] Specifically, before playing the video to be played based on the video frame data in the first video source object, the video frame positioning device will also acquire the volume changes of the first video source object and the second video source object when each video frame data is stored in the first video source object and the second video source object, and determine the storage volume of each video frame data based on the volume change.

[0034] Step 12: Play the video to be played based on the video frame data in the first video source object.

[0035] Specifically, the video frame positioning device uses video tags to play the video by consuming data in the video to be played.

[0036] Step 13: In response to the pause command, obtain the data information of the unplayed video frame data of the first video source object at the time corresponding to the pause command.

[0037] Specifically, when a user clicks the video pause button, the video frame positioning device receives the pause command and, in response to the pause command, calculates the data information of the remaining data in the first video source object at the pause time, that is, the storage volume of the remaining data.

[0038] Step 14: Based on the data information, locate the current playback frame number corresponding to the pause command in all video frame data within the second video source object.

[0039] After acquiring the remaining data information from the first video source object at the pause time, the video frame positioning device processes the video frame data in the second video source object based on this data information to locate the current playback frame number at the time corresponding to the pause command. The video frame positioning device only needs to fetch one video stream and store it in two video source objects. By acquiring the video frame data information at the time of video pause, it can accurately locate the position of the current frame in the video, reducing errors in the positioning process.

[0040] Optionally, when the data information is the storage volume of video frame data, the steps of the video frame positioning method to locate the current playback frame number are as follows: Figure 3 As shown, Figure 3 This is a flowchart illustrating the second embodiment of the video frame positioning method provided in this application. This embodiment can be achieved through, as shown in... Figure 3 The method shown achieves the positioning of the current playback frame.

[0041] Step 31: Based on the video information, perform reverse addition on the video frame data within the second video source object, so that the data information of the video frame data after reverse addition is the same as the data information of the unplayed video frame data.

[0042] Specifically, the video frame positioning device adds the video frame data in the second video source object in reverse order until the sum equals the storage volume of the remaining data in the first video source object at the pause time, thus obtaining the video frame data of the last frame that has not yet been played at the pause time.

[0043] Step 32: Obtain the video frame corresponding to the result of the reverse addition.

[0044] Specifically, the video frame positioning device can locate the corresponding video frame based on the video frame data obtained when the last frame has not yet been played at the time of the pause.

[0045] Step 33: Obtaining the previous frame of the video frame will locate the current playback frame number at the moment corresponding to the pause command.

[0046] Specifically, the video frame positioning device subtracts one from the number of the last unplayed video frame to obtain the number of playing frames at the current pause time. By utilizing the storage volume of the remaining unplayed video data during the pause, the video frame positioning device accurately locates the unplayed video frame. By taking one frame backward from the unplayed video frame, the currently playing video frame can be obtained, resulting in more accurate positioning with lower error.

[0047] For example, if the storage size of the video to be played is 1000MB, the storage size of the first frame is 100MB, the storage size of the second frame is 30MB, and the storage size of the third frame is 40MB, when the user pauses at the third frame, the video frame positioning device obtains that the storage size of the remaining video data to be played is 830MB. The video frame data in the second video source object is added from the last frame backwards until the total storage size equals the storage size of the remaining video data, which is 830MB. The video frame positioning device then obtains the frame number corresponding to the last frame added, which is the fourth frame. By subtracting one from this frame number, the third frame is obtained, thus locating the currently playing video frame at the moment of pause.

[0048] Optionally, the video frame positioning device can, according to the user's needs, obtain the frame in the video frame data that corresponds to the current playback frame number plus or minus one, and play the frame to achieve the switching between the upper and lower frames of the video to be played.

[0049] Optionally, the video frame positioning device can obtain the number of currently playing video frames, and thus play the video in reverse order from the currently playing video frames to achieve reverse playback of the video.

[0050] Optionally, the video frame positioning device can locate the currently playing video frame to obtain the image of the current frame, and can take a screenshot of the image of the currently playing video frame, and perform image processing or image analysis on the captured image.

[0051] Unlike existing technologies, the video frame positioning method provided in this application is applied to a video frame positioning device. The device acquires the video stream of a video to be played and stores it in a first video source object and a second video source object, respectively. The video stream contains all video frame data of the video to be played. The device plays the video to be played based on the video frame data in the first video source object. In response to a pause command, it acquires data information of the unplayed video frame data of the first video source object at the time of the pause command. Based on this data information, it locates the current playing frame number at the time of the pause command within all video frame data in the second video source object. Compared to conventional video frame positioning methods, this application, by pulling only one video stream and storing it in two video source objects, and locating the currently playing frame in the video by acquiring the data information of the video frame data when the video is paused, can accurately locate the position of the current frame in the video and switch between the previous and next frames based on this position. This video frame localization method locates the current playback frame by acquiring data information from the video frame data. It can accurately locate the position of the current playback frame while saving performance by only pulling one video stream, and reduces the error compared with conventional video localization methods.

[0052] The method described in the above embodiments can be implemented using a video frame positioning device, as described below. Figure 4 Describe, Figure 4 This is a schematic diagram of the structure of the first embodiment of the video frame positioning device provided in this application.

[0053] like Figure 4 As shown, the video frame positioning device 40 of this application embodiment includes a storage module 41, a playback module 42, a pause module 43, and a positioning module 44.

[0054] The storage module 41 is used to acquire the video stream of the video to be played and store the video stream into the first video source object and the second video source object respectively. The video stream contains all the video frame data of the video to be played.

[0055] The playback module 42 is used to play the video to be played based on the video frame data in the first video source object.

[0056] The pause module 43 is used to respond to a pause command and obtain data information of the unplayed video frame data of the first video source object at the time corresponding to the pause command.

[0057] The positioning module 44 is used to locate the current playback frame number at the moment corresponding to the pause instruction in all video frame data within the second video source object based on the data information.

[0058] The method described in the above embodiments can be implemented using a video frame positioning device, as described below. Figure 5 , Figure 5 This is a schematic diagram of the structure of the second embodiment of the video frame positioning device provided in this application. The video frame positioning device 50 includes a memory 51 and a processor 52. The memory 51 is used to store program data, and the processor 52 is used to execute the program data to implement the following method:

[0059] The system acquires the video stream of the video to be played and stores it in a first video source object and a second video source object, respectively. The video stream contains all the video frame data of the video to be played. The system plays the video to be played based on the video frame data in the first video source object. In response to a pause command, the system acquires the data information of the unplayed video frame data of the first video source object at the time corresponding to the pause command. Based on the data information, the system locates the current playing frame number at the time corresponding to the pause command in all the video frame data in the second video source object.

[0060] See Figure 6 , Figure 6 This is a schematic diagram of an embodiment of the computer-readable storage medium 60 provided in this application. The computer-readable storage medium 60 stores program data 61, which, when executed by a processor, is used to implement the following method:

[0061] The system acquires the video stream of the video to be played and stores it in a first video source object and a second video source object, respectively. The video stream contains all the video frame data of the video to be played. The system plays the video to be played based on the video frame data in the first video source object. In response to a pause command, the system acquires the data information of the unplayed video frame data of the first video source object at the time corresponding to the pause command. Based on the data information, the system locates the current playing frame number at the time corresponding to the pause command in all the video frame data in the second video source object.

[0062] When the embodiments of this application are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0063] The above description is merely an embodiment of this application and does not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.

Claims

1. A browser-based video frame localization method, characterized in that, include: Obtain the video stream of the video to be played, and store the video stream into a first video source object and a second video source object respectively. The video stream contains all the video frame data of the video to be played, and the first video source object and the second video source object are the source file addresses of the video tags. Play the video to be played based on the video frame data in the first video source object; In response to a pause command, data information of unplayed video frame data of the first video source object at the time corresponding to the pause command is obtained; wherein, the data information is the storage volume of the video frame data; Based on the data information, locate the current playback frame number at the moment corresponding to the pause instruction in all video frame data within the second video source object; The step of locating the current playback frame number corresponding to the pause instruction in all video frame data within the second video source object based on the data information includes: Based on the data information, the video frame data within the second video source object are added in reverse order, so that the data information of the video frame data after the reverse addition is the same as the data information of the unplayed video frame data; Obtain the video frame corresponding to the result of the reverse addition; Obtaining the previous frame of the video frame locates the current playback frame number at the moment corresponding to the pause command; Specifically, the video frame data in the second video source object are added from the last frame forward.

2. The video frame localization method according to claim 1, characterized in that, Before playing the video to be played based on the video frame data in the first video source object, the method further includes: The volume change of the first video source object and the second video source object is obtained when each video frame data is stored in the first video source object and the second video source object; The storage volume of each video frame data is determined based on the volume change.

3. The video frame localization method according to claim 1, characterized in that, After locating the current playback frame number corresponding to the pause instruction in all video frame data within the second video source object based on the data information, the method further includes: The frame corresponding to the current playback frame number plus or minus one is obtained from the video frame data, and the frame corresponding to the current playback frame number plus or minus one is played to achieve the switching between the upper and lower frames of the video to be played.

4. The video frame localization method according to claim 1, characterized in that, Before obtaining the video stream of the video to be played and storing the video stream into the first video source object and the second video source object respectively, the method further includes: Create the first video source object and the second video source object; Create a video tag, which is used to play the video, and set the source file address of the video tag to the first video source object.

5. The video frame localization method according to claim 1, characterized in that, The step of acquiring the video stream of the video to be played and storing the video stream into a first video source object and a second video source object respectively includes: Obtain the video stream of the video to be played and copy it to obtain the first video stream and the second video stream; The first video stream is stored in the first video source object for playing the video to be played; Store the second video stream into the second video source object.

6. A video frame positioning device, characterized in that, The video frame positioning device includes a storage module, a playback module, a pause module, and a positioning module; wherein... The storage module is used to acquire the video stream of the video to be played and store the video stream into a first video source object and a second video source object respectively. The video stream contains all the video frame data of the video to be played, and the first video source object and the second video source object are the source file addresses of the video tags. The playback module is used to play the video to be played based on the video frame data in the first video source object; The pause module is used to respond to a pause command and obtain data information of the unplayed video frame data of the first video source object at the time corresponding to the pause command; wherein, the data information is the storage volume of the video frame data; The positioning module is used to locate the current playback frame number at the moment corresponding to the pause instruction in all video frame data within the second video source object based on the data information. The step of locating the current playback frame number corresponding to the pause instruction in all video frame data within the second video source object based on the data information includes: Based on the data information, the video frame data within the second video source object are added in reverse order, so that the data information of the video frame data after the reverse addition is the same as the data information of the unplayed video frame data; Obtain the video frame corresponding to the result of the reverse addition; Obtaining the previous frame of the video frame locates the current playback frame number at the moment corresponding to the pause command; Specifically, the video frame data in the second video source object are added from the last frame forward.

7. A video frame positioning device, characterized in that, The video frame positioning device includes a memory and a processor coupled to the memory; The memory is used to store program data, and the processor is used to execute the program data to implement the video frame positioning method as described in any one of claims 1 to 5.

8. A computer storage medium, characterized in that, The computer storage medium is used to store program data, which, when executed by the computer, is used to implement the video frame positioning method as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Processing method and processing device of live broadcast stream

    CN103096131A

  • Object positioning method, video display method, apparatus, device, and storage medium

    US20210099737A1