CN113766322A - Image acquisition method and device, electronic equipment and storage medium - Google Patents

Image acquisition method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN113766322A
CN113766322A CN202110062050.2A CN202110062050A CN113766322A CN 113766322 A CN113766322 A CN 113766322A CN 202110062050 A CN202110062050 A CN 202110062050A CN 113766322 A CN113766322 A CN 113766322A
Authority
CN
China
Prior art keywords
image
frame image
image acquisition
video
event
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110062050.2A
Other languages
Chinese (zh)
Inventor
张东
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Jingdong Tuoxian Technology Co Ltd
Original Assignee
Beijing Jingdong Tuoxian Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Jingdong Tuoxian Technology Co Ltd filed Critical Beijing Jingdong Tuoxian Technology Co Ltd
Priority to CN202110062050.2A priority Critical patent/CN113766322A/en
Publication of CN113766322A publication Critical patent/CN113766322A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/442Monitoring of processes or resources, e.g. detecting the failure of a recording device, monitoring the downstream bandwidth, the number of times a movie has been viewed, the storage space available from the internal hard disk
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/431Generation of visual interfaces for content selection or interaction; Content or additional data rendering
    • H04N21/4312Generation of visual interfaces for content selection or interaction; Content or additional data rendering involving specific graphical features, e.g. screen layout, special fonts or colors, blinking icons, highlights or animations
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/80Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
    • H04N21/81Monomedia components thereof
    • H04N21/8146Monomedia components thereof involving graphical data, e.g. 3D object, 2D graphics
    • H04N21/8153Monomedia components thereof involving graphical data, e.g. 3D object, 2D graphics comprising still images, e.g. texture, background image

Abstract

The embodiment of the invention discloses an image acquisition method, an image acquisition device, electronic equipment and a storage medium, wherein the method comprises the following steps: monitoring a response event associated with video playing to determine an image acquisition moment; acquiring a first frame image of a target video based on a set strategy at the image acquisition moment, and judging the effectiveness of the first frame image; and if the first frame image is an effective image, displaying the first frame image, otherwise, displaying a set image. By the technical scheme of the embodiment of the invention, not only is the accurate acquisition of the first frame image of the video realized, but also the consumption cost of the system performance is reduced.

Description

