CN110557689B - Video playing method and device - Google Patents

Video playing method and device Download PDF

Info

Publication number
CN110557689B
CN110557689B CN201910934574.9A CN201910934574A CN110557689B CN 110557689 B CN110557689 B CN 110557689B CN 201910934574 A CN201910934574 A CN 201910934574A CN 110557689 B CN110557689 B CN 110557689B
Authority
CN
China
Prior art keywords
file
video
sub
download address
information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910934574.9A
Other languages
Chinese (zh)
Other versions
CN110557689A (en
Inventor
邵灿
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hunan Happly Sunshine Interactive Entertainment Media Co Ltd
Original Assignee
Hunan Happly Sunshine Interactive Entertainment Media 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 Hunan Happly Sunshine Interactive Entertainment Media Co Ltd filed Critical Hunan Happly Sunshine Interactive Entertainment Media Co Ltd
Priority to CN201910934574.9A priority Critical patent/CN110557689B/en
Publication of CN110557689A publication Critical patent/CN110557689A/en
Application granted granted Critical
Publication of CN110557689B publication Critical patent/CN110557689B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/238Interfacing the downstream path of the transmission network, e.g. adapting the transmission rate of a video stream to network bandwidth; Processing of multiplex streams
    • 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/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/239Interfacing the upstream path of the transmission network, e.g. prioritizing client content requests
    • H04N21/2393Interfacing the upstream path of the transmission network, e.g. prioritizing client content requests involving handling client requests
    • 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/25Management operations performed by the server for facilitating the content distribution or administrating data related to end-users or client devices, e.g. end-user or client device authentication, learning user preferences for recommending movies
    • H04N21/262Content or additional data distribution scheduling, e.g. sending additional data at off-peak times, updating software modules, calculating the carousel transmission frequency, delaying a video stream transmission, generating play-lists
    • H04N21/26258Content or additional data distribution scheduling, e.g. sending additional data at off-peak times, updating software modules, calculating the carousel transmission frequency, delaying a video stream transmission, generating play-lists for generating a list of items to be played back in a given order, e.g. playlist, or scheduling item distribution according to such list
    • 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/438Interfacing the downstream path of the transmission network originating from a server, e.g. retrieving encoded video stream packets from an IP network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/80Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
    • H04N21/83Generation or processing of protective or descriptive data associated with content; Content structuring
    • H04N21/845Structuring of content, e.g. decomposing content into time segments
    • H04N21/8456Structuring of content, e.g. decomposing content into time segments by decomposing the content in the time domain, e.g. in time segments

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Databases & Information Systems (AREA)
  • Information Transfer Between Computers (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)

Abstract

The present invention relates to the field of computer technologies, and in particular, to a video playing method and apparatus. The method comprises the following steps: when a video playing request sent by a client to a media resource system is received, a file downloading request is generated, and the file downloading request is sent to a CDN scheduler; when a file downloading address fed back by the CDN scheduler is received, determining a target video file corresponding to the file downloading address in a media resource system; analyzing the target video file, obtaining each sub video file contained in the target video file, and obtaining a final download address corresponding to each sub video file according to the file download address and the sub file information of each sub video file; and sending each final download address to the client, triggering the client to obtain the video content corresponding to each sub-video file according to each final download address, and playing the video content. By the method, the time for waiting for video playing can be shortened, and the video watching experience of a user is improved.

Description

Video playing method and device
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a video playing method and apparatus.
Background
With the development of network videos, the requirements of users on video playing are higher and higher. In the prior art, a client needs to obtain an m3u8 file of a video to be played through a streaming media network transport protocol HLS, the m3u8 file is used as a video index file and includes a plurality of ts files corresponding to video stream slices, and the client can obtain a video clip corresponding to each video stream slice according to each ts file to play the video.
In the prior art, in order to obtain each ts file, a client needs to request a media resource system to obtain a CDN address, then request the CDN address to obtain a download address of an m3u8 file, and download the m3u8 file according to the download address of the m3u8 file. Each time the client requests various download addresses, the client consumes a certain request time, and after obtaining the m3u8 file, the client needs to download each ts file in the m3u8 to obtain the video clip corresponding to each ts file in the m3u8 file for playing. If the acquired m3u8 file is larger or the client network quality is poor, the required request time is longer, which results in that the time for the user to wait for the video to play is too long, and the user experience of watching the video is affected.
Disclosure of Invention
In view of this, the present invention provides a video playing method, in which a client only needs to send a video playing request to a media resource system and then waits for the media resource system to return to a final download address of a sub-video file, and multiple address requests are not needed, so that the time for waiting for video playing is shortened, and the experience of a user watching a video is improved.
The invention also provides a video playing device for ensuring the realization and the application of the method in practice.
A video playback method, comprising:
when a video playing request sent by a client to a media resource system is received, generating a file downloading request corresponding to the video playing request, and sending the file downloading request to a preset Content Delivery Network (CDN) scheduler;
when a file downloading address fed back by the CDN scheduler according to the file downloading request is received, determining a target video file corresponding to the file downloading address in each video file prestored in the media resource system;
analyzing the target video file to obtain each sub video file contained in the target video file, and obtaining a final download address corresponding to each sub video file according to the file download address and the sub file information of each sub video file;
and sending the final download address corresponding to each sub-video file to the client, triggering the client to obtain the video content corresponding to each sub-video file according to each final download address, and playing the video content.
Optionally, the generating a file download request corresponding to the video playing request, and sending the file download request to a preset content delivery network CDN scheduler includes:
acquiring video information contained in the video playing request;
generating a file downloading request corresponding to the video playing request according to the video information;
and acquiring a scheduling address corresponding to the video information, and sending the file downloading request to the CDN scheduler through the scheduling address.
Optionally, the determining, in each video file pre-stored in the media asset system, a target video file corresponding to the file download address includes:
acquiring file information of each video file pre-stored in the media asset system;
analyzing each file information, obtaining a file identifier corresponding to each file information, and matching each file identifier with the file downloading address;
and if the currently matched file identifier is matched with the file downloading address, determining the video file corresponding to the currently matched file identifier as a target video file.
Optionally, the obtaining a final download address corresponding to each sub-video file according to the file download address and the sub-file information of each sub-video file includes:
acquiring a subfile list contained in the target video file, wherein the subfile list contains a plurality of sub video files;
determining the arrangement sequence corresponding to each sub video file in the sub file list, and sequentially analyzing each sub video file according to the arrangement sequence to obtain a file path corresponding to each sub video file;
and splicing the file download address with each file path respectively to obtain a final download address corresponding to each sub-video file.
Optionally, in the method, the sending the final download address corresponding to each of the sub video files to the client, triggering the client to obtain the video content corresponding to each of the sub video files according to each of the final download addresses, and playing the video content includes:
storing each final download address into the subfile list according to the arrangement sequence, and determining playing information corresponding to video content to be played;
and sending the file list and the playing information to the client, triggering the client to obtain video contents corresponding to the sub-video files according to the final downloading addresses in the file list, and playing the video contents according to the playing information.
A video playback apparatus comprising:
the generation unit is used for generating a file downloading request corresponding to the video playing request when receiving the video playing request sent by the client to the media resource system, and sending the file downloading request to a preset Content Delivery Network (CDN) scheduler;
a determining unit, configured to determine, when a file download address fed back by the CDN scheduler according to the file download request is received, a target video file corresponding to the file download address in each video file pre-stored by the media resource system;
the analysis unit is used for analyzing the target video file, obtaining each sub video file contained in the target video file, and obtaining a final download address corresponding to each sub video file according to the file download address and the sub file information of each sub video file;
and the sending unit is used for sending the final download address corresponding to each sub-video file to the client, triggering the client to obtain the video content corresponding to each sub-video file according to each final download address, and playing the video content.
The above apparatus, optionally, the generating unit includes:
the first acquiring subunit is used for acquiring the video information contained in the video playing request;
the generating subunit is used for generating a file downloading request corresponding to the video playing request according to the video information;
and the sending subunit is configured to obtain a scheduling address corresponding to the video information, and send the file downloading request to the CDN scheduler through the scheduling address.
The above apparatus, optionally, the determining unit includes:
the second acquisition subunit is used for acquiring file information of each video file pre-stored in the media resource system;
the matching subunit is used for analyzing each file information, obtaining a file identifier corresponding to each file information, and matching each file identifier with the file downloading address;
and the determining subunit is used for determining the video file corresponding to the currently matched file identifier as the target video file if the currently matched file identifier is matched with the file downloading address.
The above apparatus, optionally, the parsing unit includes:
a third obtaining subunit, configured to obtain a subfile list included in the target video file, where the subfile list includes multiple sub video files;
the analysis subunit is configured to determine an arrangement order corresponding to each of the sub video files in the sub file list, and sequentially analyze each of the sub video files according to the arrangement order to obtain a file path corresponding to each of the sub video files;
and the splicing subunit is used for splicing the file download address with each file path respectively to obtain a final download address corresponding to each sub-video file.
The above apparatus, optionally, the sending unit includes:
the storage subunit is configured to store each final download address into the subfile list according to the arrangement order, and determine playing information corresponding to video content to be played;
and the sending subunit is configured to send the file list and the playing information to the client, so that the client obtains video content corresponding to each sub-video file according to each final download address in the file list, and plays the video content according to the playing information.
Compared with the prior art, the invention has the following advantages:
the invention provides a video playing method, which comprises the following steps: when a video playing request sent by a client to a media resource system is received, generating a file downloading request corresponding to the video playing request, and sending the file downloading request to a preset Content Delivery Network (CDN) scheduler; when a file downloading address fed back by the CDN scheduler according to the file downloading request is received, determining a target video file corresponding to the file downloading address in each video file prestored in the media resource system; analyzing the target video file to obtain each sub video file contained in the target video file, and obtaining a final download address corresponding to each sub video file according to the file download address and the sub file information of each sub video file; and sending the final download address corresponding to each sub-video file to the client, triggering the client to obtain the video content corresponding to each sub-video file according to each final download address, and playing the video content. By the method, the time for waiting for video playing can be shortened, and the video watching experience of a user is improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a flowchart of a method for playing a video according to an embodiment of the present invention;
fig. 2 is a flowchart of another method of playing a video according to an embodiment of the present invention;
fig. 3 is a flowchart of another method of playing a video according to an embodiment of the present invention;
fig. 4 is a device structure diagram of a video playback device according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, 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 invention.
In this application, relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions, and the terms "comprises", "comprising", or any other variation thereof are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The invention is operational with numerous general purpose or special purpose computing device environments or configurations. For example: personal computers, server computers, hand-held or portable devices, tablet-type devices, multi-processor apparatus, distributed computing environments that include any of the above devices or equipment, and the like.
The embodiment of the invention provides a video playing method which can be applied to various system platforms, and the execution main body of the method can be a media resource system or a processor arranged in the media resource system. The media asset system is a system device for managing various audio and video digital media data, and is used for performing management operations such as storage, conversion, sharing, release and the like on various multimedia data, and a method flow chart of the method is shown in fig. 1, and specifically comprises the following steps:
s101: when a video playing request sent by a client to a media resource system is received, generating a file downloading request corresponding to the video playing request, and sending the file downloading request to a preset Content Delivery Network (CDN) scheduler;
in the embodiment of the invention, when a user needs to play a certain video, the triggering operation needs to be carried out through the client. And the client sends a video playing request to the media resource system according to the triggering operation of the user. When the media resource system receives a video playing request sent by the client, a file downloading request is generated according to the video playing request. And directly sending the file downloading request to the CDN scheduler through an intranet between the media resource system and the CDN scheduler of the content delivery network.
It should be noted that, when the media resource system sends a file download request to the CDN scheduler through the intranet, it hardly consumes excessive time, and a situation of network delay does not occur.
It should be further noted that the CDN scheduler stores a file download address of each video file, and when a file download request is received, the CDN scheduler generates the file download address according to the file download request to perform feedback.
S102: when a file downloading address fed back by the CDN scheduler according to the file downloading request is received, determining a target video file corresponding to the file downloading address in each video file prestored in the media resource system;
in the embodiment of the invention, after the CDN scheduler receives the file downloading request sent by the media resource system, the file downloading address corresponding to the file downloading information is generated according to the file downloading information contained in the file downloading request. And feeding back the file download address to the request end, namely feeding back the file download address to the media resource system. And when the media resource system receives the file download address fed back by the CDN scheduler, searching a video file matched with the file download address in the media resource system according to the file download address. The media resource system stores a full amount of video files so as to ensure that a target video file corresponding to a file download address can be quickly obtained when the file download address is obtained.
It should be noted that the video file may specifically be an m3u8 file, the m3u8 file is a video index file, and the m3u8 file stores sub video files corresponding to all video clips belonging to the same video content.
S103: analyzing the target video file to obtain each sub video file contained in the target video file, and obtaining a final download address corresponding to each sub video file according to the file download address and the sub file information of each sub video file;
in the embodiment of the present invention, after the target video file corresponding to the file download address is obtained, since the target video file includes a plurality of sub video files, the video file needs to be parsed first, and then each sub video file included in the video file is obtained. Each sub video file may be a ts file, where the ts file is a video stream slice file of a video stream, and each video stream slice file corresponds to one video segment. And obtaining a final download address corresponding to each sub-video file according to the file download address and the file information corresponding to each sub-video file.
S104: and sending the final download address corresponding to each sub-video file to the client, triggering the client to obtain the video content corresponding to each sub-video file according to each final download address, and playing the video content.
In the embodiment of the present invention, the final download address of each sub video file is sent to the client, and the client only needs to download each video content of each sub video file according to each final download address, and play each downloaded video content.
In the video playing method provided by the embodiment of the invention, when a video playing request sent to the media resource system by the client is received, the media resource system generates a file downloading request according to the video playing request, accesses the CDN scheduler through an intranet between the media resource system and the CDN scheduler, and sends the file downloading request to the CDN scheduler. And after receiving the file downloading request sent by the media resource system, the CDN scheduler quickly responds to the file downloading request and feeds back a file downloading address corresponding to the file downloading request to the media resource system. Because the media resource system stores the whole amount of video files, after receiving the file download address, the target video file corresponding to the video playing request sent by the client is obtained according to the file download address. After the target video file is determined, each sub-video file contained in the target video file is analyzed by a media resource system, and sub-file information of each sub-video file is obtained. And obtaining a final download address corresponding to each sub video file through the file download address and each sub file information, and sending the final download address to the client. After receiving the final download address corresponding to each sub-video file, the client downloads the video stream slice corresponding to each sub-video file according to the final download address corresponding to each sub-video file, obtains the video content to be played through each video stream slice, and plays the video content in the player.
By applying the method provided by the embodiment of the invention, the client can directly obtain the final download address of each sub-video file only by sending the video play request to the media resource system, and the media resource system stores the full amount of video files, thereby saving the time for downloading the video files, shortening the time for playing the videos and improving the watching experience of users.
In the method provided in the embodiment of the present invention, based on the step S101, after the media resource system receives the video playing request, it needs to generate a file downloading request corresponding to the video playing request according to the video playing request, and send the file downloading request to a preset CDN scheduler in a content delivery network, as shown in fig. 2, the method specifically includes:
s201: acquiring video information contained in the video playing request;
in the embodiment of the invention, after a video playing request sent by a client is received, video information contained in the video playing request is obtained.
It should be noted that the video information may specifically include user information of a user requesting to play the video, client information, a video name, a video size, various video configuration parameters, and the like.
S202: generating a file downloading request corresponding to the video playing request according to the video information;
in the embodiment of the present invention, a file download request corresponding to the video playing request is generated based on the video information in the video playing request. The file downloading request comprises the video information and is used for obtaining a file downloading address according to the video information by the CDN scheduler after the file downloading request is sent to the CDN scheduler.
S203: and acquiring a scheduling address corresponding to the video information, and sending the file downloading request to the CDN scheduler through the scheduling address.
In the embodiment of the present invention, according to the video information, a scheduling address corresponding to the video information is obtained, and the CDN scheduler is accessed through the scheduling address to send a file download request to the CDN scheduler.
It should be noted that the scheduling address is an access address of the CDN scheduler, and when the mediation resource system accesses the CDN scheduler through the scheduling address, the mediation resource system accesses through an intranet between the mediation resource system and the CDN scheduler, which consumes very little time.
In the video playing method provided by the embodiment of the invention, when a video playing request sent by a client is received, video information in the video playing request is acquired. And generating a file downloading request according to the video information, acquiring a scheduling address of the CDN scheduler, and sending the file downloading request to the CDN scheduler through the scheduling address. The CDN scheduler is used for coordinating each video file in the CDN system and providing a file downloading address corresponding to the video playing request to the media resource system according to the video information. After the media resource system obtains the file downloading address, the target video file corresponding to the file downloading address is determined.
By applying the method provided by the embodiment of the invention, the CDN scheduler is accessed by the media resource system through the scheduling address, the client does not need to send the scheduling address to the client and then requests the CDN scheduler to obtain the file downloading address, so that the network time consumption is saved, the video playing time is shortened, and the watching experience of a user is improved.
In the method provided in the embodiment of the present invention, based on the step S102, after the media resource system receives the file download address fed back by the CDN scheduler, determining a target video file corresponding to the file download address in each video file pre-stored in the media resource system, specifically including:
acquiring file information of each video file pre-stored in the media asset system;
analyzing each file information, obtaining a file identifier corresponding to each file information, and matching each file identifier with the file downloading address;
and if the currently matched file identifier is matched with the file downloading address, determining the video file corresponding to the currently matched file identifier as a target video file.
In the video playing method provided by the embodiment of the invention, a plurality of video files are stored in the media asset system, and each video file has a file downloading address corresponding to the video file. Acquiring file information of each video file, acquiring a file identifier corresponding to each file information according to the file information of each video file, and determining a target video file corresponding to the file download address through each file identifier. Specifically, each file identifier represents a file download address of a video file corresponding to the file identifier, each file identifier is matched with the file download address, and if any file identifier corresponding to any one video file is matched with the file download address, the video file matched with the file download address is determined as the target video file.
Optionally, the file identifier is an address identifier of a file download address corresponding to each video file, and since the file download address of each video file is different, the file identifiers in the file information of each video file are different.
By applying the method provided by the embodiment of the invention, the target video file corresponding to the file download address in the media asset system is determined by matching the file identifier with the file download address, and the target video file is ensured to be the video file corresponding to the video required to be played by the client.
In the method provided in the embodiment of the present invention, based on the step S103, the process of obtaining the final download address corresponding to each sub video file according to the file download address and the sub file information of each sub video file is shown in fig. 3, and specifically includes:
s301: acquiring a subfile list contained in the target video file, wherein the subfile list contains a plurality of sub video files;
in the embodiment of the present invention, the target video file includes a plurality of sub video files, and each sub video file is stored in a sub file list. For example, if the target video file is an m3u8 file, the ts list in the m3u8 file is parsed by the media resource system, and the ts list includes a plurality of ts files.
S302: determining the arrangement sequence corresponding to each sub video file in the sub file list, and sequentially analyzing each sub video file according to the arrangement sequence to obtain a file path corresponding to each sub video file;
in the embodiment of the present invention, an arrangement order of each sub video file in the sub file list is determined, wherein the arrangement order of each sub video file in the sub file list is arranged according to a playing order of a video. And sequentially analyzing each sub video file according to the arrangement sequence of each sub video file to obtain a file path corresponding to each sub video file.
It should be noted that, each piece of sub-file information is encapsulated in the target video file, each piece of sub-file information is stored in the corresponding sub-video file, and each piece of file path information includes the file path of the corresponding sub-video file.
S303: and splicing the file download address with each file path respectively to obtain a final download address corresponding to each sub-video file.
In the embodiment of the invention, the file download addresses are respectively spliced with the file paths, namely, the file paths are respectively spliced on the basis of the file download addresses to obtain a plurality of final download addresses, and each final download address is respectively in one-to-one correspondence with each sub video file. The client can obtain the slice stream corresponding to each sub-video file according to each final download address, and play video content according to each slice stream.
In the video playing method provided by the embodiment of the invention, after each sub-video file in the sub-file list of the target video file is obtained, each sub-video file is sequentially analyzed to obtain a file path corresponding to each sub-video file, and the file download address is respectively spliced with each file path to obtain a final download address corresponding to each sub-video file. By applying the method, the media resource system can feed back to the client after obtaining the final download address corresponding to each sub-video file, and the client only needs to obtain the video content according to the final download address to play the video, so that the time for requesting the video to play is saved, and the experience of watching the video by the user is improved.
In the method provided in this embodiment of the present invention, based on step S104, sending the final download address corresponding to each sub video file to the client, triggering the client to obtain the video content corresponding to each sub video file according to each final download address, and playing the video content includes:
storing each final download address into the subfile list according to the arrangement sequence, and determining playing information corresponding to video content to be played;
and sending the file list and the playing information to the client, triggering the client to obtain video contents corresponding to the sub-video files according to the final downloading addresses in the file list, and playing the video contents according to the playing information.
In the video playing method provided by the embodiment of the present invention, after the final download addresses corresponding to the respective sub video files are obtained, the respective final download addresses are stored in the sub file list according to the original arrangement sequence of the respective sub video files, and the playing information corresponding to the video content to be played is determined. The playing information includes playing parameters such as each playable code rate, playing format, and video name corresponding to the video to be played. And the media resource system sends the sub-file list carrying the final download addresses and the playing information to the client. And the client acquires each final download address after receiving the subfile list, and acquires video content according to each final download address. And when the client plays the video content, playing the video content according to each playing parameter contained in the playing information.
It should be noted that, when the media asset system sends the subfile list to the client, the subfile list may be sent to the client in the form of text characters.
By applying the method provided by the embodiment of the invention, the client can directly obtain the final download address of each sub-video file only by sending the video play request to the media resource system, the client does not need to download the video file, and the final download address is obtained through the video file, so that the time for playing the video by the player is prolonged, and the watching experience of a user is improved.
The specific implementation procedures and derivatives thereof of the above embodiments are within the scope of the present invention.
Corresponding to the method described in fig. 1, an embodiment of the present invention further provides a video playing apparatus, which is used for implementing the method in fig. 1 specifically, the video playing apparatus provided in the embodiment of the present invention may be applied to a computer terminal or various mobile devices, and a schematic structural diagram of the video playing apparatus is shown in fig. 4, and specifically includes:
the generation unit 401 is configured to generate a file download request corresponding to a video play request when receiving the video play request sent by a client to a media resource system, and send the file download request to a preset content delivery network CDN scheduler;
a determining unit 402, configured to determine, when a file download address fed back by the CDN scheduler according to the file download request is received, a target video file corresponding to the file download address in each video file pre-stored in the media asset system;
an analyzing unit 403, configured to analyze the target video file, obtain each sub video file included in the target video file, and obtain a final download address corresponding to each sub video file according to the file download address and sub file information of each sub video file;
a sending unit 404, configured to send the final download address corresponding to each sub-video file to the client, trigger the client to obtain video content corresponding to each sub-video file according to each final download address, and play the video content.
In the video playing device provided in the embodiment of the present invention, when a video playing request sent by a client is received, a file downloading request is generated by the generation unit, and the file downloading request is sent to the CDN scheduler. After receiving the file download address fed back by the CDN scheduler, the determining unit determines a target video file corresponding to the file download address, and the analyzing unit analyzes the target video file to obtain each sub-video file. And finally, sending each final download address to the client through a sending unit. In the whole process, the final download address of each sub-video file can be obtained only by sending a video playing request by the client, so that various request processes of the client are saved, and the video playing time is shortened.
In the apparatus provided in the embodiment of the present invention, the generating unit includes:
the first acquiring subunit is used for acquiring the video information contained in the video playing request;
the generating subunit is used for generating a file downloading request corresponding to the video playing request according to the video information;
and the sending subunit is configured to obtain a scheduling address corresponding to the video information, and send the file downloading request to the CDN scheduler through the scheduling address.
In the apparatus provided in an embodiment of the present invention, the determining unit includes:
the second acquisition subunit is used for acquiring file information of each video file pre-stored in the media resource system;
the matching subunit is used for analyzing each file information, obtaining a file identifier corresponding to each file information, and matching each file identifier with the file downloading address;
and the determining subunit is used for determining the video file corresponding to the currently matched file identifier as the target video file if the currently matched file identifier is matched with the file downloading address.
In the apparatus provided in an embodiment of the present invention, the analysis unit includes:
a third obtaining subunit, configured to obtain a subfile list included in the target video file, where the subfile list includes multiple sub video files;
the analysis subunit is configured to determine an arrangement order corresponding to each of the sub video files in the sub file list, and sequentially analyze each of the sub video files according to the arrangement order to obtain a file path corresponding to each of the sub video files;
and the splicing subunit is used for splicing the file download address with each file path respectively to obtain a final download address corresponding to each sub-video file.
In the apparatus provided in the embodiment of the present invention, the sending unit includes:
the storage subunit is configured to store each final download address into the subfile list according to the arrangement order, and determine playing information corresponding to video content to be played;
and the sending subunit is configured to send the file list and the playing information to the client, so that the client obtains video content corresponding to each sub-video file according to each final download address in the file list, and plays the video content according to the playing information.
The specific working process of each unit in the video playing device disclosed in the above embodiment of the present invention can refer to the corresponding content in the video playing method disclosed in the above embodiment of the present invention, and is not described herein again.
The embodiment of the invention also provides a storage medium, which comprises a stored instruction, wherein when the instruction runs, the device where the storage medium is located is controlled to execute the video playing method.
An electronic device is provided in an embodiment of the present invention, and the structural diagram of the electronic device is shown in fig. 5, which specifically includes a memory 501 and one or more instructions 502, where the one or more instructions 502 are stored in the memory 501, and are configured to be executed by one or more processors 503 to perform the following operations according to the one or more instructions 502:
when a video playing request sent by a client to a media resource system is received, generating a file downloading request corresponding to the video playing request, and sending the file downloading request to a preset Content Delivery Network (CDN) scheduler;
when a file downloading address fed back by the CDN scheduler according to the file downloading request is received, determining a target video file corresponding to the file downloading address in each video file prestored in the media resource system;
analyzing the target video file to obtain each sub video file contained in the target video file, and obtaining a final download address corresponding to each sub video file according to the file download address and the sub file information of each sub video file;
and sending the final download address corresponding to each sub-video file to the client, triggering the client to obtain the video content corresponding to each sub-video file according to each final download address, and playing the video content.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, the system or system embodiments are substantially similar to the method embodiments and therefore are described in a relatively simple manner, and reference may be made to some of the descriptions of the method embodiments for related points. The above-described system and system embodiments are only illustrative, wherein the units described as separate parts may or may not be physically separate, and the 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 modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both.
To clearly illustrate this interchangeability of hardware and software, various illustrative components and steps have been described above generally in terms of their functionality. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. A video playback method, comprising:
when a video playing request sent by a client to a media resource system is received, generating a file downloading request corresponding to the video playing request, and sending the file downloading request to a preset Content Delivery Network (CDN) scheduler;
when a file downloading address fed back by the CDN scheduler according to the file downloading request is received, determining a target video file corresponding to the file downloading address in each video file prestored in the media resource system;
analyzing the target video file to obtain each sub video file contained in the target video file, and obtaining a final download address corresponding to each sub video file according to the file download address and the sub file information of each sub video file; the obtaining a final download address corresponding to each sub-video file according to the file download address and the sub-file information of each sub-video file includes: splicing the download address of the target video file with the file path corresponding to each sub video file respectively to obtain a final download address corresponding to each sub video file;
and sending the final download address corresponding to each sub-video file to the client, triggering the client to obtain the video content corresponding to each sub-video file according to each final download address, and playing the video content.
2. The method of claim 1, wherein the generating a file download request corresponding to the video playing request and sending the file download request to a preset Content Delivery Network (CDN) scheduler includes:
acquiring video information contained in the video playing request;
generating a file downloading request corresponding to the video playing request according to the video information;
and acquiring a scheduling address corresponding to the video information, and sending the file downloading request to the CDN scheduler through the scheduling address.
3. The method according to claim 1, wherein the determining a target video file corresponding to the file download address from among the video files pre-stored in the media asset system comprises:
acquiring file information of each video file pre-stored in the media asset system;
analyzing each file information, obtaining a file identifier corresponding to each file information, and matching each file identifier with the file downloading address;
and if the currently matched file identifier is matched with the file downloading address, determining the video file corresponding to the currently matched file identifier as a target video file.
4. The method according to claim 1, wherein the obtaining a final download address corresponding to each of the sub-video files according to the file download address and sub-file information of each of the sub-video files comprises:
acquiring a subfile list contained in the target video file, wherein the subfile list contains a plurality of sub video files;
determining the arrangement sequence corresponding to each sub video file in the sub file list, and sequentially analyzing each sub video file according to the arrangement sequence to obtain a file path corresponding to each sub video file;
and splicing the file download address with each file path respectively to obtain a final download address corresponding to each sub-video file.
5. The method according to claim 4, wherein the sending the final download address corresponding to each of the sub-video files to the client triggers the client to obtain the video content corresponding to each of the sub-video files according to each of the final download addresses, and play the video content comprises:
storing each final download address into the subfile list according to the arrangement sequence, and determining playing information corresponding to video content to be played;
and sending the file list and the playing information to the client, triggering the client to obtain video contents corresponding to the sub-video files according to the final downloading addresses in the file list, and playing the video contents according to the playing information.
6. A video playback apparatus, comprising:
the generation unit is used for generating a file downloading request corresponding to the video playing request when receiving the video playing request sent by the client to the media resource system, and sending the file downloading request to a preset Content Delivery Network (CDN) scheduler;
a determining unit, configured to determine, when a file download address fed back by the CDN scheduler according to the file download request is received, a target video file corresponding to the file download address in each video file pre-stored by the media resource system;
the analysis unit is used for analyzing the target video file, obtaining each sub video file contained in the target video file, and obtaining a final download address corresponding to each sub video file according to the file download address and the sub file information of each sub video file; the obtaining a final download address corresponding to each sub-video file according to the file download address and the sub-file information of each sub-video file includes: splicing the download address of the target video file with the file path corresponding to each sub video file respectively to obtain a final download address corresponding to each sub video file;
and the sending unit is used for sending the final download address corresponding to each sub-video file to the client, triggering the client to obtain the video content corresponding to each sub-video file according to each final download address, and playing the video content.
7. The apparatus of claim 6, wherein the generating unit comprises:
the first acquiring subunit is used for acquiring the video information contained in the video playing request;
the generating subunit is used for generating a file downloading request corresponding to the video playing request according to the video information;
and the sending subunit is configured to obtain a scheduling address corresponding to the video information, and send the file downloading request to the CDN scheduler through the scheduling address.
8. The apparatus of claim 6, wherein the determining unit comprises:
the second acquisition subunit is used for acquiring file information of each video file pre-stored in the media resource system;
the matching subunit is used for analyzing each file information, obtaining a file identifier corresponding to each file information, and matching each file identifier with the file downloading address;
and the determining subunit is used for determining the video file corresponding to the currently matched file identifier as the target video file if the currently matched file identifier is matched with the file downloading address.
9. The apparatus of claim 6, wherein the parsing unit comprises:
a third obtaining subunit, configured to obtain a subfile list included in the target video file, where the subfile list includes multiple sub video files;
the analysis subunit is configured to determine an arrangement order corresponding to each of the sub video files in the sub file list, and sequentially analyze each of the sub video files according to the arrangement order to obtain a file path corresponding to each of the sub video files;
and the splicing subunit is used for splicing the file download address with each file path respectively to obtain a final download address corresponding to each sub-video file.
10. The apparatus of claim 6, wherein the sending unit comprises:
the storage subunit is used for storing each final download address into a subfile list according to the arrangement sequence and determining the playing information corresponding to the video content to be played;
and the sending subunit is configured to send the file list and the playing information to the client, so that the client obtains video content corresponding to each sub-video file according to each final download address in the file list, and plays the video content according to the playing information.
CN201910934574.9A 2019-09-29 2019-09-29 Video playing method and device Active CN110557689B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910934574.9A CN110557689B (en) 2019-09-29 2019-09-29 Video playing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910934574.9A CN110557689B (en) 2019-09-29 2019-09-29 Video playing method and device

Publications (2)

Publication Number Publication Date
CN110557689A CN110557689A (en) 2019-12-10
CN110557689B true CN110557689B (en) 2022-02-22

Family

ID=68741955

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910934574.9A Active CN110557689B (en) 2019-09-29 2019-09-29 Video playing method and device

Country Status (1)

Country Link
CN (1) CN110557689B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112770144B (en) * 2020-12-22 2023-07-25 未来电视有限公司 Video file downloading method, video file playing method, device and terminal equipment
CN115314758A (en) * 2021-05-06 2022-11-08 武汉斗鱼鱼乐网络科技有限公司 Video playing method and related equipment
CN114615550B (en) * 2022-03-17 2023-12-08 北京奇艺世纪科技有限公司 Video acquisition method and device
CN114786042A (en) * 2022-04-12 2022-07-22 北京字节跳动网络技术有限公司 Video playing method, device, equipment and storage medium
CN116567353B (en) * 2023-07-10 2023-09-12 湖南快乐阳光互动娱乐传媒有限公司 Video delivery method and device, storage medium and electronic equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102685088A (en) * 2011-09-06 2012-09-19 天脉聚源(北京)传媒科技有限公司 Method for playing M3U8 stream media
CN105812850A (en) * 2014-12-31 2016-07-27 乐视网信息技术(北京)股份有限公司 Video file playing method and system thereof
CN105872858A (en) * 2016-04-27 2016-08-17 亦非云互联网技术(上海)有限公司 Video sharing method and system, video processing system and client side
CN105898352A (en) * 2015-11-13 2016-08-24 乐视云计算有限公司 m3u8-based streaming media file direct broadcast method and system

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101141627A (en) * 2007-10-23 2008-03-12 深圳市迅雷网络技术有限公司 Storage system and method of stream media file

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102685088A (en) * 2011-09-06 2012-09-19 天脉聚源(北京)传媒科技有限公司 Method for playing M3U8 stream media
CN105812850A (en) * 2014-12-31 2016-07-27 乐视网信息技术(北京)股份有限公司 Video file playing method and system thereof
CN105898352A (en) * 2015-11-13 2016-08-24 乐视云计算有限公司 m3u8-based streaming media file direct broadcast method and system
CN105872858A (en) * 2016-04-27 2016-08-17 亦非云互联网技术(上海)有限公司 Video sharing method and system, video processing system and client side

Also Published As

Publication number Publication date
CN110557689A (en) 2019-12-10

Similar Documents

Publication Publication Date Title
CN110557689B (en) Video playing method and device
US9344517B2 (en) Downloading and adaptive streaming of multimedia content to a device with cache assist
US10367872B2 (en) Cloud-based video delivery
CN105052107B (en) Media content Adaptive Transmission is carried out using quality information
US9060207B2 (en) Adaptive video streaming over a content delivery network
US20170164020A1 (en) Content delivery method for content delivery network platform and scheduling proxy server
CN108124202B (en) Method for making stream media server support H L S protocol
US10904642B2 (en) Methods and apparatus for updating media presentation data
CN111277869B (en) Video playing method, device, equipment and storage medium
US9356821B1 (en) Streaming content delivery system and method
WO2016054923A1 (en) Hls protocol-based user information acquisition method and server
CN103813185B (en) A kind of method that segment programs are quickly distributed, server and client
CN103826139A (en) CDN system, watching server and streaming media data transmission method
US20170171585A1 (en) Method and Electronic Device for Recording Live Streaming Media
WO2014008637A1 (en) Method and apparatus for interacting with a media presentation description that describes a summary media presentation and an original media presentation
US9723095B2 (en) Multi delivery method policy controlled client proxy
US20150268808A1 (en) Method, Device and System for Multi-Speed Playing
CN112565907A (en) Video acquisition method, electronic device and storage medium
CN107040615B (en) Downloading method of media fragment, terminal and computer readable storage medium
CN110290396B (en) Video processing method, device, system, equipment and storage medium
CN112243158B (en) Media file processing method and device, computer readable medium and electronic equipment
US8296389B2 (en) Content reproduction apparatus, content delivery apparatus, content delivery system, and method for generating metadata
US9705836B2 (en) Method, server and SNS system for message interaction
CN111314767A (en) Interactive component loading method and device for interactive video
US20170289229A1 (en) Method and terminal device for providing multimedia content

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant