CN112601127B - Video display method and device, electronic equipment and computer readable storage medium - Google Patents

Video display method and device, electronic equipment and computer readable storage medium Download PDF

Info

Publication number
CN112601127B
CN112601127B CN202011378983.4A CN202011378983A CN112601127B CN 112601127 B CN112601127 B CN 112601127B CN 202011378983 A CN202011378983 A CN 202011378983A CN 112601127 B CN112601127 B CN 112601127B
Authority
CN
China
Prior art keywords
timestamp
video
decapsulated
video frame
frame
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
CN202011378983.4A
Other languages
Chinese (zh)
Other versions
CN112601127A (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.)
Oppo Chongqing Intelligent Technology Co Ltd
Original Assignee
Oppo Chongqing Intelligent 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 Oppo Chongqing Intelligent Technology Co Ltd filed Critical Oppo Chongqing Intelligent Technology Co Ltd
Priority to CN202011378983.4A priority Critical patent/CN112601127B/en
Publication of CN112601127A publication Critical patent/CN112601127A/en
Application granted granted Critical
Publication of CN112601127B publication Critical patent/CN112601127B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/47End-user applications
    • H04N21/472End-user interface for requesting content, additional data or services; End-user interface for interacting with content, e.g. for content reservation or setting reminders, for requesting event notification, for manipulating displayed content
    • H04N21/47217End-user interface for requesting content, additional data or services; End-user interface for interacting with content, e.g. for content reservation or setting reminders, for requesting event notification, for manipulating displayed content for controlling playback functions for recorded or on-demand content, e.g. using progress bars, mode or play-point indicators or bookmarks
    • 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
    • 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/85Assembly of content; Generation of multimedia applications
    • H04N21/854Content authoring
    • H04N21/8547Content authoring involving timestamps for synchronizing content

Abstract

The embodiment of the application relates to the technical field of multimedia, and discloses a video display method and device, electronic equipment and a computer readable storage medium, wherein the method comprises the following steps: when a plurality of jump requests aiming at video progress are received, acquiring a first timestamp pointed by the current jump request, and calculating the interval duration between the first timestamp and a second timestamp, wherein the second timestamp is a timestamp corresponding to a last rendered first video frame relative to the first timestamp; and if the interval duration between the first timestamp and the second timestamp is greater than the rendering duration of the first video frame, rendering and displaying the second video frame corresponding to the first timestamp. By implementing the embodiment of the application, the pause of the video picture in the jumping process can be reduced.

Description

