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

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

Info

Publication number
CN114025201A
CN114025201A CN202111269179.7A CN202111269179A CN114025201A CN 114025201 A CN114025201 A CN 114025201A CN 202111269179 A CN202111269179 A CN 202111269179A CN 114025201 A CN114025201 A CN 114025201A
Authority
CN
China
Prior art keywords
video
target video
playing
client
target
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
CN202111269179.7A
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.)
Eversec Beijing Technology Co Ltd
Original Assignee
Eversec Beijing 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 Eversec Beijing Technology Co Ltd filed Critical Eversec Beijing Technology Co Ltd
Priority to CN202111269179.7A priority Critical patent/CN114025201A/en
Publication of CN114025201A publication Critical patent/CN114025201A/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/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/234Processing of video elementary streams, e.g. splicing of video streams, manipulating MPEG-4 scene graphs
    • H04N21/2343Processing of video elementary streams, e.g. splicing of video streams, manipulating MPEG-4 scene graphs involving reformatting operations of video signals for distribution or compliance with end-user requests or end-user device requirements
    • H04N21/234309Processing of video elementary streams, e.g. splicing of video streams, manipulating MPEG-4 scene graphs involving reformatting operations of video signals for distribution or compliance with end-user requests or end-user device requirements by transcoding between formats or standards, e.g. from MPEG-2 to MPEG-4 or from Quicktime to Realvideo
    • 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/234Processing of video elementary streams, e.g. splicing of video streams, manipulating MPEG-4 scene graphs
    • H04N21/2343Processing of video elementary streams, e.g. splicing of video streams, manipulating MPEG-4 scene graphs involving reformatting operations of video signals for distribution or compliance with end-user requests or end-user device requirements
    • H04N21/234345Processing of video elementary streams, e.g. splicing of video streams, manipulating MPEG-4 scene graphs involving reformatting operations of video signals for distribution or compliance with end-user requests or end-user device requirements the reformatting operation being performed only on part of the stream, e.g. a region of the image or a time segment
    • 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/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/437Interfacing the upstream path of the transmission network, e.g. for transmitting client requests to a VOD server
    • 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, rendering scenes according to MPEG-4 scene graphs
    • H04N21/4402Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream, rendering scenes according to MPEG-4 scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display
    • H04N21/440209Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream, rendering scenes according to MPEG-4 scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display for formatting on an optical medium, e.g. DVD
    • 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, rendering scenes according to MPEG-4 scene graphs
    • H04N21/4402Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream, rendering scenes according to MPEG-4 scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display
    • H04N21/440245Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream, rendering scenes according to MPEG-4 scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display the reformatting operation being performed only on part of the stream, e.g. a region of the image or a time segment
    • 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/442Monitoring of processes or resources, e.g. detecting the failure of a recording device, monitoring the downstream bandwidth, the number of times a movie has been viewed, the storage space available from the internal hard disk
    • H04N21/44213Monitoring of end-user related data
    • H04N21/44222Analytics of user selections, e.g. selection of programs or purchase activity

Abstract

The embodiment of the invention discloses a video playing method, a video playing device, video playing equipment and a storage medium. The method is applied to a server and comprises the following steps: receiving an uploaded target video, and generating a video index file corresponding to the target video in real time; responding to a playing request of a client to the target video, returning a video index file corresponding to the target video so that the client determines a target video segment to be played currently; and responding to an acquisition request of a client to a target video clip, acquiring file data corresponding to the target video clip and returning the file data to the client. The technical scheme of the embodiment of the invention can realize that the video can be played after being uploaded in the scene of playing the video by the streaming media.

Description

