Video playing method, device, equipment and computer readable storage medium

文档序号:1966159 发布日期:2021-12-14 浏览:6次 中文

阅读说明:本技术 视频播放方法、装置、设备和计算机可读存储介质 (Video playing method, device, equipment and computer readable storage medium ) 是由 李山林 于 2021-08-02 设计创作,主要内容包括:本公开的实施例提供了视频播放方法、装置、设备和计算机可读存储介质。所述方法包括获取待播放视频节目的节目单;确定所述节目单中的视频对应的播放器类型;若当前播放设备支持创建多个播放器实例,则加载所需的所有播放器实例,根据所述节目单中的视频播放顺序初始化对应的播放器实例进行播放;若当前播放设备不支持创建多个播放器实例,则截取待播放视频的首帧图片作为过场动画,同时初始化与所述待播放视频对应的播放器实例,初始化完成后,隐藏所述首帧图片,播放所述待播放视频。以此方式,提升了视频切换的流畅度。(The embodiment of the disclosure provides a video playing method, a video playing device, video playing equipment and a computer readable storage medium. The method comprises the steps of obtaining a program list of a video program to be played; determining a player type corresponding to the video in the program list; if the current playing equipment supports the creation of a plurality of player instances, loading all required player instances, and initializing the corresponding player instances according to the video playing sequence in the program list for playing; if the current playing equipment does not support the creation of a plurality of player instances, capturing a first frame picture of a video to be played as a scene cut animation, simultaneously initializing the player instance corresponding to the video to be played, hiding the first frame picture after the initialization is completed, and playing the video to be played. In this way, the fluency of video switching is improved.)

1. A video playback method, comprising:

acquiring a program list of a video program to be played;

determining a player type corresponding to the video in the program list;

if the current playing equipment supports the creation of a plurality of player instances, loading all required player instances, and initializing the corresponding player instances according to the video playing sequence in the program list for playing;

if the current playing equipment does not support the creation of a plurality of player instances, capturing a first frame picture of a video to be played as a scene cut animation, simultaneously initializing the player instance corresponding to the video to be played, hiding the first frame picture after the initialization is completed, and playing the video to be played.

2. The method of claim 1, further comprising:

and the videos in the program list are dynamically selected based on the player types corresponding to the videos, and the videos played by the players of the same type are divided into a group.

3. The method of claim 2,

if the video to be played is the first played video, acquiring a first frame picture of the video to be played as a cross-scene animation, initializing a player example corresponding to the video to be played, and after initialization is completed, hiding the first frame picture and playing the video.

4. The method of claim 3, further comprising:

and optimizing the loaded player instance through a preset cache algorithm, and releasing the memory space.

5. The method of claim 4,

and if the user executes the video fast switching operation, pausing the initialization and release operation of the player until the user stops the operation, and initializing the player corresponding to the video to be played in the program list to play the video according to the position of the current program list.

6. The method of claim 5, further comprising:

if the player corresponding to the video to be played does not exist in the current playing equipment, transcoding the video to be played into a video format corresponding to the player already existing in the current playing equipment according to a preset transcoding rule, simultaneously capturing a first frame picture of the video to be played as a scene cut animation, and hiding the first frame picture and playing the video after the conversion is finished.

7. The method of claim 6, wherein transcoding the video to be played into a video format corresponding to a player already existing in a current playing device according to a preset transcoding rule comprises:

if the size of the video to be played is larger than a first threshold value, cutting the video to be played into a plurality of video files smaller than a second threshold value;

and according to the playing time sequence and a preset transcoding rule, sequentially converting the cut video files into a video format which can be played by the player and is stored in the current equipment.

8. A video playback apparatus, comprising:

the acquisition module is used for acquiring a program list of a video program to be played;

the determining module is used for determining the player type corresponding to the video in the program list;

the playing module is used for loading all required player instances if the current playing equipment supports the creation of a plurality of player instances, and initializing the corresponding player instances according to the video playing sequence in the program list to play;

if the current playing equipment does not support the creation of a plurality of player instances, capturing a first frame picture of a video to be played as a scene cut animation, simultaneously initializing the player instance corresponding to the video to be played, hiding the first frame picture after the initialization is completed, and playing the video to be played.

9. An electronic device comprising a memory and a processor, the memory having stored thereon a computer program, wherein the processor, when executing the program, implements the method of any of claims 1-7.

10. A computer-readable storage medium, on which a computer program is stored, which program, when being executed by a processor, carries out the method according to any one of claims 1 to 7.

Technical Field

Embodiments of the present disclosure relate generally to the field of video playback control, and more particularly, to a video playback method, apparatus, device, and computer-readable storage medium.

Background

Currently, video files played by a playing device such as a television include: a real-time video stream sent by a video acquisition device through a network, such as a live video stream in a streaming media format; a completed complete video file, etc. Video formats acquired through different channels are various, and a plurality of player instances corresponding to the video formats are loaded according to the types of videos to be played under normal conditions to play the videos.

In practical applications, when a player needs to be switched, it usually takes a certain time to complete the switching from one video player to another video player, and the audiovisual experience of a user is seriously affected if the switching time is too long.

Disclosure of Invention

According to an embodiment of the present disclosure, a video playback scheme is provided.

In a first aspect of the present disclosure, a video playing method is provided. The method comprises the following steps:

acquiring a program list of a video program to be played;

determining a player type corresponding to the video in the program list;

if the current playing equipment supports the creation of a plurality of player instances, loading all required player instances, and initializing the corresponding player instances according to the video playing sequence in the program list for playing;

if the current playing equipment does not support the creation of a plurality of player instances, capturing a first frame picture of a video to be played as a scene cut animation, simultaneously initializing the player instance corresponding to the video to be played, hiding the first frame picture after the initialization is completed, and playing the video to be played.

Further, still include:

and the videos in the program list are dynamically selected based on the player types corresponding to the videos, and the videos played by the players of the same type are divided into a group.

Further, the air conditioner is provided with a fan,

if the video to be played is the first played video, acquiring a first frame picture of the video to be played as a cross-scene animation, initializing a player example corresponding to the video to be played, and after initialization is completed, hiding the first frame picture and playing the video.

Further, still include:

and optimizing the loaded player instance through a preset cache algorithm, and releasing the memory space.

Further, the air conditioner is provided with a fan,

and if the user executes the video fast switching operation, pausing the initialization and release operation of the player until the user stops the operation, and initializing the player corresponding to the video to be played in the program list to play the video according to the position of the current program list.

Further, still include:

if the player corresponding to the video to be played does not exist in the current playing equipment, transcoding the video to be played into a video format corresponding to the player already existing in the current playing equipment according to a preset transcoding rule, simultaneously capturing a first frame picture of the video to be played as a scene cut animation, and hiding the first frame picture and playing the video after the conversion is finished.

Further, the transcoding the video to be played into a video format corresponding to a player already stored in the current playing device according to a preset transcoding rule includes:

if the size of the video to be played is larger than a first threshold value, cutting the video to be played into a plurality of video files smaller than a second threshold value;

and according to the playing time sequence and a preset transcoding rule, sequentially converting the cut video files into a video format which can be played by the player and is stored in the current equipment.

In a second aspect of the present disclosure, a video playback device is provided. The device includes:

the acquisition module is used for acquiring a program list of a video program to be played;

the determining module is used for determining the player type corresponding to the video in the program list;

the playing module is used for loading all required player instances if the current playing equipment supports the creation of a plurality of player instances, and initializing the corresponding player instances according to the video playing sequence in the program list to play;

if the current playing equipment does not support the creation of a plurality of player instances, capturing a first frame picture of a video to be played as a scene cut animation, simultaneously initializing the player instance corresponding to the video to be played, hiding the first frame picture after the initialization is completed, and playing the video to be played.

In a third aspect of the disclosure, an electronic device is provided. The electronic device includes: a memory having a computer program stored thereon and a processor implementing the method as described above when executing the program.

In a fourth aspect of the present disclosure, a computer readable storage medium is provided, having stored thereon a computer program, which when executed by a processor, implements a method as in accordance with the first aspect of the present disclosure.

According to the video playing method provided by the embodiment of the application, a program list of a video program to be played is obtained; determining a player type corresponding to the video in the program list; if the current playing equipment supports the creation of a plurality of player instances, loading all required player instances, and initializing the corresponding player instances according to the video playing sequence in the program list for playing; if the current playing device does not support the creation of a plurality of player instances, capturing a first frame picture of a video to be played as a cross-scene animation, initializing the player instance corresponding to the video to be played, hiding the first frame picture after initialization is completed, playing the video to be played, and improving the fluency of video switching.

It should be understood that the statements herein reciting aspects are not intended to limit the critical or essential features of the embodiments of the present disclosure, nor are they intended to limit the scope of the present disclosure. Other features of the present disclosure will become apparent from the following description.

Drawings

The above and other features, advantages and aspects of various embodiments of the present disclosure will become more apparent by referring to the following detailed description when taken in conjunction with the accompanying drawings. In the drawings, like or similar reference characters designate like or similar elements, and wherein:

fig. 1 shows a flow diagram of a video playback method according to an embodiment of the present disclosure;

FIG. 2 shows a block diagram of a video playback device according to an embodiment of the present disclosure;

FIG. 3 illustrates a block diagram of an exemplary electronic device capable of implementing embodiments of the present disclosure.

Detailed Description

To make the objects, technical solutions and advantages of the embodiments of the present disclosure more clear, the technical solutions of the embodiments of the present disclosure will be described clearly and completely with reference to the drawings in the embodiments of the present disclosure, and it is obvious that the described embodiments are some, but not all embodiments of the present disclosure. All other embodiments, which can be derived by a person skilled in the art from the embodiments disclosed herein without making any creative effort, shall fall within the protection scope of the present disclosure.

In addition, the term "and/or" herein is only one kind of association relationship describing an associated object, and means that there may be three kinds of relationships, for example, a and/or B, which may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the character "/" herein generally indicates that the former and latter related objects are in an "or" relationship.

Fig. 1 shows a flow diagram of a video playback method 100 according to an embodiment of the present disclosure. The method 100 comprises:

s110, acquiring a program list of the video program to be played.

In some embodiments, the scheduling period of the program list may be a period of one day, for example: the playing time points from 1:00am of one day to 1:00am of the next day are a period (24h), or 6 hours are a period, and the like, and the starting and stopping playing time points of one period can be set according to specific situations.

In some embodiments, the program listings may be generated based on a user's on-demand operations. And when a user continuously requests a plurality of video programs, adding the identifications of the video programs into the program list. The video programs in the program list can be played in sequence, and the next video program is played after the playing of the previous video program is finished; and can be adjusted by the user according to the operation of the user. The program list may include not only the identifier of the video program, but also information such as the play start time, the play duration, etc. of the video program. When all the video programs in the program list are played, the program list can be automatically deleted, and the cache is released; the identification of the video program comprises the heat degree of the current video and the like; the popularity of the video can be from statistics of the on-demand volume of the user, or from statistics of a third-party platform.

In some embodiments, the videos in the program list may be sorted in order of popularity from high to low, and the video program with higher popularity is preferentially played, so as to bring a better viewing experience to the user.

And S120, determining the player type corresponding to the video in the program list.

In some embodiments, the video in the program listings may be a real-time video stream (e.g., live, etc.) transmitted over a network through a video capture device; or may be a complete video file that has been produced. Generally, the real-time video stream includes protocols (streaming media technology) such as HLS, RTMP, mms, rstp, and p2p, and the video formats corresponding to each protocol are different, for example, the live video format of HLS protocol is m3u8, and the live video format of RTMP is flv;

the complete video file which is manufactured comprises: AVI (. AVI), MKV (. MKV), MP4 (. MP4), VOB (. VOB), and the like;

it can be seen that depending on the video format (source), it is often necessary to match the various player instances to which it corresponds. Specifically, the player type corresponding to the video to be played in the program list may be determined through big data analysis, history analysis, and/or manual selection according to the video format of the video to be played.

In some embodiments, when different player instances are switched, the waiting time of a user is additionally increased, so that in the present disclosure, dynamic selection can be performed according to the player type required by the video to be played, the videos to be played in the program list are grouped, videos that can be played using the same player type are grouped into one group, and the video to be played is played according to the group, so that the time required for initialization and release of the player can be saved, and the waiting time for switching the player instances can be reduced for the user; the videos to be played in the program list may also be clustered, and the same player type in a time period is placed in a group, for example, in the time period from 9 to 13, 10 videos are included, so the videos in the time period may be clustered according to the playing sequence of the videos, the user requirement, and/or the video heat, and the like, and the videos that can be played using the same player type are grouped, that is, 3 videos of the first player, 2 videos of the second player, 3 videos of the third player, and 2 videos of the second player.

S130, based on the player type, video playing is carried out on the video program to be played in the program list.

In some embodiments, a playing environment of a current playing device (e.g., a smart tv, etc.) is analyzed to determine whether the current device supports creating multiple player instances, e.g., analyzing a model, a memory, etc. of the current smart tv;

if the current equipment supports the creation of a plurality of player instances (the memory is sufficient, all the required player instances and the television model support can be loaded at the same time), loading all the required player instances according to the program list, initializing the corresponding player instances according to the video playing sequence in the program list, and playing the video;

if the current playing equipment does not support the creation of a plurality of player instances, capturing a first frame picture of a video to be played as a scene cut animation, simultaneously initializing the player instance corresponding to the video to be played, hiding the first frame picture after the initialization is completed, and playing the video to be played.

In some embodiments, if the video to be played is the first played video, the first picture of the video to be played is acquired as the cut-scene animation, the player instance corresponding to the video to be played is initialized, and after the initialization is completed, the first picture is hidden and the video is played.

In some embodiments, the loaded player instance is optimized by a preset caching algorithm, and the memory space is released. For example, when the current playing device supports creation of multiple player instances, the infrequent players can be released through the LRU algorithm, so that the memory pressure is relieved; if the video to be played in the program list is dynamically selected, the player instance corresponding to the current video group is automatically released after the same group of videos are played (the videos can be played by the same player).

In some embodiments, if a user performs a video fast switching operation, the initialization and release operations of the player are suspended until the user stops the operation, the playing position of the video to be played is obtained according to the current program information, and the player corresponding to the video to be played in the program is initialized to play the video.

Further, still include:

if the player corresponding to the video to be played does not exist in the current playing equipment, transcoding the video to be played into a video format corresponding to the player already existing in the current playing equipment according to a preset transcoding rule, simultaneously capturing a first frame picture of the video to be played as a scene cut animation, and hiding the first frame picture and playing the video after the conversion is finished.

Wherein the preset transcoding rule is as follows: a rule for transcoding an original video stream (a video stream that cannot be played by a current playing device, i.e., no corresponding player instance) into a video stream that can be played by the current device; the transcoding rule comprises a transcoded code stream format, a transcoding parameter and the like; the transcoded video formats are all video formats which can be played by current equipment (playing formats supported by player examples); the parameters comprise image resolution, code rate and/or frame rate after transcoding the original video stream.

In some embodiments, when transcoding an original video stream, the image resolution of the transcoded image may be set according to specific conditions, for example, in the case that the current playing device is poor (insufficient memory, poor hardware, etc.), the image resolution of the transcoded image may be set to be a lower image resolution, for example, 352x288, which may ensure that a smoother playing effect is obtained and the phenomena of stutter and the like are reduced in the case that the device is poor; under the condition that the current device state is better (the memory is sufficient), the image resolution of the transcoded image can be set to be higher image resolution, for example 1920 × 1080, so that a clearer visual effect can be provided for a user, and the viewing experience of the user is improved.

Similarly, based on the state of the current playing device, the bitrate and the frame rate of the video stream transcoded from the original video stream can be set.

Further, still include:

in some embodiments, based on information such as the play start time and the play duration of the video to be played, the video to be played may be divided into a plurality of video files, and then played sequentially according to the play order of the video to be played, so as to reduce the waiting time of the user.

Specifically, if the size of the video to be played is larger than a first threshold, that is, the video to be played is large, and the loading time may be too long, the video to be played is cut into a plurality of video files smaller than a second threshold; the first threshold value may be set according to information such as a format of a video to be played and a memory space of the current playing device, for example, 1 GB; the second threshold value can be determined according to the playing time and/or the application scene of the video to be played;

furthermore, when the video to be played is cut, the video to be played can be cut once according to the playing time length, and can also be cut for many times according to the actual application scene. For example, a video file with a size of 1GB (1GB 1000mb) is cut into two video files of 100mb and 900mb according to the playing sequence, and in order to reduce the waiting time of the user, while the 100mb video file is played, the 900mb video file is cut again into 9 files of 100 mb.

Similarly, when the video transcoding is performed, the video to be played can be transcoded into a plurality of video formats which can be played by the current device according to the playing time, and the videos are played in sequence.

According to the embodiment of the disclosure, the following technical effects are achieved:

the player instance corresponding to the program list of the video to be played is created, so that the time for loading the player instance is reduced, and the streaming degree of video switching is improved; when the player is loaded, the first frame image of the video to be played is captured as a process animation, so that the problem of screen blackness when the player is loaded is solved, and the watching experience of a user is improved; meanwhile, the original video stream which cannot be played by the current player can be transcoded according to a preset transcoding rule, so that the transcoded original video stream can be played by the player, and the watching experience of a user is further improved.

It is noted that while for simplicity of explanation, the foregoing method embodiments have been described as a series of acts or combination of acts, it will be appreciated by those skilled in the art that the present disclosure is not limited by the order of acts, as some steps may, in accordance with the present disclosure, occur in other orders and concurrently. Further, those skilled in the art should also appreciate that the embodiments described in the specification are exemplary embodiments and that acts and modules referred to are not necessarily required by the disclosure.

The above is a description of embodiments of the method, and the embodiments of the apparatus are further described below.

Fig. 2 shows a block diagram of a video playback device 200 according to an embodiment of the present disclosure. Apparatus as shown in fig. 2, the apparatus 200 comprises:

an obtaining module 210, configured to obtain a program list of a video program to be played;

a determining module 220, configured to determine a player type corresponding to a video in the program list;

a playing module 230, configured to load all required player instances if the current playing device supports creating multiple player instances, and initialize a corresponding player instance according to a video playing sequence in the program list to play;

if the current playing equipment does not support the creation of a plurality of player instances, capturing a first frame picture of a video to be played as a scene cut animation, simultaneously initializing the player instance corresponding to the video to be played, hiding the first frame picture after the initialization is completed, and playing the video to be played.

It can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working process of the described module may refer to the corresponding process in the foregoing method embodiment, and is not described herein again.

FIG. 3 shows a schematic block diagram of an electronic device 300 that may be used to implement embodiments of the present disclosure. As shown, device 300 includes a Central Processing Unit (CPU)301 that may perform various appropriate actions and processes in accordance with computer program instructions stored in a Read Only Memory (ROM)302 or loaded from a storage unit 308 into a Random Access Memory (RAM) 303. In the RAM303, various programs and data necessary for the operation of the device 300 can also be stored. The CPU 301, ROM 302, and RAM303 are connected to each other via a bus 304. An input/output (I/O) interface 305 is also connected to bus 304.

Various components in device 300 are connected to I/O interface 305, including: an input unit 306 such as a keyboard, a mouse, or the like; an output unit 307 such as various types of displays, speakers, and the like; a storage unit 308 such as a magnetic disk, optical disk, or the like; and a communication unit 309 such as a network card, modem, wireless communication transceiver, etc. The communication unit 309 allows the device 300 to exchange information/data with other devices via a computer network such as the internet and/or various telecommunication networks.

The processing unit 301 performs the various methods and processes described above, such as the method 100. For example, in some embodiments, the method 100 may be implemented as a computer software program tangibly embodied in a machine-readable medium, such as the storage unit 308. In some embodiments, part or all of the computer program may be loaded and/or installed onto device 300 via ROM 302 and/or communication unit 309. When the computer program is loaded into RAM303 and executed by CPU 301, one or more steps of method 100 described above may be performed. Alternatively, in other embodiments, the CPU 301 may be configured to perform the method 100 by any other suitable means (e.g., by way of firmware).

The functions described herein above may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: a Field Programmable Gate Array (FPGA), an Application Specific Integrated Circuit (ASIC), an Application Specific Standard Product (ASSP), a system on a chip (SOC), a load programmable logic device (CPLD), and the like.

Program code for implementing the methods of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the program codes, when executed by the processor or controller, cause the functions/operations specified in the flowchart and/or block diagram to be performed. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package partly on the machine and partly on a remote machine or entirely on the remote machine or server.

In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

Further, while operations are depicted in a particular order, this should be understood as requiring that such operations be performed in the particular order shown or in sequential order, or that all illustrated operations be performed, to achieve desirable results. Under certain circumstances, multitasking and parallel processing may be advantageous. Likewise, while several specific implementation details are included in the above discussion, these should not be construed as limitations on the scope of the disclosure. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single implementation. Conversely, various features that are described in the context of a single implementation can also be implemented in multiple implementations separately or in any suitable subcombination.

Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are disclosed as example forms of implementing the claims.

12页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:电视机共享节目的控制方法、控制设备及可读存储介质

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类