CN113490044B - Video playing method and device, electronic equipment and storage medium - Google Patents

Video playing method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN113490044B
CN113490044B CN202110726940.9A CN202110726940A CN113490044B CN 113490044 B CN113490044 B CN 113490044B CN 202110726940 A CN202110726940 A CN 202110726940A CN 113490044 B CN113490044 B CN 113490044B
Authority
CN
China
Prior art keywords
frame image
current frame
playing
video
time length
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.)
Active
Application number
CN202110726940.9A
Other languages
Chinese (zh)
Other versions
CN113490044A (en
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 Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and 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 Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN202110726940.9A priority Critical patent/CN113490044B/en
Publication of CN113490044A publication Critical patent/CN113490044A/en
Application granted granted Critical
Publication of CN113490044B publication Critical patent/CN113490044B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs
    • 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/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs
    • H04N21/4402Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display
    • H04N21/440281Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display by altering the temporal resolution, e.g. by frame skipping

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)
  • Television Signal Processing For Recording (AREA)

Abstract

The application discloses a video playing method, a video playing device, electronic equipment and a storage medium, and relates to the field of multimedia, in particular to the field of computer vision and media cloud. The specific implementation scheme is as follows: extracting a frame of image from the video to be played as a current frame of image; preprocessing the current frame image to obtain a preprocessed current frame image; and recording the time length consumed by preprocessing the current frame image; calculating a waiting interval duration corresponding to the current frame image based on a preset playing duration of one frame and a duration consumed by preprocessing the current frame image; and playing the preprocessed current frame image based on the waiting interval duration corresponding to the current frame image. According to the method and the device for displaying the video, the playing mode of each frame of image can be dynamically adjusted, different playing modes can be adopted for different images, and therefore video playing speed can be increased, and watching experience of a user is improved.

Description