Image acquisition method and device, electronic equipment and storage medium
Technical Field
The embodiment of the invention relates to the technical field of computers, in particular to an image acquisition method, an image acquisition device, electronic equipment and a storage medium.
Background
In many service scenes, the first frame image of the video needs to be acquired, for example, the first frame image of the video is displayed as a cover page. Therefore, it is very important to accurately acquire the first frame image of the video.
The currently common acquisition method is: the first frame image of the video is acquired by the audio tool ffmpeg.
In the process of implementing the invention, the inventor finds that at least the following problems exist in the prior art:
due to the limitation of the attribute of the audio tool ffmpeg, the acquisition of the first frame image of the video through the audio tool ffmpeg will cause a sharp surge in the memory of the system, and the cost is high.
Disclosure of Invention
The embodiment of the invention provides an image acquisition method, an image acquisition device, electronic equipment and a storage medium, which not only realize accurate acquisition of a first frame image of a video, but also reduce the consumption cost of system performance.
In a first aspect, an embodiment of the present invention provides an image acquisition method, where the method includes:
monitoring a response event associated with video playing to determine an image acquisition moment;
acquiring a first frame image of a target video based on a set strategy at the image acquisition moment;
judging the validity of the first frame image;
and if the first frame image is an effective image, displaying the first frame image, otherwise, displaying a set image.
In a second aspect, an embodiment of the present invention further provides an image capturing apparatus, where the apparatus includes:
the determining module is used for monitoring the response event associated with the video playing to determine the image acquisition moment;
the acquisition module is used for acquiring a first frame image of a target video based on a set strategy at the image acquisition moment;
the judging module is used for judging the effectiveness of the first frame image;
and the display module is used for displaying the first frame image if the first frame image is an effective image, or displaying the set image if the first frame image is not an effective image.
In a third aspect, an embodiment of the present invention further provides an electronic device, where the electronic device includes:
one or more processors;
a memory for storing one or more programs;
when executed by the one or more processors, cause the one or more processors to implement the image acquisition method steps and steps as provided by any of the embodiments of the invention.
In a fourth aspect, the embodiments of the present invention further provide a computer-readable storage medium, on which a computer program is stored, where the computer program is executed by a processor to implement the steps of the image acquisition method and the steps provided in any embodiment of the present invention.
The embodiment of the invention has the following advantages or beneficial effects:
monitoring a response event associated with video playing to determine an image acquisition moment; acquiring a first frame image of a target video based on a set strategy at the image acquisition moment, and judging the effectiveness of the first frame image; if the first frame image is an effective image, the first frame image is displayed, otherwise, a set image is displayed, so that not only is the first frame image of the video accurately acquired, but also the consumption cost of the system performance is reduced.
Drawings
Fig. 1 is a flowchart of an image acquisition method according to an embodiment of the present invention;
FIG. 2 is a flowchart of an image capturing method according to a second embodiment of the present invention;
FIG. 3 is a flowchart of another image capturing method according to a second embodiment of the present invention;
fig. 4 is a schematic structural diagram of an image capturing apparatus according to a third embodiment of the present invention;
fig. 5 is a schematic structural diagram of an electronic device according to a fourth embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
Example one
Fig. 1 is a flowchart of an image obtaining method according to an embodiment of the present invention, where the embodiment is applicable to a scene in which a first frame image of a target video is captured. The method may be performed by an image acquisition apparatus, which may be implemented by means of software and/or hardware.
As shown in fig. 1, the method specifically includes the following steps:
step 110, monitoring the response event associated with the video playing to determine the image acquisition time.
The response event associated with video playing specifically refers to processing logic for loading a video from a server and playing the video at a client. The response event includes at least one of: metadata loaded event metadata, video data loaded event loaded data, allowed play events can-play, time update event update, start play event play, and wait for event waiting.
The metadata loading event loaded metadata is triggered when the video metadata is loaded, and the video metadata specifically refers to data describing a video, such as information of a storage path, name information, or playing time length of a video file. However, the video metadata does not include the video content itself, and thus it is not suitable to immediately acquire the first frame image of the target video when it is monitored that the metadata loading event loaded metadata is triggered.
The video data loading event loaded data is triggered when the loading of the first frame image data of the video is finished, and it can be understood that the first frame image of the video can be immediately acquired when the video data loading event loaded data is monitored to be triggered.
The play-allowed event can-play is triggered when the video can start playing, that is, the number of frames loaded is determined according to the number of the uploaded video frames, and then the requirement of the play picture is met, and the play-allowed event can-play is triggered when the requirement of the play picture is met, so that the image acquisition time is determined by monitoring the play-allowed event can-play, and the first frame image needs to be further determined, because the play-allowed event can-play may have the multi-frame video image loaded when being triggered, and not only the first frame video image.
The time update event time update is typically triggered when the playing position of the video changes. The play starting event play is triggered when the video starts to play, and the waiting event waiting is triggered when the video is played but the next picture is not buffered, so that the method is suitable for inserting the small advertisements.
By the above description of the response events, for example, the monitoring the response event associated with the video playing to determine the image acquisition time includes:
and determining the moment when the monitored video data loading event loaded data is triggered as the image acquisition moment.
Or, determining the moment when the metadata loading event loaded metadata is triggered;
and determining the image acquisition time according to the size of the target video and the current network state based on the time.
Generally, after a metadata loading event loaded metadata is triggered, video content starts to be loaded, the loading speed is related to the current network state and the size of a target video, and the relation among the loading speed, the current network state and the size of the target video can be counted through continuous business practice, so that the time sequence relation between the moment when a first frame video image is loaded and the moment when the metadata loading event loaded metadata is triggered is further determined, and the image acquisition moment is determined according to the moment when the metadata loading event loaded metadata is triggered.
And 120, acquiring a first frame image of the target video based on a set strategy at the image acquisition time.
The setting strategy comprises graph drawing, specifically, for example, a graph drawing tool canvas is used for acquiring a first frame image of a target video. The canvas is a new label in the HTML5, is used for generating an image in real time on a webpage, can operate the image content, is a bitmap which can be operated by JavaScript, and the canvas object represents an HTML canvas element, and can realize the support of the scripted client drawing operation through an interface.
Specifically, the acquiring a first frame image of the target video based on the graph drawing canvas at the image acquisition time includes:
acquiring an attribute ref node at the image acquisition time;
determining the width and height of the first frame image according to the attribute ref node;
acquiring video data of a video data loading event loaded data at the image acquisition moment;
drawing the first frame image based on a graphics drawing canvas according to the width, height and video data; finally, the source object src of a canvas can be obtained through canvas.
And step 130, judging the effectiveness of the first frame image.
And 140, if the first frame image is an effective image, displaying the first frame image, otherwise, displaying the set image.
Sometimes, due to the poor quality of the target video or the influence of some other factors, the captured first frame image is often not very satisfactory, and an invalid image such as a pure black image, a transparent image, or a white image may appear in the conference. Therefore, it is necessary to identify the validity of the image. It has been found through experimentation that the color values of the transparent image are all 0, the color values of the white image are all 255, and the color values of the black image show an unexpected number 238, which is a color value biased toward 255 white, because white and transparent colors are not excessive, and black is excessive, which is a problem when canvas draws.
Based on the service characteristics, for example, the determining the validity of the first frame image includes:
and judging the effectiveness of the first frame image according to the color value corresponding to the first frame image.
Specifically, an array composed of 8-bit unsigned integers with values fixed in the interval of 0-255 can be represented by a Uint8 claspedarray (8-bit unsigned integer fixed array) typed array; if a value outside the [0,255] interval is specified, it will be replaced with 0 or 255; if a non-integer is specified, it will be set to the nearest integer. The contents of the array Uint8 claspedarray are initialized to 0. Once the Uint8ClampedArray is created, the elements in the array may be referenced using the method of the object, or using standard array index syntax (i.e., using square bracket notation). According to the statistical characteristics of the color values of the invalid image, only one image between 0 and 200 is needed to be judged and identified whether the acquired first frame image is the valid image, and the acquired first frame image is the invalid image as long as no numerical value exists in the array.
The set image is a preset default image, the set image is an image irrelevant to the target video, and the set image can be understood as a degraded image or a bottom-holding image of the first frame image, so that a user side is prevented from displaying blank images, the method is suitable for all videos, and the set image is called for displaying if the first frame image is not acquired from the videos.
According to the technical scheme of the embodiment, the image acquisition time is determined by monitoring the response event associated with the video playing; the first frame image of the target video is acquired based on the graph drawing canvas at the image acquisition moment, so that the first frame image of the video is accurately acquired, and the consumption cost of the system performance is reduced.
Example two
Fig. 2 is a flowchart of an image obtaining method according to a second embodiment of the present invention, and this embodiment provides an implementation manner of "monitoring a response event associated with video playing to determine an image obtaining time" in step 110 on the basis of the above embodiment, which is intended to improve accuracy of the image obtaining time and further achieve accurate obtaining of a first frame image of a video. Wherein explanations of the same or corresponding terms as those of the above-described embodiments are omitted.
Referring to fig. 2, the image acquiring method provided in this embodiment specifically includes the following steps:
step 210, determining the moment when the metadata loading event is triggered.
The metadata loading event loaded metadata is triggered when the video metadata is loaded, where the video metadata specifically refers to data describing a video, such as information of a storage path, name information, or playing time length of a video file. However, the video metadata does not include the video content itself, and thus it is not suitable to immediately acquire the first frame image of the target video when it is monitored that the metadata loading event loaded metadata is triggered.
And step 220, determining the image acquisition time according to the size of the target video and the current network state based on the time.
Generally, after a metadata loading event loaded metadata is triggered, video content starts to be loaded, the loading speed is related to the current network state and the size of a target video, and the relation among the loading speed, the current network state and the size of the target video can be counted through continuous business practice, so that the time sequence relation between the moment when a first frame video image is loaded and the moment when the metadata loading event loaded metadata is triggered is further determined, and the image acquisition moment is determined according to the moment when the metadata loading event loaded metadata is triggered.
And step 230, acquiring a first frame image of the target video based on a set strategy at the image acquisition time.
And 240, judging the effectiveness of the first frame image.
And 250, if the first frame image is an effective image, displaying the first frame image, otherwise, displaying a set image.
In the technical solution of this embodiment, on the basis of the above embodiment, an implementation manner of "monitoring a response event associated with video playing to determine an image acquisition time" in step 110 is provided, specifically, a time at which a metadata loading event is triggered is determined; the image acquisition time is determined according to the size of the target video and the current network state based on the time, so that the accuracy of the image acquisition time is improved, the accurate acquisition of the first frame image of the video is realized, the image acquisition stability is improved, the effective image is ensured to be acquired and displayed, and the user experience is improved.
On the basis of the technical solution of the above embodiment, referring to a flow diagram of another image acquisition method shown in fig. 3, the method includes:
a response event test of video (video playing), wherein the response event test determines that the loading of the first frame image data of a video is finished when the video data loading event loaded data is triggered, so a canvas is defined in advance, then the video data loading event loaded data is monitored through addEventListener, and when the video data loading event loaded data is triggered, the width and the height are acquired; acquiring a first frame image through drawlmap and toDataURL; carrying out validity judgment on the first frame image through Uint8ClampedArray, and if the first frame image is judged to be invalid, displaying a default image; and if the first frame image is judged to be valid, displaying the first frame image.
The following is an embodiment of an image acquiring apparatus and a picture processing apparatus according to an embodiment of the present invention, which belong to the same inventive concept as the image acquiring methods of the above embodiments, and reference may be made to the embodiments of the image acquiring method and the picture processing apparatus for details that are not described in detail in the embodiments of the image acquiring apparatus and the picture processing apparatus.
EXAMPLE III
Fig. 4 is a schematic structural diagram of an image capturing apparatus provided in the third embodiment of the present invention, where the apparatus specifically includes: a determination module 410, an acquisition module 420, a decision module 430, and a presentation module 440.
The determining module 410 is configured to monitor a response event associated with video playing to determine an image obtaining time; an obtaining module 420, configured to obtain a first frame image of a target video based on a set policy at the image obtaining time; a determining module 430, configured to determine validity of the first frame image; a displaying module 440, configured to display the first frame image if the first frame image is an effective image, and otherwise display a set image.
On the basis of the above technical solutions, the response event includes at least one of the following: metadata loaded event metadata, video data loaded event loaded data, allowed play events can-play, time update event update, start play event play, and wait for event waiting.
On the basis of the above technical solutions, the determining module 410 is specifically configured to: and determining the moment when the monitored video data loading event loaded data is triggered as the image acquisition moment.
On the basis of the above technical solutions, the determining module 410 is specifically configured to: determining the moment when the metadata loading event loaded metadata is triggered; and determining the image acquisition time according to the size of the target video and the current network state based on the time.
On the basis of the above technical solutions, the obtaining module 420 includes:
a first obtaining unit, configured to obtain an attribute node at the image obtaining time;
a determining unit, configured to determine a width and a height of the first frame image according to the attribute node;
the second acquisition unit is used for acquiring video data of the video data loading event loaded data at the image acquisition moment;
and the drawing unit is used for drawing the first frame image based on a graph drawing canvas according to the width, the height and the video data.
On the basis of the above technical solutions, the determining module 430 is specifically configured to: and judging the effectiveness of the first frame image according to the color value corresponding to the first frame image.
According to the technical scheme of the embodiment, the image acquisition time is determined by monitoring the response event associated with the video playing; the first frame image of the target video is acquired based on the graph drawing canvas at the image acquisition moment, so that the first frame image of the video is accurately acquired, and the consumption cost of the system performance is reduced.
The image acquisition device provided by the embodiment of the invention can execute the image acquisition method provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of executing the image acquisition method.
Example four
Fig. 5 is a schematic structural diagram of an electronic device according to a fifth embodiment of the present invention. FIG. 5 illustrates a block diagram of an exemplary electronic device 12 suitable for use in implementing embodiments of the present invention. The electronic device 12 shown in fig. 5 is only an example and should not bring any limitation to the function and the scope of use of the embodiment of the present invention.
As shown in FIG. 5, electronic device 12 is embodied in the form of a general purpose computing electronic device. The components of electronic device 12 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, and a bus 18 that couples various system components including the system memory 28 and the processing unit 16.
Bus 18 represents one or more of any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, and a processor or local bus using any of a variety of bus architectures. By way of example, such architectures include, but are not limited to, Industry Standard Architecture (ISA) bus, micro-channel architecture (MAC) bus, enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
Electronic device 12 typically includes a variety of computer system readable media. Such media may be any available media that is accessible by electronic device 12 and includes both volatile and nonvolatile media, removable and non-removable media.
The system memory 28 may include computer system readable media in the form of volatile memory, such as Random Access Memory (RAM)30 and/or cache memory 32. The electronic device 12 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 34 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 5, and commonly referred to as a "hard drive"). Although not shown in FIG. 5, a magnetic disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 18 by one or more data media interfaces. System memory 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiments of the invention.
A program/utility 40 having a set (at least one) of program modules 42 may be stored, for example, in system memory 28, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which examples or some combination thereof may comprise an implementation of a network environment. Program modules 42 generally carry out the functions and/or methodologies of the described embodiments of the invention.
Electronic device 12 may also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), with one or more devices that enable a user to interact with electronic device 12, and/or with any devices (e.g., network card, modem, etc.) that enable electronic device 12 to communicate with one or more other computing devices. Such communication may be through an input/output (I/O) interface 22. Also, the electronic device 12 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the Internet) via the network adapter 20. As shown, the network adapter 20 communicates with other modules of the electronic device 12 via the bus 18. It should be understood that although not shown in the figures, other hardware and/or software modules may be used in conjunction with electronic device 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
The processing unit 16 executes various functional applications and image acquisition methods by running programs stored in the system memory 28, for example, implementing the steps of one of the image acquisition methods provided by the present embodiment, and the steps; the image acquisition method comprises the following steps:
monitoring a response event associated with video playing to determine an image acquisition moment;
acquiring a first frame image of a target video based on a set strategy at the image acquisition moment;
judging the validity of the first frame image;
and if the first frame image is an effective image, displaying the first frame image, otherwise, displaying a set image.
Of course, those skilled in the art will understand that the processor may also implement the technical solution of the image acquisition method provided by any embodiment of the present invention.
EXAMPLE five
This fifth embodiment provides a computer-readable storage medium, on which a computer program is stored, which when executed by a processor, implements the steps of an image acquisition method provided by any embodiment of the present invention, the image acquisition method comprising:
monitoring a response event associated with video playing to determine an image acquisition moment;
acquiring a first frame image of a target video based on a set strategy at the image acquisition moment;
judging the validity of the first frame image;
and if the first frame image is an effective image, displaying the first frame image, otherwise, displaying a set image.
Computer storage media for embodiments of the invention may employ any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. The computer-readable storage medium may be, for example but not limited to: an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
It will be understood by those skilled in the art that the modules or steps of the invention described above may be implemented by a general purpose computing device, they may be centralized on a single computing device or distributed across a network of computing devices, and optionally they may be implemented by program code executable by a computing device, such that it may be stored in a memory device and executed by a computing device, or it may be separately fabricated into various integrated circuit modules, or it may be fabricated by fabricating a plurality of modules or steps thereof into a single integrated circuit module. Thus, the present invention is not limited to any specific combination of hardware and software.
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (10)

1. An image acquisition method, comprising:
monitoring a response event associated with video playing to determine an image acquisition moment;
acquiring a first frame image of a target video based on a set strategy at the image acquisition moment;
judging the validity of the first frame image;
and if the first frame image is an effective image, displaying the first frame image, otherwise, displaying a set image.
2. The method of claim 1, wherein the response event comprises at least one of: metadata load event, video data load event, allow play event, time update event, start play event, and wait event.
3. The method of claim 2, wherein the listening for the response event associated with the video playback to determine the image acquisition time comprises:
and determining the moment when the monitored video data loading event is triggered as the image acquisition moment.
4. The method of claim 2, wherein the listening for the response event associated with the video playback to determine the image acquisition time comprises:
determining the moment when a metadata loading event is triggered;
and determining the image acquisition time according to the size of the target video and the current network state based on the time.
5. The method according to any one of claims 1-4, wherein said obtaining a first frame image of a target video based on a set policy at the time of image obtaining comprises:
acquiring an attribute node of the image acquisition moment;
determining the width and height of the first frame image according to the attribute nodes;
acquiring video data of a video data loading event at the image acquisition moment;
and drawing the first frame image according to the width, the height and the video data.
6. The method of any of claims 1-4, wherein the set policy comprises graphical rendering.
7. The method according to any one of claims 1-4, wherein said determining the validity of the first frame image comprises:
and judging the effectiveness of the first frame image according to the color value corresponding to the first frame image.
8. An image acquisition apparatus, characterized by comprising:
the determining module is used for monitoring the response event associated with the video playing to determine the image acquisition moment;
the acquisition module is used for acquiring a first frame image of a target video based on a set strategy at the image acquisition moment;
the judging module is used for judging the effectiveness of the first frame image;
and the display module is used for displaying the first frame image if the first frame image is an effective image, or displaying the set image if the first frame image is not an effective image.
9. An electronic device, characterized in that the electronic device comprises:
one or more processors;
a memory for storing one or more programs;
when executed by the one or more processors, cause the one or more processors to implement the image acquisition method steps of any of claims 1-7.
10. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the image acquisition method steps of any one of claims 1 to 7.
CN202110062050.2A 2021-01-18 2021-01-18 Image acquisition method and device, electronic equipment and storage medium Pending CN113766322A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110062050.2A CN113766322A (en) 2021-01-18 2021-01-18 Image acquisition method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110062050.2A CN113766322A (en) 2021-01-18 2021-01-18 Image acquisition method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN113766322A true CN113766322A (en) 2021-12-07