Video display method and device, electronic equipment and computer readable storage medium
Technical Field
The present application relates to the field of multimedia technologies, and in particular, to a video display method and apparatus, an electronic device, and a computer-readable storage medium.
Background
During the playing process of the video, a user usually drags the video from one time point to another time point to jump the video frame to the favorite content of the user.
In practice, it is found that several tens or even hundreds of jump requests may be generated during the process of dragging a video from one time point to another time point, and the conventional video display device cannot process a large number of jump requests in a short time, thereby causing the video picture to be stuck during the jump.
Disclosure of Invention
The embodiment of the application discloses a video display method and device, electronic equipment and a computer readable storage medium, which can reduce the pause of a video picture in the jumping process and improve the display effect of a video.
A first aspect of an embodiment of the present application discloses a video display method, including:
when a plurality of jump requests aiming at video progress are received, acquiring a first timestamp pointed by the current jump request, and calculating the interval duration between the first timestamp and a second timestamp, wherein the second timestamp is a timestamp corresponding to a first video frame which is rendered last relative to the first timestamp;
and if the interval duration is longer than the rendering duration of the first video frame, rendering and displaying a second video frame corresponding to the first timestamp.
A second aspect of the embodiments of the present application discloses a video display apparatus, including:
the computing unit is used for acquiring a first timestamp pointed by a current skip request when a plurality of skip requests aiming at video progress are received, and computing the interval duration between the first timestamp and a second timestamp, wherein the second timestamp is a timestamp corresponding to a first video frame rendered last relative to the first timestamp;
and the display unit is used for rendering and displaying the second video frame corresponding to the first timestamp when the interval duration is longer than the rendering duration of the first video frame.
A third aspect of the embodiments of the present application discloses an electronic device, including:
a memory storing executable program code;
a processor coupled with the memory;
the processor calls the executable program code stored in the memory to execute the video display method disclosed by the first aspect of the embodiment of the present application.
A fourth aspect of the embodiments of the present application discloses a computer-readable storage medium storing a computer program, where the computer program enables a computer to execute a video display method disclosed in the first aspect of the embodiments of the present application.
A fifth aspect of embodiments of the present application discloses a computer program product, which, when run on a computer, causes the computer to perform part or all of the steps of any one of the methods of the first aspect of embodiments of the present application.
Compared with the prior art, the embodiment of the application has the following beneficial effects:
when the continuous sliding video progress bar is applied to the upper layer and then a plurality of video progress jump requests are generated, the first timestamp pointed by each video progress jump request can be obtained, the interval duration between the first timestamp and the second timestamp corresponding to the last rendered and displayed video frame is calculated, and if the interval duration between the two timestamps is longer than the duration required by the rendering and displaying of the last video frame, the video progress jump request cannot conflict with the rendering and displaying of the last video frame, so that the video frame corresponding to the first timestamp can be rendered and displayed. Therefore, in the process of applying the continuous sliding video progress bar on the upper layer, more video progress jump requests can be screened out and can be realized, and the conflicting video progress jump requests cannot be generated, so that more video frames can be rendered and displayed as much as possible, and the video frames are smoother in the process of sliding the progress bar.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required to be used in the embodiments will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a schematic flow chart of a video display method disclosed in an embodiment of the present application;
fig. 2A is a schematic diagram illustrating whether a second video frame corresponding to a first timestamp can be rendered and displayed according to an embodiment of the present application;
fig. 2B is another schematic diagram illustrating whether a second video frame corresponding to the first timestamp can be rendered and displayed according to the embodiment of the present application;
FIG. 3 is a schematic flow chart diagram of another video display method disclosed in the embodiments of the present application;
fig. 4 is a schematic diagram illustrating how a second video frame is determined from the first decapsulated video data according to an embodiment of the present disclosure;
FIG. 5 is a schematic flow chart diagram illustrating a further video display method disclosed in an embodiment of the present application;
fig. 6 is a schematic structural diagram of a video display apparatus according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of another video display apparatus disclosed in the embodiments of the present application;
fig. 8 is a schematic structural diagram of an electronic device disclosed in an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only some embodiments of the present application, and not all embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments in the present application without making any creative effort belong to the protection scope of the present application.
It should be noted that the terms "first", "second", "third" and "fourth" etc. in the description and claims of the present application are used for distinguishing different objects, and are not used for describing a specific order. The terms "comprises," "comprising," and "having," and any variations thereof, of the embodiments of the present application, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
The embodiment of the application discloses a video display method and device, electronic equipment and a computer readable storage medium, which can reduce the pause of a video picture in the jumping process and improve the watching experience of a user.
The technical solution of the present application will be described in detail with reference to specific examples.
To more clearly illustrate the video display method disclosed in the embodiments of the present application, an application scenario to which the video display method is applied is first introduced. The video display method can be applied to the process of playing video pictures by video application programs such as a video player, a video editing application program or a video recording application program which are built in the electronic equipment. Specifically, the method can be applied to the process that a user drags the video progress bar so as to accurately jump the video pictures. As it is found in practice that during the playing of the video, the user usually adjusts the progress of the video to jump the video to the favorite content. It can be understood that a video frame is usually obtained by continuously displaying a plurality of video frames according to a certain sequence, so that adjusting the progress of the video is actually adjusting the video frame currently displayed on the video frame, and how to adjust is determined by a timestamp pointed by a skip request (i.e., seek request) generated by the electronic device according to a video progress adjustment operation (e.g., dragging the video progress, clicking the video progress, etc.) received by an upper-layer application.
In practical applications, a user may adjust the video progress several times in a short time, so that the electronic device may generate several tens or even hundreds of jump requests in a short time, but since a certain time is required for rendering and displaying a video frame into a video picture, a collision may occur between the jump requests, resulting in video stalling. In order to solve the technical defects, the related art generally processes only the last jump request of multiple jump requests generated in a short time so as to avoid collision among the multiple jump requests. However, since the fluency of the video frame display is related to the number of the displayed video frames (generally, the greater the number of the displayed video frames, the smoother the video frame is, and vice versa, the more the video frame is stuck), the related art only processes the last jump request of the multiple jump requests in a short time, which causes the video frame to be stuck in the jump process, thereby affecting the viewing experience of the user. Therefore, the video display method disclosed by the embodiment of the application can screen a plurality of jump requests generated by the electronic equipment in a short time, so that more jump requests which are not conflicted with each other are determined as much as possible in the plurality of jump requests to be processed, more video frames are rendered and displayed in the process of video progress jump, and the smoothness degree of video picture jump is improved.
Referring to fig. 1, fig. 1 is a schematic flowchart illustrating a video display method according to an embodiment of the present disclosure, where the video display method may be applied to electronic devices such as a mobile phone, a tablet computer, a desktop computer, and a wearable device, and the video display method may include the following steps:
102. when multiple jump requests aiming at the video progress are received, a first timestamp pointed by the current jump request is obtained, the interval duration between the first timestamp and a second timestamp is calculated, and the second timestamp is a timestamp corresponding to a last rendered first video frame relative to the first timestamp.
In the embodiment of the present application, in the process of running a video application (e.g., a video player, a video editing application) to play a video, if a skip operation (e.g., dragging the video progress, clicking the video progress, etc.) for the video progress is detected, the electronic device may generate a plurality of skip requests for the video progress corresponding to the skip operation in this period, it can be understood that the plurality of skip requests are generated according to a certain sequence, and each corresponding skip request may correspond to a timestamp for representing a timestamp corresponding to a video frame to which the skip request is to skip, for example: the first timestamp pointed by the current skip request is 16 min 08 s, which indicates that the current skip request intends to skip to a video frame with a timestamp of 16 min 08 s.
Alternatively, the video frames requested to be skipped by the skip request may be key video frames (I-frames) or non-key video frames (P-frames or B-frames), wherein a key video frame refers to a video frame comprising a complete picture, which is usually the first frame of a group of pictures; the non-key video frame is a video frame recording change information relative to the key video frame; non-key video frames are typically arranged after the key video frames on which they depend.
In an embodiment, the electronic device may obtain a current skip request (i.e., a skip request processed by the electronic device at a current time point) among the skip requests, and further determine a first timestamp pointed by the current skip request, where the first timestamp is a timestamp corresponding to a video frame that the current skip request wants to skip to display in the video progress. And in order to judge whether the current jump request conflicts with the video which is rendered and displayed last time, the electronic device may acquire a second timestamp corresponding to the first video frame which is rendered and displayed last time relative to the first timestamp, and calculate an interval duration between the first timestamp and the second timestamp. Wherein, the first video frame rendered and displayed at the last time of the first time stamp refers to the video frame rendered before the first time stamp and closest to the first time stamp.
It can be understood that, if the interval duration between the first timestamp and the second timestamp is longer than the rendering duration of the last rendered and displayed video frame, it indicates that the electronic device can render and display the second video frame corresponding to the first timestamp after processing the rendering and displaying of the last video frame, so that the rendering and displaying of the two video frames do not collide. On the contrary, since the electronic device can only render and display one video frame in the same time period, if the duration of the interval between the first timestamp and the second timestamp is less than or equal to the duration required by the rendering and display of the previous video frame, the rendering and display of the two video frames will collide, so that the current skip request cannot be realized.
Optionally, after calculating the interval duration between the first timestamp and the second timestamp, if the interval duration between the first timestamp and the second timestamp is not greater than the rendering duration of the first video frame, the electronic device may ignore the current skip request; further, if the current skip request is not the last skip request, the electronic device may use the next skip request as the current skip request, and continue to perform the step of obtaining the first timestamp pointed by the current skip request; conversely, if the duration of the interval between the first timestamp and the second timestamp is greater than the rendering duration of the first video frame, the electronic device can perform step 104.
By implementing the method, the electronic device can ignore the skip request which conflicts with the last rendered and displayed video frame, so as to avoid the display conflict between the video frames to cause the picture to be stuck.
It should be further noted that, if the current skip request acquired by the electronic device is the first skip request in the multiple skip requests for the video progress, no video frame needs to be rendered and displayed before the current skip request, so that the electronic device can directly process the current skip request. Optionally, the electronic device may determine whether the current skip request is a first skip request of the received multiple skip requests, and if the current skip request is the first skip request of the received multiple skip requests, render and display a second video frame corresponding to a first timestamp pointed by the current skip request.
104. And if the interval duration between the first timestamp and the second timestamp is greater than the rendering duration of the first video frame, rendering and displaying the second video frame corresponding to the first timestamp.
In the embodiment of the present application, the rendering and displaying time duration of each video frame may be the same or different, so the rendering time duration of the first video frame may be set by a developer according to a great amount of development experience, and is not limited herein.
However, in practice, the rendering display duration of a video frame may be related to parameters (e.g., resolution, format, etc.) of the video frame, the number of elements (e.g., filters, transition special effects, etc.) included in the video frame, and the rendering display efficiency of the electronic device. Generally, the higher the resolution of a video frame is, the longer the rendering display time of the video frame is, and vice versa; the more elements a video frame includes, the longer the rendering display time of the video frame, and vice versa. Since the rendering display efficiency of the electronic device is generally related to the processing efficiency of the processor of the electronic device, the higher the processing efficiency of the processor of the electronic device is, the higher the rendering display efficiency of the electronic device is, the shorter the duration of rendering and displaying a frame of video frame by the electronic device is, and vice versa.
Alternatively, before determining whether the interval duration between the first timestamp and the second timestamp is greater than the rendering duration of the first video frame, the electronic device may obtain parameter information of the first video frame, and determine the rendering duration of the first video frame according to the parameter information of the first video frame. Alternatively, the parameter information of the first video frame may include a resolution of the first video frame or a format of the first video frame.
In another embodiment, before determining whether the interval duration between the first timestamp and the second timestamp is greater than the rendering duration of the first video frame, the electronic device may obtain quantity information of elements included in the first video frame, and determine the rendering duration of the first video frame according to the quantity information. Optionally, the rendering duration of the first video frame may be in positive correlation with the quantity information of the elements included in the first video frame, that is, the more the elements included in the first video frame are, the longer the rendering duration of the first video frame is, and vice versa.
In yet another embodiment, before determining whether the interval duration between the first timestamp and the second timestamp is greater than the rendering duration of the first video frame, the electronic device may obtain rendering display efficiency of the electronic device, and determine the rendering duration of the first video frame according to the rendering display efficiency of the electronic device. Optionally, the rendering display efficiency of the electronic device may be in a positive correlation with the processing efficiency of the processor of the electronic device, and the rendering duration of the first video frame may be in a positive correlation with the rendering display efficiency of the electronic device.
By implementing the method disclosed by each embodiment, the electronic device determines a more accurate video frame rendering duration according to the information of the last rendered and displayed video frame and the processing efficiency of the electronic device, so that the collision between the current skip request and the last video frame can be avoided.
In some embodiments, the skip request for the video progress may include a forward skip request for skipping to the end direction of the video progress and a backward skip request for skipping to the start direction of the video progress. Optionally, for different jump requests, after acquiring a first timestamp pointed by a current jump request, if it is determined that the current jump request is a forward jump request, the electronic device may calculate a sum of a second timestamp corresponding to a last rendered first video frame with respect to the first timestamp and a rendering duration of the first video frame; and judging whether the first time stamp is larger than the sum of the rendering duration of the first video frame and the second time stamp corresponding to the last rendered first video frame, and if so, rendering and displaying the second video frame corresponding to the first time stamp.
Optionally, if the first timestamp is not greater than the sum of the rendering duration of the first video frame and a second timestamp corresponding to the last rendered first video frame, ignoring the current jump request; and if the current jump request is not the last jump request, the electronic device may use the next jump request as the current jump request and continue to execute the step of obtaining the first timestamp pointed by the current jump request.
For example, referring to fig. 2A, assuming that the second timestamp corresponding to the last rendered first video frame is at a point A1 of the video progress, and the rendering duration of the first video frame is t, the display timestamp of the first video frame is equal to the sum of the second timestamp corresponding to the first video frame and the rendering duration of the first video frame, that is, A1+ t = A2. At this time, if the current jump request is a forward jump, if the first timestamp B1 is greater than A2, as can be seen from fig. 2A, the first timestamp B1 already exceeds the period of rendering the first video frame from A1 to A2, so the electronic device can process the video frame at B1 after displaying the previous video frame at A2, so the electronic device can render and display the second video frame corresponding to the first timestamp, and conversely, if the first timestamp B2 is not greater than A2, it is indicated that the rendered and displayed video frame corresponding to the first timestamp will collide with the video frame of the previous frame, so the electronic device can ignore the current jump request.
In another embodiment, after acquiring a first timestamp pointed by a current jump request, if the current jump request is a backward jump request, the electronic device may calculate a difference between a second timestamp corresponding to a last rendered first video frame with respect to the first timestamp and a rendering duration of the first video frame; and judging whether the first time stamp is smaller than a second time stamp corresponding to a last rendered first video frame and the difference of the rendering duration of the first video frame, and if so, rendering and displaying the second video frame corresponding to the first time stamp.
Optionally, if the first timestamp is not less than a second timestamp corresponding to a last rendered first video frame and a difference between rendering durations of the first video frame and the second timestamp, ignoring the current jump request; and if the current jump request is not the last jump request, taking the next jump request as the current jump request, and continuing to execute the step of acquiring the first timestamp pointed by the current jump request.
For example, in conjunction with fig. 2B, it is also assumed that the second timestamp corresponding to the last rendered first video frame is at a point A1 of the video progress, the rendering duration of the first video frame is t, and when the jump request is a backward jump, the video frames are sequentially flipped backward, so similarly, the display timestamp of the first video frame may be equal to the difference between the second timestamp corresponding to the first video frame and the rendering duration of the first video frame, i.e., A1-t = A2. Unlike the forward skip, when the current skip request is the backward skip, if the first timestamp B1 is smaller than A2, as can be seen from fig. 2B, the first timestamp B1 already exceeds the period of rendering the first video frame from A1 to A2, so the electronic device can display the last video frame at A2 and then process the video frame at B1, so the electronic device can render and display the second video frame corresponding to the first timestamp, conversely, if the first timestamp B2 is not smaller than A2, it is indicated that the rendered and displayed video frame corresponding to the first timestamp will collide with the video frame of the last frame, so the electronic device can ignore the current skip request.
By implementing the method disclosed in each of the embodiments, the electronic device may obtain a first timestamp pointed by each video progress jump request, and calculate an interval duration between the first timestamp and a second timestamp corresponding to a last rendered and displayed video frame, and if the interval duration between the two timestamps is greater than a duration required by the rendering and displaying of the last video frame, it is indicated that the video progress jump request does not conflict with the rendering and displaying of the last video frame, so that a target video frame corresponding to the first timestamp may be rendered and displayed. Compared with the prior art that when a plurality of video progress jump requests are faced, the last video progress jump request is usually processed, more video progress jump requests which can be realized and can not conflict are screened out in the process of continuously sliding the video progress bar on the upper layer, so that more video frames can be rendered and displayed as much as possible, the video frames are smoother in the process of sliding the progress bar, and the watching experience of a user is improved.
Referring to fig. 3, fig. 3 is a schematic flowchart illustrating another video display method disclosed in the present application, where the video display method may be applied to electronic devices such as a mobile phone, a tablet computer, a desktop computer, and a wearable device, and the video display method may include the following steps:
302. when a plurality of jump requests aiming at video progress are received, a first timestamp pointed by the current jump request is obtained, and the interval duration between the first timestamp and a second timestamp is calculated, wherein the second timestamp is a timestamp corresponding to a last rendered first video frame relative to the first timestamp.
304. If the interval duration between the first timestamp and the second timestamp is greater than the rendering duration of the first video frame, a timestamp range corresponding to the stored first decapsulated video data is obtained, and the timestamp range is from a third timestamp corresponding to the first frame of decapsulated video data in the first decapsulated video data to a fourth timestamp corresponding to the last frame of decapsulated video data in the first decapsulated video data.
In the embodiment of the application, the video file stored in the electronic device is usually a packaged video file, and the packaged video file is usually in an mkv format, and is obtained by packaging a video file in an avi or mp4 format, or the like. Because the original video file can be compressed by packaging the video file, the occupied storage space is smaller, the storage space of the electronic equipment can be saved, and the electronic equipment can conveniently transmit the video file. However, the encapsulated video file cannot be directly decoded and displayed by the electronic device, so when playing a video, the electronic device usually needs to perform an decapsulation operation on the encapsulated video file to obtain decapsulated video data, that is, an AVPacket, which is data obtained after decapsulation of the encapsulated video file, and is still compressed data, including a video frame and some additional information, such as a display timestamp, a decoding timestamp, a data duration, an index of a local media stream, and the like, so that the electronic device can perform a decoding and displaying operation on the decapsulated video data.
In practical applications, the electronic device does not decapsulate all the encapsulated video files at one time, which occupies too much storage space of the electronic device, so the electronic device usually decapsulates only a part of the encapsulated video files and stores the decapsulated video files in a temporary storage list for calling, for example, the electronic device usually decapsulates only decapsulated video data corresponding to a Group of pictures (GOP) from the encapsulated video files and stores the decapsulated video data. A group of pictures is a set of consecutive pictures that typically consists of one key video frame (i.e., an I-frame, which is a complete picture, typically the first frame in a group of pictures) and several non-key video frames (e.g., P-frames and B-frames, which record changes relative to the I-frame, which depend on the I-frame in the group of pictures). Since a group of pictures can individually represent a group of consecutive pictures without referring to other images, an electronic device usually only decapsulates the decapsulated video data corresponding to a group of pictures from the encapsulated video file and stores the decapsulated video data for easy invocation by the electronic device.
However, in practice, it is found that the time durations corresponding to a group of pictures included in different video files are actually different (where the time duration corresponding to a group of pictures is a timestamp difference between a first key video frame included in the group of pictures and a next key video frame, for example, the timestamp of the first key video frame included in the group of pictures is 16 seconds, and the timestamp of the next key video frame is 20 seconds, the time duration corresponding to the group of pictures is 20 seconds-16 seconds =4 seconds), and since the time durations corresponding to a group of pictures included in different video files are different, if the time duration corresponding to a group of pictures included in a video file is too short, the amount of video data corresponding to only one group of pictures decapsulated by the electronic device at a time is smaller, so that the probability that a video frame that the electronic device wants to display is in decapsulated data is smaller, and the electronic device needs to perform frequent decapsulation operations, which is not beneficial to improve the efficiency of video display.
Optionally, before obtaining the timestamp range corresponding to the stored first decapsulated video data, the electronic device may determine whether a duration corresponding to a group of pictures included in the video file is greater than a first duration (where the duration corresponding to the group of pictures is a timestamp difference between two adjacent key video frames; the first duration may be set by a developer according to a great amount of development experience, and typical values may be 15 seconds, 16 seconds, and the like, which is not limited herein); if the duration corresponding to the frame group is greater than or equal to the first duration, decapsulating video data of the duration corresponding to one frame group from the video file to obtain first decapsulated data and storing the decapsulated data; and if the duration corresponding to the frame group is less than the first duration, decapsulating the video data corresponding to the first duration from the video file to obtain and store first decapsulated data.
For example, assuming that the first duration is set to 15 seconds, if the duration of a group of pictures included in the video file is 6 seconds and less than 15 seconds, the electronic device may decapsulate the 15 seconds of video data from the video file to increase the data amount of decapsulated data stored in the electronic device; if the duration of a frame group included in the video file is 16 seconds or longer than 15 seconds, the electronic device may directly decapsulate the 16 seconds of video data from the video file.
By implementing the method, the electronic equipment can decapsulate more appropriate amount of video data from the video file, thereby avoiding frequent decapsulation operations performed by the electronic equipment and further improving the video display efficiency.
It should be further noted that, the timestamps corresponding to the stored multiple decapsulated video data are sequentially arranged according to a certain sequence, for example: and if the first time stamp is in the time stamp range corresponding to the decapsulated video frame data, the video frame corresponding to the first time stamp is in the stored decapsulated video data. In this regard, after determining that the interval duration between the first timestamp and the second timestamp is greater than the rendering duration of the first video frame, the electronic device may obtain a timestamp range corresponding to the stored first decapsulated video data, where the timestamp range is from a third timestamp corresponding to the first frame of decapsulated video data in the first decapsulated video data to a fourth timestamp corresponding to the last frame of decapsulated video data in the first decapsulated video data. For example: the third timestamp corresponding to the first frame of decapsulated video data in the first decapsulated video data is 16 seconds, and the fourth timestamp corresponding to the last frame of decapsulated video data in the first decapsulated video data is 20 seconds, so that the timestamp range corresponding to the first decapsulated video data is 16 seconds to 20 seconds.
306. And if the first timestamp is within the timestamp range, determining a second video frame corresponding to the first timestamp in the first de-encapsulation video data, and rendering and displaying the second video frame.
In the embodiment of the application, after the electronic device determines that the first timestamp is in the timestamp range corresponding to the stored first decapsulated video data, because the first decapsulated video data is still compressed data, the display cannot be directly rendered by the electronic device, the electronic device needs to decode the first decapsulated video data to determine the second video frame corresponding to the first timestamp, and the video frame can be directly rendered by the electronic device for display, so after determining the second video frame, the electronic device can directly render the second video frame for display.
It should be noted that there may be a plurality of (including two or more) stored first decapsulated video data, but the electronic device does not decode all the first decapsulated video data into video frames at one time, but sequentially decodes only one decapsulated video data according to the arrangement order of the first decapsulated video data to obtain video frames, and determines whether the decoded video frames need to be rendered for display, if so, renders the video frames for display, and if not, discards the video frames and then decodes the next decapsulated video data. Optionally, the electronic device may determine target decapsulated video data from the first decapsulated video data, and decode the target decapsulated video data to obtain a target video frame; further calculating the sum of the corresponding timestamp of the target video frame and the rendering duration of the target video frame to obtain the display time of the target video frame; if the display time of the target video frame is greater than the first timestamp, it is indicated that the target video frame needs to be rendered and displayed, so that the electronic device can determine the target video frame as a second video frame; on the contrary, if the display time of the target video frame is not greater than the first timestamp, and the target decapsulated video data is not the last frame decapsulated video data in the first decapsulated video data, the electronic device may use the next frame decapsulated data of the target decapsulated video data as new target decapsulated video data, and perform decoding on the target decapsulated video data to obtain the target video frame until the second video frame is determined.
By way of example with reference to fig. 4, assume that the electronic device decodes from the first decapsulated video data and determines that the display timestamp of the first video frame is a1, and that the first video frame will be dropped because a1 is less than the first timestamp A3; the electronic device can decode the second decapsulated video data and determine that the display timestamp of the second video frame is a2, and similarly, the second video frame is lost because a2 is smaller than the first timestamp A3; the electronic device continues to decode the third decapsulated video frame and determines that the display timestamp of the third video frame is A3, and since A3 is greater than the first timestamp A3, the electronic device may render and display the subsequent video frames from the third video frame.
By implementing the method, the electronic device can determine from which first decapsulated video data the electronic device starts to decode and display by judging whether the display timestamp of the target video frame obtained by decoding is greater than the first timestamp; in addition, video frames with display timestamps not greater than the first timestamp may also be dropped to avoid the video frame displaying a frame that the user does not need to display.
In practical application, it is found that a skip request for a video progress can be divided into forward skip and backward skip, and it is considered that when a video is played, first decapsulated video data is decoded forward in sequence all the time, so when the skip request is a forward skip, the electronic device can directly decode and display the first decapsulated video data from the previous frame, thereby avoiding the need for the electronic device to decode from the first decapsulated video data again, and improving the display efficiency of the video.
Alternatively, if the current skip request is a forward skip, the electronic device may determine that the next frame of decapsulated video data relative to the second timestamp (i.e., the timestamp corresponding to the last rendered first video frame relative to the first timestamp) in the first decapsulated video data is the target decapsulated video data. In another embodiment, since the first decapsulated video data is decoded forward in sequence all the time when the video is played, if the current skip request is a backward skip, the skip direction and the decoding direction conflict, and therefore the electronic device still needs to determine the first frame of decapsulated video data in the first decapsulated video data as the target decapsulated video data and then perform the subsequent decoding and displaying process.
By way of example with further reference to fig. 4, assuming that the last rendered video frame is a2 and the current jump request is a forward jump, the electronic device may directly start with a2 and then decode a3, a4 \8230; if the current skip request is a backward skip, the electronic device needs to decode the decapsulated video data a1 from the first frame.
In another embodiment, if the current skip request is the first skip request in the skip requests, the electronic device can only start decoding from the first decapsulated video data since the decapsulated video data has not been decoded before. That is, if the current skip request is the first skip request of the multiple skip requests, the electronic device may determine the first frame decapsulated video data in the first decapsulated video data as the target decapsulated video data.
By implementing the method, the electronic equipment can be prevented from repeatedly decoding from the first decapsulated video data, so that the display efficiency of the video is improved.
Obviously, the above method for rendering and displaying the second video frame corresponding to the first timestamp is based on the fact that the second video frame corresponding to the first timestamp exists in the stored first decapsulated video data. However, since the first decapsulated video data only includes a part of the video data in the video file, the second video frame corresponding to the first timestamp may not exist in the stored first decapsulated video data. Optionally, after obtaining the timestamp range corresponding to the stored first decapsulated video data, if the electronic device determines that the first timestamp is not within the timestamp range corresponding to the first decapsulated video data, it indicates that the second video frame corresponding to the first timestamp may not exist in the stored first decapsulated video data. In this regard, the electronic device needs to continue to decapsulate the video file to obtain the decapsulated data including the second video frame, whereas as described above, the electronic device typically decapsulates video data of only one group of pictures, and the group of pictures are typically distinguished by the key video frames that it includes. Optionally, the electronic device may determine a target key video frame from a plurality of key video frames included in the video file, where the target key video frame is a key video frame whose timestamp is before the first timestamp and is closest to the first timestamp; and then the electronic equipment can decapsulate second decapsulated video data corresponding to the target key video frame in the video file, and can determine a second video frame corresponding to the first timestamp from the first decapsulated data in the above manner, determine a second video frame corresponding to the first timestamp from the second decapsulated data, and render and display the second video frame.
As can be seen from the above, determining whether the first timestamp is within the timestamp range corresponding to the first decapsulated video data affects subsequent steps performed by the electronic device, so it is important to determine whether the first timestamp is within the timestamp range corresponding to the first decapsulated video data. As an optional implementation manner, after obtaining a timestamp range corresponding to the stored first decapsulated video data, if the electronic device determines that the current skip request is a forward skip, and if the first timestamp is greater than the fourth timestamp, the electronic device may determine that the first timestamp is not within the timestamp range, and if the first timestamp is not greater than the fourth timestamp, determine that the first timestamp is within the timestamp range.
In another embodiment, if the current jump request is a backward jump and the first timestamp is less than the third timestamp, the electronic device may determine that the first timestamp is not within the timestamp range, and if the first timestamp is not less than the third timestamp, the electronic device determines that the first timestamp is within the timestamp range.
By implementing the method, the electronic equipment can accurately determine whether the first timestamp is in the timestamp range corresponding to the first decapsulated video data, so that the subsequent video frame decoding and displaying step can be more accurately executed, and the video displaying efficiency is improved.
By implementing the method disclosed by each embodiment, more video progress skipping requests can be screened out in the process of continuously sliding the video progress bar on the upper layer, and the conflicting video progress skipping requests cannot be generated, so that more video frames can be rendered and displayed as much as possible, the video frames are smoother in the process of sliding the progress bar, and the watching experience of a user is improved; moreover, the video data with more appropriate amount can be unpackaged from the video file, so that the electronic equipment is prevented from frequently unpacking, and the video display efficiency is improved; and determining from which first decapsulated video data the electronic device starts decoding display by judging whether the display timestamp of the decoded target video frame is greater than the first timestamp; in addition, the video frames with the display time stamps not greater than the first time stamp can be discarded to avoid the video pictures from displaying pictures which are not required to be displayed by the user; the electronic equipment can be prevented from repeatedly decoding from the first decapsulated video data, so that the display efficiency of the video is improved; and whether the first timestamp is in the timestamp range corresponding to the first decapsulated video data or not can be accurately determined, so that the subsequent video frame decoding and displaying step can be more accurately executed, and the video displaying efficiency is improved.
Referring to fig. 5, fig. 5 is a schematic flowchart illustrating a video display method according to an embodiment of the present disclosure, where the video display method may be applied to electronic devices such as a mobile phone, a tablet computer, a desktop computer, and a wearable device, and the video display method may include the following steps:
502. when a plurality of jump requests aiming at video progress are received, a first timestamp pointed by the current jump request is obtained, and the interval duration between the first timestamp and a second timestamp is calculated, wherein the second timestamp is a timestamp corresponding to a last rendered first video frame relative to the first timestamp.
504. And if the interval duration between the first timestamp and the second timestamp is longer than the duration of the video frame for rendering and displaying, storing the first timestamp into a timestamp queue.
In the embodiment of the application, because a plurality of jump requests received by the electronic device may be generated in a short time, the first timestamps determined by the electronic device in the short time may also be multiple, and because the display of the video frames is generally a rendering display of one frame and one frame, when video frames corresponding to a plurality of first timestamps need to be rendered and displayed in a short time, the electronic device may store the first timestamps in a timestamp queue, and then take out the first timestamps from the timestamp queue according to a certain rule and perform a subsequent video frame rendering and displaying step.
506. And acquiring the latest stored first timestamp from the timestamp set, and rendering and displaying a second video frame corresponding to the latest stored first timestamp.
In this embodiment of the application, the order in which the first timestamps are stored in the timestamp queue is usually a storage manner in which the first timestamps are generated and stored first, so that the most recently stored first timestamps are timestamps to which the most recently generated skip request points, and thus, in order to ensure the validity of the video frames to be rendered and displayed, the electronic device may obtain the most recently stored first timestamps from the timestamp set, and render and display the second video frames corresponding to the most recently stored first timestamps. Thereby ensuring that the video picture is the most effective picture.
And after the electronic device acquires the most recently stored first timestamp from the timestamp queue to process, the other first timestamps stored in the timestamp queue lose effectiveness, so that the electronic device does not need to process the first timestamps any more, and optionally, after the electronic device acquires the most recently stored first timestamp from the timestamp list, the electronic device can empty the first timestamps stored in the timestamp queue. In another embodiment, after emptying the plurality of first timestamps stored in the timestamp queue, the electronic device may continue to acquire the first timestamp to which the current jump request points, and when it is determined that the interval duration between the first timestamp and the timestamp corresponding to the last rendered first video frame is greater than the duration of rendering and displaying the video frame, store the new first timestamp in the timestamp queue to ensure the effectiveness of the first timestamp stored in the timestamp queue.
By implementing the method disclosed by each embodiment, more video progress skipping requests can be screened out in the process of continuously sliding the video progress bar in the upper layer, and the conflicting video progress skipping requests cannot be generated, so that more video frames can be rendered and displayed as much as possible, video pictures are smoother in the process of sliding the progress bar, and the watching experience of a user is improved; and acquiring the latest stored first timestamp from the timestamp set, and rendering and displaying a second video frame corresponding to the latest stored first timestamp. Thereby ensuring that the video picture is the picture with the most effectiveness; and the electronic device may empty the plurality of first time stamps stored in the time stamp queue after retrieving the most recently stored first time stamp from the time stamp list to guarantee validity of the first time stamp stored in the time stamp queue.
Referring to fig. 6, fig. 6 is a schematic structural diagram of a video display device according to an embodiment of the present disclosure, where the video display device can be applied to the electronic apparatus, and the video display device may include: a calculation unit 601 and a display unit 602, wherein:
a calculating unit 601, configured to, when multiple skip requests for a video progress are received, obtain a first timestamp pointed by a current skip request, and calculate an interval duration between the first timestamp and a second timestamp, where the second timestamp is a timestamp corresponding to a first video frame rendered last relative to the first timestamp;
a display unit 602, configured to render and display the second video frame corresponding to the first timestamp when an interval duration between the first timestamp and the second timestamp is greater than a rendering duration of the first video frame.
By implementing the video display device, the first timestamp pointed by each video progress jump request can be obtained, the interval duration between the first timestamp and the second timestamp corresponding to the last rendered and displayed video frame is calculated, and if the interval duration between the two timestamps is longer than the duration required by the rendering and displaying of the last video frame, the video progress jump request cannot conflict with the rendering and displaying of the last video frame, so that the target video frame corresponding to the first timestamp can be rendered and displayed. Compared with the prior art that when a plurality of video progress jump requests are faced, the last video progress jump request is usually processed, more video progress jump requests which can be realized and can not conflict are screened out in the process of continuously sliding the video progress bar on the upper layer, so that more video frames can be rendered and displayed as much as possible, the video frames are smoother in the process of sliding the progress bar, and the watching experience of a user is improved.
Referring to fig. 7, fig. 7 is a schematic structural diagram of another video display apparatus disclosed in the embodiment of the present application, the video display apparatus may be applied to the electronic device, the video display apparatus shown in fig. 7 may be optimized from the video display apparatus shown in fig. 6, and compared with the video display apparatus shown in fig. 6, the video display apparatus shown in fig. 7 may further include: an ignoring unit 603 and a first determining unit 604, wherein:
an ignoring unit 603, configured to, when the calculating unit 601 receives multiple skip requests for a video schedule, obtain a first timestamp pointed by a current skip request, and calculate an interval duration between the first timestamp and a second timestamp, where the second timestamp is a timestamp corresponding to a last rendered first video frame corresponding to the first timestamp, and ignore the current skip request if the interval duration is not greater than the rendering duration;
a first determining unit 604, configured to, when the current jump request is not the last jump request, take the next jump request as the current jump request, and continue to perform the step of obtaining the first timestamp pointed by the current jump request.
By implementing the video display device, the skip request generated by the video frame which is rendered and displayed last can be ignored, so that the display conflict between the video frames is avoided, and the screen is prevented from being jammed.
As an optional implementation manner, the manner that the display unit 602 is configured to render and display the second video frame corresponding to the first timestamp may specifically be:
a display unit 602, configured to obtain a timestamp range corresponding to stored first decapsulated video data, where the timestamp range is a timestamp range from a third timestamp corresponding to first frame decapsulated video data in the first decapsulated video data to a fourth timestamp corresponding to last frame decapsulated video data in the first decapsulated video data; and if the first timestamp is within the timestamp range, determining a second video frame corresponding to the first timestamp in the first de-encapsulation video data, and rendering and displaying the second video frame.
By implementing the video display device, the video frame corresponding to the first timestamp can be accurately determined from the stored first decapsulated video data for rendering display, so that the video display efficiency is improved.
As an optional implementation manner, the manner that the display unit 602 is configured to determine the second video frame corresponding to the first timestamp in the first decapsulated video data may specifically be:
a display unit 602, configured to determine target decapsulated video data from the first decapsulated video data; decoding the target decapsulated video data to obtain a target video frame; calculating the sum of the corresponding timestamp of the target video frame and the rendering duration of the target video frame to obtain the display time of the target video frame; if the display time is larger than the first timestamp, determining the target video frame as a second video frame; and if the display time is not greater than the timestamp and the target decapsulated video data is not the last frame decapsulated video data in the first decapsulated video data, taking next frame decapsulated data of the target decapsulated video data as new target decapsulated video data, and performing decoding on the target decapsulated video data to obtain a target video frame until the second video frame is determined.
By implementing the video display device, whether the display time stamp of the target video frame obtained by decoding is greater than the first time stamp can be judged to determine from which first decapsulated video data the electronic equipment starts to perform decoding display; in addition, video frames with display timestamps not greater than the first timestamp may also be dropped to avoid the video frame displaying a frame that the user does not need to display.
As an optional implementation manner, the manner that the display unit 602 is configured to determine the target decapsulated video data pair from the first decapsulated video data may specifically be:
a displaying unit 602, configured to determine, when the current skip request is a forward skip, decapsulated video data of a next frame in the first decapsulated video data with respect to the second timestamp as target decapsulated video data.
By implementing the video display device, the electronic equipment can be prevented from repeatedly decoding from the first decapsulated video data, so that the video display efficiency is improved.
As an optional implementation manner, the manner that the display unit 602 is configured to determine the target decapsulated video data pair from the first decapsulated video data may specifically be:
a displaying unit 602, configured to determine, when the current jump request is a backward jump, first frame decapsulation data in the first decapsulated video data as target decapsulated video data.
By implementing the video display device, the electronic equipment can be prevented from repeatedly decoding from the first decapsulated video data, so that the video display efficiency is improved.
As an alternative embodiment, the video display apparatus shown in fig. 7 may further include: a second determining unit 605, a third determining unit 606 and a rendering unit 607, wherein:
a second determining unit 605, configured to determine, after the display unit 602 acquires the timestamp range corresponding to the stored first decapsulated video data, if the first timestamp is not within the timestamp range, a target key video frame from a plurality of key video frames included in the video file, where the target key video frame is a key video frame whose timestamp is before the first timestamp and is closest to the first timestamp;
a third determining unit 606, configured to decapsulate second decapsulated video data corresponding to the target key video frame in the video file, and determine a second video frame corresponding to the first timestamp in the second decapsulated data;
and a rendering unit 607, configured to render and display the second video frame.
By implementing the video display device, when the first timestamp is not within the timestamp range corresponding to the first decapsulated video data, decapsulated data including the second video frame from the video file and a subsequent decoding and displaying step can be performed.
As an alternative embodiment, the video display apparatus shown in fig. 7 may further include: a fourth determination unit 608 and a fifth determination unit 609, wherein:
a fourth determining unit 608, configured to determine that the first timestamp is not within the timestamp range if the current skip request is a forward skip and the first timestamp is greater than the fourth timestamp after the display unit 602 acquires the timestamp range corresponding to the stored first decapsulated video data, and determine that the first timestamp is within the timestamp range if the first timestamp is not greater than the fourth timestamp;
a fifth determining unit 609, configured to determine, after the display unit 602 acquires the timestamp range corresponding to the stored first decapsulated video data, that the first timestamp is not within the timestamp range if the current skip request is a backward skip request and the first timestamp is smaller than the third timestamp, and determine that the first timestamp is within the timestamp range if the first timestamp is not smaller than the third timestamp.
By implementing the video display device, whether the first timestamp is in the timestamp range corresponding to the first decapsulated video data or not can be accurately determined, so that the subsequent video frame decoding and displaying step can be more accurately executed, and the video display efficiency is improved.
As an alternative embodiment, the video display apparatus shown in fig. 7 may further include: a judging unit 610, a first decapsulating unit 611, and a second decapsulating unit 612, wherein:
a determining unit 610, configured to determine whether a duration corresponding to a group of pictures included in the video file is greater than a first duration before the displaying unit 602 obtains a timestamp range corresponding to the stored first decapsulated video data, where the duration corresponding to the group of pictures is a timestamp difference between two adjacent key video frames;
a first decapsulating unit 611, configured to decapsulate, if a duration corresponding to a frame group is greater than or equal to a first duration, video data with a duration corresponding to one frame group from a video file, obtain first decapsulated data, and store the decapsulated data;
a second decapsulating unit 612, configured to decapsulate, if the duration corresponding to the group of pictures is less than the first duration, the video data corresponding to the first duration from the video file, obtain and store the first decapsulated data.
By implementing the video display device, the video data with more appropriate quantity can be decapsulated from the video file, so that the electronic equipment is prevented from frequently performing decapsulation operation, and the video display efficiency is improved.
As an optional implementation manner, when the duration of the interval between the first timestamp and the second timestamp is longer than the rendering duration of the first video frame, the manner of rendering and displaying the second video frame corresponding to the first timestamp may specifically be:
a display unit 602, configured to store the first timestamp in a timestamp queue if an interval duration between the first timestamp and the second timestamp is greater than a duration for rendering and displaying the video frame; and acquiring the latest stored first timestamp from the timestamp set, and rendering and displaying a second video frame corresponding to the latest stored first timestamp.
By implementing the video display device, the latest stored first timestamp can be acquired from the timestamp set, and the second video frame corresponding to the latest stored first timestamp can be rendered and displayed. Thereby ensuring that the video picture is the most effective picture.
As an alternative embodiment, the video display apparatus shown in fig. 7 may further include: an emptying unit 613, in which:
a clearing unit 613, configured to clear the plurality of first timestamps stored in the timestamp queue after the display unit 602 acquires the most recently stored first timestamp from the timestamp set.
By implementing the video display device, the effectiveness of the first time stamp stored in the time stamp queue can be ensured.
Referring to fig. 8, fig. 8 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure. As shown in fig. 8, the electronic device may include: a memory 801 in which executable program code is stored; a processor 802 coupled with the memory 801; the processor 802 calls the executable program code stored in the memory 801 to execute the video display method disclosed in the above embodiments.
The embodiment of the application discloses a computer readable storage medium, which stores a computer program, wherein the computer program enables a computer to execute the video display method disclosed by each embodiment.
The embodiment of the present application further discloses an application publishing platform, wherein the application publishing platform is used for publishing a computer program product, and when the computer program product runs on a computer, the computer is caused to execute part or all of the steps of the method in the above method embodiments.
It should be appreciated that reference throughout this specification to "one embodiment" or "an embodiment" means that a particular feature, structure or characteristic described in connection with the embodiment is included in at least one embodiment of the present application. Thus, the appearances of the phrases "in one embodiment" or "in an embodiment" in various places throughout this specification are not necessarily all referring to the same embodiment. Furthermore, the particular features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. Those skilled in the art should also appreciate that the embodiments described in this specification are all alternative embodiments and that the acts and modules involved are not necessarily required for this application.
In various embodiments of the present application, it should be understood that the sequence numbers of the above-mentioned processes do not imply a necessary order of execution, and the order of execution of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated units, if implemented as software functional units and sold or used as a stand-alone product, may be stored in a computer accessible memory. Based on such understanding, the technical solution of the present application, which is a part of or contributes to the prior art in essence, or all or part of the technical solution, may be embodied in the form of a software product, stored in a memory, including several requests for causing a computer device (which may be a personal computer, a server, a network device, or the like, and may specifically be a processor in the computer device) to execute part or all of the steps of the above-described method of the embodiments of the present application.
It will be understood by those skilled in the art that all or part of the steps of the methods of the embodiments described above may be implemented by associated hardware instructed by a program, which may be stored in a computer-readable storage medium, including Read-Only Memory (ROM), random Access Memory (RAM), programmable Read-Only Memory (PROM), erasable Programmable Read-Only Memory (EPROM), one-time Programmable Read-Only Memory (OTPROM), electrically Erasable Programmable Read-Only Memory (EEPROM), a Compact Disc-Read-Only Memory (CD-ROM) or other Memory capable of storing data, a magnetic tape, or any other computer-readable medium capable of storing data.
The video display method and apparatus, the electronic device, and the computer-readable storage medium disclosed in the embodiments of the present application are introduced in detail, and specific examples are applied herein to illustrate the principles and implementations of the present application, and the descriptions of the embodiments are only used to help understand the method and the core ideas of the present application; meanwhile, for a person skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.

Claims (14)

1. A method for video display, the method comprising:
when a plurality of jump requests aiming at video progress are received, acquiring a first timestamp pointed by the current jump request, and calculating the interval duration between the first timestamp and a second timestamp, wherein the second timestamp is a timestamp corresponding to a first video frame which is rendered last relative to the first timestamp;
if the interval duration is longer than the rendering duration of the first video frame, rendering and displaying a second video frame corresponding to the first timestamp;
and if the interval duration is not greater than the rendering duration of the first video frame, ignoring the current jump request.
2. The method of claim 1, wherein after said calculating the duration of the interval between the first timestamp and the second timestamp, the method further comprises:
and if the current jump request is not the last jump request, taking the next jump request as the current jump request, and continuously executing the step of acquiring the first timestamp pointed by the current jump request.
3. The method according to claim 1, wherein the rendering and displaying the second video frame corresponding to the first timestamp comprises:
acquiring a timestamp range corresponding to stored first decapsulated video data, where the timestamp range is a time range from a third timestamp corresponding to first frame decapsulated video data in the first decapsulated video data to a fourth timestamp corresponding to last frame decapsulated video data in the first decapsulated video data;
and if the first timestamp is within the timestamp range, determining a second video frame corresponding to the first timestamp in the first decapsulated video data, and rendering and displaying the second video frame.
4. The method of claim 3, wherein determining the second video frame corresponding to the first timestamp in the first decapsulated video data comprises:
determining target decapsulated video data from the first decapsulated video data;
decoding the target decapsulated video data to obtain a target video frame;
calculating the sum of the time stamp corresponding to the target video frame and the rendering duration of the target video frame to obtain the display time of the target video frame;
if the display time is greater than the first timestamp, determining the target video frame as a second video frame;
and if the display time is not greater than the first timestamp and the target decapsulated video data is not the last frame decapsulated video data in the first decapsulated video data, taking next frame decapsulated data of the target decapsulated video data as new target decapsulated video data, and executing the step of decoding the target decapsulated video data to obtain a target video frame until the second video frame is determined.
5. The method of claim 4, wherein the determining the target decapsulated video data from the first decapsulated video data comprises:
and if the current jump request is forward jump, determining the next frame of decapsulated video data relative to the second timestamp in the first decapsulated video data as target decapsulated video data.
6. The method of claim 4, wherein the determining the target decapsulated video data from the first decapsulated video data comprises:
and if the current jump request is backward jump, determining the first frame decapsulated video data in the first decapsulated video data as target decapsulated video data.
7. The method of claim 3, wherein after the obtaining the timestamp range corresponding to the stored first decapsulated video data, the method further comprises:
if the first timestamp is not within the timestamp range, determining a target key video frame from a plurality of key video frames included in a video file, wherein the target key video frame is a key video frame of which the timestamp is in front of the first timestamp and is closest to the first timestamp;
decapsulating second decapsulated video data corresponding to the target key video frame in the video file, and determining a second video frame corresponding to the first timestamp in the second decapsulated data;
and rendering and displaying the second video frame.
8. The method of claim 7, wherein after the obtaining of the timestamp range corresponding to the stored first decapsulated video data, the method further comprises:
when the current jump request is forward jump, if the first timestamp is greater than the fourth timestamp, determining that the first timestamp is not in the timestamp range, and if the first timestamp is not greater than the fourth timestamp, determining that the first timestamp is in the timestamp range;
when the current jump request is a backward jump, if the first timestamp is smaller than the third timestamp, determining that the first timestamp is not in the timestamp range, and if the first timestamp is not smaller than the third timestamp, determining that the first timestamp is in the timestamp range.
9. The method according to any one of claims 3 to 8, wherein before the obtaining the timestamp range corresponding to the stored first decapsulated video data, the method further comprises:
judging whether the time length corresponding to a picture group included in a video file is greater than a first time length or not, wherein the time length corresponding to the picture group is a timestamp difference value of two adjacent key video frames;
if the duration corresponding to the frame group is greater than or equal to the first duration, decapsulating video data of the duration corresponding to one frame group from the video file to obtain first decapsulated data and storing the decapsulated data;
and if the duration corresponding to the frame group is less than the first duration, decapsulating the video data corresponding to the first duration from the video file to obtain first decapsulated data and storing the decapsulated data.
10. The method according to claim 1, wherein rendering and displaying the second video frame corresponding to the first timestamp if the interval duration is greater than a duration required for rendering and displaying the video frame comprises:
if the interval duration is longer than the duration of rendering display of the video frame, storing the first timestamp in a timestamp queue;
and acquiring a first timestamp which is stored recently from the timestamp queue, and rendering and displaying a second video frame corresponding to the first timestamp which is stored recently.
11. The method of claim 10, wherein after said retrieving a most recently stored first timestamp from the timestamp queue and before said rendering a second video frame corresponding to the most recently stored first timestamp, the method further comprises:
emptying the plurality of first timestamps stored by the timestamp queue.
12. A video display apparatus, comprising:
the computing unit is used for acquiring a first timestamp pointed by a current skip request when a plurality of skip requests aiming at video progress are received, and computing the interval duration between the first timestamp and a second timestamp, wherein the second timestamp is a timestamp corresponding to a first video frame rendered last relative to the first timestamp;
the display unit is used for rendering and displaying a second video frame corresponding to the first timestamp when the interval duration is longer than the rendering duration of the first video frame;
and the ignoring unit is used for ignoring the current jump request when the interval duration is not greater than the rendering duration of the first video frame.
13. An electronic device comprising a memory storing executable program code, and a processor coupled to the memory; wherein the processor calls the executable program code stored in the memory to execute the video display method of any one of claims 1 to 11.
14. A computer-readable storage medium storing a computer program, wherein the computer program causes a computer to execute the video display method according to any one of claims 1 to 11.
CN202011378983.4A 2020-11-30 2020-11-30 Video display method and device, electronic equipment and computer readable storage medium Active CN112601127B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011378983.4A CN112601127B (en) 2020-11-30 2020-11-30 Video display method and device, electronic equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011378983.4A CN112601127B (en) 2020-11-30 2020-11-30 Video display method and device, electronic equipment and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN112601127A CN112601127A (en) 2021-04-02
CN112601127B true CN112601127B (en) 2023-03-24

Family

ID=75187338

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011378983.4A Active CN112601127B (en) 2020-11-30 2020-11-30 Video display method and device, electronic equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN112601127B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115225940B (en) * 2021-04-15 2023-07-28 青岛海信宽带多媒体技术有限公司 Set top box and set top box page display method
CN113747237B (en) * 2021-08-31 2023-03-17 深信服科技股份有限公司 Data processing method and device, electronic equipment and storage medium
CN113965786B (en) * 2021-09-29 2024-03-26 杭州当虹科技股份有限公司 Method for precisely controlling video output playing
CN117640818A (en) * 2022-08-26 2024-03-01 荣耀终端有限公司 Screen projection method and device

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100539697C (en) * 2005-12-27 2009-09-09 联发科技股份有限公司 Method for processing video frequency
US8930570B1 (en) * 2011-01-25 2015-01-06 Visualon, Inc. Processing video in advance to maintain video synchronization
CN104915200A (en) * 2014-10-20 2015-09-16 晶晨半导体(上海)有限公司 Video frame treatment in mobile operating system
CN108769815A (en) * 2018-06-21 2018-11-06 威盛电子股份有限公司 Method for processing video frequency and its device
CN109379624A (en) * 2018-11-27 2019-02-22 Oppo广东移动通信有限公司 Method for processing video frequency, device, electronic equipment and storage medium
CN110234031A (en) * 2018-03-05 2019-09-13 青岛海信传媒网络技术有限公司 A kind of method and device of media play

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050028213A1 (en) * 2003-07-31 2005-02-03 International Business Machines Corporation System and method for user-friendly fast forward and backward preview of video

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100539697C (en) * 2005-12-27 2009-09-09 联发科技股份有限公司 Method for processing video frequency
US8930570B1 (en) * 2011-01-25 2015-01-06 Visualon, Inc. Processing video in advance to maintain video synchronization
CN104915200A (en) * 2014-10-20 2015-09-16 晶晨半导体(上海)有限公司 Video frame treatment in mobile operating system
CN110234031A (en) * 2018-03-05 2019-09-13 青岛海信传媒网络技术有限公司 A kind of method and device of media play
CN108769815A (en) * 2018-06-21 2018-11-06 威盛电子股份有限公司 Method for processing video frequency and its device
CN109379624A (en) * 2018-11-27 2019-02-22 Oppo广东移动通信有限公司 Method for processing video frequency, device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN112601127A (en) 2021-04-02

