Video frame extraction method and video preview interaction method

Upload videos through online access links and cache them in the local database to generate homologous video links, which solves the problem of unsmooth video frame extraction in traditional technology, implements a method of quickly acquiring video frames, and improves the efficiency of video frame extraction.

CN118803293APending Publication Date: 2024-10-18TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202310436197.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-04-13
Publication Date
2024-10-18

AI Technical Summary

Technical Problem

The traditional video frame extraction method has the problem of unsmooth video frame extraction, mainly because it takes a long time for the video link to access the video platform server.

Method used

Upload the video through the online access link and cache it to the local database, generate the same-origin video link, obtain the frame waiting time in response to the video frame extraction event, trigger the access to the same-origin video link, forward the access request to the local database, thereby obtaining and extracting the matching Video frames.

Benefits of technology

It achieves smooth video frame extraction, shortens the time to obtain video frames, and improves the efficiency and user experience of video frame extraction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118803293A_ABST
    Figure CN118803293A_ABST
Patent Text Reader

Abstract

The invention relates to a video frame extraction method and a video preview interaction method. The video frame extraction method comprises the following steps: uploading a video through an online access link, and caching the video to a local database; generating a homologous video link of the video according to the online access link; the homologous video link comprises a local cache identifier and a local video identifier pointing to a video cached in a local database; in response to a video frame extraction event for the video, obtaining to-be-extracted frame time of the video, and triggering an access request indicating to access a homologous video link and carrying the to-be-extracted frame time; when a local cache identifier in a homologous video link to which the access request indicates to access is identified, forwarding the access request to a local database; and acquiring locally cached videos fed back by the local database in response to the access request, and extracting frame extraction video frames matched with the to-be-extracted frame time of the locally cached videos identified by the local video identifier from the locally cached videos. By adopting the method, smooth video frame extraction can be realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a video frame extraction method, apparatus, computer equipment, storage medium and computer program product, as well as a video preview interaction method, apparatus, computer equipment, storage medium and computer program product. Background Art

[0002] With the development of Internet technology, many publishers publish their video content on major video platforms every day. In the process of publishing video content, the publisher usually selects one frame from the video content as the cover, so video frame extraction is often required.

[0003] In the traditional technology, the video frame extraction method is to extract the video frame by accessing the video link fed back by the video platform server after uploading the video to the video platform server at the front end. However, in the traditional technology, it takes a long time to access the video resources in the video platform server through the video link, and there is a problem of unsmooth video frame extraction. Summary of the invention

[0004] Based on this, it is necessary to provide a video frame extraction method, device, computer equipment, computer-readable storage medium and computer program product, as well as a video preview interaction method, device, computer equipment, storage medium and computer program product that can achieve smooth video frame extraction in response to the above-mentioned technical problems.

[0005] In a first aspect, the present application provides a video frame extraction method. The method comprises:

[0006] Upload videos through online access links and cache them in a local database;

[0007] Generate a homologous video link of the video according to the online access link; the homologous video link includes a local cache identifier and a local video identifier pointing to the video cached in the local database;

[0008] In response to a video frame extraction event for a video, a time of a frame to be extracted of the video is obtained, and an access request indicating access to a homologous video link and carrying the time of the frame to be extracted is triggered;

[0009] When a local cache identifier in a homologous video link indicated by an access request is identified, the access request is forwarded to a local database;

[0010] The locally cached video fed back by the local database in response to the access request is obtained, and a frame-by-frame video frame is extracted from the locally cached video, and the frame-by-frame video frame matches a time to be extracted of the locally cached video identified by the local video identifier.

[0011] In a second aspect, the present application further provides a video frame extraction device. The device comprises:

[0012] The video upload module is used to upload videos through online access links and cache videos to a local database;

[0013] A link generation module, used to generate a homologous video link of a video according to an online access link; the homologous video link includes a local cache identifier and a local video identifier pointing to a video cached in a local database;

[0014] A frame extraction triggering module, used to respond to a video frame extraction event for a video, obtain a time of a video frame to be extracted, and trigger an access request indicating access to a homologous video link and carrying the time of a video frame to be extracted;

[0015] An identification module, configured to forward the access request to a local database upon identifying a local cache identifier in a homologous video link that is accessed by the access request;

[0016] The video frame acquisition module is used to obtain the locally cached video fed back by the local database in response to the access request, extract the extracted video frame from the locally cached video, and the extracted video frame matches the to-be-extracted frame time of the locally cached video identified by the local video identifier.

[0017] In a third aspect, the present application further provides a computer device. The computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program:

[0018] Upload videos through online access links and cache them in a local database;

[0019] Generate a homologous video link of the video according to the online access link; the homologous video link includes a local cache identifier and a local video identifier pointing to the video cached in the local database;

[0020] In response to a video frame extraction event for a video, a time of a frame to be extracted of the video is obtained, and an access request indicating access to a homologous video link and carrying the time of the frame to be extracted is triggered;

[0021] When a local cache identifier in a homologous video link indicated by an access request is identified, the access request is forwarded to a local database;

[0022] The locally cached video fed back by the local database in response to the access request is obtained, and a frame-by-frame video frame is extracted from the locally cached video, and the frame-by-frame video frame matches a time to be extracted of the locally cached video identified by the local video identifier.

[0023] In a fourth aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the following steps are implemented:

[0024] Upload videos through online access links and cache them in a local database;

[0025] Generate a homologous video link of the video according to the online access link; the homologous video link includes a local cache identifier and a local video identifier pointing to the video cached in the local database;

[0026] In response to a video frame extraction event for a video, a time of a frame to be extracted of the video is obtained, and an access request indicating access to a homologous video link and carrying the time of the frame to be extracted is triggered;

[0027] When a local cache identifier in a homologous video link indicated by an access request is identified, the access request is forwarded to a local database;

[0028] The locally cached video fed back by the local database in response to the access request is obtained, and a frame-by-frame video frame is extracted from the locally cached video, and the frame-by-frame video frame matches a time to be extracted of the locally cached video identified by the local video identifier.

[0029] In a fifth aspect, the present application further provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, the following steps are implemented:

[0030] Upload videos through online access links and cache them in a local database;

[0031] Generate a homologous video link of the video according to the online access link; the homologous video link includes a local cache identifier and a local video identifier pointing to the video cached in the local database;

[0032] In response to a video frame extraction event for a video, a time of a frame to be extracted of the video is obtained, and an access request indicating access to a homologous video link and carrying the time of the frame to be extracted is triggered;

[0033] When a local cache identifier in a homologous video link indicated by an access request is identified, the access request is forwarded to a local database;

[0034] The locally cached video fed back by the local database in response to the access request is obtained, and a frame-by-frame video frame is extracted from the locally cached video, and the frame-by-frame video frame matches a time to be extracted of the locally cached video identified by the local video identifier.

[0035] The above-mentioned video frame extraction method, device, computer equipment, storage medium and computer program product upload videos through an online access link and cache the videos to a local database, generate a homologous video link of the video including a local cache identifier and a local video identifier pointing to the video cached in the local database according to the online access link, and can realize the construction of the homologous video link of the video, so that in response to a video frame extraction event for the video, the waiting frame extraction time of the video can be obtained, and an access request indicating access to the homologous video link and carrying the video frame extraction event can be triggered. When the local cache identifier in the homologous video link accessed by the access request is identified, the access request is forwarded to the local database to obtain the locally cached video fed back by the local database in response to the access request, and the extracted video frames that match the waiting frame extraction time of the locally cached video identified by the local video identifier are extracted from the locally cached video, thereby realizing a closed loop from uploading the video to opening it through the homologous video link for video frame extraction, shortening the time to obtain the extracted video frames, and realizing smooth video frame extraction.

[0036] In a sixth aspect, the present application provides a video preview interaction method. The method comprises:

[0037] In response to a preview trigger event for a video, displaying a preview control area and a preview display area of ​​the video;

[0038] In the preview control area, multiple fixed preview images from the video are displayed in a time sequence according to the corresponding progress time range in the video;

[0039] In response to the designation of the preview progress of the preview control area, in the fixed preview image designated by the preview progress in the preview control area, marking the progress position of the designated fixed preview image designated by the preview progress within the corresponding progress time interval in the video;

[0040] In the preview display area, a video frame preview image of a video frame corresponding to the progress time indicated by the progress position in the video is displayed.

[0041] In a seventh aspect, the present application also provides a video preview interaction device. The device comprises:

[0042] A preview area display module, used to display a preview control area and a preview display area of ​​the video in response to a preview trigger event for the video;

[0043] A fixed preview image display module is used to display multiple fixed preview images from the video in a time sequence corresponding to the progress time range in the video in the preview control area;

[0044] A progress designation module, for responding to the designation of the preview progress of the preview control area, marking, in the fixed preview image designated by the preview progress in the preview control area, a progress position designated by the preview progress within a corresponding progress time interval in the video;

[0045] The video frame display module is used to display, in the preview display area, a video frame preview image of a video frame corresponding to the progress time indicated by the progress position in the video.

[0046] In an eighth aspect, the present application further provides a computer device. The computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program:

[0047] In response to a preview trigger event for a video, display a preview control area and a preview display area of ​​the video;

[0048] In the preview control area, multiple fixed preview images from the video are displayed in a time sequence according to the corresponding progress time range in the video;

[0049] In response to the designation of the preview progress of the preview control area, in the fixed preview image designated by the preview progress in the preview control area, marking the progress position of the designated fixed preview image designated by the preview progress within the corresponding progress time interval in the video;

[0050] In the preview display area, a video frame preview image of a video frame corresponding to the progress time indicated by the progress position in the video is displayed.

[0051] In a ninth aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the following steps are implemented:

[0052] In response to a preview trigger event for a video, displaying a preview control area and a preview display area of ​​the video;

[0053] In the preview control area, multiple fixed preview images from the video are displayed in a time sequence according to the corresponding progress time range in the video;

[0054] In response to the designation of the preview progress of the preview control area, in the fixed preview image designated by the preview progress in the preview control area, marking the progress position of the designated fixed preview image designated by the preview progress within the corresponding progress time interval in the video;

[0055] In the preview display area, a video frame preview image of a video frame corresponding to the progress time indicated by the progress position in the video is displayed.

[0056] In a tenth aspect, the present application further provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, the following steps are implemented:

[0057] In response to a preview trigger event for a video, displaying a preview control area and a preview display area of ​​the video;

[0058] In the preview control area, multiple fixed preview images from the video are displayed in a time sequence according to the corresponding progress time range in the video;