Video playing method, device, equipment and storage medium
Technical Field
The embodiment of the invention relates to the technical field of data processing, in particular to a video playing method, a video playing device, video playing equipment and a storage medium.
Background
At present, the webpage video playing technology is roughly divided into Flash playing, Js plug-in playing and streaming media playing. The video website adopts a streaming media transmission protocol, namely, a section of video is cut into a plurality of segments, each segment is processed into a corresponding video file, an m3u8 index file of the video file is generated, and the video file is played on a webpage section by section. Wherein, the m3u8 index file is used for organizing the video files together in the form of a play list for the multimedia player to download and play.
However, in this video playing mode, the client can request to play the video according to the m3u8 index file after the source video is sliced and transcoded on the server to generate all ts slice files and a complete m3u8 index file, so that a certain time is required from uploading the video to playing the video, and the video cannot be played after the uploading is completed.
Disclosure of Invention
The embodiment of the invention provides a video playing method, a video playing device, video playing equipment and a storage medium, which are used for realizing that a video can be played after being uploaded in a scene in which the video is played by a streaming media.
In a first aspect, an embodiment of the present invention provides a video playing method, applied to a server, including:
receiving the uploaded target video, and generating a video index file corresponding to the target video in real time;
responding to a playing request of a client to a target video, returning a video index file corresponding to the target video so that the client determines a target video segment to be played currently;
and responding to an acquisition request of the client to the target video clip, acquiring file data corresponding to the target video clip and returning the file data to the client.
Optionally, the receiving the uploaded target video and generating a video index file corresponding to the target video in real time includes:
receiving the uploaded target video and determining the total duration of the target video;
calculating the starting and stopping playing time of each video clip after the target video is sliced according to the preset video clip duration and the total duration;
and generating a video index file corresponding to the target video according to the starting and ending playing time of each video clip and the request address distributed to each video clip.
Optionally, in response to an acquisition request of the client for the target video segment, acquiring file data corresponding to the target video segment and returning the file data to the client, including:
responding to an acquisition request of a client to a target video clip, and judging whether file data corresponding to the target video clip exists locally;
if the target video clip does not exist, extracting the starting and ending playing time of the target video clip from the acquisition request;
and carrying out slice transcoding on the target video according to the starting and stopping playing time by using an FFmpeg tool to generate file data corresponding to the target video segment, and returning the file data to the client.
In a second aspect, an embodiment of the present invention further provides a video playing method, applied to a client, including:
responding to the click playing operation of the target video, and sending a playing request of the target video to a server to acquire a video index file corresponding to the target video; the video index file is generated by the server in real time according to the received target video;
analyzing a video index file returned by the server, and determining a target video segment matched with a playing time point corresponding to the click playing operation;
and sending an acquisition request of the target video clip to the server, and playing and displaying file data of the target video clip returned by the server.
In a third aspect, an embodiment of the present invention further provides a video playing apparatus, which is applied to a server, and includes:
the index generation module is used for receiving the uploaded target video and generating a video index file corresponding to the target video in real time;
the index returning module is used for responding to a playing request of the client to the target video and returning a video index file corresponding to the target video so as to enable the client to determine a target video segment to be played currently;
and the video return module is used for responding to an acquisition request of the client to the target video clip, acquiring file data corresponding to the target video clip and returning the file data to the client.
Optionally, the index generating module is configured to:
receiving the uploaded target video and determining the total duration of the target video;
calculating the starting and stopping playing time of each video clip after the target video is sliced according to the preset video clip duration and the total duration;
and generating a video index file corresponding to the target video according to the starting and ending playing time of each video clip and the request address distributed to each video clip.
Optionally, the video returning module is configured to:
responding to an acquisition request of a client to a target video clip, and judging whether file data corresponding to the target video clip exists locally;
if the target video clip does not exist, extracting the starting and ending playing time of the target video clip from the acquisition request;
and carrying out slice transcoding on the target video according to the starting and stopping playing time by using an FFmpeg tool to generate file data corresponding to the target video segment, and returning the file data to the client.
In a fourth aspect, an embodiment of the present invention further provides a video playing apparatus, which is applied to a client, and includes:
the request module is used for responding to the click playing operation of the target video and sending a playing request of the target video to the server so as to obtain a video index file corresponding to the target video; the video index file is generated by the server in real time according to the received target video;
the index analysis module is used for analyzing the video index file returned by the server and determining a target video segment matched with the playing time point corresponding to the click playing operation;
and the video playing module is used for sending an acquisition request of the target video clip to the server and playing and displaying the file data of the target video clip returned by the server.
In a fifth aspect, an embodiment of the present invention further provides a computer device, where the computer device includes:
one or more processors;
a storage device for storing one or more programs,
when the one or more programs are executed by the one or more processors, the one or more processors implement the video playing method provided by any embodiment of the invention.
In a sixth aspect, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the video playing method provided in any embodiment of the present invention.
In the embodiment of the invention, a server receives an uploaded target video and generates a video index file corresponding to the target video in real time; responding to a playing request of a client to a target video, returning a video index file corresponding to the target video so that the client determines a target video segment to be played currently; the method and the device respond to the acquisition request of the client to the target video clip, acquire the file data corresponding to the target video clip and return the file data to the client, solve the problem that the time consumption from video uploading to video playing is long when the streaming media is used for playing in the prior art, and realize that the video can be played after the video uploading is completed in the scene that the streaming media plays the video.
Drawings
Fig. 1a is a flowchart of a video playing method according to a first embodiment of the present invention;
fig. 1b is a flowchart of a streaming video playing according to a first embodiment of the present invention;
fig. 2 is a flowchart of a video playing method according to a second embodiment of the present invention;
fig. 3 is a schematic structural diagram of a video playback device according to a third embodiment of the present invention;
fig. 4 is a schematic structural diagram of a video playback device according to a fourth embodiment of the present invention;
fig. 5 is a schematic structural diagram of a computer device in the fifth embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
Example one
Fig. 1a is a flowchart of a video playing method in one embodiment of the present invention, which is applicable to reducing time consumption between video uploading and video playing when playing a video using a streaming media, and the method may be executed by a video playing apparatus, which may be implemented by hardware and/or software, and may be generally integrated in a computer device, such as a server, and used in cooperation with a client. As shown in fig. 1a, the method comprises:
and 110, receiving the uploaded target video, and generating a video index file corresponding to the target video in real time.
In this embodiment, the uploaded target video may be in any format, for example, a video in MP4, WebM, Ogg, Flv, or the like. The video index file can be an m3u8 index file, m3u8 is one of m3u, the encoding mode is utf-8 encoding, and the m3u8 index file is actually used for resolving the request address of the corresponding video clip placed on the server, so that online playing is realized.
Optionally, receiving the uploaded target video, and generating a video index file corresponding to the target video in real time may include: receiving the uploaded target video and determining the total duration of the target video; calculating the starting and stopping playing time of each video clip after the target video is sliced according to the preset video clip duration and the total duration; and generating a video index file corresponding to the target video according to the starting and ending playing time of each video clip and the request address distributed to each video clip.
In this embodiment, as shown in fig. 1b, after receiving the uploaded target video in any format, an FFmpeg tool may be used to obtain a total duration of the target video, then according to a predetermined video segment duration, a start playing time and an end playing time of each video segment obtained after the target video is sliced are calculated, and a corresponding request address is pre-allocated to each video segment. For example, the total duration of the target video is 20 minutes, the duration of the preset video segment is 30 seconds, the starting playing time of the first video segment obtained after the target video is sliced corresponds to 0 th second of the target video, the ending playing time corresponds to 30 th second of the target video, and the allocated request address may be xxx. And generating an m3u8 index file corresponding to the target video according to the starting and stopping playing time and the request address of each video clip.
FFmpeg is a specialized multimedia framework that can decode, encode, transcode, multiplex, demultiplex, stream, filter, and play almost all forms of media files. The core of the method is a video and audio processing tool based on a command line, and the method is mainly used for scenes such as video transcoding, basic editing (pruning and merging), video zooming, post-effect production and the like.
In the embodiment, after the target video is uploaded, slice transcoding is not directly performed, but the starting and ending playing time of each video segment corresponding to the transcoded target video slice is calculated first, and a request address is allocated to each video segment, so that an m3u8 index file can be generated before the target video is switched and transcoded, and a client can request the server for video playing without waiting for the time of slice transcoding processing on the target video.
And step 120, responding to a playing request of the client to the target video, and returning a video index file corresponding to the target video so that the client determines a target video segment to be played currently.
In this embodiment, as shown in fig. 1b, after generating the m3u8 index file, in response to a play request of the client for the target video, the server returns the m3u8 index file corresponding to the target video to the client, so that the client obtains the start-stop play time and the request address corresponding to each video clip of the target video by parsing the m3u8 index file, and determines the target video clip to be currently played according to the video play time selected by the user on the target video.
Step 130, responding to the request of the client for obtaining the target video clip, obtaining the file data corresponding to the target video clip and returning the file data to the client.
In this embodiment, the storage location of the file data of each video clip is not in the static directory, but the file data is read by the backend program and then returned. That is, when the server receives the request for acquiring the video segment, it first determines whether the corresponding file data exists locally, if not, it transcodes the segment, if so, it directly reads and returns.
Optionally, in response to an acquisition request of the client for the target video segment, acquiring file data corresponding to the target video segment and returning the file data to the client, which may include: responding to an acquisition request of a client to a target video clip, and judging whether file data corresponding to the target video clip exists locally; if the target video clip does not exist, extracting the starting and ending playing time of the target video clip from the acquisition request; and carrying out slice transcoding on the target video according to the starting and stopping playing time by using an FFmpeg tool to generate file data corresponding to the target video segment, and returning the file data to the client.
In this embodiment, as shown in fig. 1b, when an acquisition request of a client for a target video segment is received, it is first determined whether file data of the target video segment exists locally, and if so, the corresponding file data is directly read and returned to the client. If not, using an FFmpeg tool to slice the target video file according to the starting and ending playing time of the target video segment carried in the request, and transcoding the cut video segment to obtain file data in a specified format, such as a ts format file. Since the time consumed by slice transcoding is typically short, the client's perception of the slice transcoding process is not obvious. And the server reads the ts format file of the target video clip and returns the ts format file to the client for playing, and simultaneously stores the ts file of the target video clip so as to directly return when the target video clip is requested next time.
Wherein TS is a packaging format performed by shooting with a japanese high-definition camera, and is collectively called MPEG 2-TS. ts is an abbreviation for "TransportStream". The MPEG2-TS format is characterized by the requirement that it can be decoded independently from any segment of the video stream.
In this embodiment, by pre-calculating and generating the m3u8 index file of the target video, when the client requests to start playing from the specified video segment according to the m3u8 index file, the server can directly read the file data of the target video segment and return the file data without sequentially acquiring all the file data before the target video segment, and after the video is uploaded, the specified video segment is played in real time according to the user requirement.
In the embodiment of the invention, a server receives an uploaded target video and generates a video index file corresponding to the target video in real time; responding to a playing request of a client to a target video, returning a video index file corresponding to the target video so that the client determines a target video segment to be played currently; the method and the device respond to the acquisition request of the client to the target video clip, acquire the file data corresponding to the target video clip and return the file data to the client, solve the problem that the time consumption from video uploading to video playing is long when the streaming media is used for playing in the prior art, and realize that the video can be played after the video uploading is completed in the scene that the streaming media plays the video.
Example two
Fig. 2 is a flowchart of a video playing method in a second embodiment of the present invention, which is applicable to reducing time consumption between video uploading and video playing when a video is played using a streaming media, and the method may be executed by a video playing apparatus, which may be implemented by hardware and/or software, and may be generally integrated in a computer device, such as a client, and used in cooperation with a server. As shown in fig. 2, the method includes:
step 210, responding to a click playing operation of a target video, sending a playing request of the target video to a server to obtain a video index file corresponding to the target video; the video index file is generated by the server in real time according to the received target video.
In this embodiment, when a user clicks a target video to request playing, or clicks a designated position of a playing progress bar of the target video to request playing from a designated time point of the target video, the client sends a playing request for the target video to the server to obtain an m3u8 index file corresponding to the target video. The m3u8 index file is generated by the steps that after the server receives the uploaded target video, the server does not perform slice transcoding on the target video, the FFmpeg tool is directly used for obtaining the total duration of the target video, and the total duration is calculated in real time according to the preset duration of the video segment. The M3u8 index file includes the start and stop playing time and the request address of each video clip obtained after the target video is sliced.
And step 220, analyzing the video index file returned by the server, and determining a target video segment matched with the playing time point corresponding to the click playing operation.
In this embodiment, after acquiring the m3u8 index file returned by the server, the client analyzes the m3u8 index file to acquire the start-stop play time and the request address corresponding to each video clip of the target video, matches the video play time point selected by the user on the target video through a click operation with the start-stop play time of each video clip, and determines the target video clip to be played currently.
Step 230, sending an acquisition request of the target video clip to the server, and playing and displaying the file data of the target video clip returned by the server.
In this embodiment, after determining a target video segment to be currently played, the client sends an acquisition request of the target video segment to the server, receives file data returned by the server, and locates to a video playing time point selected by the user to start playing. After receiving the acquisition request of the target video clip, the server firstly judges whether a ts file storing the target video clip exists locally, and if so, directly reads the corresponding ts file and returns the ts file to the client for playing. And if not, using an FFmpeg tool to slice the target video file according to the starting and ending playing time of the target video segment carried in the request, transcoding the cut video segment to obtain a ts file, and returning the ts file to the client for playing.
In this embodiment, the server calculates and generates the m3u8 index file of the target video in advance, and the client can start playing from the specified video clip according to the request of the m3u8 index file, at this time, the server can directly read the file data of the target video clip and return the file data without sequentially acquiring all the file data before the target video clip, and after the video is uploaded, the specified video clip is played in real time according to the user requirement.
In the embodiment of the invention, a client responds to a click playing operation of a target video and sends a playing request of the target video to a server so as to obtain a video index file corresponding to the target video; the video index file is generated by the server in real time according to the received target video; analyzing a video index file returned by the server, and determining a target video segment matched with a playing time point corresponding to the click playing operation; the method and the device send the acquisition request of the target video clip to the server, and play and display the file data of the target video clip returned by the server, solve the problem that the time consumption from video uploading to video playing is long when the streaming media is used for playing in the prior art, and realize that the video can be played after the video uploading is finished in the scene of playing the video by the streaming media.
EXAMPLE III
Fig. 3 is a schematic structural diagram of a video playing apparatus in a third embodiment of the present invention, which is applicable to reducing time consumption between video uploading and video playing when a video is played using a streaming media, and the apparatus may be implemented by hardware and/or software, and may be generally integrated in a computer device, such as a server, and used in cooperation with a client. As shown in fig. 3, the apparatus is applied to a server, and includes:
the index generation module 310 is configured to receive the uploaded target video and generate a video index file corresponding to the target video in real time;
the index returning module 320 is configured to return a video index file corresponding to a target video in response to a playing request of a client for the target video, so that the client determines a target video segment to be played currently;
the video returning module 330 is configured to, in response to an acquisition request of the client for the target video segment, acquire file data corresponding to the target video segment and return the file data to the client.
In the embodiment of the invention, a server receives an uploaded target video and generates a video index file corresponding to the target video in real time; responding to a playing request of a client to a target video, returning a video index file corresponding to the target video so that the client determines a target video segment to be played currently; the method and the device respond to the acquisition request of the client to the target video clip, acquire the file data corresponding to the target video clip and return the file data to the client, solve the problem that the time consumption from video uploading to video playing is long when the streaming media is used for playing in the prior art, and realize that the video can be played after the video uploading is completed in the scene that the streaming media plays the video.
Optionally, the index generating module 310 is configured to:
receiving the uploaded target video and determining the total duration of the target video;
calculating the starting and stopping playing time of each video clip after the target video is sliced according to the preset video clip duration and the total duration;
and generating a video index file corresponding to the target video according to the starting and ending playing time of each video clip and the request address distributed to each video clip.
Optionally, the video returning module 330 is configured to:
responding to an acquisition request of a client to a target video clip, and judging whether file data corresponding to the target video clip exists locally;
if the target video clip does not exist, extracting the starting and ending playing time of the target video clip from the acquisition request;
and carrying out slice transcoding on the target video according to the starting and stopping playing time by using an FFmpeg tool to generate file data corresponding to the target video segment, and returning the file data to the client.
The video playing device provided by the embodiment of the invention can execute the video playing method applied to the server provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.
Example four
Fig. 4 is a schematic structural diagram of a video playing apparatus in a fourth embodiment of the present invention, which is applicable to reducing time consumption between video uploading and video playing when a video is played using a streaming media, and the apparatus may be implemented by hardware and/or software, and may generally be integrated in a computer device, for example, in a client, and used in cooperation with a server. As shown in fig. 4, the apparatus is applied to a client, and includes:
the request module 410 is configured to send a play request for a target video to a server in response to a click play operation on the target video, so as to obtain a video index file corresponding to the target video; the video index file is generated by the server in real time according to the received target video;
the index parsing module 420 is configured to parse the video index file returned by the server, and determine a target video segment matched with a play time point corresponding to a click play operation;
the video playing module 430 is configured to send an acquisition request of the target video segment to the server, and play and display file data of the target video segment returned by the server.
In the embodiment of the invention, a client responds to a click playing operation of a target video and sends a playing request of the target video to a server so as to obtain a video index file corresponding to the target video; the video index file is generated by the server in real time according to the received target video; analyzing a video index file returned by the server, and determining a target video segment matched with a playing time point corresponding to the click playing operation; the method and the device send the acquisition request of the target video clip to the server, and play and display the file data of the target video clip returned by the server, solve the problem that the time consumption from video uploading to video playing is long when the streaming media is used for playing in the prior art, and realize that the video can be played after the video uploading is finished in the scene of playing the video by the streaming media.
The video playing device provided by the embodiment of the invention can execute the video playing method applied to the client terminal provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.
EXAMPLE five
Fig. 5 is a schematic structural diagram of a computer apparatus according to a fifth embodiment of the present invention, as shown in fig. 5, the apparatus includes a processor 510, a memory 520, an input device 530, and an output device 540; the number of the processors 510 in the device may be one or more, and one processor 510 is taken as an example in fig. 5; the processor 510, the memory 520, the input device 530 and the output device 540 of the apparatus may be connected by a bus or other means, as exemplified by the bus connection in fig. 5.
The memory 520 is a computer-readable storage medium, and can be used for storing software programs, computer-executable programs, and modules, such as program instructions/modules corresponding to the video playing method in the embodiment of the present invention (for example, the index generating module 310, the index returning module 320, and the video returning module 330 in the video playing apparatus, or the requesting module 410, the index parsing module 420, and the video playing module 430 in the video playing apparatus). The processor 510 executes various functional applications of the device and data processing by executing software programs, instructions and modules stored in the memory 520, that is, implements the video playing method described above.
The memory 520 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required for at least one function; the storage data area may store data created according to the use of the terminal, and the like. Further, the memory 520 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device. In some examples, memory 520 may further include memory located remotely from processor 510, which may be connected to devices through a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The input device 530 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function control of the apparatus. The output device 540 may include a display device such as a display screen.
EXAMPLE six
The sixth embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements a video playing method.
Namely, the video playing method is realized, is applied to a server, and comprises the following steps:
receiving the uploaded target video, and generating a video index file corresponding to the target video in real time;
responding to a playing request of a client to a target video, returning a video index file corresponding to the target video so that the client determines a target video segment to be played currently;
and responding to an acquisition request of the client to the target video clip, acquiring file data corresponding to the target video clip and returning the file data to the client.
And, realize a video broadcast method, apply to the customer end, including:
responding to the click playing operation of the target video, and sending a playing request of the target video to a server to acquire a video index file corresponding to the target video; the video index file is generated by the server in real time according to the received target video;
analyzing a video index file returned by the server, and determining a target video segment matched with a playing time point corresponding to the click playing operation;
and sending an acquisition request of the target video clip to the server, and playing and displaying file data of the target video clip returned by the server.
Of course, the computer program of the computer-readable storage medium provided in the embodiments of the present invention may execute the operations of the method not limited to the above, and may also execute the related operations in the video playing method provided in any embodiment of the present invention.
From the above description of the embodiments, it is obvious for those skilled in the art that the present invention can be implemented by software and necessary general hardware, and certainly, can also be implemented by hardware, but the former is a better embodiment in many cases. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which may be stored in a computer-readable storage medium, such as a floppy disk, a Read-only memory (ROM), a Random Access Memory (RAM), a FLASH memory (FLASH), a hard disk or an optical disk of a computer, and includes several instructions for enabling a computer device (which may be a personal computer, a server, or a network device) to execute the methods according to the embodiments of the present invention.
It should be noted that, in the embodiment of the data processing apparatus, the included units and modules are merely divided according to functional logic, but are not limited to the above division as long as the corresponding functions can be implemented; in addition, specific names of the functional units are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present invention.
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (10)

1. A video playing method is applied to a server and comprises the following steps:
receiving an uploaded target video, and generating a video index file corresponding to the target video in real time;
responding to a playing request of a client to the target video, returning a video index file corresponding to the target video so that the client determines a target video segment to be played currently;
and responding to an acquisition request of a client to a target video clip, acquiring file data corresponding to the target video clip and returning the file data to the client.
2. The method of claim 1, wherein receiving the uploaded target video and generating a video index file corresponding to the target video in real time comprises:
receiving an uploaded target video and determining the total duration of the target video;
calculating the starting and stopping playing time of each video clip after the target video is sliced according to the preset video clip duration and the total duration;
and generating a video index file corresponding to the target video according to the starting and ending playing time of each video clip and the request address distributed to each video clip.
3. The method of claim 1, wherein in response to a request for obtaining a target video segment from a client, obtaining file data corresponding to the target video segment and returning the file data to the client comprises:
responding to an acquisition request of a client to a target video clip, and judging whether file data corresponding to the target video clip exists locally;
if the target video clip does not exist, extracting the starting and ending playing time of the target video clip from the acquisition request;
and using an FFmpeg tool to perform slice transcoding on the target video according to the starting and stopping playing time, generating file data corresponding to the target video segment, and returning the file data to the client.
4. A video playing method is applied to a client and comprises the following steps:
responding to a click playing operation of a target video, and sending a playing request of the target video to a server to acquire a video index file corresponding to the target video; the video index file is generated by the server in real time according to the received target video;
analyzing the video index file returned by the server, and determining a target video segment matched with the playing time point corresponding to the click playing operation;
and sending an acquisition request of the target video clip to the server, and playing and displaying the file data of the target video clip returned by the server.
5. A video playing device applied to a server comprises:
the index generation module is used for receiving the uploaded target video and generating a video index file corresponding to the target video in real time;
the index returning module is used for responding to a playing request of a client to the target video and returning a video index file corresponding to the target video so as to enable the client to determine a target video segment to be played currently;
and the video return module is used for responding to an acquisition request of the client to the target video clip, acquiring file data corresponding to the target video clip and returning the file data to the client.
6. The apparatus of claim 5, wherein the index generation module is configured to:
receiving an uploaded target video and determining the total duration of the target video;
calculating the starting and stopping playing time of each video clip after the target video is sliced according to the preset video clip duration and the total duration;
and generating a video index file corresponding to the target video according to the starting and ending playing time of each video clip and the request address distributed to each video clip.
7. The apparatus of claim 5, wherein the video return module is configured to:
responding to an acquisition request of a client to a target video clip, and judging whether file data corresponding to the target video clip exists locally;
if the target video clip does not exist, extracting the starting and ending playing time of the target video clip from the acquisition request;
and using an FFmpeg tool to perform slice transcoding on the target video according to the starting and stopping playing time, generating file data corresponding to the target video segment, and returning the file data to the client.
8. A video playing device is applied to a client side and comprises:
the request module is used for responding to click playing operation of a target video and sending a playing request of the target video to a server so as to obtain a video index file corresponding to the target video; the video index file is generated by the server in real time according to the received target video;
the index analysis module is used for analyzing the video index file returned by the server and determining a target video segment matched with the playing time point corresponding to the click playing operation;
and the video playing module is used for sending the acquisition request of the target video clip to the server and playing and displaying the file data of the target video clip returned by the server.
9. A computer device, the device comprising:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the video playback method of any one of claims 1-3, or the video playback method of claim 4.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out a video playback method according to any one of claims 1 to 3, or carries out a video playback method according to claim 4.
CN202111269179.7A 2021-10-29 2021-10-29 Video playing method, device, equipment and storage medium Pending CN114025201A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111269179.7A CN114025201A (en) 2021-10-29 2021-10-29 Video playing method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111269179.7A CN114025201A (en) 2021-10-29 2021-10-29 Video playing method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114025201A true CN114025201A (en) 2022-02-08

Family

ID=80058789

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111269179.7A Pending CN114025201A (en) 2021-10-29 2021-10-29 Video playing method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114025201A (en)

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104394443A (en) * 2014-09-16 2015-03-04 东方有线网络有限公司 Method for dynamically inserting and broadcasting program in HLS live broadcast streaming medium
CN104469433A (en) * 2013-09-13 2015-03-25 深圳市腾讯计算机系统有限公司 Live video replay method and device
CN105228001A (en) * 2015-09-26 2016-01-06 北京暴风科技股份有限公司 The method and system that a kind of FLV format video is play online
CN106559677A (en) * 2015-09-30 2017-04-05 华为技术有限公司 The method and device of terminal, caching server and acquisition video slicing
CN108391179A (en) * 2018-04-26 2018-08-10 腾讯科技(深圳)有限公司 live data processing method, device, server, terminal and storage medium
CN110213672A (en) * 2019-07-04 2019-09-06 腾讯科技(深圳)有限公司 Video generation, playback method, system, device, storage medium and equipment
CN110213616A (en) * 2018-05-15 2019-09-06 腾讯科技(深圳)有限公司 Video providing method, acquisition methods, device and equipment
CN110248219A (en) * 2018-03-08 2019-09-17 腾讯科技(深圳)有限公司 Video broadcasting method, device and equipment
WO2020211731A1 (en) * 2019-04-19 2020-10-22 华为技术有限公司 Video playing method and related device
CN112243136A (en) * 2019-07-16 2021-01-19 中国移动通信集团浙江有限公司 Content playing method, video storage method and equipment

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104469433A (en) * 2013-09-13 2015-03-25 深圳市腾讯计算机系统有限公司 Live video replay method and device
CN104394443A (en) * 2014-09-16 2015-03-04 东方有线网络有限公司 Method for dynamically inserting and broadcasting program in HLS live broadcast streaming medium
CN105228001A (en) * 2015-09-26 2016-01-06 北京暴风科技股份有限公司 The method and system that a kind of FLV format video is play online
CN106559677A (en) * 2015-09-30 2017-04-05 华为技术有限公司 The method and device of terminal, caching server and acquisition video slicing
CN110248219A (en) * 2018-03-08 2019-09-17 腾讯科技(深圳)有限公司 Video broadcasting method, device and equipment
CN108391179A (en) * 2018-04-26 2018-08-10 腾讯科技(深圳)有限公司 live data processing method, device, server, terminal and storage medium
CN110213616A (en) * 2018-05-15 2019-09-06 腾讯科技(深圳)有限公司 Video providing method, acquisition methods, device and equipment
WO2020211731A1 (en) * 2019-04-19 2020-10-22 华为技术有限公司 Video playing method and related device
CN110213672A (en) * 2019-07-04 2019-09-06 腾讯科技(深圳)有限公司 Video generation, playback method, system, device, storage medium and equipment
CN112243136A (en) * 2019-07-16 2021-01-19 中国移动通信集团浙江有限公司 Content playing method, video storage method and equipment

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
张岩峰;王翠荣;赵煜辉;高远;: "一种基于时间驱动实时视频流缓冲区的设计与实现", 东北大学学报(自然科学版), no. 05 *

Similar Documents

Publication Publication Date Title
CN108391179B (en) Live broadcast data processing method and device, server, terminal and storage medium
US10200723B2 (en) Converting live streaming content to video-on-demand streaming content
USRE48360E1 (en) Method and apparatus for providing trick play service
WO2017063399A1 (en) Video playback method and device
US9349413B2 (en) User interface for video preview creation
WO2020211731A1 (en) Video playing method and related device
CN112188225B (en) Bullet screen issuing method for live broadcast playback and live broadcast video bullet screen playback method
US20110219386A1 (en) Method and apparatus for generating bookmark information
CN105376612A (en) Video playing method, media equipment, playing equipment and multimedia system
CN112261416A (en) Cloud-based video processing method and device, storage medium and electronic equipment
US9986267B2 (en) Methods and systems for dynamically editing, encoding, posting and updating live video content
CN109587514B (en) Video playing method, medium and related device
CN105516736B (en) Video file processing method and device
WO2018103696A1 (en) Media file playback method, server, client, and system
CN110198494B (en) Video playing method, device, equipment and storage medium
JP7431329B2 (en) Video processing methods, apparatus, computer devices and computer programs
CN108924630B (en) Method for displaying cache progress and playing device
CN112087642B (en) Cloud guide playing method, cloud guide server and remote management terminal
CN106331763B (en) Method for seamlessly playing fragmented media file and device for implementing method
CN106303754A (en) A kind of audio data play method and device
WO2012107570A1 (en) A method for optimizing a video stream
JP6535273B2 (en) Receiving device, segment acquisition method, and program
CN109587517B (en) Multimedia file playing method and device, server and storage medium
JP7290260B1 (en) Servers, terminals and computer programs
CN114025201A (en) Video playing method, device, equipment and storage medium

Legal Events

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