Similar Documents

Publication Publication Date Title
CN112601127B (en) Video display method and device, electronic equipment and computer readable storage medium
US20140304730A1 (en) Methods and apparatus for mandatory video viewing
CN111316659A (en) Dynamically reducing playout of substitute content to help align the end of substitute content with the end of replaced content
US10063937B2 (en) Methods for serving a video advertisement to a user
US20100247066A1 (en) Method and apparatus for reverse playback of encoded multimedia content
EP3142381A1 (en) Network video playing method and device
CN112055254B (en) Video playing method, device, terminal and storage medium
CN110636321A (en) Data processing method, device, system, mobile terminal and storage medium
JP6043825B2 (en) Information processing apparatus, information processing method, information processing program, and distribution apparatus
CN110913272A (en) Video playing method and device, computer readable storage medium and computer equipment
CN112087665A (en) Previewing method of live video, computing equipment and computer storage medium
CN110996157A (en) Video playing method and device, electronic equipment and machine-readable storage medium
KR20160088803A (en) Video playback control program, video playback control method, video delivery server, transmission program and transmission apparatus
US9055272B2 (en) Moving image reproduction apparatus, information processing apparatus, and moving image reproduction method
CN106331871B (en) Method and device for realizing fast forward or fast backward of video stream
KR101742420B1 (en) Video data file generation program, video data file generation method and video data file generation apparatus
CN113014981A (en) Video playing method and device, electronic equipment and readable storage medium
US10469794B2 (en) Information processing apparatus, information processing method, and information processing system for content management using play lists
CN112711726B (en) Method, device, computer equipment and storage medium for caching video data
CN114827724A (en) Video playing method and related equipment
CN111182363B (en) Multimedia content playing control method, device, equipment and medium
EP2810446B1 (en) Methods and systems for providing file data for a media file
US11960444B2 (en) Methods and systems for providing file data for a media file
CN112351314B (en) Multimedia information playing method, server, terminal, system and storage medium
CN116309971A (en) Animation playing method and 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
GR01 Patent grant
GR01 Patent grant