Video playing method and device, electronic equipment and storage medium
Technical Field
The disclosure relates to the technical field of multimedia, and further relates to computer vision and media cloud technology, in particular to a video playing method, a video playing device, electronic equipment and a storage medium.
Background
With the development of internet technology, watching video has become one of the main ways people entertain and acquire information daily. The video playing method in the prior art mainly comprises the following operation steps: firstly, acquiring a video to be played, analyzing the video to be played, and acquiring the frame rate of the video and the playing time of one frame; then, decoding the video to be played to obtain a frame of video image, and rendering the video image to a player window for playing; a play time interval of one frame; then, judging whether the video image is the last frame image of the video to be played or not; if the video image is not the last frame image of the video to be played, returning to the operation step of acquiring a frame of video image; and if the video image is the last frame image of the video to be played, ending playing.
In the video playing method in the prior art, a playing strategy with fixed interval duration is adopted, namely, for the same video, the playing duration of each frame of image is fixed, the playing duration of one frame is occupied, and the playing of the next frame of image can be started after the playing of the previous frame of image is completed. If the performance of any link of decoding, rendering or playing is reduced or the time consumption is increased, the interval between two frames of images is greatly increased, and the playing time of one frame is far longer than the playing time of one frame, so that the video playing speed becomes very slow, thereby affecting the viewing experience of users.
Disclosure of Invention
The disclosure provides a video playing method, a video playing device, electronic equipment and a storage medium.
In a first aspect, the present application provides a video playing method, where the method includes:
extracting a frame of image from the video to be played as a current frame of image;
preprocessing the current frame image to obtain a preprocessed current frame image; and recording the time length consumed by preprocessing the current frame image;
calculating a waiting interval duration corresponding to the current frame image based on a preset playing duration of one frame and a duration consumed by preprocessing the current frame image;
playing the preprocessed current frame image based on the waiting interval time corresponding to the current frame image; and if the current frame image is not the last frame image of the video to be played, repeating the operation of extracting the current frame image until the current frame image is the last frame image of the video to be played.
In a second aspect, the present application provides a video playing device, the device comprising: the device comprises an extraction module, a preprocessing module, a calculation module and a playing module; wherein,,
the extraction module is used for extracting a frame of image from the video to be played as a current frame of image;
the preprocessing module is used for preprocessing the current frame image to obtain a preprocessed current frame image; and recording the time length consumed by preprocessing the current frame image;
the calculating module is used for calculating the waiting interval duration corresponding to the current frame image based on the preset playing duration of one frame and the duration consumed by preprocessing the current frame image;
the playing module is used for playing the preprocessed current frame image based on the waiting interval duration corresponding to the current frame image; and if the current frame image is not the last frame image of the video to be played, repeating the operation of extracting the current frame image until the current frame image is the last frame image of the video to be played.
In a third aspect, an embodiment of the present application provides an electronic device, including:
one or more processors;
a memory for storing one or more programs,
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the video playback method described in any of the embodiments of the present application.
In a fourth aspect, embodiments of the present application provide a storage medium having stored thereon a computer program that, when executed by a processor, implements the video playing method according to any embodiment of the present application.
In a fifth aspect, a computer program product is provided, which when executed by a computer device implements the video playing method according to any embodiment of the present application.
According to the technology, the technical problem brought by the adoption of the playing strategy with the fixed interval duration in the prior art is solved, if the performance of any link of decoding, rendering or playing is reduced or the time consumption is increased, the interval between two frames of images is greatly increased and the playing duration of one frame is far exceeded, so that the video playing speed is very slow, and the watching experience of a user is influenced. According to the technical scheme, the playing mode of each frame of image can be dynamically adjusted, different playing modes can be adopted for different images, so that the video playing speed can be increased, and the watching experience of a user is improved.
It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the disclosure, nor is it intended to be used to limit the scope of the disclosure. Other features of the present disclosure will become apparent from the following specification.
Drawings
The drawings are for a better understanding of the present solution and are not to be construed as limiting the present disclosure. Wherein:
fig. 1 is a schematic flow chart of a video playing method according to an embodiment of the present application;
fig. 2 is a schematic diagram of a second flow of a video playing method according to an embodiment of the present application;
fig. 3 is a third flow chart of a video playing method according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of a video playing device according to an embodiment of the present application;
fig. 5 is a block diagram of an electronic device for implementing a video playing method according to an embodiment of the present application.
Detailed Description
Exemplary embodiments of the present disclosure are described below in conjunction with the accompanying drawings, which include various details of the embodiments of the present disclosure to facilitate understanding, and should be considered as merely exemplary. Accordingly, one of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present disclosure. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
Example 1
Fig. 1 is a schematic flow chart of a video playing method provided in an embodiment of the present application, where the method may be performed by a video playing apparatus or an electronic device, where the apparatus or the electronic device may be implemented by software and/or hardware, and the apparatus or the electronic device may be integrated into any intelligent device with a network communication function. As shown in fig. 1, the video playing method may include the steps of:
s101, extracting a frame of image from a video to be played as a current frame of image.
In this step, the electronic device may extract a frame image from the video to be played as the current frame image. Specifically, the electronic device may extract a frame image from the video to be played as the current frame image according to a predetermined frame format or frame structure.
S102, preprocessing a current frame image to obtain a preprocessed current frame image; and recording the time length consumed for preprocessing the current frame image.
In this step, the electronic device may perform preprocessing on the current frame image to obtain a preprocessed current frame image. Specifically, the electronic device may decode the current frame image first to obtain a decoded current frame image; then rendering the decoded current frame image to obtain a rendered current frame image; and taking the rendered current frame image as the preprocessed current frame image. In addition, the electronic device may also record the duration consumed for preprocessing the current frame image. Specifically, the electronic device may record, first, a time length consumed for decoding the current frame image and a time length consumed for rendering the decoded current frame image, respectively; and then obtaining the time length consumed for preprocessing the current frame image according to the time length consumed for decoding the current frame image and the time length consumed for rendering the decoded current frame image.
S103, calculating the waiting interval duration corresponding to the current frame image based on the preset playing duration of one frame and the duration consumed by preprocessing the current frame image.
In this step, the electronic device may calculate the waiting interval duration corresponding to the current frame image based on the predetermined play duration of one frame and the duration consumed for preprocessing the current frame image. Specifically, the electronic device may calculate a difference between a play time length of one frame and a time length consumed for preprocessing an image of a current frame; and taking the difference value of the playing time length of one frame and the time length consumed by preprocessing the current frame image as the waiting interval time length corresponding to the current frame image.
S104, playing the preprocessed current frame image based on the waiting interval time corresponding to the current frame image; and if the current frame image is not the last frame image of the video to be played, repeating the operation of extracting the current frame image until the current frame image is the last frame image of the video to be played.
In this step, the electronic device may play the preprocessed current frame image based on the waiting interval duration corresponding to the current frame image; and if the current frame image is not the last frame image of the video to be played, repeating the operation of extracting the current frame image until the current frame image is the last frame image of the video to be played. Specifically, if the waiting interval duration corresponding to the current frame image is smaller than a predetermined threshold, the electronic device may perform a fast play operation on the preprocessed current frame image; if the waiting interval time corresponding to the current frame image is greater than or equal to the preset threshold value, the electronic equipment can perform normal play operation on the preprocessed current frame image.
The video playing method provided by the embodiment of the application comprises the steps of firstly extracting a frame of image from a video to be played as a current frame of image; then preprocessing the current frame image to obtain a preprocessed current frame image; and recording the time length consumed by preprocessing the current frame image; calculating the waiting interval duration corresponding to the current frame image based on the preset playing duration of one frame and the duration consumed by preprocessing the current frame image; finally playing the preprocessed current frame image based on the waiting interval time corresponding to the current frame image; and if the current frame image is not the last frame image of the video to be played, repeating the operation of extracting the current frame image until the current frame image is the last frame image of the video to be played. That is, the present application may dynamically adjust the playing mode of each frame of image, and may adopt different playing modes for different images. In the existing video playing method, a playing strategy with fixed interval duration is adopted, namely, the playing duration of each frame of image is fixed for the same video, the playing duration of one frame is occupied, and the playing of the next frame of image can be started after the playing of the previous frame of image is completed. Because the method adopts the technical means of recording the time consumed by preprocessing the current frame image and playing the preprocessed current frame image based on the waiting interval time corresponding to the current frame image, the technical problems brought by adopting a playing strategy with fixed interval time in the prior art are overcome, if the performance of any link of decoding, rendering or playing is reduced or the time consumption is increased, the interval between two frames of images is greatly increased, and the playing time of one frame is far more than that of one frame, so that the video playing speed is very slow, thereby influencing the watching experience of users. According to the technical scheme, the playing mode of each frame of image can be dynamically adjusted, and different playing modes can be adopted for different images, so that the video playing speed can be increased, and the watching experience of a user is improved; in addition, the technical scheme of the embodiment of the application is simple and convenient to realize, convenient to popularize and wider in application range.
Example two
Fig. 2 is a second flowchart of a video playing method according to an embodiment of the present application. Further optimization and expansion based on the above technical solution can be combined with the above various alternative embodiments. As shown in fig. 2, the video playing method may include the steps of:
s201, extracting a frame of image from the video to be played as a current frame of image.
In a specific embodiment of the present application, before extracting a frame image from a video to be played as a current frame image, the electronic device may also first obtain the video to be played; then analyzing the video to be played to obtain video information data of the video to be played; and obtaining the playing time length of one frame based on the video information data.
S202, decoding the current frame image to obtain a decoded current frame image.
S203, rendering the decoded current frame image to obtain a rendered current frame image; and taking the rendered current frame image as the preprocessed current frame image.
S204, recording the time consumed for decoding the current frame image and the time consumed for rendering the decoded current frame image.
S205, obtaining the time length consumed for preprocessing the current frame image according to the time length consumed for decoding the current frame image and the time length consumed for rendering the decoded current frame image.
S206, calculating the waiting interval duration corresponding to the current frame image based on the preset playing duration of one frame and the duration consumed by preprocessing the current frame image.
In a specific implementation of the present application, the electronic device may calculate according to the following formula: the waiting interval duration corresponding to the current frame image=the playing duration of one frame-the duration consumed for preprocessing the current frame image.
S207, playing the preprocessed current frame image based on the waiting interval time corresponding to the current frame image; and if the current frame image is not the last frame image of the video to be played, repeating the operation of extracting the current frame image until the current frame image is the last frame image of the video to be played.
In this step, the electronic device may play the preprocessed current frame image based on the waiting interval duration corresponding to the current frame image. Specifically, if the waiting interval duration corresponding to the current frame image is smaller than a predetermined threshold, the electronic device may perform a fast play operation on the preprocessed current frame image; if the waiting interval time corresponding to the current frame image is greater than or equal to the preset threshold value, the electronic equipment can perform normal play operation on the preprocessed current frame image. Further, if the waiting interval duration corresponding to the current frame image is smaller than 0, directly performing decoding rendering operation of next cyclic playing without waiting for the interval duration; and if the waiting interval time length corresponding to the current frame image is greater than or equal to 0, the waiting interval time length is used for carrying out the next cyclic playing decoding rendering operation. The fast play operation in the embodiment of the present application refers to: directly performing decoding rendering operation of next cyclic play without waiting for interval duration; the normal play operation in the embodiment of the present application refers to: waiting for the interval duration is needed, and the next cyclic playing, decoding and rendering operation is carried out.
The video playing method provided by the embodiment of the application comprises the steps of firstly extracting a frame of image from a video to be played as a current frame of image; then preprocessing the current frame image to obtain a preprocessed current frame image; and recording the time length consumed by preprocessing the current frame image; calculating the waiting interval duration corresponding to the current frame image based on the preset playing duration of one frame and the duration consumed by preprocessing the current frame image; finally playing the preprocessed current frame image based on the waiting interval time corresponding to the current frame image; and if the current frame image is not the last frame image of the video to be played, repeating the operation of extracting the current frame image until the current frame image is the last frame image of the video to be played. That is, the present application may dynamically adjust the playing mode of each frame of image, and may adopt different playing modes for different images. In the existing video playing method, a playing strategy with fixed interval duration is adopted, namely, the playing duration of each frame of image is fixed for the same video, the playing duration of one frame is occupied, and the playing of the next frame of image can be started after the playing of the previous frame of image is completed. Because the method adopts the technical means of recording the time consumed by preprocessing the current frame image and playing the preprocessed current frame image based on the waiting interval time corresponding to the current frame image, the technical problems brought by adopting a playing strategy with fixed interval time in the prior art are overcome, if the performance of any link of decoding, rendering or playing is reduced or the time consumption is increased, the interval between two frames of images is greatly increased, and the playing time of one frame is far more than that of one frame, so that the video playing speed is very slow, thereby influencing the watching experience of users. According to the technical scheme, the playing mode of each frame of image can be dynamically adjusted, and different playing modes can be adopted for different images, so that the video playing speed can be increased, and the watching experience of a user is improved; in addition, the technical scheme of the embodiment of the application is simple and convenient to realize, convenient to popularize and wider in application range.
Example III
Fig. 3 is a third flow chart of a video playing method according to an embodiment of the present application. Further optimization and expansion based on the above technical solution can be combined with the above various alternative embodiments. As shown in fig. 3, the video playing method may include the steps of:
s301, extracting a frame of image from the video to be played as a current frame of image.
S302, decoding the current frame image to obtain a decoded current frame image.
S303, rendering the decoded current frame image to obtain a rendered current frame image; and taking the rendered current frame image as the preprocessed current frame image.
S304, recording the time consumed for decoding the current frame image and the time consumed for rendering the decoded current frame image.
S305, obtaining the time length consumed for preprocessing the current frame image according to the time length consumed for decoding the current frame image and the time length consumed for rendering the decoded current frame image.
S306, calculating a difference value between the playing time length of one frame and the time length consumed by preprocessing the current frame image; and taking the difference value of the playing time length of one frame and the time length consumed by preprocessing the current frame image as the waiting interval time length corresponding to the current frame image.
In this step, the electronic device may calculate a difference between a play time length of one frame and a time length consumed for preprocessing the current frame image; and taking the difference value of the playing time length of one frame and the time length consumed by preprocessing the current frame image as the waiting interval time length corresponding to the current frame image. Specifically, the electronic device may calculate according to the following formula: the waiting interval duration corresponding to the current frame image=the playing duration of one frame-the duration consumed for preprocessing the current frame image.
S307, playing the preprocessed current frame image based on the waiting interval time corresponding to the current frame image; and if the current frame image is not the last frame image of the video to be played, repeating the operation of extracting the current frame image until the current frame image is the last frame image of the video to be played.
The embodiment of the application can reduce the influence of time consumption of the whole flow of the player on the playing rhythm. Because the Web end plays the video of h.265, which must be only soft decoded and is different from the video of h.264, the browser player natively supports playing; therefore, h.265 requires the whole player process flow to be developed manually, which is very difficult in some technologies.
The video playing method provided by the embodiment of the application comprises the steps of firstly extracting a frame of image from a video to be played as a current frame of image; then preprocessing the current frame image to obtain a preprocessed current frame image; and recording the time length consumed by preprocessing the current frame image; calculating the waiting interval duration corresponding to the current frame image based on the preset playing duration of one frame and the duration consumed by preprocessing the current frame image; finally playing the preprocessed current frame image based on the waiting interval time corresponding to the current frame image; and if the current frame image is not the last frame image of the video to be played, repeating the operation of extracting the current frame image until the current frame image is the last frame image of the video to be played. That is, the present application may dynamically adjust the playing mode of each frame of image, and may adopt different playing modes for different images. In the existing video playing method, a playing strategy with fixed interval duration is adopted, namely, the playing duration of each frame of image is fixed for the same video, the playing duration of one frame is occupied, and the playing of the next frame of image can be started after the playing of the previous frame of image is completed. Because the method adopts the technical means of recording the time consumed by preprocessing the current frame image and playing the preprocessed current frame image based on the waiting interval time corresponding to the current frame image, the technical problems brought by adopting a playing strategy with fixed interval time in the prior art are overcome, if the performance of any link of decoding, rendering or playing is reduced or the time consumption is increased, the interval between two frames of images is greatly increased, and the playing time of one frame is far more than that of one frame, so that the video playing speed is very slow, thereby influencing the watching experience of users. According to the technical scheme, the playing mode of each frame of image can be dynamically adjusted, and different playing modes can be adopted for different images, so that the video playing speed can be increased, and the watching experience of a user is improved; in addition, the technical scheme of the embodiment of the application is simple and convenient to realize, convenient to popularize and wider in application range.
Example IV
Fig. 4 is a schematic structural diagram of a video playing device according to an embodiment of the present application. As shown in fig. 4, the apparatus 400 includes: an extraction module 401, a preprocessing module 402, a calculation module 403 and a playing module 404; wherein,,
the extracting module 401 is configured to extract a frame image from a video to be played as a current frame image;
the preprocessing module 402 is configured to preprocess the current frame image to obtain a preprocessed current frame image; and recording the time length consumed by preprocessing the current frame image;
the calculating module 403 is configured to calculate a waiting interval duration corresponding to the current frame image based on a predetermined play duration of one frame and a duration consumed for preprocessing the current frame image;
the playing module 404 is configured to play the preprocessed current frame image based on a waiting interval duration corresponding to the current frame image; and if the current frame image is not the last frame image of the video to be played, repeating the operation of extracting the current frame image until the current frame image is the last frame image of the video to be played.
Further, the device further comprises: an acquisition module 405 (not shown) and an analysis module 406 (not shown); wherein,,
the obtaining module 405 is configured to obtain the video to be played;
the parsing module 406 is configured to parse the video to be played to obtain video information data of the video to be played; and obtaining the playing time length of the frame based on the video information data.
Further, the preprocessing module 402 is specifically configured to decode the current frame image to obtain a decoded current frame image; rendering the decoded current frame image to obtain a rendered current frame image; and taking the rendered current frame image as the preprocessed current frame image.
Further, the preprocessing module 402 is specifically configured to record a duration consumed for decoding the current frame image and a duration consumed for rendering the decoded current frame image; and obtaining the time length consumed for preprocessing the current frame image according to the time length consumed for decoding the current frame image and the time length consumed for rendering the decoded current frame image.
Further, the calculating module 403 is specifically configured to calculate a difference between a playing duration of the one frame and a duration consumed for preprocessing the current frame image; and taking the difference value of the playing time length of the one frame and the time length consumed by preprocessing the current frame image as the waiting interval time length corresponding to the current frame image.
Further, the playing module 404 is specifically configured to perform a fast playing operation on the preprocessed current frame image if the waiting interval duration corresponding to the current frame image is less than a predetermined threshold; and if the waiting interval time length corresponding to the current frame image is greater than or equal to the preset threshold value, performing normal play operation on the preprocessed current frame image.
The video playing device can execute the method provided by any embodiment of the application, and has the corresponding functional modules and beneficial effects of the execution method. Technical details not described in detail in this embodiment may be referred to the video playing method provided in any embodiment of the present application.
In the technical scheme of the disclosure, the acquisition, storage, application and the like of the related user personal information all conform to the regulations of related laws and regulations, and the public sequence is not violated.
Example five
According to embodiments of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.
Fig. 5 illustrates a schematic block diagram of an example electronic device 500 that may be used to implement embodiments of the present disclosure. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the disclosure described and/or claimed herein.
As shown in fig. 5, the apparatus 500 includes a computing unit 501 that can perform various suitable actions and processes according to a computer program stored in a Read Only Memory (ROM) 502 or a computer program loaded from a storage unit 508 into a Random Access Memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the device 500 can also be stored. The computing unit 501, ROM502, and RAM 503 are connected to each other by a bus 504. An input/output (I/O) interface 505 is also connected to bus 504.
Various components in the device 500 are connected to the I/O interface 505, including: an input unit 506 such as a keyboard, a mouse, etc.; an output unit 507 such as various types of displays, speakers, and the like; a storage unit 508 such as a magnetic disk, an optical disk, or the like; and a communication unit 509 such as a network card, modem, wireless communication transceiver, etc. The communication unit 509 allows the device 500 to exchange information/data with other devices via a computer network such as the internet and/or various telecommunication networks.
The computing unit 501 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of computing unit 501 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 501 performs the respective methods and processes described above, such as a video playback method. For example, in some embodiments, the video playback method may be implemented as a computer software program tangibly embodied on a machine-readable medium, such as storage unit 508. In some embodiments, part or all of the computer program may be loaded and/or installed onto the device 500 via the ROM502 and/or the communication unit 509. When a computer program is loaded into RAM 503 and executed by computing unit 501, one or more steps of the video playback method described above may be performed. Alternatively, in other embodiments, the computing unit 501 may be configured to perform the video playback method in any other suitable way (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuit systems, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems On Chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for carrying out methods of the present disclosure may be written in any combination of one or more programming languages. These program code may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus such that the program code, when executed by the processor or controller, causes the functions/operations specified in the flowchart and/or block diagram to be implemented. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. The machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on 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.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and pointing device (e.g., a mouse or trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such background, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), blockchain networks, and the internet.
The computer system may include a client and a server. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical hosts and VPS service are overcome.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps described in the present disclosure may be performed in parallel, sequentially, or in a different order, provided that the desired results of the technical solutions disclosed in the present application are achieved, and are not limited herein. In the technical scheme of the disclosure, the acquisition, storage, application and the like of the related user personal information all conform to the regulations of related laws and regulations, and the public sequence is not violated.
The above detailed description should not be taken as limiting the scope of the present disclosure. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present disclosure are intended to be included within the scope of the present disclosure.

Claims (10)

1. A video playing method, the method comprising:
extracting a frame of image from the video to be played as a current frame of image;
preprocessing the current frame image to obtain a preprocessed current frame image; and recording the time length consumed by preprocessing the current frame image;
calculating a difference value between a preset playing time length of a frame and a time length consumed by preprocessing the current frame image; taking the difference value between the playing time length of the frame and the time length consumed by preprocessing the current frame image as the waiting interval time length corresponding to the current frame image;
if the waiting interval duration corresponding to the current frame image is smaller than a preset threshold value, performing fast play operation on the preprocessed current frame image; if the waiting interval time length corresponding to the current frame image is greater than or equal to the preset threshold value, normal playing operation is carried out on the preprocessed current frame image; wherein, the fast play operation means: directly performing decoding rendering operation of next cyclic play without waiting for interval duration; the normal play operation means: waiting for the interval time length, and performing next cyclic play decoding rendering operation;
and if the current frame image is not the last frame image of the video to be played, repeating the operation of extracting the current frame image until the current frame image is the last frame image of the video to be played.
2. The method of claim 1, further comprising, prior to said extracting a frame image in the video to be played as the current frame image:
acquiring the video to be played;
analyzing the video to be played to obtain video information data of the video to be played; and obtaining the playing time length of the frame based on the video information data.
3. The method of claim 1, wherein the preprocessing the current frame image to obtain a preprocessed current frame image comprises:
decoding the current frame image to obtain a decoded current frame image;
rendering the decoded current frame image to obtain a rendered current frame image; and taking the rendered current frame image as the preprocessed current frame image.
4. A method according to claim 3, wherein said recording the length of time spent preprocessing the current frame image comprises:
recording the time length consumed for decoding the current frame image and the time length consumed for rendering the decoded current frame image;
and obtaining the time length consumed for preprocessing the current frame image according to the time length consumed for decoding the current frame image and the time length consumed for rendering the decoded current frame image.
5. A video playback device, the device comprising: the device comprises an extraction module, a preprocessing module, a calculation module and a playing module; wherein,,
the extraction module is used for extracting a frame of image from the video to be played as a current frame of image;
the preprocessing module is used for preprocessing the current frame image to obtain a preprocessed current frame image; and recording the time length consumed by preprocessing the current frame image;
the calculating module is used for calculating the waiting interval duration corresponding to the current frame image based on the preset playing duration of one frame and the duration consumed by preprocessing the current frame image;
the playing module is used for playing the preprocessed current frame image based on the waiting interval duration corresponding to the current frame image; if the current frame image is not the last frame image of the video to be played, repeating the operation of extracting the current frame image until the current frame image is the last frame image of the video to be played;
the calculating module is specifically configured to calculate a difference between a playing duration of the one frame and a duration consumed for preprocessing the current frame image; taking the difference value between the playing time length of the frame and the time length consumed by preprocessing the current frame image as the waiting interval time length corresponding to the current frame image;
the playing module is specifically configured to perform a fast playing operation on the preprocessed current frame image if the waiting interval duration corresponding to the current frame image is less than a predetermined threshold; if the waiting interval time length corresponding to the current frame image is greater than or equal to the preset threshold value, normal playing operation is carried out on the preprocessed current frame image; wherein, the fast play operation means: directly performing decoding rendering operation of next cyclic play without waiting for interval duration; the normal play operation means: waiting for the interval duration is needed, and the next cyclic playing, decoding and rendering operation is carried out.
6. The apparatus of claim 5, the apparatus further comprising: an acquisition module and an analysis module; wherein,,
the acquisition module is used for acquiring the video to be played;
the analysis module is used for analyzing the video to be played to obtain video information data of the video to be played; and obtaining the playing time length of the frame based on the video information data.
7. The apparatus of claim 5, wherein the preprocessing module is specifically configured to decode the current frame image to obtain a decoded current frame image; rendering the decoded current frame image to obtain a rendered current frame image; and taking the rendered current frame image as the preprocessed current frame image.
8. The apparatus of claim 7, wherein the preprocessing module is specifically configured to record a duration consumed for decoding the current frame image and a duration consumed for rendering the decoded current frame image; and obtaining the time length consumed for preprocessing the current frame image according to the time length consumed for decoding the current frame image and the time length consumed for rendering the decoded current frame image.
9. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-4.
10. A non-transitory computer readable storage medium storing computer instructions for causing the computer to perform the method of any one of claims 1-4.
CN202110726940.9A 2021-06-29 2021-06-29 Video playing method and device, electronic equipment and storage medium Active CN113490044B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110726940.9A CN113490044B (en) 2021-06-29 2021-06-29 Video playing method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110726940.9A CN113490044B (en) 2021-06-29 2021-06-29 Video playing method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN113490044A CN113490044A (en) 2021-10-08
CN113490044B true CN113490044B (en) 2023-07-28

Family

ID=77936591

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110726940.9A Active CN113490044B (en) 2021-06-29 2021-06-29 Video playing method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113490044B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2011000253A1 (en) * 2009-06-30 2011-01-06 华为技术有限公司 Media stream processing method and communication system and related devices
CN107948735A (en) * 2017-12-06 2018-04-20 北京金山安全软件有限公司 Video playing method and device and electronic equipment
CN112272327A (en) * 2020-10-26 2021-01-26 腾讯科技(深圳)有限公司 Data processing method, device, storage medium and equipment
CN112995654A (en) * 2021-02-08 2021-06-18 咪咕音乐有限公司 Video playing pause detection method and device, server and readable storage medium

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CA2684678A1 (en) * 2009-11-03 2011-05-03 Research In Motion Limited System and method for dynamic post-processing on a mobile device
CA2843766A1 (en) * 2011-08-16 2013-02-21 Destiny Software Productions Inc. Script-based video rendering
CN104144312B (en) * 2013-05-09 2018-06-05 腾讯科技(深圳)有限公司 A kind of method for processing video frequency and relevant apparatus
US11665379B2 (en) * 2019-11-26 2023-05-30 Photo Sensitive Cinema (PSC) Rendering image content as time-spaced frames
CN113507637A (en) * 2021-07-13 2021-10-15 北京字跳网络技术有限公司 Media file processing method, device, equipment, readable storage medium and product

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2011000253A1 (en) * 2009-06-30 2011-01-06 华为技术有限公司 Media stream processing method and communication system and related devices
CN107948735A (en) * 2017-12-06 2018-04-20 北京金山安全软件有限公司 Video playing method and device and electronic equipment
WO2019109650A1 (en) * 2017-12-06 2019-06-13 香港乐蜜有限公司 Video playing method and apparatus, and electronic device
CN112272327A (en) * 2020-10-26 2021-01-26 腾讯科技(深圳)有限公司 Data processing method, device, storage medium and equipment
CN112995654A (en) * 2021-02-08 2021-06-18 咪咕音乐有限公司 Video playing pause detection method and device, server and readable storage medium

Also Published As

Publication number Publication date
CN113490044A (en) 2021-10-08

Similar Documents

Publication Publication Date Title
CN113453073B (en) Image rendering method and device, electronic equipment and storage medium
CN112908297B (en) Response speed testing method, device, equipment and storage medium of vehicle-mounted equipment
CN113691864A (en) Video clipping method, video clipping device, electronic equipment and readable storage medium
CN112738418A (en) Video acquisition method and device and electronic equipment
CN114422799B (en) Decoding method and device for video file, electronic equipment and program product
CN113490044B (en) Video playing method and device, electronic equipment and storage medium
CN114125324B (en) Video stitching method and device, electronic equipment and storage medium
CN116866661A (en) Video prerendering method, device, equipment and storage medium
CN114501084B (en) Play method, device, equipment and medium of player
CN114363704B (en) Video playing method, device, equipment and storage medium
CN114554110B (en) Video generation method, device, electronic equipment and storage medium
CN113542888B (en) Video processing method and device, electronic equipment and storage medium
CN114071192A (en) Information acquisition method, terminal, server, electronic device, and storage medium
CN114490990A (en) Method, device and equipment for determining text to be marked and storage medium
CN113556575A (en) Method, apparatus, device, medium and product for compressing data
CN115312042A (en) Method, apparatus, device and storage medium for processing audio
CN112988105A (en) Playing state control method and device, electronic equipment and storage medium
CN112929728A (en) Video rendering method, device and system, electronic equipment and storage medium
CN114786051B (en) Video rendering method and device, electronic equipment and storage medium
CN113225596B (en) Video processing method and device, electronic equipment and storage medium
CN113362218B (en) Data processing method and device, electronic equipment and storage medium
WO2024045026A1 (en) Display method, electronic device, display device, screen mirroring device and medium
CN117097955A (en) Video processing method, device, equipment and storage medium
CN117392583A (en) Video repetition determination method, device, equipment and storage medium
CN115484460A (en) Video data processing method, device, equipment and medium based on artificial intelligence

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
GR01 Patent grant
GR01 Patent grant