[0059] In response to the designation of the preview progress of the preview control area, in the fixed preview image designated by the preview progress in the preview control area, marking the progress position of the designated fixed preview image designated by the preview progress within the corresponding progress time interval in the video;

[0060] In the preview display area, a video frame preview image of a video frame corresponding to the progress time indicated by the progress position in the video is displayed.

[0061] The above-mentioned video preview interaction method, device, computer equipment, storage medium and computer program product, in response to a preview trigger event for a video, display a preview control area and a preview display area of ​​the video, in which a plurality of fixed preview images spaced apart from each other are displayed in a time sequence according to a corresponding progress time range in the video, and can use a plurality of fixed preview images to implement guidance for video frame extraction so as to quickly and accurately locate the video frame to be extracted, and in response to the designation of the preview progress of the preview control area, in the fixed preview images designated by the preview progress in the preview control area, mark the progress position designated by the preview progress within the corresponding progress time interval in the video in the fixed preview images designated by the preview progress, so as to implement rapid positioning and indication of video frame extraction, and further, in the preview display area, display a video frame preview image of the video frame corresponding to the progress time indicated by the progress position in the video, so as to implement rapid and smooth video frame extraction. BRIEF DESCRIPTION OF THE DRAWINGS

[0062] Figure 1 A diagram showing an application environment of a video frame extraction method in an embodiment;

[0063] Figure 2 A schematic diagram of a flow chart of a video frame extraction method in one embodiment;

[0064] Figure 3 A schematic diagram of caching videos to a local database in one embodiment;

[0065] Figure 4A schematic diagram of a process for setting a video cover in a newly added scenario in an embodiment;

[0066] Figure 5 A schematic diagram of a process for modifying video cover settings in a scene in an embodiment;

[0067] Figure 6 A schematic diagram of frame extraction logic for a degradation scheme for setting a video cover in one embodiment;

[0068] Figure 7 A diagram of an application environment of a video preview interaction method in an embodiment;

[0069] Figure 8 A schematic diagram of a flow chart of a video preview interaction method in one embodiment;

[0070] Fig. 9 A schematic diagram of a layout of a preview control area and a preview display area in one embodiment;

[0071] Fig.10 A schematic diagram of responding to a designation of preview progress in one embodiment;

[0072] Fig.11 A schematic diagram of displaying a video frame preview image in one embodiment;

[0073] Fig.12 A schematic diagram of responding to a move operation on a preview progress indicator in one embodiment;

[0074] Fig.13 A schematic diagram of responding to a cover capture operation in one embodiment;

[0075] Fig.14 is a schematic diagram of displaying multiple fixed preview images in one embodiment;

[0076] Fig.15 A structural block diagram of a video frame extraction device in one embodiment;

[0077] Fig.16 It is a structural block diagram of a video preview interaction device in one embodiment;

[0078] Fig.17 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0079] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0080] The video frame extraction method provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown. Among them, the terminal 102 communicates with the server 104 through the network. The data storage system can store the data that the server 104 needs to process. The data storage system can be integrated on the server 104, or it can be placed on the cloud or other servers. The terminal 102 is installed with a client for implementing video frame extraction, which can be an application, a web client, or a sub-application running in the operating environment of the parent application. The terminal 102 uploads the video through the online access link provided by the server 104, and caches the video to the local database, and generates a homologous video link of the video according to the online access link; the homologous video link includes a local cache identifier and a local video identifier pointing to the video cached in the local database, and in response to the video frame extraction event for the video, obtains the frame time to be extracted of the video, and triggers an access request indicating access to the homologous video link and carrying the frame time to be extracted, and when the local cache identifier in the homologous video link indicated by the access request is identified, the access request is forwarded to the local database, and the local cached video fed back by the local database in response to the access request is obtained, and the frame extraction video frame is extracted from the local cached video, and the frame extraction video frame matches the frame time to be extracted of the local cached video identified by the local video identifier. Among them, the terminal 102 can be, but is not limited to, various desktop computers, laptops, smart phones, tablet computers, Internet of Things devices and portable wearable devices, and the Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart car-mounted devices, etc. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. Server 104 can be implemented as an independent server or a server cluster consisting of multiple servers, or can be a node on the blockchain.

[0081] In one embodiment, Figure 2 As shown, a video frame extraction method is provided, which can be executed by a terminal or a server alone, or by a terminal and a server in collaboration. In the embodiment of the present application, the method is applied to a terminal as an example for explanation, and includes the following steps:

[0082] Step 202, upload the video through the online access link, and cache the video to the local database.

[0083] Among them, the online access link refers to a link that can be accessed online for uploading videos. Video involves various technologies that capture, record, process, store, transmit and reproduce a series of static images in the form of electrical signals. When the continuous image changes exceed 24 frames per second, according to the principle of visual persistence, the human eye cannot distinguish a single static picture, and it looks like a smooth and continuous visual effect. Such a continuous picture is called a video. In this embodiment, the type of video to be uploaded is not limited. For example, the video to be uploaded can be a video clip shot by the video uploader. For another example, the video to be uploaded can be a film or TV drama clip edited by the video uploader.

[0084] Among them, the local database refers to a database used to cache data locally in the terminal. For example, the local database can specifically refer to IndexedDB (a local database provided by the browser installed in the terminal), which can be created and operated by web scripts, allows the storage of large amounts of data, provides a search interface, and can also create indexes. In terms of database type, it does not belong to a relational database and does not support SQL (Structured Query Language server database) query statements. IndexedDB uses an object store to store data internally, and all types of data can be directly stored, including JavaScript objects. In the object store, data is saved in the form of "key-value pairs", and each data record has a corresponding primary key. The primary key is unique and cannot be repeated, otherwise an error will be reported.

[0085] Specifically, the terminal can upload the video through the online access link and cache the video to the local database. In a specific application, the terminal displays a video upload page corresponding to the online access link. In response to the video upload operation triggered by the video uploader on the video upload page, the terminal will upload the local video through the online access link and cache the video to the local database. In a specific application, the terminal can upload the video to the video platform server by calling the video upload SDK (Software Development Kit).

[0086] In a specific application, when uploading a video through an online access link, the terminal can obtain the source file of the video, so as to generate a local video identifier of the video based on the source file of the video, and cache the video to the local database using the local video identifier. In a specific application, the local database uses an object warehouse to store videos. The data in the object warehouse is saved in the form of "key-value pairs", and the primary key corresponding to the video is the local video identifier.

[0087] Step 204, generating a homologous video link of the video according to the online access link; the homologous video link includes a local cache identifier and a local video identifier pointing to the video cached in the local database.

[0088] Among them, the same-source video link refers to a link that is the same source as the online access link and can be used to access the video cached in the local database. Here, the same source means that the network protocol, host address and port of the same-source video link and the online access link are the same. The network protocol refers to a set of rules that must be followed when exchanging information between peer entities that communicate with each other in a computer network. For example, common network protocols include HTTP (Hyper Text Transfer Protocol), HTTPS (Hypertext Transfer Protocol Secure), etc. The host address is the address used to uniquely identify each host or device in the TCP (Transmission Control Protocol) / IP (Internet Protocol) network. The host address consists of 32 bits (a total of four octets) of binary. The port refers to a port in the logical sense, generally referring to a port in the TCP / IP protocol. The port number ranges from 0 to 65535. Common ports include port 80 for browsing web services, port 21 for FTP (File Transfer Protocol) services, and so on.

[0089] Among them, the local cache identifier refers to a mark used to identify the same-origin video link. As long as the local cache identifier exists in the video link, it is a same-origin video link. The local video identifier refers to a mark used to identify the video, which is used to uniquely identify the video. For example, the local video identifier can specifically refer to the hash value of the video obtained by the hash algorithm. For example, assuming that the online access link is https: / / A.com / B, the generated same-origin video link can be https: / / A.com / localCache / C, where localCache is the local cache identifier and C is the local video identifier.

[0090] Specifically, the terminal will parse the online access link, determine the homologous link attributes that the homologous link of the online access link needs to have, and then generate a homologous video link for the video based on the homologous link attributes that the homologous link needs to have, the local cache identifier used to identify the homologous video link, and the local video identifier of the video. The homologous video link includes the local cache identifier and the local video identifier pointing to the video cached in the local database.

[0091] Step 206 , in response to a video frame extraction event for a video, obtain the time of the frame to be extracted of the video, and trigger an access request indicating access to a homologous video link and carrying the time of the frame to be extracted.

[0092] The video frame extraction event refers to an event in which at least one video frame is extracted from a video. The frame extraction time refers to the playback time of the video frame to be extracted in the video. For example, when extracting the first video frame, the frame extraction time may be the 0th second of the video. The access request is used to access the locally cached video read from the local database by the same source video link, so as to extract the extracted video frame that matches the frame extraction time from the locally cached video.

[0093] Specifically, the terminal monitors the video frame extraction event for the video in real time. When the video frame extraction event for the video is detected, it responds to the video frame extraction event for the video, obtains the frame extraction time of the video, and triggers an access request indicating access to the same-source video link and carrying the frame extraction time.

[0094] In a specific application, a video frame extraction event for a video can be automatically triggered after the video has been loaded. In a specific application, after generating a homologous video link for a video based on an online access link, the terminal will return the generated homologous video link through the video tag of the video, and start monitoring the loaded event of the video based on the video tag. When the loaded event of the video is detected, a video frame extraction event for the video is automatically triggered. In the case of automatically triggering a video frame extraction event for a video, the frame extraction time indicated by the video frame extraction event can be configured according to the actual application scenario. For example, the frame extraction time indicated by the video frame extraction event can be the 0th second, and the automatically triggered video frame extraction event for the video refers to extracting the first video frame from the video.

[0095] In a specific application, the video tag is used to embed a video element in a page. For example, the video tag may specifically refer to a video tag, which is a new tag in HTML5 (HyperText Markup Language 5) and is used to embed a video element in an HTML page. The terminal uses the same-origin video link as the URL (uniform resource locator) of the video to be played in the video tag of the video, and returns the generated same-origin video link through the video tag of the video.

[0096] In a specific application, the loaded event may specifically refer to a loadeddata event. When a loadeddata event is detected, it indicates that the video has been loaded into the memory. A loadeddata event occurs when the data of the current frame has been loaded, but there is not enough data to play the next frame of the specified video. In this embodiment, the addEventListener() method may be used to implement monitoring of the loadeddata event.

[0097] In a specific application, the video frame extraction event for the video can be triggered after the video uploader sets the frame extraction time. In a specific application, after generating a homologous video link of the video based on the online access link, the terminal will return the generated homologous video link through the video tag of the video, and start monitoring the loaded event of the video based on the video tag. When the loaded event of the video is detected, it indicates that the video frame extraction can be performed. The terminal will continue to monitor the setting event of the frame extraction time for the video. When the setting event of the frame extraction time for the video is detected, the video frame extraction event for the video is triggered.

[0098] In a specific application, after monitoring the event of setting the frame time to be extracted for the video, the terminal will respond to the event of setting the frame time to be extracted for the video, set the playback time of the video to the frame time to be extracted, and monitor the playback time setting event. After monitoring the playback time setting event, it indicates that the playback time of the video has been set to the frame time to be extracted. In response to the playback time setting event, a video frame extraction event for the video is triggered.

[0099] In a specific application, the play time setting event can be specifically a sought event. When a sought event is detected, it indicates that the play time of the video has been set to the frame time to be drawn. The seek event is triggered when the user has moved / jumped to a new position in the video. In this embodiment, the addEventListener() method can be used to implement monitoring of the sought event.

[0100] In a specific application, in response to a video frame extraction event for a video, the terminal can use a canvas tag to extract a frame extraction video frame that matches the frame extraction time to be extracted. In a specific application, in response to a video frame extraction event for a video, the terminal will create a canvas object for drawing the frame extraction video frame based on the canvas tag, read the video tag of the video through the canvas object to obtain the frame extraction time of the video, initiate an access request indicating access to the same source video link and carrying the frame extraction time to obtain the frame extraction video frame, draw the frame extraction video frame on the canvas, and realize the extraction of the frame extraction video frame.

[0101] In a specific application, the canvas tag can specifically refer to the Canvas tag. The Canvas tag is a new tag in HTML5, which is used to generate images in real time on web pages and can manipulate image content. Basically, it is a bitmap that can be manipulated with JavaScript. The canvas object can specifically refer to the Canvas object, which represents an HTML canvas element. <canvas>, it has no behavior of its own, but defines an interface to support scripted client drawing operations, which can directly specify the width and height, that is, the canvas size, on the Canvas object. Most of the functionality of the Canvas object can be obtained through the CanvasRenderingContext2D object, which is obtained by passing the literal string "2d" as the only parameter to the getContext() method of the Canvas object.

[0102] In a specific application, the drawImage method can be used to draw the extracted video frame onto the canvas object. The specific drawImage method used can be context.drawImage(video,dx,dy,canvas.width,canvas.height), where video is the video tag of the video, dx and dy are the positions of the extracted video frame on the canvas, canvas.width is the canvas width, and canvas.height is the canvas height. The position of the extracted video frame on the canvas, the canvas width, and the canvas height can be configured according to the actual application scenario. In a specific application, the canvas width can be the same as the video width in the video tag, and the canvas height can be the same as the video height in the video tag.

[0103] Step 208: When the local cache identifier in the same-source video link indicated by the access request is identified, the access request is forwarded to the local database.

[0104] Specifically, the terminal will intercept and identify the access request. When it identifies the local cache identifier in the same-source video link that the access request indicates to access, it means that the access request actually indicates to read the cached video from the local database. The terminal will forward the access request to the local database.

[0105] Step 210, obtaining the locally cached video fed back by the local database in response to the access request, extracting a frame from the locally cached video, and matching the frame to be extracted time of the locally cached video identified by the local video identifier.

[0106] Specifically, after receiving the access request, the local database will parse the access request, determine the local video identifier in the homologous video link in the access request, and feedback the locally cached video that matches the local video identifier. The terminal obtains the locally cached video that the local database responds to the access request, extracts the frame-by-frame video frame from the locally cached video, and the frame-by-frame video frame matches the frame-to-be-extracted time of the locally cached video identified by the local video identifier. Among them, the locally cached video refers to the video cached in the local database.

[0107] The above-mentioned video frame extraction method uploads the video through an online access link and caches the video to a local database, generates a homologous video link of the video according to the online access link, which includes a local cache identifier and a local video identifier pointing to the video cached in the local database, and can realize the construction of the homologous video link of the video, so that in response to a video frame extraction event for the video, the waiting frame extraction time of the video can be obtained, and an access request indicating access to the homologous video link and carrying the video frame extraction event can be triggered. When the local cache identifier in the homologous video link accessed by the access request is identified, the access request is forwarded to the local database to obtain the locally cached video fed back by the local database in response to the access request, and the extracted video frame that matches the waiting frame extraction time of the locally cached video identified by the local video identifier is extracted from the locally cached video, thereby realizing a closed loop from uploading the video to opening it through the homologous video link for video frame extraction, shortening the time to obtain the extracted video frame, and realizing smooth video frame extraction.

[0108] It should be noted that the video frame extraction method provided in this application can fully meet the needs of the video uploader to extract any frame of the video at the functional level. At the experience level, it is also very fast and smooth. After the video uploader triggers the video frame extraction event, the extracted video frame is displayed almost immediately.

[0109] In one embodiment, generating a homologous video link of a video according to an online access link includes:

[0110] Obtain the local cache identifier, the local video identifier of the video, and the homology link attribute of the online access link;

[0111] Generate a homologous video link of the video according to the local cache identifier, the local video identifier and the homologous link attribute.

[0112] Among them, the local cache identifier refers to a mark used to identify the same-origin video link. As long as the local cache identifier exists in the video link, it is a same-origin video link, which can be configured according to the actual application scenario. For example, the local cache identifier can be a preconfigured string. For example, the local cache identifier can be localCache. The local video identifier refers to a mark used to identify the video, which is used to uniquely identify the video. For example, the local video identifier can specifically refer to the hash value of the video obtained by the hash algorithm. The same-origin link attribute refers to the attributes that the link with the same origin as the online access link needs to have, including the network protocol, host address and port of the online access link.

[0113] Specifically, the terminal will obtain a local cache identifier for identifying a homologous video link, a local video identifier of the video, and a homologous link attribute of the online access link, and generate a homologous video link of the video based on the local cache identifier, the local video identifier, and the homologous link attribute, with reference to the link format of the online access link. In a specific application, with reference to the link format of the online access link, the format of the homologous video link of the generated video can be: network protocol / host address / local cache identifier / local video identifier. For example, when the network protocol is https, the host address is A.com, the local cache identifier is localCache, and the local video identifier is C, the homologous video link of the generated video can be https: / / A.com / localCache / C.

[0114] In this embodiment, by acquiring the local cache identifier, the local video identifier of the video and the homologous link attribute of the online access link, the local cache identifier, the local video identifier and the homologous link attribute can be used to construct the homologous video link of the video.

[0115] In one embodiment, the video frame extraction method further includes:

[0116] Start a service worker thread; the service worker thread is used to intercept and identify access requests;

[0117] When identifying a local cache identifier in a homologous video link indicated by an access request, forwarding the access request to a local database includes:

[0118] When the local cache identifier in the same-origin video link indicated by the access request is identified, the service worker thread forwards the access request to the local database.

[0119] Among them, the service worker thread Service Worker is a thread similar to the proxy server in the browser, which can intercept outgoing requests and cache responses. This allows web pages to be used normally without a network connection because some or all pages can be served from the service worker thread cache.

[0120] Specifically, the terminal will obtain the service worker file, load the service worker file, and start the service worker thread, which is mainly used to intercept and identify access requests, which is equivalent to the role of a proxy server. After triggering an access request that indicates access to the same-source video link and carries the frame time to be extracted, the service worker thread can intercept and identify the access request. When the local cache identifier in the same-source video link that the access request indicates to access is identified, it means that the access request is actually an instruction to read the cached video from the local database, and the service worker thread will forward the access request to the local database.

[0121] In a specific application, when a service worker thread is started, the homologous video link of the video may also be constructed by the service worker thread. Therefore, the access request may be intercepted and identified by the service worker thread.

[0122] In this embodiment, by starting a service worker thread, the service worker thread can be used to intercept and identify access requests, so that when the local cache identifier in the same-origin video link indicated by the access request is identified, the access request can be forwarded to the local database to achieve local access.

[0123] In one embodiment, uploading a video via an online access link and caching the video to a local database includes:

[0124] Upload the video through the online access link and obtain the video information of the video;

[0125] When it is determined according to the video information that the video format of the video does not meet the video caching condition, the video is transcoded to obtain a transcoded video; the video format of the transcoded video meets the video caching condition;

[0126] Cache the transcoded video to the local database.

[0127] Among them, video information refers to information used to describe the video, including the encoding format and encapsulation format of the video. Video format includes the encoding format and encapsulation format of the video. Video caching conditions refer to the conditions for directly caching the video in the local database, which can be configured according to the actual application scenario. For example, the video caching conditions may specifically be that only videos with specific encodings and specific formats can be cached in the local database. For example, the specific encoding may be H.264 (digital video compression format) encoding, and the specific format may be MP4 (Moving Picture Experts Group 4) format.

[0128] Specifically, when uploading a video through an online access link, the terminal can obtain the source file of the video, and thus can obtain the video information of the video by parsing the source file of the video. After obtaining the video information of the video, the terminal will determine whether the video format of the video meets the video cache condition according to the video information. When it is determined according to the video information that the video format of the video does not meet the video cache condition, the terminal will transcode the video through a pre-loaded video transcoding tool to obtain a transcoded video whose video format meets the video cache condition, and cache the transcoded video to the local database.

[0129] In specific applications, the terminal can parse the source file of the video through a video parameter detection tool to obtain the video information of the video. The video parameter detection tool can be configured according to the actual application scenario. If the video format of the video meets the video caching conditions based on the video information, the terminal can directly cache the video to the local database without transcoding.

[0130] In this embodiment, when uploading a video through an online access link, the video information of the video can be obtained, so that when it is determined based on the video information that the video format does not meet the video caching conditions, the video can be transcoded to obtain a transcoded video whose video format meets the video caching conditions, and then the transcoded video can be cached to the local database. The whole process can realize local caching of the uploaded video.

[0131] In one embodiment, the video frame extraction method further includes:

[0132] Start the web worker thread;

[0133] Load the video transcoding tool through the web worker thread;

[0134] When it is determined according to the video information that the video format of the video does not meet the video caching condition, the video is transcoded to obtain the transcoded video including:

[0135] When it is determined according to the video information that the video format of the video does not meet the video caching condition, the video is transcoded by a video transcoding tool to obtain a transcoded video.

[0136] Among them, Web (World Wide Web) Worker is part of the HTML5 standard. This specification defines a set of interfaces that allow us to open up new worker threads outside the browser's JavaScript main thread and run a JavaScript script in it, which gives developers the ability to use JavaScript to operate multiple threads. The web worker thread is an independent thread that can run simultaneously with the browser's JavaScript main thread without blocking each other. Therefore, when there are a large number of computing tasks, the computing tasks can be handed over to the web worker thread for processing. When the web worker thread completes the calculation, the result is returned to the browser's JavaScript main thread. In this way, the browser's JavaScript main thread only needs to focus on processing business logic, and does not need to spend too much time processing a large number of complex calculations, thereby reducing blocking time and improving operating efficiency. The page fluency and user experience are naturally improved.

[0137] Specifically, when entering the video upload page corresponding to the online access link, the terminal will obtain the web worker file, asynchronously load the web worker file to start the web worker thread, and when the web worker thread is started, obtain the file for loading the video transcoding tool, and use the file for loading the video transcoding tool to load the video transcoding tool. When the video transcoding tool is loaded, when it is determined according to the video information that the video format of the video does not meet the video caching condition, the video transcoding tool is called, and the video is transcoded by the video transcoding tool to obtain a transcoded video.

[0138] In a specific application, the file used to load the video transcoding tool can be a Web Assembly file, through which the video transcoding tool providing video transcoding capabilities can be loaded. Among them, WebAssembly is a virtual instruction set architecture (virtual ISA), the overall architecture includes the core ISA definition, binary encoding, definition and execution of program semantics, and application programming interface (WebAssemblyAPI) for different embedded environments (such as Web). Its initial goal is to compile programs written in languages ​​such as C / C++ and run them better on the Web platform while ensuring security and running speed close to that of native applications.

[0139] In a specific application, such as Figure 3 As shown, when entering the video upload page corresponding to the online access link, the terminal will obtain the web worker file, asynchronously load the web worker file to start the web worker thread, and when the web worker thread is started, obtain the file for loading the video transcoding tool, and use the file for loading the video transcoding tool to load the video transcoding tool. When the video transcoding tool is loaded, while calling the video upload SDK to upload the video, the video information of the video is obtained through the web worker thread. When it is determined that the video format of the video does not meet the video caching condition according to the video information, the video is transcoded by the loaded video transcoding tool to obtain the transcoded video, and the transcoded video is cached to the local database. When it is determined that the video format of the video meets the video caching condition according to the video information, the video is directly cached to the local database.

[0140] In this embodiment, by starting a web worker thread, the web worker thread can be used to load a video transcoding tool, so that when it is determined based on video information that the video format does not meet the video caching conditions, the video can be transcoded by the video transcoding tool to obtain a transcoded video, and the video transcoding can be handed over to an independent thread for processing. This allows the main thread of the client on the terminal used to implement video frame extraction to focus on processing business logic without spending too much time processing a large number of complex calculations, thereby reducing blocking time and improving operating efficiency.

[0141] In one embodiment, uploading a video via an online access link and caching the video to a local database includes:

[0142] Upload the video through the online access link, generate the local video ID of the video, and trigger a video query request carrying the local video ID to the local database;

[0143] When there is no cached video corresponding to the local video identifier in the local database, the video is cached to the local database.

[0144] Specifically, when uploading a video through an online access link, the terminal can obtain the source file of the video, so that the local video identifier of the video can be generated based on the source file of the video, and a video query request carrying the local video identifier is triggered to the local database to check whether there is a cached video corresponding to the local video identifier in the local database. When there is no cached video corresponding to the local video identifier in the local database, it means that the video has not been cached in the local database, and the terminal will cache the video in the local database. When there is a cached video corresponding to the local video identifier in the local database, it means that the video has been cached in the local database and does not need to be cached again.

[0145] In specific applications, when the web worker thread is started, the local video identifier of the video can be generated based on the source file of the video through the web worker thread, and a video query request carrying the local video identifier can be triggered to the local database. By assigning this part of the task to an independent thread for processing, the main thread of the client on the terminal used to implement video frame extraction can only focus on processing business logic, without spending too much time processing a large number of complex calculations, thereby reducing blocking time and improving operating efficiency.

[0146] In this embodiment, it is possible to check whether a video corresponding to the local video identifier has been cached in the local database. Only when there is no cached video corresponding to the local video identifier in the local database, the video is cached to the local database, which can avoid repeated operations and improve processing efficiency.

[0147] In one embodiment, the video frame extraction method further includes:

[0148] The extracted video frames and the time of the frames to be extracted are associated and cached in a local database;

[0149] In response to a re-frame extraction event for a video, obtain a re-frame extraction time of the video, and trigger a video frame query request carrying the re-frame extraction time to a local database;

[0150] When there is a cached video frame matching the frame re-extraction time in the local database, the cached video frame fed back by the local database in response to the video frame query request is obtained.

[0151] The re-frame extraction event refers to an event of re-extracting a video frame when the extracted video frame is extracted. The re-frame extraction time refers to the playback time of the re-extracted video frame in the video.

[0152] Specifically, after extracting the extracted video frame, the terminal will associate the extracted video frame with the time to be extracted and cache it in the local database, and monitor the re-extraction event for the video. In the case of monitoring the re-extraction event for the video, the terminal responds to the re-extraction event for the video, obtains the re-extraction time of the video, and triggers a video frame query request carrying the re-extraction time to the local database to query whether there is a cached video frame matching the re-extraction time cached in the local database. When there is a cached video frame matching the re-extraction time in the local database, the cached video frame fed back by the local database in response to the video frame query request is obtained.

[0153] In a specific application, when there is no cached video frame matching the re-frame extraction time in the local database, the terminal will trigger a re-access request indicating access to the same-source video link and carrying the re-frame extraction time. When the local cache identifier in the same-source video link indicated by the re-access request is identified, the re-access request will be forwarded to the local database, the locally cached video fed back by the local database in response to the re-access request will be obtained, and the video frame matching the re-frame extraction time will be extracted from the locally cached video.

[0154] In this embodiment, when the extracted video frames and the time to be extracted are associated and cached in a local database, by responding to a re-extraction event for the video, the re-extraction time of the video is obtained, and a video frame query request carrying the re-extraction time is triggered to the local database. This can enable a query on whether there are cached video frames matching the re-extraction time in the local database. Therefore, when there are cached video frames matching the re-extraction time in the local database, the cached video frames fed back by the local database in response to the video frame query request can be directly obtained, which can avoid repeated frame extraction operations and improve processing efficiency.

[0155] In one embodiment, the video frame extraction method further includes:

[0156] In response to a video cover setting operation for the extracted video frame, using the extracted video frame as a video cover of the video;

[0157] In response to a publishing operation for the video, the video is published to the video platform based on a content distribution network link of the video; the content distribution network link is generated by a video platform server that caches the video.

[0158] Specifically, after extracting the extracted video frame, if the video uploader wants to use the extracted video frame as the video cover of the video, it will trigger a video cover setting operation for the extracted video frame, and the terminal will use the extracted video frame as the video cover of the video in response to the video cover setting operation for the extracted video frame. When the video cover is set, the video uploader can publish the video by triggering a publishing operation for the video, and the terminal will publish the video to the video platform based on the content distribution network link of the video in response to the publishing operation for the video, and the content distribution network link is generated by the video platform server that caches the video.

[0159] In specific applications, when uploading a video through an online access link, the video will be uploaded to the video platform server. After receiving the video, the video platform server will perform unified transcoding, compression and other operations on the video while retaining the source file of the video, and then provide access to the outside in the form of a content distribution network link. Therefore, the video uploader may upload videos with different encodings and formats, but ultimately the videos that can be accessed through the content distribution network link are all videos with fixed encodings and fixed formats. For example, the fixed encoding and fixed format video can specifically refer to a video with an encoding format of H.264 and a video format of MP4.

[0160] In this embodiment, by responding to a video cover setting operation for a frame-by-frame video frame, the frame-by-frame video frame is used as the video cover of the video, so that the setting of the video cover can be achieved; by responding to a publishing operation for the video, the video is published to a video platform based on a content distribution network link of the video, so that the publishing of the video can be achieved.

[0161] In one embodiment, the video frame extraction method further includes:

[0162] In response to a video cover modification event for a video, obtain the cover frame extraction time of the video, and trigger an acquisition request for accessing a content distribution network link of the video and carrying the cover frame extraction time to a video platform server;

[0163] Obtain the background cache video fed back by the video platform server in response to the acquisition request, extract and modify the cover frame from the background cache video, and modify the cover frame to match the cover frame extraction time;

[0164] Updates the modified cover frame to the video cover of the video.

[0165] The video cover modification event refers to the event of modifying the video cover of a video after the video has been published. When the video has been published, the video uploader can modify the video cover of the video by triggering the video cover modification event for the video. The cover frame extraction time refers to the time when the cover frame is modified to play in the video.

[0166] Specifically, when the video has been published, if the video uploader wants to modify the video cover of the video, a video cover modification event for the video can be triggered. In response to the video cover modification event for the video, the terminal obtains the cover frame extraction time of the video, and triggers an acquisition request indicating access to the content distribution network link of the video and carrying the cover frame extraction time to the video platform server. After receiving the acquisition request, the video platform server responds to the acquisition request and feeds back the background cached video. The terminal obtains the background cached video fed back by the video platform server in response to the acquisition request, extracts the modified cover frame from the background cached video, and updates the modified cover frame to the video cover of the video, and the modified cover frame matches the cover frame extraction time.

[0167] In specific applications, because the background cached video is accessed remotely through a content distribution network link, when the background cached video is large, the local video frame extraction experience will be relatively jerky. Therefore, the terminal will start a web worker thread to extract the video frame of the background cached video. Before the frame extraction is successful, the terminal will first use the default placeholder image to avoid the main thread of the client on the terminal used to implement video frame extraction being occupied by the frame extraction logic, resulting in page rendering jams. The default placeholder image can be configured according to the actual application scenario.

[0168] In this embodiment, in response to a video cover modification event for a video, the modified cover frame can be extracted by utilizing the content distribution network link and the cover frame extraction time, and the video cover can be modified by updating the modified cover frame to the video cover of the video.

[0169] In one embodiment, the video frame extraction method of the present application is described by taking the video cover setting applied to the video as an example. When applied to the video cover setting of the video, the video frame extraction method of the present application is mainly divided into two scenarios, a new addition scenario and a modified scenario. Among them, the new addition scenario refers to setting the video cover when the video cover is not set. The modified scenario refers to changing the video cover when the video cover is set. In the new addition scenario, when video frame extraction is performed, the video used for frame extraction is a locally cached video obtained from the local database through a homologous video link. In the modified scenario, when video frame extraction is performed, the video used for frame extraction is a background cached video obtained from the video platform server through a content distribution network link. The video frame extraction in the new addition scenario and the modified scenario are described below.

[0170] In one embodiment, Figure 4 As shown, in the newly added scenario, if the video uploader wants to upload a video, a video upload page corresponding to the online access link will be opened in the terminal client (specifically, a browser). When entering the video upload page, the client first asynchronously loads the web worker file to start the web worker thread, and then the web worker thread loads the video transcoding tool (such as ) that provides video transcoding capabilities. Figure 4 Specifically, it can be FFmpeg (Fast Forward Mpeg, multimedia video processing tool) Worker), which is a video transcoding tool that can convert all video formats into standard H.264-encoded MP4 format files. When the video uploader uploads the video on the video upload page, the client will obtain the video information of the video through the web worker thread, including the encoding format, packaging format, etc., and determine whether the video needs to be transcoded based on the video information. When it is determined that the video format of the video does not meet the video caching conditions based on the video information, the video is transcoded through the video transcoding tool to obtain the transcoded video, and the transcoded video is cached in the local database ( Figure 4 In lndexedDB in, if the video does not need to be transcoded, omit the above steps.

[0171] In one embodiment, when uploading a video through an online access link, the client generates a local video identifier for the video and triggers a video query request carrying the local video identifier to the local database. The video is cached to the local database only when there is no cached video corresponding to the local video identifier in the local database.

[0172] In one embodiment, Figure 4 As shown, in addition to loading the video transcoding tool, the client also loads the service worker file to start the service worker thread. After caching the video to the local database, the client generates a homologous video link of the video based on the online access link through the service worker thread. The homologous video link includes a local cache identifier and a local video identifier pointing to the video cached in the local database. The homologous video link can be returned through the video tag. In a specific application, such as Figure 4 As shown, the client also includes a video frame extraction SDK, and a service worker file can be loaded in the video frame extraction SDK to start a service worker thread and respond to a video frame extraction event for the video in the video frame extraction SDK.

[0173] In one embodiment, when a homologous video link is returned through a video tag, the client monitors a video frame extraction event for the video. When a video frame extraction event for the video is detected, the client obtains the frame extraction time of the video in response to the video frame extraction event, and triggers an access request indicating access to the homologous video link and carrying the frame extraction time. The service worker thread intercepts and identifies the access request. When a local cache identifier in the homologous video link indicated by the access request is identified, the access request is forwarded to the local database, the locally cached video fed back by the local database in response to the access request is obtained, and the extracted video frame is extracted from the locally cached video. The extracted video frame matches the frame extraction time of the locally cached video identified by the local video identifier.

[0174] In a specific application, when returning the same-origin video link through the video tag, the client will monitor the loadeddata event and the sought event, such as Figure 4 As shown, when the loadeddata event occurs, it indicates that the video has been loaded into the memory, and an event for extracting the first frame of the video using the canvas tag is automatically triggered. The canvas tag can obtain the corresponding frame time to be extracted for the first frame by reading the video tag, and trigger an access request indicating access to the same-source video link and carrying the corresponding frame time to be extracted for the first frame. The service worker thread intercepts and identifies the access request, and when the local cache identifier in the same-source video link indicated by the access request is identified, the access request is forwarded to the local database, and the locally cached video (i.e., the local cached video) fed back by the local database in response to the access request is obtained. Figure 4 The first frame of the video is extracted from the locally cached video and returned to the video upload page of the client.

[0175] In specific applications, such as Figure 4 As shown, while returning the first video frame to the video upload page of the client, the cover editing entry will be displayed on the video upload page to prompt the video uploader to select the video cover. In response to the trigger operation on the cover editing entry, the client will trigger a preview trigger event for the video, extract multiple video frames, and generate multiple fixed preview images corresponding to the multiple video frames as preview frames of the video for the video uploader to select. When the video uploader selects one of the preview frames and detects the sought event, the video frame extraction event for the video is triggered, and the canvas tag is used to extract the specified time frame of the newly added scene that matches the corresponding frame time to be extracted of the selected preview frame. The canvas tag can obtain the corresponding frame time to be extracted of the preview frame by reading the video tag, and trigger an access request indicating access to the same source video link and carrying the corresponding frame time to be extracted of the preview frame. The service worker thread intercepts and identifies the access request. When the local cache identifier in the same source video link indicated by the access request is identified, the access request is forwarded to the local database, the local cached video fed back by the local database in response to the access request is obtained, and the specified time frame of the newly added scene is extracted from the local cached video. After extracting the specified time frame of the newly added scene, the terminal uploads the specified time frame of the newly added scene to the image warehouse for storage.

[0176] In a specific application, if the video uploader chooses to use a specified time frame as the video cover of the video, a video cover setting operation for the specified time frame will be triggered, and the client will respond to the video cover setting operation for the specified video frame and use the specified time frame as the video cover of the video. After setting the video cover, the video uploader can trigger a publishing operation for the video, and the client will respond to the publishing operation for the video and publish the video to the video platform based on the content distribution network link of the video.

[0177] In one embodiment, in a modification scenario, if the video uploader wants to modify the cover of a published video, the editing content page displayed on the client can trigger a video cover modification event for the video. In response to the video cover modification event for the video, the client obtains the cover frame extraction time of the video, and triggers a content distribution network link indicating access to the video and carries a request for the cover frame extraction time to the video platform server, obtains the background cached video fed back by the video platform server in response to the acquisition request, extracts the modified cover frame from the background cached video, modifies the cover frame to match the cover frame extraction time, and updates the modified cover frame to the video cover of the video.

[0178] In one embodiment, Figure 5 As shown, in response to the video cover modification event for the video, the client will first call the video frame extraction SDK to access the content distribution network link to read the video cached in the background, extract the first video frame from the video cached in the background, return the first video frame to the client's editing content page, and display the cover editing entrance on the editing content page to prompt the video uploader that the video cover can be edited. In response to the trigger operation for the cover editing entrance, the client will trigger a preview trigger event for the video, call the video frame extraction SDK to access the content distribution network link to read the video cached in the background, extract multiple video frames from the video cached in the background, and generate multiple fixed preview images corresponding to the multiple video frames as the preview frames of the video for the video uploader to select. When the video uploader selects one of the preview frames and detects the seeked event, the video frame extraction SDK is called to extract the specified time frame of the modified scene that matches the frame time to be extracted corresponding to the selected preview frame, that is, the modified cover frame, and the modified cover frame is updated to the video cover of the video, and uploaded to the image warehouse for storage.

[0179] In one embodiment, when the video frame extraction SDK is called to extract video frames from the video cached in the background, the canvas tag is mainly used to extract video frames. Taking the extraction and modification of the cover frame as an example, the canvas tag will read the video tag, obtain the cover frame extraction time of the video, and trigger an access instruction to the content distribution network link of the video and carry the cover frame extraction time to the video platform server to obtain the background cached video fed back by the video platform server in response to the acquisition request, extract and modify the cover frame from the background cached video, and modify the cover frame to match the cover frame extraction time.

[0180] In one embodiment, when applying to the video cover setting of the video, the terminal needs to check the support level of the client for FFmpeg and Canvas (canvas tag), and adopt a degradation scheme if it is not supported. The frame extraction logic of the degradation scheme is as follows: Figure 6 shown.

[0181] If the client supports FFmpeg and the uploaded video is not larger than the video size threshold, the main path, that is, the above-mentioned video frame extraction method, is used. If the client supports FFmpeg but the uploaded video is larger than the video size threshold, canvas tag frame extraction is used. If the client does not support FFmpeg and canvas tag frame extraction can be used, canvas tag frame extraction is used. If the client does not support FFmpeg and canvas tag frame extraction cannot be used, the video cover of the video is directly uploaded. Among them, the video size threshold can be configured according to the actual application scenario. The video cover directly uploaded can be configured according to the actual application scenario. For example, the first frame of the video frame can be directly uploaded as the video cover.

[0182] The video preview interaction method provided in the embodiment of the present application can be applied to Figure 7 In the application environment shown. Among them, a client for realizing video preview interaction is installed on the terminal 702, and the client can be an application, a web client, or a sub-application running in the running environment of the parent application. In response to the preview trigger event for the video, the terminal 702 displays the preview control area and the preview display area of ​​the video. In the preview control area, multiple fixed preview images from the video are arranged and displayed in a time sequence according to the corresponding progress time range in the video. In response to the designation of the preview progress of the preview control area, in the fixed preview image specified by the preview progress in the preview control area, the progress position specified by the preview progress in the corresponding progress time interval in the video is marked in the fixed preview image specified by the preview progress, and in the preview display area, the video frame preview image of the video frame corresponding to the progress time indicated by the progress position in the video is displayed. Among them, the terminal 702 can be, but is not limited to, various desktop computers, laptops, smart phones, tablet computers, Internet of Things devices and portable wearable devices. The Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart car-mounted devices, etc. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc.

[0183] In one embodiment, Figure 8 As shown, a video preview interaction method is provided, which can be executed by a terminal or a server alone, or by a terminal and a server in collaboration. In the embodiment of the present application, the method is applied to a terminal as an example for explanation, and includes the following steps:

[0184] Step 802: In response to a preview triggering event for a video, a preview control area and a preview display area of ​​the video are displayed.

[0185] The preview trigger event refers to an event for previewing a video frame in a video. The preview control area refers to an area for controlling the preview of a video frame, and the preview display area refers to an area for displaying a preview image of a video frame.

[0186] Specifically, in response to a preview trigger event for a video, the terminal will display a preview control area and a preview display area of ​​the video. In a specific application, the preview trigger event for the video can be triggered by the interactive object when a video frame in the video needs to be previewed. In a specific application, the interactive object can be a video uploader, and the video uploader can trigger a preview trigger event for the video when video frame extraction is required, and preview the video frames in the video so as to select the video frames to be extracted. In a specific application, the layout of the displayed preview control area and the preview display area can be as follows: Fig. 9 As shown in (1) in FIG. 1 , the preview display area is displayed above the preview control area, and the size of the preview display area is larger than the preview control area. The layout of the preview control area and the preview display area can also be as follows: Fig. 9 As shown in (2), the preview display area is displayed on the right side of the preview control area, and the size of the preview display area is larger than the preview control area.

[0187] Step 804: In the preview control area, a plurality of fixed preview images from the video that are spaced apart are displayed in a time sequence according to the corresponding progress time range in the video.

[0188] The fixed preview image refers to an image obtained by processing a video frame extracted from the video for preview, and corresponds to the video frame extracted from the video for preview.

[0189] Specifically, in the preview control area, the terminal will display multiple fixed preview images from the video in a time sequence corresponding to the progress time range in the video. In a specific application, in response to a preview trigger event for the video, the terminal will extract multiple video frames for preview at intervals from the video, process the multiple video frames for preview, obtain a fixed preview image corresponding to each video frame, and then display the multiple fixed preview images in a time sequence corresponding to the progress time range in the video.

[0190] In a specific application, the progress time ranges corresponding to the multiple fixed preview images in the video can be determined according to the video playback time of the multiple video frames extracted from the video for preview. For each of the multiple video frames for preview, the video playback time range between the video playback time of the targeted video frame and the video playback time of the last extracted video frame is the progress time range corresponding to the fixed preview image in the video corresponding to the targeted video frame. In a specific application, for the first extracted video frame among the multiple video frames for preview, the progress time range corresponding to the corresponding fixed preview image in the video is the video playback time range between the video playback time of the first extracted video frame and the 0th second.

[0191] In a specific application, assuming that the video length of a video is 60 seconds, multiple video frames for preview are extracted at equal time intervals, and the number of extracted video frames is 12, then frame extraction is performed every five seconds, the video playback time of the first extracted video frame is 5 seconds, the video playback time of the second extracted video frame is 10 seconds, and so on. The video playback time of the twelfth extracted video frame is 60 seconds. The progress time range of the fixed preview image corresponding to the first extracted video frame in the video is 0 to 5 seconds, the progress time range of the fixed preview image corresponding to the second extracted video frame in the video is 5 seconds to 10 seconds, and the progress time range of the fixed preview image corresponding to the twelfth extracted video frame in the video is 55 seconds to 60 seconds.

[0192] Step 806, in response to the designation of the preview progress in the preview control area, in the fixed preview image designated by the preview progress in the preview control area, mark the progress position designated by the preview progress within the corresponding progress time interval in the video.

[0193] The specification of the preview progress is used to specify the progress of the video preview. For example, the specification of the preview progress may be a selection operation for any position in any fixed preview image among multiple fixed preview images.

[0194] Specifically, the multiple fixed preview images displayed in the preview control area are equivalent to the preview image progress bar. If the interactive object wants to specify the video preview progress, the preview control area can be triggered to specify the preview progress. In response to the specification of the preview progress in the preview control area, the terminal will mark the progress position of the specified fixed preview image specified by the preview progress within the corresponding progress time interval in the video in the fixed preview image specified by the preview progress in the preview control area.

[0195] In specific applications, such as Fig.10 As shown, 12 fixed preview images are displayed in the preview control area. If the interactive object wants to specify the video preview progress, the preview progress can be triggered in the preview control area (i.e., a selection operation for any position in any fixed preview image among multiple fixed preview images, and it is assumed here that the designation of the preview progress is a selection operation for any position in the fifth fixed preview image). In response to the designation of the preview progress in the preview control area, the terminal will mark the progress position of the designated fixed preview image specified by the preview progress within the corresponding progress time interval in the video in the fifth fixed preview image specified by the preview progress in the preview control area, i.e., the selected position in the fifth fixed preview image.

[0196] Step 808: Display, in the preview display area, a video frame preview image of a video frame corresponding to the progress time indicated by the progress position in the video.

[0197] Specifically, after marking the progress position, the terminal will use the progress time indicated by the progress position as the frame time to be extracted of the video to extract the video frame, so as to obtain the video frame corresponding to the progress time indicated by the progress position in the video, and display the video frame preview image of the video frame corresponding to the progress time indicated by the progress position in the video in the preview display area. The video frame corresponding to the progress time indicated by the progress position in the video can be understood as the extracted video frame that matches the frame time to be extracted.

[0198] In specific applications, such as Fig.11 As shown, 12 fixed preview images are displayed in the preview control area. If the preview progress triggered by the preview control area is designated as a selection operation on the icon position in the first fixed preview image, the terminal will mark the progress position of the designated fixed preview image designated by the preview progress within the corresponding progress time interval in the video, that is, the selected position in the first fixed preview image, in the first fixed preview image designated by the preview progress in the preview control area, and display the progress time indicated by the progress position ( Fig.11 In the preview display area, a video frame preview image of a video frame corresponding to the progress time indicated by the progress position in the video is displayed.

[0199] The above-mentioned video preview interaction method displays a preview control area and a preview display area of ​​the video in response to a preview trigger event for the video. In the preview control area, multiple fixed preview images from the video are displayed in a time sequence according to the corresponding progress time range in the video. The multiple fixed preview images can be used to guide video frame extraction so as to quickly and accurately locate the video frame to be extracted. In response to the designation of the preview progress of the preview control area, in the fixed preview images specified by the preview progress in the preview control area, the progress position specified by the preview progress within the corresponding progress time interval in the video is marked in the fixed preview images specified by the preview progress, so that fast positioning and indication of video frame extraction can be achieved. Then, in the preview display area, a video frame preview image of the video frame corresponding to the progress time indicated by the progress position in the video can be displayed, so as to achieve fast and smooth video frame extraction.

[0200] In one embodiment, the video preview interaction method further includes:

[0201] In the preview control area, a preview progress indicator is displayed; the preview progress indicator is used to specify the preview progress in the preview control area;

[0202] In response to a moving operation on the preview progress indicator, the preview progress indicator is displayed to move along an arrangement track of the plurality of fixed preview images; the position of the preview progress indicator in the preview control area is used to mark a progress position specified by the preview progress.

[0203] Specifically, in the preview control area, the terminal will display a preview progress indicator, which is used to specify the preview progress in the preview progress area. In response to the movement operation of the preview progress indicator, the terminal will display the preview progress indicator moving along the arrangement trajectory of multiple fixed preview images. The position of the preview progress indicator in the preview control area is used to mark the progress position specified by the preview progress.

[0204] In specific applications, such as Fig.12 As shown, multiple fixed preview images can be arranged horizontally. In the preview control area, a preview progress indicator will be displayed. The preview progress indicator is initially located at the leftmost side of the multiple fixed preview images. In response to a movement operation on the preview progress indicator, the terminal will display the preview progress indicator moving along the arrangement track of the multiple fixed preview images.

[0205] In this embodiment, by displaying the preview progress indicator, the preview progress can be specified in the preview control area using the preview progress indicator, and by responding to the movement operation on the preview progress indicator, the preview progress indicator is displayed to move along the arrangement trajectory of multiple fixed preview images, thereby realizing the display of the specified preview progress, and then the position of the preview progress indicator in the preview control area can be used to realize the marking of the progress position specified by the preview progress.

[0206] In one embodiment, the video preview interaction method further includes:

[0207] In response to a cover capture operation on the video frame preview image, highlighting at least a portion of the video frame preview image indicated by the cover capture operation in the preview display area;

[0208] In response to a cover setting operation for a video, at least a portion of the highlighted video frame preview image indicated by the cover capture operation is displayed as a video cover of the video.

[0209] The cover capture operation refers to an operation of capturing a portion of the video frame preview image as the video cover.

[0210] Specifically, when the interactive object has the need to capture a part of the video frame preview image as a video cover, a cover capture operation for the video frame preview image will be triggered. In response to the cover capture operation for the video frame preview image, the terminal will highlight at least a part of the video frame preview image indicated by the cover capture operation in the preview display area. If the interactive object determines to use at least a part of the highlighted video frame preview image indicated by the cover capture operation as the video cover, a cover setting operation for the video can be triggered. In response to the cover setting operation for the video, the terminal will display at least a part of the highlighted video frame preview image indicated by the cover capture operation as the video cover of the video.

[0211] In the present embodiment, by responding to a cover capture operation on a video frame preview image, at least a portion of the video frame preview image indicated by the cover capture operation is highlighted in the preview display area, so that at least a portion of the cover capture operation of interest can be more quickly and directly noticed. By responding to a cover setting operation on a video, at least a portion of the highlighted video frame preview image indicated by the cover capture operation is displayed as a video cover of the video, so that the setting of the video cover can be achieved.

[0212] In one embodiment, the video preview interaction method further includes:

[0213] Displaying a cover cutout area in the preview display area; at least a portion of the video frame preview image is displayed in the cover cutout area;

[0214] In response to a cover capture operation on a video frame preview image, highlighting at least a portion of the video frame preview image indicated by the cover capture operation in a preview display area, including:

[0215] In response to a cover capture operation on a video frame preview image, a cover capture area that changes according to the area adjustment method indicated by the cover capture operation is displayed, and in the cover capture area, at least a portion of the cover capture area captured from the video frame preview image is displayed.

[0216] Specifically, the terminal will display a cover capture area in the preview display area, and at least a portion of the video frame preview image will be displayed in the cover capture area. If the interactive object wants to capture the video frame preview image, a cover capture operation for the video frame preview image can be triggered. In response to the cover capture operation for the video frame preview image, the terminal will display the cover capture area that changes according to the area adjustment method indicated by the cover capture operation. In the cover capture area, at least a portion of the cover capture area captured from the video frame preview image is displayed. In a specific application, the cover capture operation can specifically be an area adjustment operation for the cover capture area. The area adjustment operation can specifically refer to a move operation on the cover capture area, or it can refer to a zoom operation on the cover capture area.

[0217] In specific applications, such as Fig.13 As shown, the terminal will display the cover capture area in the preview display area ( Fig.13 In the cover capture area, at least a portion of the video frame preview image is displayed. If the cover capture operation on the video frame preview image is a move operation on the cover capture area, the terminal will display the moving direction indicated by the move operation on the cover capture area in response to the cover capture operation on the video frame preview image ( Fig.13 If the cover capture operation for the video frame preview image is a zoom-out operation for the cover capture area, the terminal will display the cover capture area that changes in the zoom-out direction indicated by the zoom-out operation for the cover capture area in response to the cover capture operation for the video frame preview image.

[0218] In this embodiment, by displaying the cover capture area in the preview display area, the cover capture area can be used to respond to the cover capture operation on the video frame preview image, thereby realizing the capture of the video frame preview image.

[0219] In one embodiment, the video preview interaction method further includes:

[0220] In response to the upload operation for the video, when the video is cached in the local database, the initial video cover and cover editing entrance of the video are displayed;

[0221] In response to the trigger operation on the cover editing entry, a preview trigger event for the video is triggered.

[0222] Specifically, in response to the upload operation for the video, when the video is cached to the local database, the terminal will display the initial video cover and the cover editing entrance of the video. If the interactive object (i.e., the video uploader) wants to modify the initial video cover, it can trigger the trigger operation for the cover editing entrance. In response to the trigger operation for the cover editing entrance, the terminal will trigger a preview trigger event for the video. In specific applications, the initial video cover can be configured according to the actual application scenario. For example, the initial video cover can be any frame of the video. For example, the initial video cover can be the first frame of the video.

[0223] In this embodiment, in response to an upload operation on a video, when the video is cached to a local database, the initial video cover and a cover editing entry of the video are displayed, and a cover editing entry can be provided to modify the initial video cover. Furthermore, in response to a trigger operation on the cover editing entry, a preview trigger event for the video can be triggered, so that the video cover can be edited through video preview interaction.

[0224] In one embodiment, among the multiple video frames corresponding to the multiple fixed preview images in the video, the time interval between every two adjacent video frames is equal; among the multiple rectangular fixed preview images arranged along a preset arrangement direction in the preview control area, every two adjacent fixed preview images are connected by the side length, and the direction of the side length is perpendicular to the preset arrangement direction.

[0225] Specifically, the terminal can obtain multiple video frames corresponding to multiple fixed preview images in the video by extracting frames at equal time intervals on the video, and then obtain multiple fixed preview images by processing the multiple video frames. Among the multiple rectangular fixed preview images arranged along the preset arrangement direction in the preview control area, every two adjacent fixed preview images are connected by the side length, and the direction of the side length is perpendicular to the preset arrangement direction. Among them, the preset arrangement direction can be configured according to the actual application scenario. For example, the preset arrangement direction can be horizontal or vertical. The direction of the side length is perpendicular to the preset arrangement direction, that is, when the preset arrangement direction is horizontal, the direction of the side length is vertical, and when the preset arrangement direction is vertical, the direction of the side length is horizontal. Among them, since the time interval between every two adjacent video frames is equal, the size of the rectangular shape of each fixed preview image is the same. It can be understood that if the time interval between every two adjacent video frames is not equal, the size of the rectangular shape of each fixed preview image is not exactly the same, and the length of the rectangular shape is positively correlated with the time interval. The longer the time interval, the longer the length of the rectangular shape.

[0226] In a specific application, assuming that the video duration of a video is 60 seconds, multiple video frames corresponding to multiple fixed preview images in the video are extracted at equal time intervals, and the number of extracted video frames is 12, then the time interval between every two adjacent video frames is 5 seconds. Further, assuming that the preset arrangement direction is horizontal and the direction of the side length is vertical, the multiple fixed preview images displayed in the preview control area can be as follows: Fig.14 As shown, the number of the 12 rectangular fixed preview images is the same as the number of the extracted video frames, and every two adjacent fixed preview images are connected by the side length.

[0227] In this embodiment, the display of multiple fixed preview images can be realized in this way, thereby enriching the display forms of multiple fixed preview images.

[0228] In one embodiment, the video preview interaction method in the present application is described by taking a client for uploading videos in a terminal as an example. In the client for uploading videos, the video uploader can upload the video through the video upload page provided by the client for uploading videos. After uploading the video, the video uploader has the desire to select any frame in the video as the video cover.

[0229] The video uploader triggers an upload operation for the video on the client in the terminal, and the client in the terminal responds to the upload operation for the video. When the video is cached in the local database, the initial video cover and cover editing entrance of the video are displayed. In response to the trigger operation on the cover editing entrance, a preview trigger event for the video is triggered. In response to the preview trigger event for the video, the preview control area and preview display area of ​​the video are displayed.

[0230] In the preview control area, multiple fixed preview images from the video are displayed in a time sequence according to the corresponding progress time range in the video, and a preview progress indicator is displayed, and the preview progress indicator is used to specify the preview progress in the preview control area. Among them, in the multiple video frames corresponding to the multiple fixed preview images in the video, the time interval between each two adjacent video frames is equal, and in the multiple rectangular fixed preview images arranged along the preset arrangement direction in the preview control area, each two adjacent fixed preview images are connected by the side length, and the direction of the side length is perpendicular to the preset arrangement direction.

[0231] The video uploader triggers a moving operation for the preview progress indicator, and the client in the terminal responds to the moving operation for the preview progress indicator, displays the preview progress indicator moving along the arrangement track of multiple fixed preview images, and the position of the preview progress indicator in the preview control area is used to mark the progress position specified by the preview progress, and in the preview display area, displays the video frame preview image of the video frame corresponding to the progress time indicated by the progress position in the video. At the same time, the cover capture area is displayed in the preview display area, and at least a part of the video frame preview image is displayed in the cover capture area.

[0232] The video uploader can capture the cover by triggering a cover capture operation for the video frame preview image. The client in the terminal responds to the cover capture operation for the video frame preview image and displays the cover capture area that changes according to the area adjustment method indicated by the cover capture operation. In the cover capture area, at least a portion of the cover capture area captured from the video frame preview image is displayed. In the case of capturing the video cover, the video uploader can set the video cover by triggering a cover setting operation for the video. The client in the terminal responds to the cover setting operation for the video and displays at least a portion of the cover capture area captured from the video frame preview image as the video cover of the video.

[0233] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0234] Based on the same inventive concept, the embodiment of the present application also provides a video frame extraction device for implementing the video frame extraction method involved above and a video preview interaction device for implementing the video preview interaction method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in the embodiments of one or more video frame extraction devices and video preview interaction devices provided below can refer to the limitations of the video frame extraction method and video preview interaction method above, and will not be repeated here.

[0235] In one embodiment, Fig.15 As shown, a video frame extraction device is provided, including: a video uploading module 1502, a link generating module 1504, a frame extraction triggering module 1506, an identification module 1508 and a video frame acquiring module 1510, wherein:

[0236] The video upload module 1502 is used to upload the video through the online access link and cache the video to the local database;

[0237] The link generation module 1504 is used to generate a homologous video link of the video according to the online access link; the homologous video link includes a local cache identifier and a local video identifier pointing to the video cached in the local database;

[0238] The frame extraction triggering module 1506 is used to obtain the frame extraction time of the video in response to the video frame extraction event for the video, and trigger an access request indicating access to the same-source video link and carrying the frame extraction time;

[0239] The identification module 1508 is used to forward the access request to the local database when identifying the local cache identifier in the same-source video link that the access request indicates to access;

[0240] The video frame acquisition module 1510 is used to obtain the locally cached video fed back by the local database in response to the access request, extract the extracted video frame from the locally cached video, and the extracted video frame matches the to-be-extracted frame time of the locally cached video identified by the local video identifier.

[0241] The above-mentioned video frame extraction device uploads the video through an online access link and caches the video to a local database. It generates a homologous video link of the video according to the online access link, which includes a local cache identifier and a local video identifier pointing to the video cached in the local database. It can realize the construction of the homologous video link of the video, so that in response to a video frame extraction event for the video, the waiting frame extraction time of the video can be obtained, and an access request indicating access to the homologous video link and carrying the video frame extraction event can be triggered. When the local cache identifier in the homologous video link accessed by the access request is identified, the access request is forwarded to the local database to obtain the locally cached video fed back by the local database in response to the access request, and the extracted video frame that matches the waiting frame extraction time of the locally cached video identified by the local video identifier is extracted from the locally cached video, thereby realizing a closed loop from uploading the video to opening it through the homologous video link for video frame extraction, shortening the time to obtain the extracted video frame, and realizing smooth video frame extraction.

[0242] In one embodiment, the link generation module is further used to obtain a local cache identifier, a local video identifier of the video and a homologous link attribute of the online access link, and generate a homologous video link of the video according to the local cache identifier, the local video identifier and the homologous link attribute.

[0243] In one embodiment, the identification module is also used to start a service worker thread, which is used to intercept and identify access requests. When the local cache identifier in the same-origin video link indicated by the access request is identified, the service worker thread forwards the access request to the local database.

[0244] In one embodiment, the video upload module is also used to upload the video through an online access link to obtain the video information of the video. When it is determined based on the video information that the video format of the video does not meet the video caching condition, the video is transcoded to obtain a transcoded video. The video format of the transcoded video meets the video caching condition, and the transcoded video is cached to a local database.

[0245] In one embodiment, the video upload module is also used to start a web worker thread, load a video transcoding tool through the web worker thread, and when it is determined based on the video information that the video format does not meet the video caching conditions, the video is transcoded through the video transcoding tool to obtain a transcoded video.

[0246] In one embodiment, the video upload module is also used to upload the video through an online access link, generate a local video identifier for the video, and trigger a video query request carrying the local video identifier to the local database. When there is no cached video corresponding to the local video identifier in the local database, the video is cached to the local database.

[0247] In one embodiment, the video frame acquisition module is also used to cache the extracted video frames and the time to be extracted in a local database, and in response to a re-extraction event for the video, obtain the re-extraction time of the video, and trigger a video frame query request carrying the re-extraction time to the local database. When there is a cached video frame matching the re-extraction time in the local database, the cached video frame fed back by the local database in response to the video frame query request is obtained.

[0248] In one embodiment, the video frame extraction device also includes a video publishing module, which is used to respond to a video cover setting operation for the extracted video frame, use the extracted video frame as the video cover of the video, and respond to the publishing operation for the video to publish the video to the video platform based on the content distribution network link of the video, and the content distribution network link is generated by the video platform server that caches the video.

[0249] In one embodiment, the video frame extraction device also includes a cover update module, which is used to respond to a video cover modification event for a video, obtain the cover frame extraction time of the video, and trigger an acquisition request indicating access to the content distribution network link of the video and carrying the cover frame extraction time to the video platform server, obtain the background cache video fed back by the video platform server in response to the acquisition request, extract the modified cover frame from the background cache video, modify the cover frame to match the cover frame extraction time, and update the modified cover frame to the video cover of the video.

[0250] In one embodiment, Fig.16 As shown, a video preview interaction device is provided, including: a preview area display module 1602, a fixed preview image display module 1604, a progress designation module 1606 and a video frame display module 1608, wherein:

[0251] A preview area display module 1602, for displaying a preview control area and a preview display area of ​​a video in response to a preview triggering event for the video;

[0252] The fixed preview image display module 1604 is used to display multiple fixed preview images from the video in a time sequence corresponding to the progress time range in the video in the preview control area;

[0253] The progress designation module 1606 is used to, in response to the designation of the preview progress of the preview control area, mark the progress position of the designated fixed preview image designated by the preview progress in the preview control area within the corresponding progress time interval in the video.

[0254] The video frame display module 1608 is used to display, in the preview display area, a video frame preview image of a video frame corresponding to the progress time indicated by the progress position in the video.

[0255] The above-mentioned video preview interaction device displays a preview control area and a preview display area of ​​the video in response to a preview trigger event for the video. In the preview control area, multiple fixed preview images from the video are displayed in a time sequence according to the corresponding progress time range in the video. The multiple fixed preview images can be used to guide video frame extraction so as to quickly and accurately locate the video frame to be extracted. In response to the designation of the preview progress of the preview control area, in the fixed preview images designated by the preview progress in the preview control area, the progress position designated by the preview progress within the corresponding progress time interval in the video is marked in the fixed preview images designated by the preview progress, so that fast positioning and indication of video frame extraction can be achieved. Then, in the preview display area, a video frame preview image of the video frame corresponding to the progress time indicated by the progress position in the video can be displayed, so as to achieve fast and smooth video frame extraction.

[0256] In one embodiment, the progress designation module is further used to display a preview progress indicator in the preview control area, and the preview progress indicator is used to designate the preview progress in the preview control area. In response to a move operation on the preview progress indicator, the preview progress indicator is displayed to move along the arrangement trajectory of multiple fixed preview images; the position of the preview progress indicator in the preview control area is used to mark the progress position specified by the preview progress.

[0257] In one embodiment, the video preview interaction device also includes a video cover display module, which is used to respond to a cover capture operation on the video frame preview image, highlight at least a portion of the video frame preview image indicated by the cover capture operation in the preview display area, and respond to a cover setting operation on the video to display at least a portion of the highlighted video frame preview image indicated by the cover capture operation as the video cover of the video.

[0258] In one embodiment, the video cover display module is also used to display a cover capture area in the preview display area, in which at least a portion of the video frame preview image is displayed. In response to a cover capture operation on the video frame preview image, the cover capture area is displayed according to the area adjustment method indicated by the cover capture operation. In the cover capture area, at least a portion of the cover capture area captured from the video frame preview image is displayed.

[0259] In one embodiment, the preview area display module is also used to respond to an upload operation on a video. When the video is cached to a local database, the initial video cover and cover editing entry of the video are displayed. In response to a trigger operation on the cover editing entry, a preview trigger event for the video is triggered.

[0260] In one embodiment, among the multiple video frames corresponding to the multiple fixed preview images in the video, the time interval between every two adjacent video frames is equal; among the multiple rectangular fixed preview images arranged along a preset arrangement direction in the preview control area, every two adjacent fixed preview images are connected by the side length, and the direction of the side length is perpendicular to the preset arrangement direction.

[0261] Each module in the above-mentioned video frame extraction device and video preview interaction device can be implemented in whole or in part by software, hardware and their combination. Each module can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the corresponding operations of each module above.

[0262] In one embodiment, a computer device is provided. The computer device may be a terminal or a server. Taking the computer device as a terminal as an example, its internal structure diagram may be as follows: Fig.17 As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. The processor, the memory and the input / output interface are connected via a system bus, and the communication interface, the display unit and the input device are connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a video frame extraction method and a video preview interaction method are implemented. The display unit of the computer device is used to form a visually visible image, and can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen. The input device of the computer device can be a touch layer covered on the display screen, or a button, trackball or touchpad set on the computer device casing, or an external keyboard, touchpad or mouse, etc.

[0263] Those skilled in the art will understand that Fig.17 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0264] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.

[0265] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.

[0266] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.

[0267] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.

[0268] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0269] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.< / canvas>

Claims

1. A video frame extraction method, characterized in that: The method comprises: Uploading a video via an online access link and caching the video to a local database; Generate a homologous video link of the video according to the online access link; the homologous video link includes a local cache identifier and a local video identifier pointing to the video cached in the local database; In response to a video frame extraction event for the video, obtaining a time of a frame to be extracted of the video, and triggering an access request indicating access to the homologous video link and carrying the time of the frame to be extracted; When the local cache identifier in the homologous video link indicated by the access request is identified, forwarding the access request to the local database; The locally cached video fed back by the local database in response to the access request is obtained, and a frame-by-frame video frame is extracted from the locally cached video; the frame-by-frame video frame is matched with the frame-to-be-extracted time of the locally cached video identified by the local video identifier.

2. The method according to claim 1, characterized in that The step of generating a homologous video link of the video according to the online access link comprises: Acquire a local cache identifier, a local video identifier of the video, and a homologous link attribute of the online access link; A homologous video link of the video is generated according to the local cache identifier, the local video identifier and the homologous link attribute.

3. The method according to claim 1, characterized in that: The method further comprises: Starting a service worker thread; the service worker thread is used to intercept and identify the access request; When identifying the local cache identifier in the homologous video link indicated by the access request, forwarding the access request to the local database includes: When the local cache identifier in the homologous video link that the access request indicates to access is identified, the service worker thread forwards the access request to the local database.

4. The method according to claim 1, characterized in that: The step of uploading the video via an online access link and caching the video in a local database includes: Upload a video through an online access link to obtain video information of the video; When it is determined according to the video information that the video format of the video does not meet the video caching condition, transcoding the video to obtain a transcoded video; the video format of the transcoded video meets the video caching condition; The transcoded video is cached in a local database.

5. The method according to claim 4, characterized in that The method further comprises: Start the web worker thread; Loading a video transcoding tool through the web worker thread; When it is determined according to the video information that the video format of the video does not meet the video caching condition, transcoding the video to obtain the transcoded video includes: When it is determined according to the video information that the video format of the video does not satisfy the video caching condition, the video is transcoded by the video transcoding tool to obtain a transcoded video.

6. The method according to claim 1, characterized in that The step of uploading the video via an online access link and caching the video in a local database includes: Uploading a video through an online access link, generating a local video identifier of the video, and triggering a video query request carrying the local video identifier to a local database; When there is no cached video corresponding to the local video identifier in the local database, the video is cached in the local database.

7. The method according to any one of claims 1 to 6, characterized in that: The method further comprises: Cache the extracted video frame and the time of the frame to be extracted in association with each other in the local database; In response to a re-frame extraction event for the video, obtaining a re-frame extraction time of the video, and triggering a video frame query request carrying the re-frame extraction time to the local database; When there is a cached video frame matching the re-frame extraction time in the local database, the cached video frame fed back by the local database in response to the video frame query request is obtained.

8. The method according to any one of claims 1 to 6, characterized in that: The method further comprises: In response to a video cover setting operation for the extracted video frame, using the extracted video frame as a video cover of the video; In response to a publishing operation for the video, the video is published to a video platform based on a content distribution network link of the video; the content distribution network link is generated by a video platform server that caches the video.

9. The method according to claim 8, characterized in that The method further comprises: In response to a video cover modification event for the video, obtain the cover frame extraction time of the video, and trigger an acquisition request for accessing a content distribution network link of the video and carrying the cover frame extraction time to the video platform server; Acquire the background cache video fed back by the video platform server in response to the acquisition request, extract and modify the cover frame from the background cache video, and the modified cover frame matches the cover frame extraction time; The modified cover frame is updated to the video cover of the video.

10. A video preview interaction method, characterized in that: The method comprises: In response to a preview trigger event for a video, displaying a preview control area and a preview display area of ​​the video; In the preview control area, a plurality of fixed preview images from the video are displayed in a time sequence arranged according to the corresponding progress time range in the video; In response to the designation of the preview progress of the preview control area, marking, in the fixed preview image designated by the preview progress in the preview control area, a progress position designated by the preview progress within a corresponding progress time interval in the video; In the preview display area, a video frame preview image of a video frame corresponding to the progress time indicated by the progress position in the video is displayed.

11. The method according to claim 10, characterized in that The method further comprises: In the preview control area, a preview progress indicator is displayed; the preview progress indicator is used to specify the preview progress in the preview control area; In response to a movement operation on the preview progress indicator, the preview progress indicator is displayed moving along an arrangement track of the plurality of fixed preview images; the position of the preview progress indicator in the preview control area is used to mark a progress position specified by the preview progress.

12. The method according to claim 10, characterized in that The method further comprises: In response to a cover capture operation on the video frame preview image, highlighting at least a portion of the video frame preview image indicated by the cover capture operation in the preview display area; In response to a cover setting operation for the video, at least a portion of the video frame preview image indicated by the cover capture operation is highlighted and displayed as a video cover of the video.

13. The method according to claim 12, characterized in that The method further comprises: Displaying a cover cutout area in the preview display area; at least a portion of the video frame preview image is displayed in the cover cutout area; In response to the cover capture operation on the video frame preview image, highlighting at least a portion of the video frame preview image indicated by the cover capture operation in the preview display area comprises: In response to a cover capture operation on the video frame preview image, a cover capture area that changes according to the area adjustment method indicated by the cover capture operation is displayed, and in the cover capture area, at least a portion of the cover capture area captured from the video frame preview image is displayed.

14. The method according to claim 10, characterized in that The method further comprises: In response to an upload operation for a video, when the video is cached in a local database, an initial video cover and a cover editing entry of the video are displayed; In response to a trigger operation on the cover editing entry, a preview trigger event for the video is triggered.

15. The method according to any one of claims 10 to 14, characterized in that In the multiple video frames corresponding to the multiple fixed preview images in the video, the time interval between every two adjacent video frames is equal; in the multiple rectangular fixed preview images arranged along a preset arrangement direction in the preview control area, every two adjacent fixed preview images are connected by a side length, and the direction of the side length is perpendicular to the preset arrangement direction.

16. A video frame extraction device, characterized in that: The device comprises: A video upload module, used to upload videos through online access links and cache the videos in a local database; A link generation module, used to generate a homologous video link of the video according to the online access link; the homologous video link includes a local cache identifier and a local video identifier pointing to the video cached in the local database; A frame extraction triggering module, configured to obtain a time of a frame to be extracted of the video in response to a video frame extraction event for the video, and trigger an access request indicating access to the homologous video link and carrying the time of the frame to be extracted; an identification module, configured to forward the access request to the local database upon identifying the local cache identifier in the homologous video link that the access request indicates to access; A video frame acquisition module is used to obtain the locally cached video fed back by the local database in response to the access request, and extract a frame-by-frame video frame from the locally cached video; the frame-by-frame video frame matches the frame-to-be-extracted time of the locally cached video identified by the local video identifier.

17. A video preview interactive device, characterized in that: The device comprises: A preview area display module, configured to display a preview control area and a preview display area of ​​the video in response to a preview triggering event for the video; A fixed preview image display module, used to display, in the preview control area, a plurality of fixed preview images from the video at intervals in a time sequence according to a corresponding progress time range in the video; a progress designation module, configured to, in response to designation of a preview progress of the preview control area, mark, in a fixed preview image designated by the preview progress in the preview control area, a progress position designated by the preview progress within a corresponding progress time interval in the video; The video frame display module is used to display, in the preview display area, a video frame preview image of a video frame corresponding to the progress time indicated by the progress position in the video.

18. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 15 are implemented.

19. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 15 are implemented.

20. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 15 are implemented.

Citation Information

Cited By

  • Video frame extraction method, video preview interaction method, device, computer program product, and medium

    EP4633171A1