Family

ID=78786405

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110062050.2A Pending CN113766322A (en) 2021-01-18 2021-01-18 Image acquisition method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113766322A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109672902A (en) * 2018-12-25 2019-04-23 百度在线网络技术(北京)有限公司 A kind of video takes out frame method, device, electronic equipment and storage medium
CN110505511A (en) * 2019-08-20 2019-11-26 海南车智易通信息技术有限公司 It is a kind of to play the method, apparatus of video, system in webpage and calculate equipment
WO2020097888A1 (en) * 2018-11-15 2020-05-22 深圳市欢太科技有限公司 Video processing method and apparatus, electronic device, and computer-readable storage medium
CN111970561A (en) * 2020-08-11 2020-11-20 北京达佳互联信息技术有限公司 Video cover generation method, system and device and electronic equipment

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020097888A1 (en) * 2018-11-15 2020-05-22 深圳市欢太科技有限公司 Video processing method and apparatus, electronic device, and computer-readable storage medium
CN109672902A (en) * 2018-12-25 2019-04-23 百度在线网络技术(北京)有限公司 A kind of video takes out frame method, device, electronic equipment and storage medium
CN110505511A (en) * 2019-08-20 2019-11-26 海南车智易通信息技术有限公司 It is a kind of to play the method, apparatus of video, system in webpage and calculate equipment
CN111970561A (en) * 2020-08-11 2020-11-20 北京达佳互联信息技术有限公司 Video cover generation method, system and device and electronic equipment

