WO2022156166A1 - 进度拖动过程中的视频文件播放方法及装置 - Google Patents

进度拖动过程中的视频文件播放方法及装置 Download PDF

Info

Publication number
WO2022156166A1
WO2022156166A1 PCT/CN2021/106958 CN2021106958W WO2022156166A1 WO 2022156166 A1 WO2022156166 A1 WO 2022156166A1 CN 2021106958 W CN2021106958 W CN 2021106958W WO 2022156166 A1 WO2022156166 A1 WO 2022156166A1
Authority
WO
WIPO (PCT)
Prior art keywords
video
frame
time
target time
pixel data
Prior art date
Application number
PCT/CN2021/106958
Other languages
English (en)
French (fr)
Inventor
刘志杰
林炳河
龚浩
Original Assignee
稿定(厦门)科技有限公司
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 稿定(厦门)科技有限公司 filed Critical 稿定(厦门)科技有限公司
Publication of WO2022156166A1 publication Critical patent/WO2022156166A1/zh

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/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/4302Content synchronisation processes, e.g. decoder synchronisation
    • H04N21/4307Synchronising the rendering of multiple content streams or additional data on devices, e.g. synchronisation of audio on a mobile phone with the video output on the TV screen
    • 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/433Content storage operation, e.g. storage operation in response to a pause request, caching operations
    • 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
    • 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/482End-user interface for program selection
    • H04N21/4825End-user interface for program selection using a list of items to be played back in a given order, e.g. playlists

Definitions

  • the present invention relates to the technical field of player control, in particular to a video file playing method during a progress dragging process, a computer-readable storage medium, a computer device and a video file playing device during an extreme dragging process.
  • the user In the process of the player playing the video, the user often skips the current video frame as needed to fast forward to the video frame they want to watch, or rewind to the played video frame; and these operations , often achieved by dragging.
  • the search logic needs to be performed; that is, each time the user drags, the corresponding key frame needs to be searched, and the target video frame is decoded according to the key frame; resulting in video frame synchronization.
  • the update is slow, and the real-time update of the screen cannot be performed.
  • an object of the present invention is to propose a method for playing video files during the progress dragging process, which can avoid repeated decoding of video frames and improve the real-time performance of video picture update during the progress dragging process.
  • a second object of the present invention is to provide a computer-readable storage medium.
  • the third object of the present invention is to propose a computer device.
  • the fourth object of the present invention is to provide a video file playback device in the process of progress dragging.
  • the embodiment of the first aspect of the present invention proposes a method for playing a video file during a progress dragging process, including the following steps: acquiring a video file sent by a user, Decode the video frame, and cache the decoded frame pixel data in the first buffer queue; during the playback of the video, obtain the user's dragging instruction through the video stream rendering thread, and obtain the dragging instruction according to the dragging instruction Query the first cache queue according to the target time, to judge whether the frame pixel data corresponding to the target time is stored in the first cache queue according to the query result; if the first cache queue is stored in the first cache queue If there is no frame pixel data corresponding to the target time, obtain the current video frame time of the decoding thread according to the drag instruction, and traverse the video key frame list to obtain the first key frame time corresponding to the target time and the current video frame time The second key frame time corresponding to the video frame time; determine whether the first key frame time is consistent with the second key frame time; if so,
  • a video file sent by a user is acquired, and the video frame in the video file is decoded by a video stream decoding thread, and the decoded frame is decoded.
  • the pixel data is cached in the first cache queue; then, during the playback of the video, the user's dragging instruction is obtained through the video stream rendering thread, and the target time corresponding to the dragging behavior is obtained according to the dragging instruction; then, according to The target time queries the first cache queue to determine whether the first cache queue stores the frame pixel data corresponding to the target time according to the query result; frame pixel data, obtain the current video frame time of the decoding thread according to the drag instruction, and traverse the video key frame list to obtain the first key frame time corresponding to the target time and the first key frame time corresponding to the current video frame time.
  • Two key frame times determine whether the first key frame time is consistent with the second key frame time; then, if so, the video stream rendering thread enters a waiting state, and the first cache queue
  • the video frame corresponding to the target time is rendered according to the frame pixel data, thereby avoiding the repeated decoding of the video frame and improving the real-time performance of the video screen update during the progress dragging process.
  • the method for playing a video file during a progress dragging process proposed according to the foregoing embodiments of the present invention may also have the following additional technical features.
  • the video stream rendering thread acquires the frame pixel data, and renders the video frame corresponding to the target time according to the frame pixel data.
  • the video stream rendering thread generates a search instruction, where the search instruction includes the first key frame time.
  • decoding the video file through a video stream decoding thread, and buffering the decoded frame pixel data into the first buffer queue includes: the video stream decoding thread traverses the video key frame list, so that according to the The key frame list decodes the video frame; judges whether there is a search instruction currently; if so, clears the first cache queue, and searches for the corresponding first key frame according to the first key frame time in the search instruction; according to the The first key frame decodes the next video frame, and after the decoding is completed, the next video frame is stored in the first buffer queue, and after the storage is completed, the current video frame is updated according to the playback time of the next video frame. time.
  • the audio frame is decoded by the audio stream decoding thread, and the decoded audio data is stored in the second buffer queue;
  • the second buffer queue is obtained through the audio stream playback thread and stored in the second buffer queue. the audio data, and play the audio data.
  • the user's dragging instruction is acquired through the audio stream decoding thread, the target time corresponding to the dragging behavior is acquired according to the dragging instruction, and the corresponding audio frame is acquired according to the target time.
  • the second aspect of the present invention provides a computer-readable storage medium, which stores a video file playback program in the progress dragging process, and the video file playback program in the progress dragging process is processed.
  • the browser is executed, the above-mentioned video file playing method in the progress dragging process is realized.
  • the processor by storing the video file playing program during the progress dragging process, the processor can realize the above-mentioned progress dragging when executing the video file playing program during the progress dragging process.
  • the video file playback method in the moving process is implemented; thus avoiding the repeated decoding of video frames and improving the real-time performance of the video screen update during the progress dragging process.
  • the embodiments of the present invention provide a computer device, including a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that the processor executes the program , implement the video file playback method in the progress dragging process as described above.
  • the video file playing program in the progress dragging process is stored in the memory, so that the processor can realize the above-mentioned progress dragging when executing the video file playing program in the progress dragging process.
  • the video file playback method in the moving process is implemented; thus avoiding the repeated decoding of video frames and improving the real-time performance of the video screen update during the progress dragging process.
  • the embodiment of the present invention proposes a video file playing device in a progress dragging process, including: an acquisition module, the acquisition module is used to acquire a video file sent by a user; a video stream decoding module, the The video stream decoding module is used to decode the video frame in the video file, and buffer the decoded frame pixel data to the first buffer queue; the video stream rendering module, the video stream rendering module is used for playing in the video
  • the user's dragging instruction is obtained through the video stream rendering thread, and the target time corresponding to the dragging behavior is obtained according to the dragging instruction;
  • the video stream rendering module is also used to query the first cache according to the target time.
  • the motion instruction obtains the current video frame time of the decoding thread, and traverses the video key frame list to obtain the first key frame time corresponding to the target time and the second key frame time corresponding to the current video frame time; the video stream
  • the rendering module determines whether the time of the first key frame is consistent with the time of the second key frame, and if they are consistent, it enters a waiting state, and after the frame pixel data corresponding to the target time is stored in the first cache queue, according to The frame of pixel data renders the video frame corresponding to the target time.
  • the acquisition module is configured to acquire the video file sent by the user;
  • the video stream decoding module is used to decode the video frame in the video file, and to The decoded frame pixel data is cached in the first cache queue;
  • the video stream rendering module is used to obtain the user's dragging instruction through the video stream rendering thread during the playback of the video, and obtain the dragging behavior according to the dragging instruction The corresponding target time;
  • the video stream rendering module is also used to query the first buffer queue according to the target time, so as to determine whether the frame pixel data corresponding to the target time is stored in the first buffer queue according to the query result, and store the pixel data in the first buffer queue according to the query result.
  • the video stream rendering module judges whether the first key frame time and the second key frame time are consistent, if they are consistent, enter the waiting state, and in the After the frame pixel data corresponding to the target time is stored in the first cache queue, the video frame corresponding to the target time is rendered according to the frame pixel data; thereby avoiding the repeated decoding of the video frame and improving the progress of the video frame in the dragging process. Real-time updates.
  • the device for playing a video file in a progress dragging process proposed according to the above embodiments of the present invention may also have the following additional technical features.
  • the video stream rendering thread acquires the frame pixel data, and renders the video frame corresponding to the target time according to the frame pixel data.
  • FIG. 1 is a schematic flowchart of a method for playing a video file during a progress dragging process according to an embodiment of the present invention.
  • FIG. 2 is a schematic diagram of a decoding process of a video stream decoding thread according to an embodiment of the present invention.
  • FIG. 3 is a schematic block diagram of an apparatus for playing a video file during a progress dragging process according to an embodiment of the present invention.
  • the video sent by the user is obtained. file, and decode the video frame in the video file by the video stream decoding thread, and buffer the decoded frame pixel data to the first buffer queue; then, in the video playback process, obtain by the video stream rendering thread
  • the user's dragging instruction, and the target time corresponding to the dragging behavior is obtained according to the dragging instruction; then, the first cache queue is queried according to the target time, so as to determine whether the first cache queue is stored in the first cache queue according to the query result.
  • the frame pixel data corresponding to the target time then, if the frame pixel data corresponding to the target time does not exist in the first cache queue, obtain the current video frame time of the decoding thread according to the drag instruction, and traverse the video key frame list to obtain the first key frame time corresponding to the target time and the second key frame time corresponding to the current video frame time; then, determine whether the first key frame time and the second key frame time are Then, if so, the video stream rendering thread enters a waiting state, and after storing the frame pixel data corresponding to the target time in the first buffer queue, the video frame corresponding to the target time is stored according to the frame pixel data. Rendering; thus avoiding the repeated decoding of video frames and improving the real-time performance of video screen updates during the progress dragging process.
  • FIG. 1 is a schematic flowchart of a method for playing a video file during a progress dragging process according to an embodiment of the present invention; as shown in FIG. 1 , the method for playing a video file during the progress dragging process includes the following steps.
  • S101 Acquire a video file sent by a user, decode a video frame in the video file through a video stream decoding thread, and cache the decoded frame pixel data in a first buffer queue.
  • the video decoder traverses the video key frame list (it can be understood that in the video compression technology
  • the video frame includes key frame, prediction frame and bidirectional prediction frame; among them, the key frame is a full-frame compression coding frame; the prediction frame is to compress the transmission data volume by sufficiently reducing the temporal redundancy information of the previous coded frames in the image sequence
  • the prediction frame takes the key frame as the reference frame, and the complete video frame can be obtained;
  • the bidirectional prediction frame not only considers the coded frame before the source image sequence, but also considers the temporal redundancy between the coded frames after the source image sequence and decode the corresponding next video frame according to the key frame, and after the decoding is completed, buffer the obtained frame pixel data in the first buffer queue; wherein, after the buffering is completed , the video decoder can update the current video frame time to identify the working state of the
  • the user can perform fast-forward or fast-rewind operations according to their own needs.
  • the video stream rendering thread obtains the user's drag command, and obtains the target time corresponding to the drag behavior according to the drag command, which is the target video frame of the user's fast-forward or fast-rewind time.
  • first query the first cache queue according to the target time to determine whether the frame pixel data corresponding to the target time is stored in the first cache queue;
  • the frame pixel data corresponding to the target time stored in the queue is obtained to render the video frame corresponding to the target time according to the frame pixel data; instead of obtaining the key frame according to the target time, and then decoding according to the key frame, to The video frame corresponding to the target time is acquired; thus, repeated decoding behavior of the video frame can be avoided, and the synchronization efficiency of the video frame during the user's dragging process can be improved.
  • S105 Determine whether the first key frame time is consistent with the second key frame time.
  • the video stream rendering thread enters a waiting state, and after the frame pixel data corresponding to the target time is stored in the first buffer queue, the video frame corresponding to the target time is rendered according to the frame pixel data.
  • the frame pixel data corresponding to the target time does not exist in the first buffer queue, it means that the key frame on which the video decoder is currently decoding is different from the key frame corresponding to the target time;
  • the key frame on which the decoding behavior is based is the same as the key frame corresponding to the target time, but the video frame corresponding to the target time has not been decoded according to its decoding order; therefore, first, obtain the current video frame time of the decoding thread according to the drag command , and traverse the video key frame list to obtain the first key frame time corresponding to the target time and the second key frame time corresponding to the current video frame time; then, determine whether the first key frame time and the second key frame time are consistent; if If they are consistent, it means that the key frame on which the current decoding behavior of the video decoder is based is the same as the key frame corresponding to the target time, but the video frame corresponding to the target time has not been decoded according to its decoding order; further, the video stream rendering thread
  • the video stream rendering thread obtains the frame pixel data and performs the target time corresponding to the data. Rendering of video frames; thus, it is possible to prevent repeated decoding of decoded video frames; and improve the efficiency of video frame decoding during video dragging.
  • the video stream rendering thread if the first keyframe time is inconsistent with the second keyframe time, the video stream rendering thread generates a lookup instruction, wherein the lookup instruction includes the first keyframe time.
  • the time of the first key frame is inconsistent with the time of the second key frame, it means that the key frame on which the current decoding behavior of the video decoder is based is different from the key frame corresponding to the target time; then the video stream rendering thread generates a search instruction, In order for the video stream decoding thread to know that the key frame needs to be changed currently according to the search instruction, the key frame can be reselected.
  • decoding the video file by the video stream decoding thread, and buffering the decoded frame pixel data into the first buffer queue includes: the video stream decoding thread traverses the video key frame list, so as to perform the decoding process according to the key frame list. Decoding of video frames; judging whether there is a current search command; if so, clear the first cache queue, and search for the corresponding first key frame according to the first key frame time in the search command; perform the next video according to the first key frame The frame is decoded, and the next video frame is stored in the first buffer queue after the decoding is completed, and the current video frame time is updated according to the playback time of the next video frame after the storage is completed.
  • the decoding process of the video stream decoding thread is:
  • step S203 determine whether there is a search instruction currently; if yes, go to step S205; if not, go to step S204.
  • step S204 decode the video frame to be decoded; and perform step S207 after the decoding is completed.
  • step S206 determining the video frame to be decoded according to the first key frame, and returning to step S204.
  • step S209 Determine whether the decoding task has been completed according to the current video frame time; if yes, execute step S210; if not, return to step S202.
  • the logic of audio and video production and consumption needs to be synchronized and waited with each other, which will increase the complexity of processing logic; and will cause unnecessary waiting until Time-consuming, thus reducing the decoding efficiency of the video; therefore, the decoding thread of the audio stream and the decoding thread of the video stream are separated to realize the independent processing of audio/video decoding, consumption Seek and other logics; improve the decoding efficiency of the video.
  • the audio frame is decoded by the audio stream decoding thread, and the decoded audio data is stored in the second buffer queue; the audio stream playback thread is used to obtain the data stored in the second buffer queue. audio data, and play the audio data.
  • the user's dragging instruction is acquired through the audio stream decoding thread, the target time corresponding to the dragging behavior is acquired according to the dragging instruction, and the corresponding audio frame is acquired according to the target time.
  • audio frames are not distinguished by key frames, predicted frames, etc.; and the decoding speed of audio is relatively fast. Therefore, after obtaining the drag command sent by the user, the corresponding target time can be obtained according to the user's drag command, and , the audio frame corresponding to the target time is decoded by the audio decoding thread; after the decoding is completed, the decoded audio data is buffered in the second buffer queue, so that the audio stream playing thread can play the audio after taking it.
  • a video file sent by a user is acquired, and a video frame in the video file is decoded by a video stream decoding thread, and Cache the decoded frame pixel data to the first cache queue; then, during the playback of the video, obtain the user's dragging instruction through the video stream rendering thread, and obtain the target corresponding to the dragging behavior according to the dragging instruction time; then, query the first cache queue according to the target time, to judge whether the frame pixel data corresponding to the target time is stored in the first cache queue according to the query result; then, if there is no frame pixel data in the first cache queue If there is frame pixel data corresponding to the target time, obtain the current video frame time of the decoding thread according to the drag instruction, and traverse the video key frame list to obtain the first key frame time corresponding to the target time and the current video The second key frame time corresponding to the frame time; then, determine whether
  • the embodiment of the present invention proposes a computer-readable storage medium on which a video file playing program in a progress dragging process is stored, and the video file playing program in the progress dragging process is executed by a processor When implementing the above-mentioned video file playback method during the progress dragging process.
  • the processor by storing the video file playing program during the progress dragging process, the processor can realize the above-mentioned progress dragging when executing the video file playing program during the progress dragging process.
  • the video file playback method in the moving process is implemented; thus avoiding the repeated decoding of video frames and improving the real-time performance of the video screen update during the progress dragging process.
  • the embodiments of the present invention provide a computer device, including a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that the processor executes the program , implement the video file playback method in the progress dragging process as described above.
  • the video file playing program in the progress dragging process is stored in the memory, so that the processor can realize the above-mentioned progress dragging when executing the video file playing program in the progress dragging process.
  • the video file playback method in the moving process is implemented; thus avoiding the repeated decoding of video frames and improving the real-time performance of the video screen update during the progress dragging process.
  • the embodiment of the present invention proposes a video file playing device during the progress dragging process.
  • the video file playing device during the progress dragging process includes: an acquisition module 10, a video stream A decoding module 20 and a video stream rendering module 30 .
  • the obtaining module 10 is used for obtaining the video file sent by the user.
  • the video stream decoding module 20 is used for decoding the video frame in the video file, and buffering the decoded frame pixel data into the first buffer queue.
  • the video stream rendering module 30 is configured to acquire the user's drag instruction through the video stream rendering thread during the video playback process, and acquire the target time corresponding to the drag behavior according to the drag instruction.
  • the video stream rendering module 30 is further configured to query the first buffer queue according to the target time, so as to determine whether the frame pixel data corresponding to the target time is stored in the first buffer queue according to the query result, and there is no target time in the first buffer queue.
  • the video stream rendering module 30 obtain the current video frame time of the decoding thread according to the drag command, and traverse the video key frame list to obtain the first key frame time corresponding to the target time and the second key frame time corresponding to the current video frame time.
  • the video stream rendering module 30 determines whether the time of the first key frame is consistent with the time of the second key frame, and if they are consistent, it enters a waiting state, and after storing the frame pixel data corresponding to the target time in the first cache queue, according to the frame pixel data The data renders the video frame corresponding to the target time.
  • the video stream rendering thread acquires the frame pixel data, and renders the video frame corresponding to the target time according to the frame pixel data.
  • the acquisition module is configured to acquire the video file sent by the user; the video stream decoding module is used for the video frame in the video file. Decoding, and buffering the decoded frame pixel data into the first cache queue; the video stream rendering module is used to obtain the user's drag instruction through the video stream rendering thread during the playback of the video, and according to the drag instruction Obtain the target time corresponding to the dragging behavior; the video stream rendering module is further configured to query the first cache queue according to the target time, so as to determine whether the frame pixels corresponding to the target time are stored in the first cache queue according to the query result.
  • the video stream rendering module determines whether the first key frame time and the second key frame time are consistent, and if they are consistent, enter Waiting state, and after the frame pixel data corresponding to the target time is stored in the first cache queue, the video frame corresponding to the target time is rendered according to the frame pixel data; thus avoiding repeated decoding of video frames and improving progress drag.
  • embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
  • computer-usable storage media including, but not limited to, disk storage, CD-ROM, optical storage, etc.
  • These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory result in an article of manufacture comprising instruction means, the instructions
  • An apparatus implements the functions specified in a flow or flows of the flowcharts and/or a block or blocks of the block diagrams.
  • These computer program instructions can also be loaded on a computer or other programmable data processing device to cause a series of operational steps to be performed on the computer or other programmable device to produce a computer-implemented process such that The instructions provide steps for implementing the functions specified in one or more of the flowcharts and/or one or more blocks of the block diagrams.
  • any reference signs placed between parentheses shall not be construed as limiting the claim.
  • the word “comprising” does not exclude the presence of elements or steps not listed in a claim.
  • the word “a” or “an” preceding an element does not preclude the presence of a plurality of such elements.
  • the invention can be implemented by means of hardware comprising several different components and by means of a suitably programmed computer. In a unit claim enumerating several means, several of these means may be embodied by one and the same item of hardware.
  • the use of the words first, second, and third, etc. do not denote any order. These words can be interpreted as names.
  • first and second are only used for description purposes, and cannot be interpreted as indicating or implying relative importance or the number of indicated technical features. Thus, a feature defined as “first” or “second” may expressly or implicitly include one or more of that feature.
  • “plurality” means two or more, unless otherwise expressly and specifically defined.
  • the terms “installed”, “connected”, “connected”, “fixed” and other terms should be understood in a broad sense, for example, it may be a fixed connection or a detachable connection , or integrated; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, and it can be the internal connection of the two elements or the interaction relationship between the two elements.
  • installed may be a fixed connection or a detachable connection , or integrated; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, and it can be the internal connection of the two elements or the interaction relationship between the two elements.
  • a first feature "on” or “under” a second feature may be in direct contact between the first and second features, or the first and second features indirectly through an intermediary touch.
  • the first feature being “above”, “over” and “above” the second feature may mean that the first feature is directly above or obliquely above the second feature, or simply means that the first feature is level higher than the second feature.
  • the first feature being “below”, “below” and “below” the second feature may mean that the first feature is directly below or obliquely below the second feature, or simply means that the first feature has a lower level than the second feature.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Human Computer Interaction (AREA)
  • Databases & Information Systems (AREA)
  • Television Signal Processing For Recording (AREA)

Abstract

本发明公开了一种进度拖动过程中的视频文件播放方法、介质、设备及装置,其中方法包括:对视频文件中的视频帧进行解码,并将得到的帧像素数据缓存至第一缓存队列;根据拖动指令获取对应的目标时间;判断该第一缓存队列中是否存储有目标时间对应的帧像素数据;如果否,则获取解码线程的当前视频帧时间,并遍历视频关键帧列表,以获取目标时间对应的第一关键帧时间和当前视频帧时间对应的第二关键帧时间;判断是否一致;如果是,则视频流渲染线程进入等待状态,并在第一缓存队列中存储有目标时间对应的帧像素数据之后,根据该帧像素数据对目标时间对应的视频帧进行渲染;能够避免视频帧的重复解码,提高进度拖动过程中视频画面更新的实时性。

Description

进度拖动过程中的视频文件播放方法及装置 技术领域
本发明涉及播放器控制技术领域,特别涉及一种进度拖动过程中的视频文件播放方法、一种计算机可读存储介质、一种计算机设备以及一种极度拖动过程中的视频文件播放装置。
背景技术
在播放器对视频进行播放的过程中,用户经常会根据需要对当前视频帧进行跳过,以快进到自己想要观看的视频帧,或者,快退到播放过的视频帧;而这些操作,往往都是通过拖动的方式实现的。
相关技术中,在用户进行进度拖动时,均需要进行查找逻辑;即言,每一次用户拖动都需要进行相应关键帧的查找,并根据关键帧进行目标视频帧的解码;导致视频帧同步更新较慢,无法进行画面的实时更新。
技术解决方案
本发明旨在至少在一定程度上解决上述技术中的技术问题之一。为此,本发明的一个目的在于提出一种进度拖动过程中的视频文件播放方法,能够避免视频帧的重复解码,提高进度拖动过程中视频画面更新的实时性。
本发明的第二个目的在于提出一种计算机可读存储介质。
本发明的第三个目的在于提出一种计算机设备。
本发明的第四个目的在于提出一种进度拖动过程中的视频文件播放装置。
为达到上述目的,本发明第一方面实施例提出了一种进度拖动过程中的视频文件播放方法,包括以下步骤:获取用户发送的视频文件,并通过视频流解码线程对所述视频文件中的视频帧进行解码,以及将解码得到的帧像素数据缓存至第一缓存队列;在视频的播放过程中,通过视频流渲染线程获取用户的拖动指令,并根据所述拖动指令获取该拖动行为对应的目标时间;根据所述目标时间查询第一缓存队列,以根据查询结果判断该第一缓存队列中是否存储有所述目标时间对应的帧像素数据;如果所述第一缓存队列中不存在目标时间对应的帧像素数据,则根据所述拖动指令获取解码线程的当前视频帧时间,并遍历视频关键帧列表,以获取所述目标时间对应的第一关键帧时间和所述当前视频帧时间对应的第二关键帧时间;判断所述第一关键帧时间与所述第二关键帧时间是否一致;如果是,则所述视频流渲染线程进入等待状态,并在所述第一缓存队列中存储有目标时间对应的帧像素数据之后,根据该帧像素数据对目标时间对应的视频帧进行渲染。
根据本发明实施例的进度拖动过程中的视频文件播放方法,首先,获取用户发送的视频文件,并通过视频流解码线程对所述视频文件中的视频帧进行解码,以及将解码得到的帧像素数据缓存至第一缓存队列;接着,在视频的播放过程中,通过视频流渲染线程获取用户的拖动指令,并根据所述拖动指令获取该拖动行为对应的目标时间;然后,根据所述目标时间查询第一缓存队列,以根据查询结果判断该第一缓存队列中是否存储有所述目标时间对应的帧像素数据;接着,如果所述第一缓存队列中不存在目标时间对应的帧像素数据,则根据所述拖动指令获取解码线程的当前视频帧时间,并遍历视频关键帧列表,以获取所述目标时间对应的第一关键帧时间和所述当前视频帧时间对应的第二关键帧时间;然后,判断所述第一关键帧时间与所述第二关键帧时间是否一致;接着,如果是,则所述视频流渲染线程进入等待状态,并在所述第一缓存队列中存储有目标时间对应的帧像素数据之后,根据该帧像素数据对目标时间对应的视频帧进行渲染;从而实现避免视频帧的重复解码,提高进度拖动过程中视频画面更新的实时性。
另外,根据本发明上述实施例提出的进度拖动过程中的视频文件播放方法还可以具有如下附加的技术特征。
可选地,如果所述第一缓存队列中存在目标时间对应的帧像素数据,则视频流渲染线程获取该帧像素数据,并根据该帧像素数据对目标时间对应的视频帧进行渲染。
可选地,如果所述第一关键帧时间与所述第二关键帧时间不一致,则所述视频流渲染线程生成查找指令,其中,所述查找指令包括第一关键帧时间。
可选地,通过视频流解码线程对所述视频文件进行解码,以及将解码后的帧像素数据缓存至第一缓存队列,包括:所述视频流解码线程遍历视频关键帧列表,以便根据所述关键帧列表进行视频帧的解码;判断当前是否存在查找指令;如果是,则清空第一缓存队列,并根据所述查找指令中的第一关键帧时间查找对应的第一关键帧;根据所述第一关键帧进行下一视频帧的解码,并在解码结束后将该下一视频帧存储到第一缓存队列,以及在存储完毕后根据该下一视频帧的播放时间更新所述当前视频帧时间。
可选地,在视频的播放过程中,通过音频流解码线程对音频帧进行解码,并将解码得到的音频数据存储到第二缓存队列;通过音频流播放线程获取所述第二缓存队列中存储的音频数据,并对所述音频数据进行播放。
可选地,通过所述音频流解码线程获取用户的拖动指令,并根据所述拖动指令获取该拖动行为对应的目标时间,以及根据所述目标时间获取对应的音频帧。
为达到上述目的,本发明第二方面实施例提出了一种计算机可读存储介质,其上存储有进度拖动过程中的视频文件播放程序,该进度拖动过程中的视频文件播放程序被处理器执行时实现如上述的进度拖动过程中的视频文件播放方法。
根据本发明实施例的计算机可读存储介质,通过存储进度拖动过程中的视频文件播放程序,以使得处理器在执行该进度拖动过程中的视频文件播放程序时,实现如上述的进度拖动过程中的视频文件播放方法;从而实现避免视频帧的重复解码,提高进度拖动过程中视频画面更新的实时性。
为了实现上述实施例,本发明实施例提出了一种计算机设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,其特征在于,所述处理器执行所述程序时,实现如上述的进度拖动过程中的视频文件播放方法。
根据本发明实施例的计算机设备,通过存储器对进度拖动过程中的视频文件播放程序进行存储,以使得处理器在执行该进度拖动过程中的视频文件播放程序时,实现如上述的进度拖动过程中的视频文件播放方法;从而实现避免视频帧的重复解码,提高进度拖动过程中视频画面更新的实时性。
为了实现上述实施例,本发明实施例提出了一种进度拖动过程中的视频文件播放装置,包括:获取模块,所述获取模块用于获取用户发送的视频文件;视频流解码模块,所述视频流解码模块用于对所述视频文件中的视频帧进行解码,以及将解码得到的帧像素数据缓存至第一缓存队列;视频流渲染模块,所述视频流渲染模块用于在视频的播放过程中,通过视频流渲染线程获取用户的拖动指令,并根据所述拖动指令获取该拖动行为对应的目标时间;所述视频流渲染模块还用于根据所述目标时间查询第一缓存队列,以根据查询结果判断该第一缓存队列中是否存储有所述目标时间对应的帧像素数据,并在所述第一缓存队列中不存在目标时间对应的帧像素数据时,根据所述拖动指令获取解码线程的当前视频帧时间,并遍历视频关键帧列表,以获取所述目标时间对应的第一关键帧时间和所述当前视频帧时间对应的第二关键帧时间;所述视频流渲染模块判断所述第一关键帧时间与所述第二关键帧时间是否一致,如果一致,则进入等待状态,并在所述第一缓存队列中存储有目标时间对应的帧像素数据之后,根据该帧像素数据对目标时间对应的视频帧进行渲染。
根据本发明实施例的进度拖动过程中的视频文件播放装置,通过设置获取模块用于获取用户发送的视频文件;视频流解码模块用于对所述视频文件中的视频帧进行解码,以及将解码得到的帧像素数据缓存至第一缓存队列;视频流渲染模块用于在视频的播放过程中,通过视频流渲染线程获取用户的拖动指令,并根据所述拖动指令获取该拖动行为对应的目标时间;视频流渲染模块还用于根据所述目标时间查询第一缓存队列,以根据查询结果判断该第一缓存队列中是否存储有所述目标时间对应的帧像素数据,并在所述第一缓存队列中不存在目标时间对应的帧像素数据时,根据所述拖动指令获取解码线程的当前视频帧时间,并遍历视频关键帧列表,以获取所述目标时间对应的第一关键帧时间和所述当前视频帧时间对应的第二关键帧时间;视频流渲染模块判断所述第一关键帧时间与所述第二关键帧时间是否一致,如果一致,则进入等待状态,并在所述第一缓存队列中存储有目标时间对应的帧像素数据之后,根据该帧像素数据对目标时间对应的视频帧进行渲染;从而实现避免视频帧的重复解码,提高进度拖动过程中视频画面更新的实时性。
另外,根据本发明上述实施例提出的进度拖动过程中的视频文件播放装置还可以具有如下附加的技术特征。
可选地,如果所述第一缓存队列中存在目标时间对应的帧像素数据,则视频流渲染线程获取该帧像素数据,并根据该帧像素数据对目标时间对应的视频帧进行渲染。
附图说明
图1为根据本发明实施例的进度拖动过程中的视频文件播放方法的流程示意图。
图2为根据本发明实施例的视频流解码线程的解码流程示意图。
图3为根据本发明实施例的进度拖动过程中的视频文件播放装置的方框示意图。
具体实施方式
下面详细描述本发明的实施例,所述实施例的示例在附图中示出,其中自始至终相同或类似的标号表示相同或类似的元件或具有相同或类似功能的元件。下面通过参考附图描述的实施例是示例性的,旨在用于解释本发明,而不能理解为对本发明的限制。
相关技术中,在用户进行进度拖动时,视频帧同步更新较慢,无法进行画面的实时更新;根据本发明实施例的进度拖动过程中的视频文件播放方法,首先,获取用户发送的视频文件,并通过视频流解码线程对所述视频文件中的视频帧进行解码,以及将解码得到的帧像素数据缓存至第一缓存队列;接着,在视频的播放过程中,通过视频流渲染线程获取用户的拖动指令,并根据所述拖动指令获取该拖动行为对应的目标时间;然后,根据所述目标时间查询第一缓存队列,以根据查询结果判断该第一缓存队列中是否存储有所述目标时间对应的帧像素数据;接着,如果所述第一缓存队列中不存在目标时间对应的帧像素数据,则根据所述拖动指令获取解码线程的当前视频帧时间,并遍历视频关键帧列表,以获取所述目标时间对应的第一关键帧时间和所述当前视频帧时间对应的第二关键帧时间;然后,判断所述第一关键帧时间与所述第二关键帧时间是否一致;接着,如果是,则所述视频流渲染线程进入等待状态,并在所述第一缓存队列中存储有目标时间对应的帧像素数据之后,根据该帧像素数据对目标时间对应的视频帧进行渲染;从而实现避免视频帧的重复解码,提高进度拖动过程中视频画面更新的实时性。
为了更好的理解上述技术方案,下面将参照附图更详细地描述本发明的示例性实施例。虽然附图中显示了本发明的示例性实施例,然而应当理解,可以以各种形式实现本发明而不应被这里阐述的实施例所限制。相反,提供这些实施例是为了能够更透彻地理解本发明,并且能够将本发明的范围完整的传达给本领域的技术人员。
为了更好的理解上述技术方案,下面将结合说明书附图以及具体的实施方式对上述技术方案进行详细的说明。
图1为根据本发明实施例的进度拖动过程中的视频文件播放方法的流程示意图;如图1所述,该进度拖动过程中的视频文件播放方法包括以下步骤。
S101,获取用户发送的视频文件,并通过视频流解码线程对视频文件中的视频帧进行解码,以及将解码得到的帧像素数据缓存至第一缓存队列。
即言,获取用户发送的视频文件,然后,通过视频流解码线程对该视频文件中的视频帧进行解码,视频帧解码完成后,可以获得该视频帧对应的帧像素数据,将该帧像素数据缓存到第一缓存队列中。
作为一种示例,在获取到用户要播放的视频文件之后,首先,启动视频流解码线程,并对视频解码器进行初始化;接着,视频解码器遍历视频关键帧列表(可以理解,在视频压缩技术中,视频帧包括关键帧、预测帧和双向预测帧;其中,关键帧是全帧压缩编码帧;预测帧是通过充分降低于图像序列中前面已编码帧的时间冗余信息来压缩传输数据量的编码图像,预测帧以关键帧作为参考帧,可以得到完整的视频帧;双向预测帧是既考虑与源图像序列前面已编码帧,也顾忌源图像序列后面已编码帧之间的时间冗余信息来压缩传输数据量的编码图像);并根据关键帧进行对应的下一视频帧的解码,以及在解码完成之后,将得到的帧像素数据缓存至第一缓存队列;其中,在缓存完成之后,视频解码器可以对当前视频帧时间进行更新,以标识当前视频解码器的工作状态。
S102,在视频的播放过程中,通过视频流渲染线程获取用户的拖动指令,并根据拖动指令获取该拖动行为对应的目标时间。
也就是说,在根据用户所选择的视频文件进行视频播放的过程中,用户可以根据自身的需要进行快进或者快退的操作,而在进行快进或者快退时,用户通过拖动的行为来发起拖动指令;此时,视频流渲染线程获取用户的拖动指令,并根据拖动指令获取该拖动行为对应的目标时间,该目标时间即为用户快进或快退的目标视频帧的时间。
S103,根据目标时间查询第一缓存队列,以根据查询结果判断该第一缓存队列中是否存储有目标时间对应的帧像素数据。
即言,在获取到目标时间之后,首先根据目标时间对第一缓存队列进行查询,以判断该第一缓存队列中是否存储有目标时间对应的帧像素数据;如果是,则对该第一缓存队列中存储的目标时间对应的帧像素数据进行获取,以根据该帧像素数据对目标时间对应的视频帧进行渲染;而非根据目标时间进行关键帧的获取,再根据该关键帧进行解码,以获取目标时间对应的视频帧;从而,可以避免重复地进行视频帧的解码行为,提高用户拖动过程中,视频帧的同步效率。
S104,如果第一缓存队列中不存在目标时间对应的帧像素数据,则根据拖动指令获取解码线程的当前视频帧时间,并遍历视频关键帧列表,以获取目标时间对应的第一关键帧时间和当前视频帧时间对应的第二关键帧时间。
S105,判断第一关键帧时间与第二关键帧时间是否一致。
S106,如果是,则视频流渲染线程进入等待状态,并在第一缓存队列中存储有目标时间对应的帧像素数据之后,根据该帧像素数据对目标时间对应的视频帧进行渲染。
可以理解,如果第一缓存队列中不存在目标时间对应的帧像素数据,则表示视频解码器当前正在解码的行为所依据的关键帧与目标时间对应的关键帧不同;或者,视频解码器当前正在解码的行为所依据的关键帧与目标时间对应的关键帧相同,可是,按其解码顺序还未解码到目标时间对应的视频帧;因此,首先,根据拖动指令获取解码线程的当前视频帧时间,并遍历视频关键帧列表,以获取目标时间对应的第一关键帧时间和当前视频帧时间对应的第二关键帧时间;接着,判断第一关键帧时间与第二关键帧时间是否一致;如果一致,则表示视频解码器当前正在解码的行为所依据的关键帧与目标时间对应的关键帧相同,可是,按其解码顺序还未解码到目标时间对应的视频帧;进而,视频流渲染线程进入等待状态,而视频流解码线程按其既定方式继续执行其解码行为,当第一缓存队列中存储有目标时间对应的帧像素数据时,视频流渲染线程获取该帧像素数据,并进行目标时间对应的视频帧的渲染;从而,可以防止已解码视频帧的重复解码;提高视频拖动过程中视频帧解码的效率。
在一些实施例中,如果第一关键帧时间与第二关键帧时间不一致,则视频流渲染线程生成查找指令,其中,查找指令包括第一关键帧时间。
可以理解,如果第一关键帧时间与第二关键帧时间不一致,则表示视频解码器当前正在解码的行为所依据的关键帧与目标时间对应的关键帧不同;则视频流渲染线程生成查找指令,以便视频流解码线程根据该查找指令获知当前需要进行关键帧的变更,进行关键帧的重新选择。
在一些实施例中,通过视频流解码线程对视频文件进行解码,以及将解码后的帧像素数据缓存至第一缓存队列,包括:视频流解码线程遍历视频关键帧列表,以便根据关键帧列表进行视频帧的解码;判断当前是否存在查找指令;如果是,则清空第一缓存队列,并根据查找指令中的第一关键帧时间查找对应的第一关键帧;根据第一关键帧进行下一视频帧的解码,并在解码结束后将该下一视频帧存储到第一缓存队列,以及在存储完毕后根据该下一视频帧的播放时间更新当前视频帧时间。
作为一种示例,如图2所示,视频流解码线程的解码流程为。
S201,遍历视频关键帧列表,以获取关键帧信息。
S202,获取待解码视频帧信息。
S203,判断当前是否存在查找指令;如果是,则执行步骤S205;如果否,则执行步骤S204。
S204,对待解码视频帧进行解码;并在解码完成后执行步骤S207。
S205,清空第一缓存队列,并根据第一关键帧时间查找对应的第一关键帧。
S206,根据第一关键帧确定待解码视频帧,返回步骤S204。
S207,将解码得到的帧像素数据缓存至第一缓存队列。
S208,根据待解码视频帧对应的播放时间更新当前视频帧时间。
S209,根据当前视频帧时间判断解码任务是否已完成;如果是,则执行步骤S210;如果否,则返回步骤S202。
S210,结束。
在一些实施例中,由于视频流和音频流解码逻辑相互影响,导致音频、视频之间生产、消费等逻辑需要互相同步、等待,将使得处理逻辑复杂度增加;并且,会产生不必要的等到耗时,进而降低视频的解码效率;因此,将音频流的解码线程和视频流的解码线程进行分离,以实现音频/视频的解码、消费Seek等逻辑的独立处理;提高视频的解码效率。
作为一种示例,在视频的播放过程中,通过音频流解码线程对音频帧进行解码,并将解码得到的音频数据存储到第二缓存队列;通过音频流播放线程获取第二缓存队列中存储的音频数据,并对音频数据进行播放。其中,通过音频流解码线程获取用户的拖动指令,并根据拖动指令获取该拖动行为对应的目标时间,以及根据目标时间获取对应的音频帧。
可以理解,音频帧没有关键帧、预测帧等区分;并且,音频的解码速度较快,因此,在获取到用户发送的拖动指令之后,可以根据用户的拖动指令获取对应的目标时间,并且,通过音频解码线程对目标时间对应的音频帧进行解码;在解码完成之后,将解码得到的音频数据缓存至第二缓存队列,以便音频流播放线程取用后进行音频的播放。
综上所述,根据本发明实施例的进度拖动过程中的视频文件播放方法,首先,获取用户发送的视频文件,并通过视频流解码线程对所述视频文件中的视频帧进行解码,以及将解码得到的帧像素数据缓存至第一缓存队列;接着,在视频的播放过程中,通过视频流渲染线程获取用户的拖动指令,并根据所述拖动指令获取该拖动行为对应的目标时间;然后,根据所述目标时间查询第一缓存队列,以根据查询结果判断该第一缓存队列中是否存储有所述目标时间对应的帧像素数据;接着,如果所述第一缓存队列中不存在目标时间对应的帧像素数据,则根据所述拖动指令获取解码线程的当前视频帧时间,并遍历视频关键帧列表,以获取所述目标时间对应的第一关键帧时间和所述当前视频帧时间对应的第二关键帧时间;然后,判断所述第一关键帧时间与所述第二关键帧时间是否一致;接着,如果是,则所述视频流渲染线程进入等待状态,并在所述第一缓存队列中存储有目标时间对应的帧像素数据之后,根据该帧像素数据对目标时间对应的视频帧进行渲染;从而实现避免视频帧的重复解码,提高进度拖动过程中视频画面更新的实时性。
为了实现上述实施例,本发明实施例提出了一种计算机可读存储介质,其上存储有进度拖动过程中的视频文件播放程序,该进度拖动过程中的视频文件播放程序被处理器执行时实现如上述的进度拖动过程中的视频文件播放方法。
根据本发明实施例的计算机可读存储介质,通过存储进度拖动过程中的视频文件播放程序,以使得处理器在执行该进度拖动过程中的视频文件播放程序时,实现如上述的进度拖动过程中的视频文件播放方法;从而实现避免视频帧的重复解码,提高进度拖动过程中视频画面更新的实时性。
为了实现上述实施例,本发明实施例提出了一种计算机设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,其特征在于,所述处理器执行所述程序时,实现如上述的进度拖动过程中的视频文件播放方法。
根据本发明实施例的计算机设备,通过存储器对进度拖动过程中的视频文件播放程序进行存储,以使得处理器在执行该进度拖动过程中的视频文件播放程序时,实现如上述的进度拖动过程中的视频文件播放方法;从而实现避免视频帧的重复解码,提高进度拖动过程中视频画面更新的实时性。
为了实现上述实施例,本发明实施例提出了一种进度拖动过程中的视频文件播放装置,如图3所示,该进度拖动过程中的视频文件播放装置包括:获取模块10、视频流解码模块20、视频流渲染模块30。
其中,获取模块10用于获取用户发送的视频文件。
视频流解码模块20用于对视频文件中的视频帧进行解码,以及将解码得到的帧像素数据缓存至第一缓存队列。
视频流渲染模块30用于在视频的播放过程中,通过视频流渲染线程获取用户的拖动指令,并根据拖动指令获取该拖动行为对应的目标时间。
视频流渲染模块30还用于根据目标时间查询第一缓存队列,以根据查询结果判断该第一缓存队列中是否存储有目标时间对应的帧像素数据,并在第一缓存队列中不存在目标时间对应的帧像素数据时,根据拖动指令获取解码线程的当前视频帧时间,并遍历视频关键帧列表,以获取目标时间对应的第一关键帧时间和当前视频帧时间对应的第二关键帧时间。
视频流渲染模块30判断第一关键帧时间与第二关键帧时间是否一致,如果一致,则进入等待状态,并在第一缓存队列中存储有目标时间对应的帧像素数据之后,根据该帧像素数据对目标时间对应的视频帧进行渲染。
在一些实施例中,如果第一缓存队列中存在目标时间对应的帧像素数据,则视频流渲染线程获取该帧像素数据,并根据该帧像素数据对目标时间对应的视频帧进行渲染。
需要说明的是,上述关于图1中进度拖动过程中的视频文件播放方法的描述同样适用于该进度拖动过程中的视频文件播放装置,在此不做赘述。
综上所述,根据本发明实施例的进度拖动过程中的视频文件播放装置,通过设置获取模块用于获取用户发送的视频文件;视频流解码模块用于对所述视频文件中的视频帧进行解码,以及将解码得到的帧像素数据缓存至第一缓存队列;视频流渲染模块用于在视频的播放过程中,通过视频流渲染线程获取用户的拖动指令,并根据所述拖动指令获取该拖动行为对应的目标时间;视频流渲染模块还用于根据所述目标时间查询第一缓存队列,以根据查询结果判断该第一缓存队列中是否存储有所述目标时间对应的帧像素数据,并在所述第一缓存队列中不存在目标时间对应的帧像素数据时,根据所述拖动指令获取解码线程的当前视频帧时间,并遍历视频关键帧列表,以获取所述目标时间对应的第一关键帧时间和所述当前视频帧时间对应的第二关键帧时间;视频流渲染模块判断所述第一关键帧时间与所述第二关键帧时间是否一致,如果一致,则进入等待状态,并在所述第一缓存队列中存储有目标时间对应的帧像素数据之后,根据该帧像素数据对目标时间对应的视频帧进行渲染;从而实现避免视频帧的重复解码,提高进度拖动过程中视频画面更新的实时性。
本领域内的技术人员应明白,本发明的实施例可提供为方法、系统、或计算机程序产品。因此,本发明可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。
本发明是参照根据本发明实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。
应当注意的是,在权利要求中,不应将位于括号之间的任何参考符号构造成对权利要求的限制。单词“包含”不排除存在未列在权利要求中的部件或步骤。位于部件之前的单词“一”或“一个”不排除存在多个这样的部件。本发明可以借助于包括有若干不同部件的硬件以及借助于适当编程的计算机来实现。在列举了若干装置的单元权利要求中,这些装置中的若干个可以是通过同一个硬件项来具体体现。单词第一、第二、以及第三等的使用不表示任何顺序。可将这些单词解释为名称。
尽管已描述了本发明的优选实施例,但本领域内的技术人员一旦得知了基本创造性概念,则可对这些实施例作出另外的变更和修改。所以,所附权利要求意欲解释为包括优选实施例以及落入本发明范围的所有变更和修改。
显然,本领域的技术人员可以对本发明进行各种改动和变型而不脱离本发明的精神和范围。这样,倘若本发明的这些修改和变型属于本发明权利要求及其等同技术的范围之内,则本发明也意图包含这些改动和变型在内。
在本发明的描述中,需要理解的是,术语“第一”、“第二”仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括一个或者更多个该特征。在本发明的描述中,“多个”的含义是两个或两个以上,除非另有明确具体的限定。
在本发明中,除非另有明确的规定和限定,术语“安装”、“相连”、“连接”、“固定”等术语应做广义理解,例如,可以是固定连接,也可以是可拆卸连接,或成一体;可以是机械连接,也可以是电连接;可以是直接相连,也可以通过中间媒介间接相连,可以是两个元件内部的连通或两个元件的相互作用关系。对于本领域的普通技术人员而言,可以根据具体情况理解上述术语在本发明中的具体含义。
在本发明中,除非另有明确的规定和限定,第一特征在第二特征 “上”或“下”可以是第一和第二特征直接接触,或第一和第二特征通过中间媒介间接接触。而且,第一特征在第二特征“之上”、“上方”和“上面”可是第一特征在第二特征正上方或斜上方,或仅仅表示第一特征水平高度高于第二特征。第一特征在第二特征“之下”、“下方”和“下面”可以是第一特征在第二特征正下方或斜下方,或仅仅表示第一特征水平高度小于第二特征。
在本说明书的描述中,参考术语“一个实施例”、“一些实施例”、 “示例”、“具体示例”、或“一些示例”等的描述意指结合该实施例或示例描述的具体特征、结构、材料或者特点包含于本发明的至少一个实施例或示例中。在本说明书中,对上述术语的示意性表述不应理解为必须针对的是相同的实施例或示例。而且,描述的具体特征、结构、材料或者特点可以在任一个或多个实施例或示例中以合适的方式结合。此外,在不相互矛盾的情况下,本领域的技术人员可以将本说明书中描述的不同实施例或示例以及不同实施例或示例的特征进行结合和组合。
尽管上面已经示出和描述了本发明的实施例,可以理解的是,上述实施例是示例性的,不能理解为对本发明的限制,本领域的普通技术人员在本发明的范围内可以对上述实施例进行变化、修改、替换和变型。

Claims (10)

  1. 一种进度拖动过程中的视频文件播放方法,其特征在于,包括以下步骤:
    获取用户发送的视频文件,并通过视频流解码线程对所述视频文件中的视频帧进行解码,以及将解码得到的帧像素数据缓存至第一缓存队列;
    在视频的播放过程中,通过视频流渲染线程获取用户的拖动指令,并根据所述拖动指令获取该拖动行为对应的目标时间;
    根据所述目标时间查询第一缓存队列,以根据查询结果判断该第一缓存队列中是否存储有所述目标时间对应的帧像素数据;
    如果所述第一缓存队列中不存在目标时间对应的帧像素数据,则根据所述拖动指令获取解码线程的当前视频帧时间,并遍历视频关键帧列表,以获取所述目标时间对应的第一关键帧时间和所述当前视频帧时间对应的第二关键帧时间;
    判断所述第一关键帧时间与所述第二关键帧时间是否一致;
    如果是,则所述视频流渲染线程进入等待状态,并在所述第一缓存队列中存储有目标时间对应的帧像素数据之后,根据该帧像素数据对目标时间对应的视频帧进行渲染。
  2. 如权利要求1所述的进度拖动过程中的视频文件播放方法,其特征在于,如果所述第一缓存队列中存在目标时间对应的帧像素数据,则视频流渲染线程获取该帧像素数据,并根据该帧像素数据对目标时间对应的视频帧进行渲染。
  3. 如权利要求1所述的进度拖动过程中的视频文件播放方法,其特征在于,如果所述第一关键帧时间与所述第二关键帧时间不一致,则所述视频流渲染线程生成查找指令,其中,所述查找指令包括第一关键帧时间。
  4. 如权利要求3所述的进度拖动过程中的视频文件播放方法,其特征在于,通过视频流解码线程对所述视频文件进行解码,以及将解码后的帧像素数据缓存至第一缓存队列,包括:
    所述视频流解码线程遍历视频关键帧列表,以便根据所述关键帧列表进行视频帧的解码;
    判断当前是否存在查找指令;
    如果是,则清空第一缓存队列,并根据所述查找指令中的第一关键帧时间查找对应的第一关键帧;
    根据所述第一关键帧进行下一视频帧的解码,并在解码结束后将该下一视频帧存储到第一缓存队列,以及在存储完毕后根据该下一视频帧的播放时间更新所述当前视频帧时间。
  5. 如权利要求1所述的进度拖动过程中的视频文件播放方法,其特征在于,在视频的播放过程中,通过音频流解码线程对音频帧进行解码,并将解码得到的音频数据存储到第二缓存队列;
    通过音频流播放线程获取所述第二缓存队列中存储的音频数据,并对所述音频数据进行播放。
  6. 如权利要求5所述的进度拖动过程中的视频文件播放方法,其特征在于,通过所述音频流解码线程获取用户的拖动指令,并根据所述拖动指令获取该拖动行为对应的目标时间,以及根据所述目标时间获取对应的音频帧。
  7. 一种计算机可读存储介质,其特征在于,其上存储有进度拖动过程中的视频文件播放程序,该进度拖动过程中的视频文件播放程序被处理器执行时实现如权利要求1-6中任一项所述的进度拖动过程中的视频文件播放方法。
  8. 一种计算机设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,其特征在于,所述处理器执行所述程序时,实现如权利要求1-6中任一项所述的进度拖动过程中的视频文件播放方法。
  9. 一种进度拖动过程中的视频文件播放装置,其特征在于,包括:
    获取模块,所述获取模块用于获取用户发送的视频文件;
    视频流解码模块,所述视频流解码模块用于对所述视频文件中的视频帧进行解码,以及将解码得到的帧像素数据缓存至第一缓存队列;
    视频流渲染模块,所述视频流渲染模块用于在视频的播放过程中,通过视频流渲染线程获取用户的拖动指令,并根据所述拖动指令获取该拖动行为对应的目标时间;
    所述视频流渲染模块还用于根据所述目标时间查询第一缓存队列,以根据查询结果判断该第一缓存队列中是否存储有所述目标时间对应的帧像素数据,并在所述第一缓存队列中不存在目标时间对应的帧像素数据时,根据所述拖动指令获取解码线程的当前视频帧时间,并遍历视频关键帧列表,以获取所述目标时间对应的第一关键帧时间和所述当前视频帧时间对应的第二关键帧时间;
    所述视频流渲染模块判断所述第一关键帧时间与所述第二关键帧时间是否一致,如果一致,则进入等待状态,并在所述第一缓存队列中存储有目标时间对应的帧像素数据之后,根据该帧像素数据对目标时间对应的视频帧进行渲染。
  10. 如权利要求9所述的进度拖动过程中的视频文件播放装置,其特征在于,如果所述第一缓存队列中存在目标时间对应的帧像素数据,则视频流渲染线程获取该帧像素数据,并根据该帧像素数据对目标时间对应的视频帧进行渲染。
PCT/CN2021/106958 2021-01-21 2021-07-17 进度拖动过程中的视频文件播放方法及装置 WO2022156166A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110082632.7 2021-01-21
CN202110082632.7A CN112929755B (zh) 2021-01-21 2021-01-21 进度拖动过程中的视频文件播放方法及装置

Publications (1)

Publication Number Publication Date
WO2022156166A1 true WO2022156166A1 (zh) 2022-07-28

Family

ID=76165665

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/106958 WO2022156166A1 (zh) 2021-01-21 2021-07-17 进度拖动过程中的视频文件播放方法及装置

Country Status (2)

Country Link
CN (1) CN112929755B (zh)
WO (1) WO2022156166A1 (zh)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112929755B (zh) * 2021-01-21 2022-08-16 稿定(厦门)科技有限公司 进度拖动过程中的视频文件播放方法及装置
CN114222166B (zh) * 2021-09-29 2024-02-13 重庆创通联达智能技术有限公司 多路视频码流实时处理、同屏播放方法及相关系统
CN113965786B (zh) * 2021-09-29 2024-03-26 杭州当虹科技股份有限公司 精准控制视频输出播放的方法
CN115396729B (zh) * 2022-08-26 2023-12-08 百果园技术(新加坡)有限公司 视频目标帧确定方法、装置、设备及存储介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110022489A (zh) * 2019-05-30 2019-07-16 腾讯音乐娱乐科技(深圳)有限公司 视频播放方法、装置及存储介质
CN110248245A (zh) * 2019-06-21 2019-09-17 维沃移动通信有限公司 一种视频定位方法、装置、移动终端及存储介质
CN110418186A (zh) * 2019-02-01 2019-11-05 腾讯科技(深圳)有限公司 音视频播放方法、装置、计算机设备和存储介质
CN111684816A (zh) * 2019-05-15 2020-09-18 深圳市大疆创新科技有限公司 视频解码方法、视频解码装置、存储介质与电子设备
CN112929755A (zh) * 2021-01-21 2021-06-08 稿定(厦门)科技有限公司 进度拖动过程中的视频文件播放方法及装置

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101924941A (zh) * 2010-08-30 2010-12-22 深圳市宏电技术股份有限公司 一种多媒体解码方法、系统及多媒体播放设备
CN108093292B (zh) * 2016-11-21 2020-09-11 阿里巴巴集团控股有限公司 用于管理缓存的方法、装置及系统
CN108769815B (zh) * 2018-06-21 2021-02-26 威盛电子股份有限公司 视频处理方法及其装置
CN109525879A (zh) * 2018-10-30 2019-03-26 北京凯视达科技有限公司 视频播放控制方法及装置
CN112104893B (zh) * 2020-11-04 2021-01-29 武汉中科通达高新技术股份有限公司 一种实现网页端无插件播放的视频流管理方法及装置

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110418186A (zh) * 2019-02-01 2019-11-05 腾讯科技(深圳)有限公司 音视频播放方法、装置、计算机设备和存储介质
CN111684816A (zh) * 2019-05-15 2020-09-18 深圳市大疆创新科技有限公司 视频解码方法、视频解码装置、存储介质与电子设备
CN110022489A (zh) * 2019-05-30 2019-07-16 腾讯音乐娱乐科技(深圳)有限公司 视频播放方法、装置及存储介质
CN110248245A (zh) * 2019-06-21 2019-09-17 维沃移动通信有限公司 一种视频定位方法、装置、移动终端及存储介质
CN112929755A (zh) * 2021-01-21 2021-06-08 稿定(厦门)科技有限公司 进度拖动过程中的视频文件播放方法及装置

Also Published As

Publication number Publication date
CN112929755B (zh) 2022-08-16
CN112929755A (zh) 2021-06-08

Similar Documents

Publication Publication Date Title
WO2022156166A1 (zh) 进度拖动过程中的视频文件播放方法及装置
US7673238B2 (en) Portable media device with video acceleration capabilities
JP4429643B2 (ja) ディジタルデータレートおよび方向つき再生変更を処理する方法およびシステム
JP2007511855A (ja) トリック再生の性能を向上するためのキャッシュ管理
JP2005507218A (ja) 情報ファイルを使用した早送りトリックモード及び巻き戻しトリックモード
WO2015043328A1 (zh) 基于移动信息的视频录像智能回放方法及其装置
US8391688B2 (en) Smooth rewind media playback
KR20140010337A (ko) 전자기기 및 그 제어방법
JP2008529405A (ja) デジタルビデオサーバ用のビデオプレーヤ
US11960444B2 (en) Methods and systems for providing file data for a media file
JP4827669B2 (ja) 動画再生方法および装置
WO2023083064A1 (zh) 视频处理方法、装置、电子设备及可读存储介质
WO2022160743A1 (zh) 视频文件播放系统、音视频播放流程、存储介质
US6999090B2 (en) Data processing apparatus, data processing method, information storing medium, and computer program
WO2022156165A1 (zh) 基于Sox的音频处理方法及装置
JP2013046357A (ja) 画像再生装置、画像再生方法および画像再生プログラム
JP2004350152A (ja) 映像再生装置および映像再生方法
JPH10191257A (ja) ディジタル動画像復号化装置、及びディジタル動画像復号化方法
JP5188209B2 (ja) 表示制御装置、方法、およびプログラム
JP5875837B2 (ja) コンテンツ再生装置、コンテンツ再生方法、プログラム、および記録媒体
JP2004078762A (ja) 映像検索装置および映像検索方法
JP5968069B2 (ja) 画像処理装置、撮像装置、画像処理装置の制御方法およびプログラム
US20070150440A1 (en) Method and circuit for retrieving data
JP2012034210A (ja) 映像音声記録再生装置、および映像音声記録再生方法
JP2013251612A (ja) 再生装置および再生方法

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21920547

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21920547

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 21920547

Country of ref document: EP

Kind code of ref document: A1