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

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

Info

Publication number
CN113259695A
CN113259695A CN202110474515.5A CN202110474515A CN113259695A CN 113259695 A CN113259695 A CN 113259695A CN 202110474515 A CN202110474515 A CN 202110474515A CN 113259695 A CN113259695 A CN 113259695A
Authority
CN
China
Prior art keywords
video
resource address
playing
resource
server
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110474515.5A
Other languages
Chinese (zh)
Inventor
杨智翔
李溢鹏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangzhou Huya Technology Co Ltd
Original Assignee
Guangzhou Huya 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 Guangzhou Huya Technology Co Ltd filed Critical Guangzhou Huya Technology Co Ltd
Priority to CN202110474515.5A priority Critical patent/CN113259695A/en
Publication of CN113259695A publication Critical patent/CN113259695A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/21Server components or server architectures
    • H04N21/218Source of audio or video content, e.g. local disk arrays
    • H04N21/2187Live feed
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs
    • H04N21/4402Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display
    • 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/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/47202End-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 requesting content on demand, e.g. video on demand
    • 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

Landscapes

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

Abstract

The invention provides a video playing method, a video playing device, electronic equipment and a storage medium. The method comprises the following steps: acquiring a resource address of the video from the server and storing the resource address of the video to the local; and responding to a playing instruction of the video, and playing the video based on the resource address. The method can improve the second-starting success rate of video on demand.

Description