Similar Documents

Publication Publication Date Title
WO2020007113A1 (en) Method and device for loading image
CN110012358B (en) Examination information processing method and device
CN110727825A (en) Animation playing control method, device, server and storage medium
CN107301220B (en) Method, device and equipment for data driving view and storage medium
CN115731313A (en) SVG format picture processing method, device, equipment, medium and product
CN111813465A (en) Information acquisition method, device, medium and equipment
CN112532785B (en) Image display method, image display device, electronic apparatus, and storage medium
CN107885807B (en) File saving method and device, intelligent tablet and storage medium
CN111259270A (en) Weather reminding method, equipment and computer readable medium
CN113766322A (en) Image acquisition method and device, electronic equipment and storage medium
CN113194279B (en) Recording method of network conference, computer readable storage medium and electronic device
CN111538705B (en) Video thumbnail preview method, control server and medium
CN117319736A (en) Video processing method, device, electronic equipment and storage medium
CN112367295B (en) Plug-in display method and device, storage medium and electronic equipment
CN107506119A (en) A kind of image display method, device, equipment and storage medium
CN114036431A (en) Page cache skipping method and device, electronic equipment and storage medium
CN113891136A (en) Video playing method and device, electronic equipment and storage medium
CN111083552A (en) Thumbnail generation method, device, equipment and medium
CN113885998A (en) Page rendering method and device, electronic equipment and storage medium
CN112363778B (en) Dynamic picture loading method and device, electronic equipment and storage medium
CN107741992B (en) Network storage method and device for conference records, intelligent tablet and storage medium
CN111292392A (en) Unity-based image display method, apparatus, device and medium
CN111914850A (en) Picture feature extraction method, device, server and medium
CN112506592A (en) Method, device, equipment and storage medium for determining page loading duration
CN112288774B (en) Mobile detection method, mobile detection device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination