Method for generating and playing video file, server and terminal

A technology for generating videos and files, which is applied in the field of video processing and can solve problems such as low target position accuracy and bit rate fluctuations.

Active Publication Date: 2017-10-20
成都理想智美科技有限公司
View PDF5 Cites 14 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0003] In order to realize fast broadcast skipping of HLS, the usual practice in the prior art is to estimate the target position of broadcast skipping according to the bit rate, the bit rate can be calculated from the size of the TS file and the duration of the file, and the key frame is found from this position , start decoding, and resume normal playback; this method has the advantage of fast skipping speed, but because the bit rate actually fluctuates, it will lead to the problem of low accuracy of the estimated target position

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Method for generating and playing video file, server and terminal
  • Method for generating and playing video file, server and terminal
  • Method for generating and playing video file, server and terminal

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0051] Such as figure 1 As shown, the first aspect of the present invention provides a method for generating video files, including:

[0052] S101. Divide the video stream into multiple TS files, obtain all key frames in each TS file, and record the display time stamp and file offset of each key frame in each TS file;

[0053] S102. According to the fragmentation sequences of the multiple TS files, generate n m3u8 files for describing the fragmentation sequences, and display the timestamp and file offset of each key frame in each TS file The corresponding tags are added to the n m3u8 files, where n is an integer not less than 1.

[0054] In the embodiment of the present application, the server side is the execution subject of the method for generating video files, and is used to obtain corresponding video streams according to user operation instructions, and then execute steps S101 and S102 on the obtained video streams.

[0055] Wherein, in step S101, after the server obtai...

Embodiment 2

[0076] Based on the technical idea corresponding to the method provided in the first aspect, the second aspect of the present invention provides a method for playing video files, such as image 3 shown, including:

[0077] S301. Analyze the obtained video file, and obtain n m3u8 files corresponding to the video file, a plurality of TS files contained in the n m3u8 files, and a display time stamp of each TS file, wherein n is not less than 1 an integer of

[0078] S302. Using the target time stamp skipped to the target location and the display time stamp of each TS file, find the TS file to which the target time stamp belongs from the plurality of TS files;

[0079] S303. Using the label corresponding to the display time stamp and file offset of each key frame in each TS file stored in the n m3u8 files, obtain each key frame in the TS file to which the target time stamp belongs. The display timestamp and file offset of the keyframe;

[0080] S304. According to the target tim...

Embodiment 3

[0103] Based on the same technical concept as the first aspect, the third aspect of the present invention provides a server, including a computer-readable storage medium, on which a computer program is stored, and when the program is executed by a processor, the The following steps:

[0104] Divide the video stream into multiple TS files, obtain all key frames in each TS file, and record the display timestamp and file offset of each key frame in each TS file;

[0105] According to the slice sequences of the plurality of TS files, generate n m3u8 files for describing the slice sequences, and display timestamps and file offsets corresponding to each key frame in each TS file The tags are added to the n m3u8 files, where n is an integer not less than 1.

[0106] Preferably, when the program is executed by the processor, after recording the display time stamp and file offset of each key frame in each TS file, the following steps are also implemented:

[0107] Generate a dat file...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

PUM

No PUM Login to view more

Abstract

The invention discloses a method for generating and playing a video file, a server and a terminal. The method comprises the steps of dividing a video stream into a plurality of TS files; obtaining all key frames in each TS file and recording a display time stamp of each key frame in each TS file and file offset; and generating n m3u8 files for describing a fragment sequence according to the fragment sequence of the plurality of TS files and adding the display time stamp of each key frame in each TS file and a label corresponding to the file offset to the n m3u8 files. According to the method for generating and playing the video file, the server and the terminal provided by the invention, on the basis of ensuring the playing jumping speed, the accuracy of jumping to a target position is also improved.

Description

technical field [0001] The invention relates to the technical field of video processing, in particular to a method for generating and playing video files, a server and a terminal. Background technique [0002] When the existing HTTP-based streaming media is transmitted, part of it uses the HLS (HTTP LiveStreaming) protocol to transmit the streaming media. In the HLS protocol, the server first divides the entire video stream into multiple small TS fragments, and Provide one or more m3u8 files to describe the video stream and each TS segment, and each TS segment is transmitted through HTTP; after that, the player usually obtains the m3u8 file first, and then parses it to obtain the duration of each TS segment , URL and other information, and then select the desired TS segment to download and play accordingly. When skipping HLS, generally calculate the segment at this time point according to the duration of each segment provided by the m3u8 file. Taking the following m3u8 fil...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

Application Information

Patent Timeline
no application Login to view more
Patent Type & Authority Applications(China)
IPC IPC(8): H04N21/235H04N21/234H04N21/435H04N21/44H04N21/84
CPCH04N21/234H04N21/2353H04N21/435H04N21/44H04N21/84
Inventor 韩科委
Owner 成都理想智美科技有限公司
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products