Video playing method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of live broadcast technologies, and in particular, to a video playing method and apparatus, an electronic device, and a storage medium.
Background
In a live scene, the video experience is very important, and the second-opening playing of the video is a very important technical index in the video experience. For example, the second-starting success rate of the on-demand video of tiger teeth is only about 50%, the success rate is obviously very low, and users often wait for more than 1s when starting to watch the video, so that the user experience of watching the on-demand video is greatly influenced.
Disclosure of Invention
The invention provides a video playing method, a video playing device, electronic equipment and a storage medium.
In order to solve the above technical problems, a first technical solution provided by the present invention is: a video playing method is provided, which comprises the following steps: acquiring a resource address of the video from the server and storing the resource address of the video to the local; and responding to a playing instruction of the video, and playing the video based on the resource address.
The method for acquiring the resource address of the video from the server and storing the resource address of the video to the local comprises the following steps: acquiring a first resource address of a first video segment of a video from a server and storing the first resource address to the local; in response to a play instruction of the video, playing the video based on the resource address comprises: and responding to a playing instruction of the video, loading part of video data of the video based on the first resource address and playing the video.
Wherein the method further comprises: loading video data of the video based on the first resource address and playing the video, and simultaneously acquiring second resource addresses of other video segments of the video; and loading the rest video data of the video based on the second resource address and continuing to play the video.
After the step of loading the video data of the rest of the video based on the second resource address and playing the video, the method further comprises the following steps: and saving the second resource address of the video to the local.
Wherein the method further comprises: detecting whether a playing instruction of the video is received within a preset time period; and responding to the playing instruction of the video received in the preset time period, directly acquiring the first resource address and the second resource address from the local, loading complete video data of the video and playing the video.
Wherein the method further comprises: in response to the fact that the playing instruction of the video is not received within the preset time period, the second resource address is cleared from the local area; or locally clearing a portion of the second resource address.
Wherein the format of the video comprises a video in an M3u8 format.
The step of obtaining the first resource address of the first video segment of the video from the server and storing the first resource address to the local includes: and acquiring a first resource address of a first ts video segment of the video and storing the first resource address to the local.
In order to solve the above technical problems, a second technical solution provided by the present invention is: there is provided a video playback apparatus including: the acquisition module is used for acquiring the resource address of the video from the server and storing the resource address to the local; and the video playing module is used for responding to a playing instruction of the video and playing the video based on the resource address.
In order to solve the above technical problems, a third technical solution provided by the present invention is: provided is an electronic device including: a memory storing program instructions and a processor retrieving the program instructions from the memory to perform any of the above methods.
In order to solve the above technical problems, a fourth technical solution provided by the present invention is: there is provided a computer readable storage medium storing a program file executable to implement the method of any of the above.
The method has the advantages that the method is different from the prior art, and the resource address of the video is obtained from the server in advance and is stored to the local; and responding to a playing instruction of the video, and playing the video based on the resource address. Therefore, the time for analyzing the resource address of the video is shortened, the waiting time from the video clicking to the video playing of the user is shortened, and the second-starting success rate of the video on demand is improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments are briefly introduced below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and other drawings can be obtained by those skilled in the art without inventive efforts, wherein:
fig. 1 is a schematic flowchart of a video playing method according to a first embodiment of the present invention;
FIG. 2 is a flowchart illustrating a video playing method according to a second embodiment of the present invention;
FIG. 3 is a flowchart illustrating a video playing method according to a third embodiment of the present invention;
FIG. 4 is a flowchart illustrating a video playing method according to a fourth embodiment of the present invention;
FIG. 5 is a schematic structural diagram of a video playback device according to an embodiment of the present invention;
FIG. 6 is a schematic structural diagram of an electronic device according to an embodiment of the invention;
FIG. 7 is a structural diagram of an embodiment of a computer-readable storage medium according to the invention.
Detailed Description
The current live video is mainly in an M3u8 format, and when the video in the format is played, a ts fragment set needs to be analyzed first, and then ts in the ts fragment set can be played. The time consuming process of clicking the video to view the video by the user is long, and the user needs to go through the process of m3u8 url- > m3u8 file- > first tsurl- > first ts file to be able to play. This process of downloading the video TS clip stream is time consuming, which results in a long waiting time for the user.
The invention provides a video playing method which can reduce the waiting time of a user and improve the second starting success rate of video on demand. 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 a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The terms "first", "second" and "third" in this application are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implying any indication of the number of technical features indicated. Thus, a feature defined as "first," "second," or "third" may explicitly or implicitly include at least one of the feature. In the description of the present application, "plurality" means at least two, e.g., two, three, etc., unless explicitly specifically limited otherwise. All directional indications (such as up, down, left, right, front, and rear … …) in the embodiments of the present application are only used to explain the relative positional relationship between the components, the movement, and the like in a specific posture (as shown in the drawings), and if the specific posture is changed, the directional indication is changed accordingly. Furthermore, the terms "include" and "have," as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those steps or elements listed, but may alternatively include other steps or elements not listed, or inherent to such process, method, article, or apparatus.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the application. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is explicitly and implicitly understood by one skilled in the art that the embodiments described herein can be combined with other embodiments.
Referring to fig. 1, a schematic flow chart of a video playing method according to a first embodiment of the present invention specifically includes:
step S11: and acquiring the resource address of the video from the server and storing the resource address of the video to the local.
Step S12: and responding to a playing instruction of the video, and playing the video based on the resource address.
Specifically, when a user records a video by using some live broadcast software APP, the video is uploaded to a server, the server generates some corresponding resource addresses based on the video, and when the user needs to play the video, the user needs to acquire the resource addresses from the server to play the video.
Taking the video in the M3u8 format as an example, the video in this format needs to parse the ts fragment collection before playing ts therein. The time consuming process of clicking the video to view the video by the user is long, and the user needs to go through the process of m3u8 url- > m3u8 file- > first tsurl- > first ts file to be able to play. This process of downloading the video TS clip stream is time consuming, which results in a long waiting time for the user.
By the method, the user obtains the resource address of the video from the server in advance and stores the resource address to the local, and after receiving the playing instruction of the video, the video is played based on the resource address.
In an embodiment, a request can be sent to a server at the same time when a corresponding live broadcast APP is downloaded, and resource addresses of some videos in the APP are stored at the same time when the APP is downloaded and installed, so that when a video playing instruction is received, the video is directly played based on the locally stored resource addresses. In this implementation, the request may be sent to the server at a preset interval to update the locally stored resource address. For example, a live APP downloaded by a user in 4/20 th day, at which only the resource address of a video before 4/20 th day can be acquired from the server, may send a request instruction to the server at an interval of one day, for example, in 4/21 th day, to acquire the resource address of a video generated in 4/20 th to 4/21 th day. By the method of the embodiment, the time for analyzing the ts fragment collection can be saved, and the waiting time of the user can be reduced. The method of the embodiment has higher requirements on the storage space and the storage performance of the equipment.
In another embodiment, when a video to be played appears on a screen of a mobile phone, a resource address of the video is acquired from a server and stored locally, and when a playing instruction of the video is received, the video is played directly based on the locally stored resource address. For example, existing mobile phones are designed as large screens, a user can simultaneously display 2-3 video widgets on the screen when browsing live videos, and when videos are displayed on the video widgets, the mobile phone sends an instruction for acquiring a resource address to a server, then the server issues the resource address to the mobile phone, and the mobile phone acquires the resource address of the videos from the server and stores the resource address to the local. And when the user clicks the video window to generate a video playing instruction, playing the video based on the acquired resource address. Therefore, the intention of the user can be predicted, the resource address of the video can be obtained in advance, and when a playing instruction of the user for playing the video is received, the video is directly played based on the resource address. Therefore, the time for analyzing the ts fragment collection can be saved, and the waiting time of the user can be reduced.
In another embodiment, a request instruction may also be sent to the server at a preset interval to obtain a resource address of a video generated within the preset interval, and the obtained resource address is stored locally, and when a video playing instruction is received, the video is played directly based on the locally stored resource address. For example, a request instruction may be sent to the server at an interval of 30 minutes to acquire a resource address of a video generated within 30 minutes, and the acquired resource address may be saved, so that when a play instruction of the video is received, the video is played directly based on the locally saved resource address. Therefore, the time for analyzing the ts fragment collection can be saved, and the waiting time of the user can be reduced.
Although the method of this embodiment can save ts segment collection parsing, the storage burden is caused by excessive storage of resource addresses, so the present application proposes another video playing method, specifically as shown in fig. 2, where fig. 2 is a flowchart of a second embodiment of the video playing method of the present invention, and specifically includes:
step S21: and acquiring a first resource address of a first video segment of the video from a server and storing the first resource address to the local.
Step S12: and responding to a playing instruction of the video, loading partial video data of the video based on the first resource address and playing the video.
In an embodiment, a request may be sent to a server at the same time when a corresponding live APP is downloaded, and when the APP is downloaded and installed, a first resource address of a first video segment of some videos in the APP is stored at the same time, so that when a video playing instruction is received, the video is played directly based on the locally stored first resource address. In this implementation, the request may be sent to the server at a preset time interval to update the first resource address stored locally. For example, a live APP downloaded by a user on day 4, month 20, where only the first resource address of the first video segment of the video before day 4, month 20 can be obtained from the server, may send a request instruction to the server at an interval of one day, for example, on day 4, month 21, to obtain the first resource address of the first video segment of the video generated on day 4, month 20 to day 4, month 21. By the method of the embodiment, the time for analyzing the ts fragment collection can be saved, and the waiting time of the user can be reduced. The method of the embodiment can reduce the storage burden of the device.
In another embodiment, when a video to be played appears on a screen of a mobile phone, a first resource address of a first video segment of the video is acquired from a server and stored locally, and when a playing instruction of the video is received, the video is played directly based on the locally stored first resource address. For example, existing mobile phones are designed as large screens, a user can simultaneously display 2 to 3 video widgets on the screen when browsing live videos, when videos are displayed on the video widgets, the mobile phone sends an instruction for acquiring a first resource address to a server, then the server issues the first resource address of a first video clip of the videos to the mobile phone, and the mobile phone acquires the first resource address of the first video clip of the videos from the server and stores the first resource address in the local area. And when the user clicks a video window to generate a video playing instruction, playing the video based on the acquired first resource address of the first video clip. Therefore, the intention of the user can be predicted, the first resource address of the first video clip of the video can be obtained in advance, and when a playing instruction of the user for playing the video is received, the video is directly played based on the first resource address. Therefore, the time for analyzing the ts fragment collection can be saved, and the waiting time of the user can be reduced.
In another embodiment, a request instruction may also be sent to the server at a preset interval to obtain a first resource address of a first video segment of a video generated within the preset interval, and store the obtained first resource address to the local, and when a video playing instruction is received, play is directly performed based on the locally stored first resource address. For example, a request instruction may be sent to the server at an interval of 30 minutes to acquire a first resource address of a video generated within 30 minutes, and the acquired first resource address may be saved, so that when a play instruction of the video is received, the video is played directly based on the locally saved first resource address. Therefore, the time for analyzing the ts fragment collection can be saved, and the waiting time of the user can be reduced.
By the method, only the first resource address of the first video segment of the video is stored locally, so that the storage burden can be greatly reduced, the analysis time can be saved, the waiting time of a user can be reduced, and the second-to-first rate of the video can be improved.
In an embodiment, taking a tiger video as an example for illustration, a tiger live video is mainly a video in an M3u8 format. The ts clip collection is parsed out when the video in this format is played. In the present application, the first resource address of the first ts video segment of the video in the M3u8 format is acquired from the server in advance and stored locally. Therefore, when the video is played, the video can be played based on the first ts video segment acquired in advance.
In this embodiment, the first resource address of the first video segment of all videos is obtained from the server in advance and stored locally. When a user clicks a video to play, a first resource address is directly obtained from the local, part of video data of the video is loaded based on the first resource address, and the video is played. At the moment, a resource analysis process is not needed from the moment when the user clicks the video to the moment when the video is played, so that the time consumed is reduced, the second-starting success rate of the video is improved, and the user experience is improved.
Referring to fig. 3, a flowchart of a video playing method according to a third embodiment of the present invention is shown, which is different from the first embodiment shown in fig. 2 in that step S22 is performed simultaneously with step S31: and acquiring second resource addresses of other video segments of the video while loading the video data of the video based on the first resource address and playing the video.
Since the first resource address of the first video segment of the video is acquired from the server in advance, the second resource addresses of other video segments of the video are acquired while part of video data of the video is loaded and the video is played based on the first resource address. For example, while playing a first video segment of a video based on a first resource address of the first segment, a second resource address of a second segment of the video is parsed, and after the playing of the first video segment is completed, the second resource address of the second video segment is loaded to play the second video segment. And when the second video segment is played, the second resource address of the third segment of the video is analyzed, and after the second video segment is played, the second resource address of the third segment of the video is loaded to play the third video segment, and so on.
Step S32: and loading the rest video data of the video based on the second resource address and playing the video.
And loading the rest video data of the video based on the second resource address and playing the video.
Specifically, for example, if the currently played video has a first video segment, a second video segment, and a third video segment. The first resource address of the first video segment has been obtained from the server prior to clicking on the play video. After the video is played by clicking, playing the first video clip based on the first resource address, loading or analyzing a second resource address of the second video clip from the server in the playing process of the first video clip, and directly playing the second video clip based on the second resource address of the second video clip after the playing of the first video clip is finished; and in the process of playing the second video clip, loading or analyzing a second resource address of the third video clip from the server, and directly playing the third video clip based on the second resource address of the third video clip after the second video clip is played. In another embodiment, in the process of playing the first video segment, the second resource address of the second video segment is loaded or analyzed from the server, and if the second resource address of the second video segment is analyzed, the second resource address of the third video segment can be directly analyzed.
In the method shown in this embodiment, the first resource address of the first video segment of all videos is obtained from the server in advance and stored locally. When a user clicks a video to play, a first resource address is directly obtained from the local, part of video data of the video is loaded based on the first resource address, and the video is played. And the resource addresses of other video clips are analyzed in the playing process of the first video clip, so that the time consumed is reduced, the second-starting success rate of the video is improved, and the user experience is improved.
Fig. 4 is a schematic flow chart of a video playing method according to a fourth embodiment of the present invention. Compared with the third embodiment shown in fig. 3, the difference is that the present embodiment further includes:
step S43: and saving the second resource address of the video to the local.
Specifically, after the video is played, the second resource address of the video is stored to the local. Therefore, when the video is played next time, the first resource address and the second resource address which are locally stored can be directly used for playing without loading.
Specifically, whether a video playing instruction is received within a preset time period is detected; and responding to the playing instruction of the video received in the preset time period, directly acquiring the first resource address and the second resource address from the local, loading complete video data of the video and playing the video. Specifically, when the user clicks the video to play within a preset time period, whether the second resource address of the video is stored locally or not can be judged, and the first resource address of the video is obtained from the server in advance. If the second resource address of the video is locally stored, responding to the second resource address of the video, and directly acquiring the first resource address and the second resource address of the video from the local; and loading complete video data of the video based on the first resource address and the second resource address and playing the video. And if the second resource address of the video is not locally stored, responding to the second resource address of the video which is not locally stored, and acquiring the second resource address of the video from the server. The specific obtaining method is as described in fig. 1 to fig. 3, and is not described herein again.
By the method of the embodiment, the first resource addresses of the first video segments of all videos are acquired from the server in advance and are stored locally. When a user clicks a video to play, a first resource address is directly obtained from the local, part of video data of the video is loaded based on the first resource address, and the video is played. And analyzing the resource addresses of other video clips in the playing process of the first video clip. After the video is played, the resource address of the video is stored, and when the video is played next time, the stored resource address is directly used for playing without reloading, so that the time consumed is reduced, the second-starting success rate of the video is improved, and the user experience is improved.
In another embodiment, in order to save the memory, if the playing command of the video is not received within the preset time period, the second resource address stored locally is cleared. At this point, only the first resource address of the video is saved locally. When a playing instruction of the video is received, the video is played by using the method shown in fig. 2.
In another embodiment, in order to save the memory, if the playing instruction of the video is not received within the preset time period, the second resource address stored locally is partially cleared, and the first resource address and the partial second resource address of the video are locally stored at this time. When a playing instruction of the video is received, the first video clip is played based on the first resource address, and the second resource addresses of the rest video clips are analyzed in the playing process. And if the second resource address of a certain video segment is stored locally, skipping to analyze the resource address of the video segment and analyzing the second resource address of the next video segment. For example, if the second resource address of the third video segment and the second resource address of the fourth video segment are locally stored, when the first video segment is played based on the first resource address, it is detected whether the second resource address of the second video segment is locally stored, and if not, the second resource address of the second video segment is parsed. When the second resource address of the second video segment is played, whether the second resource address of the third video segment is locally stored or not is detected, if yes, the second resource address of the third video segment is skipped over to be analyzed, whether the second resource address of the fourth video segment is locally stored or not is further detected, if yes, the second resource address of the fourth video segment is skipped over to be analyzed, whether the second resource address of the fifth video segment is locally stored or not is further detected, and if not, the second resource address of the fifth video segment is analyzed.
By the method, the analysis time can be further saved, the waiting time of a user is reduced, and the second video opening rate is improved.
In an embodiment of the present application, a video format is a video in an M3u8 format, and before playing the video, when a first resource address of a first video segment of the video is obtained from a server and stored locally, a first resource address of a first ts video segment of the video is obtained and stored locally. And when a video playing instruction is received, playing based on the first resource address of the first ts video segment, and acquiring the second resource address of the second ts video segment from the server in the playing process. After the first ts video segment, say, is complete, the second ts video segment, say, is utilized for the second resource address of the second ts video segment, and so on. By the method, the analysis time can be saved, the waiting time of a user is reduced, and the second-to-first rate of the video is improved.
Fig. 5 is a schematic structural diagram of a video playback device according to an embodiment of the present invention. The method specifically comprises the following steps: an acquisition module 51 and a video playing module 52.
In one embodiment, the obtaining module 51 is configured to obtain the resource address of the video from the server and save the resource address to the local. The playing module 52 is configured to respond to a playing instruction of the video, and play the video based on the resource address.
Specifically, when a user records a video by using some live broadcast software APP, the video is uploaded to a server, the server generates some corresponding resource addresses based on the video, and when the user needs to play the video, the user needs to acquire the resource addresses from the server to play the video. Taking the video in the M3u8 format as an example, the video in this format needs to parse the ts fragment collection before playing ts therein. The time consuming process of clicking the video to view the video by the user is long, and the user needs to go through the process of m3u8 url- > m3u8 file- > first tsurl- > first ts file to be able to play. This process of downloading the video TS clip stream is time consuming, which results in a long waiting time for the user.
In this embodiment, the user obtains the resource address of the video from the server by using the obtaining module 51 in advance and stores the resource address to the local, and when receiving the playing instruction of the video, the user plays the video based on the resource address by using the playing module 52.
In an embodiment, the obtaining module 51 may send a request to the server at the same time when downloading the corresponding live APP, and store resource addresses of some videos in the APP at the same time when downloading and installing the APP, so that when receiving a playing instruction of a video, the playing module 52 directly plays based on the locally stored resource addresses. In this embodiment, the obtaining module 51 may send a request to the server at preset time intervals to update the locally stored resource address. For example, a live APP downloaded by a user in 4/20 th day, at which only the resource address of a video before 4/20 th day can be acquired from the server, may send a request instruction to the server at an interval of one day, for example, in 4/21 th day, to acquire the resource address of a video generated in 4/20 th to 4/21 th day. By the method of the embodiment, the time for analyzing the ts fragment collection can be saved, and the waiting time of the user can be reduced. The method of the embodiment has higher requirements on the storage space and the storage performance of the equipment.
In another embodiment, when a video to be played appears on the screen of the mobile phone, that is, the obtaining module 51 is used to obtain the resource address of the video from the server and store the resource address to the local, and when a playing instruction of the video is received, the playing module 52 directly plays the video based on the locally stored resource address. For example, existing mobile phones are designed as large screens, when a user browses live videos, 2 to 3 video widgets can be displayed on the screen at the same time, when videos are displayed on the video widgets, the obtaining module 51 sends an instruction for obtaining a resource address to the server, then the server issues the resource address to the mobile phone, and the mobile phone obtains the resource address of the videos from the server and stores the resource address to the local. When the user clicks the video window to generate a video playing instruction, the playing module 52 plays the video based on the acquired resource address. Therefore, the intention of the user can be predicted, the resource address of the video can be obtained in advance, and when a playing instruction of the user for playing the video is received, the video is directly played based on the resource address. Therefore, the time for analyzing the ts fragment collection can be saved, and the waiting time of the user can be reduced.
In another embodiment, the obtaining module 51 may further send a request instruction to the server at a preset interval to obtain a resource address of a video generated within the preset interval, and store the obtained resource address to the local, and when receiving a playing instruction of the video, the playing module 52 directly plays the video based on the locally stored resource address. For example, a request instruction may be sent to the server at an interval of 30 minutes to acquire a resource address of a video generated within 30 minutes, and the acquired resource address may be saved, so that when a play instruction of the video is received, the video is played directly based on the locally saved resource address. Therefore, the time for analyzing the ts fragment collection can be saved, and the waiting time of the user can be reduced.
In an embodiment, the obtaining module 51 is configured to obtain a first resource address of a first video segment of the video from a server and store the first resource address to a local; the playing module 52 is configured to, in response to a playing instruction of the video, load a part of video data of the video based on the first resource address and play the video.
Specifically, for example, when a video to be played appears on a screen of a mobile phone, the obtaining module 51 obtains a first resource address of a first video clip of the video from a server and stores the first resource address to the local, and when a playing instruction of the video is received, the playing module 52 directly plays the video based on the first resource address stored locally. For example, existing mobile phones are designed as large screens, a user can simultaneously display 2 to 3 video widgets on the screen when browsing live videos, when videos are displayed on the video widgets, the mobile phone sends an instruction for acquiring a first resource address to a server, then the server issues the first resource address of a first video clip of the videos to the mobile phone, and the mobile phone acquires the first resource address of the first video clip of the videos from the server and stores the first resource address in the local area. And when the user clicks a video window to generate a video playing instruction, playing the video based on the acquired first resource address of the first video clip. Therefore, the intention of the user can be predicted, the first resource address of the first video clip of the video can be obtained in advance, and when a playing instruction of the user for playing the video is received, the video is directly played based on the first resource address. Therefore, the time for analyzing the ts fragment collection can be saved, and the waiting time of the user can be reduced.
In the embodiment, only the first resource address of the first video segment of the video is stored locally, so that the storage burden can be greatly reduced, the analysis time can be saved, the waiting time of a user can be reduced, and the second opening rate of the video can be improved.
In an embodiment, the obtaining module 51 is configured to obtain a first resource address of a first video segment of the video from a server and store the first resource address to a local, and the playing module 52 is configured to, in response to a playing instruction of the video, load partial video data of the video based on the first resource address and play the video. When the playing module 52 loads part of the video data of the video based on the first resource address and plays the video, the obtaining module 51 obtains second resource addresses of the remaining video segments of the video, and the playing module 52 loads the remaining part of the video data of the video based on the second resource addresses and continues to play the video.
Since the obtaining module 51 obtains the first resource address of the first video segment of the video from the server in advance, the obtaining module 51 obtains the second resource addresses of other video segments of the video while the playing module 52 loads part of the video data of the video based on the first resource address and plays the video. For example, while the playing module 52 plays the first video segment of the video based on the first resource address of the first segment, the obtaining module 51 parses the second resource address of the second segment of the video, and loads the second resource address of the second video segment to play the second video segment after the playing of the first video segment is completed. When the second video segment is played, the obtaining module 51 parses the second resource address of the third segment of the video, and after the second video segment is played, loads the second resource address of the third segment of the video to play the third video segment, and so on.
In this embodiment, the first resource address of the first video segment of all videos is obtained from the server in advance and stored locally. When a user clicks a video to play, a first resource address is directly obtained from the local, part of video data of the video is loaded based on the first resource address, and the video is played. And the resource addresses of other video clips are analyzed in the playing process of the first video clip, so that the time consumed is reduced, the second-starting success rate of the video is improved, and the user experience is improved.
In an embodiment, the playing module 52 further saves the second resource address of the video to the local after loading the remaining video data of the video based on the second resource address and playing the video.
In an embodiment, the obtaining module 51 is further configured to detect whether a playing instruction of the video is received within a preset time period, and directly obtain the first resource address and the second resource address from a local location in response to receiving the playing instruction of the video within the preset time period; the playing module 52 is used for loading the complete video data of the video and playing the video.
In an embodiment, the obtaining module 51 is further configured to detect whether a playing instruction of the video is received within a preset time period, and in response to that the playing instruction of the video is not received within the preset time period, the obtaining module 51 locally removes the second resource address; or locally clearing a portion of the second resource address.
Specifically, after the video is played, the second resource address of the video is stored to the local. Therefore, when the video is played next time, the first resource address and the second resource address which are locally stored can be directly used for playing without loading.
Specifically, whether a video playing instruction is received within a preset time period is detected; and responding to the playing instruction of the video received in the preset time period, directly acquiring the first resource address and the second resource address from the local, loading complete video data of the video and playing the video. Specifically, when the user clicks the video to play within a preset time period, whether the second resource address of the video is stored locally or not can be judged, and the first resource address of the video is obtained from the server in advance. If the second resource address of the video is locally stored, responding to the second resource address of the video, and directly acquiring the first resource address and the second resource address of the video from the local; and loading complete video data of the video based on the first resource address and the second resource address and playing the video. And if the second resource address of the video is not locally stored, responding to the second resource address of the video which is not locally stored, and acquiring the second resource address of the video from the server. The specific obtaining method is as described in fig. 1 to fig. 3, and is not described herein again.
By the method of the embodiment, the first resource addresses of the first video segments of all videos are acquired from the server in advance and are stored locally. When a user clicks a video to play, a first resource address is directly obtained from the local, part of video data of the video is loaded based on the first resource address, and the video is played. And analyzing the resource addresses of other video clips in the playing process of the first video clip. After the video is played, the resource address of the video is stored, and when the video is played next time, the stored resource address is directly used for playing without reloading, so that the time consumed is reduced, the second-starting success rate of the video is improved, and the user experience is improved.
In another embodiment, in order to save the memory, if the playing command of the video is not received within the preset time period, the second resource address stored locally is cleared. At this point, only the first resource address of the video is saved locally. When a playing instruction of the video is received, the video is played by using the method shown in fig. 2.
In another embodiment, in order to save the memory, if the playing instruction of the video is not received within the preset time period, the second resource address stored locally is partially cleared, and the first resource address and the partial second resource address of the video are locally stored at this time. When a playing instruction of the video is received, the first video clip is played based on the first resource address, and the second resource addresses of the rest video clips are analyzed in the playing process. And if the second resource address of a certain video segment is stored locally, skipping to analyze the resource address of the video segment and analyzing the second resource address of the next video segment. For example, if the second resource address of the third video segment and the second resource address of the fourth video segment are locally stored, when the first video segment is played based on the first resource address, it is detected whether the second resource address of the second video segment is locally stored, and if not, the second resource address of the second video segment is parsed. When the second resource address of the second video segment is played, whether the second resource address of the third video segment is locally stored or not is detected, if yes, the second resource address of the third video segment is skipped over to be analyzed, whether the second resource address of the fourth video segment is locally stored or not is further detected, if yes, the second resource address of the fourth video segment is skipped over to be analyzed, whether the second resource address of the fifth video segment is locally stored or not is further detected, and if not, the second resource address of the fifth video segment is analyzed.
By the method, the analysis time can be further saved, the waiting time of a user is reduced, and the second video opening rate is improved.
In an embodiment, the format of the video includes a video in M3u8 format, and before playing the video, the obtaining module 51 obtains the first resource address of the first ts video segment of the video in M3u8 format and stores the first resource address to the local. Upon receiving the video playing instruction, the playing module 52 plays the first ts video segment based on the first resource address of the first ts video segment. Further, while the playing module 52 plays the first ts video segment based on the first resource address of the first ts video segment, the obtaining module 51 obtains the second resource address of the second ts video segment of the video in the M3u8 format and stores the second resource address to the local, and the playing module 52 plays the second ts video segment based on the second resource address of the second ts video segment.
Referring to fig. 6, a schematic structural diagram of an electronic device according to an embodiment of the present invention is shown, where the electronic device includes a memory 202 and a processor 201 that are connected to each other.
The memory 202 is used to store program instructions for implementing any of the methods described above.
The processor 201 is used to execute program instructions stored by the memory 202.
The processor 201 may also be referred to as a Central Processing Unit (CPU). The processor 201 may be an integrated circuit chip having signal processing capabilities. The processor 201 may also be a general purpose processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The storage 202 may be a memory bank, a TF card, etc., and may store all information in the electronic device of the device, including the input raw data, the computer program, the intermediate operation results, and the final operation results. It stores and retrieves information based on the location specified by the controller. With the memory, the electronic device can only have the memory function to ensure the normal operation. The storage of electronic devices can be classified into a main storage (internal storage) and an auxiliary storage (external storage) according to the use, and also into an external storage and an internal storage. The external memory is usually a magnetic medium, an optical disk, or the like, and can store information for a long period of time. The memory refers to a storage component on the main board, which is used for storing data and programs currently being executed, but is only used for temporarily storing the programs and the data, and the data is lost when the power is turned off or the power is cut off.
In the several embodiments provided in the present application, it should be understood that the disclosed method and apparatus may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, a division of a module or a unit is merely a logical division, and an actual implementation may have another division, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
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 a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose 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 unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or contributed to by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a system server, a network device, or the like) or a processor (processor) to execute all or part of the steps of the method of the embodiments of the present application.
Please refer to fig. 6, which is a schematic structural diagram of a computer-readable storage medium according to the present invention. The storage medium of the present application stores a program file 203 capable of implementing all the methods described above, wherein the program file 203 may be stored in the storage medium in the form of a software product, and includes several instructions to enable a computer device (which may be a personal computer, a server, or a network device) or a processor (processor) to execute all or part of the steps of the methods of the embodiments of the present application. The aforementioned storage device includes: various media capable of storing program codes, such as a usb disk, a mobile hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, or terminal devices, such as a computer, a server, a mobile phone, and a tablet.
The above description is only an embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (11)

1. A video playback method, comprising:
acquiring a resource address of the video from the server and storing the resource address of the video to the local;
and responding to a playing instruction of the video, and playing the video based on the resource address.
2. The video playing method according to claim 1, wherein the obtaining and saving the resource address of the video from the server to the local comprises:
acquiring a first resource address of a first video segment of the video from a server and storing the first resource address to the local;
the playing the video based on the resource address in response to the playing instruction of the video comprises:
and responding to a playing instruction of the video, loading partial video data of the video based on the first resource address and playing the video.
3. The video playback method of claim 2, further comprising:
loading video data of the video based on the first resource address and playing the video, and simultaneously acquiring second resource addresses of other video segments of the video;
and loading the rest video data of the video based on the second resource address and continuing to play the video.
4. The video playing method according to claim 3, wherein after the step of loading the remaining video data of the video based on the second resource address and playing the video, the method further comprises:
saving the second resource address of the video to a local.
5. The video playback method of claim 4, wherein the method further comprises:
detecting whether a playing instruction of the video is received within a preset time period;
and responding to the playing instruction of the video received in the preset time period, directly acquiring the first resource address and the second resource address from the local, loading complete video data of the video and playing the video.
6. The video playback method of claim 5, wherein the method further comprises:
in response to the fact that the playing instruction of the video is not received within the preset time period, the second resource address is cleared from the local area; or
Clearing portions of the second resource address locally.
7. The video playback method according to claim 1, wherein the format of the video includes a video in M3u8 format.
8. The video playing method according to claim 1, wherein the step of obtaining the first resource address of the first video segment of the video from the server and saving the first resource address to the local comprises:
and acquiring a first resource address of a first ts video segment of the video and storing the first resource address to the local.
9. A video playback apparatus, comprising:
the acquisition module is used for acquiring the resource address of the video from the server and storing the resource address to the local;
and the video playing module is used for responding to a playing instruction of the video and playing the video based on the resource address.
10. An electronic device, comprising: a memory storing program instructions and a processor retrieving the program instructions from the memory to perform the method of any one of claims 1-8.
11. A computer-readable storage medium, characterized in that a program file is stored, which program file can be executed to implement the method according to any one of claims 1-8.
CN202110474515.5A 2021-04-29 2021-04-29 Video playing method and device, electronic equipment and storage medium Pending CN113259695A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110474515.5A CN113259695A (en) 2021-04-29 2021-04-29 Video playing method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110474515.5A CN113259695A (en) 2021-04-29 2021-04-29 Video playing method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN113259695A true CN113259695A (en) 2021-08-13

Family

ID=77223696

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110474515.5A Pending CN113259695A (en) 2021-04-29 2021-04-29 Video playing method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113259695A (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105872607A (en) * 2016-03-31 2016-08-17 乐视控股(北京)有限公司 Method, server and terminal device for providing multimedia contents
CN105898380A (en) * 2015-12-14 2016-08-24 乐视云计算有限公司 Rapid network video play starting method and device
CN108848401A (en) * 2018-07-26 2018-11-20 聚好看科技股份有限公司 Video plays broadcasting method and device
CN109474854A (en) * 2018-11-29 2019-03-15 广州市百果园信息技术有限公司 Video broadcasting method, the generation method of playlist and relevant device
CN110401858A (en) * 2019-08-05 2019-11-01 北京达佳互联信息技术有限公司 A kind of video broadcasting method, device, electronic equipment and storage medium
CN111182328A (en) * 2020-02-12 2020-05-19 北京达佳互联信息技术有限公司 Video editing method, device, server, terminal and storage medium
CN112584255A (en) * 2020-12-04 2021-03-30 广州虎牙科技有限公司 Method and device for playing streaming media data, computer equipment and storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105898380A (en) * 2015-12-14 2016-08-24 乐视云计算有限公司 Rapid network video play starting method and device
CN105872607A (en) * 2016-03-31 2016-08-17 乐视控股(北京)有限公司 Method, server and terminal device for providing multimedia contents
CN108848401A (en) * 2018-07-26 2018-11-20 聚好看科技股份有限公司 Video plays broadcasting method and device
CN109474854A (en) * 2018-11-29 2019-03-15 广州市百果园信息技术有限公司 Video broadcasting method, the generation method of playlist and relevant device
CN110401858A (en) * 2019-08-05 2019-11-01 北京达佳互联信息技术有限公司 A kind of video broadcasting method, device, electronic equipment and storage medium
CN111182328A (en) * 2020-02-12 2020-05-19 北京达佳互联信息技术有限公司 Video editing method, device, server, terminal and storage medium
CN112584255A (en) * 2020-12-04 2021-03-30 广州虎牙科技有限公司 Method and device for playing streaming media data, computer equipment and storage medium

Similar Documents

Publication Publication Date Title
CN108882040B (en) Startup content management method of television, smart television and readable storage medium
US20180255359A1 (en) Method for sharing a captured video clip and electronic device
CN110784750B (en) Video playing method and device and computer equipment
CN108228293B (en) Interface skin switching method and device
CN110062284A (en) Video broadcasting method, device and electronic equipment
CN109803151B (en) Multimedia data stream switching method and device, storage medium and electronic device
CN103686414A (en) Network video playing method and device
KR102552286B1 (en) Image display apparatus, and method for operating the same
CN111901695B (en) Video content interception method, device and equipment and computer storage medium
CN103618926A (en) Method and device for controlling displaying application webpage of intelligent television
US11962837B2 (en) Video update push method and terminal
CN115562744B (en) Application program loading method and electronic device
US20150032517A1 (en) Method for Playing Back Advertisement and Video Content and Electronic Apparatus Using the Method
JP7058795B2 (en) Video processing methods, devices, terminals and storage media
CN106470351B (en) Page display method and page display device
CN112383623A (en) Multimedia file processing method and device, terminal and network access point equipment
CN109348280B (en) Network television program switching method, intelligent television and computer readable storage medium
CN113259695A (en) Video playing method and device, electronic equipment and storage medium
CN109922366B (en) Equipment parameter adjusting method, device, equipment and medium
CN108572985B (en) Page display method and device
CN106844683B (en) Information sharing method and device
CN112291602B (en) Video playing method, electronic equipment and storage medium
US20130081080A1 (en) Television receiver
US20170070755A1 (en) Information device and distribution device
CN107820119B (en) Program recording method, television and computer readable 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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20210813