CN106375873A - HLS video file downloading, storing and playing method - Google Patents

HLS video file downloading, storing and playing method Download PDF

Info

Publication number
CN106375873A
CN106375873A CN201610813243.6A CN201610813243A CN106375873A CN 106375873 A CN106375873 A CN 106375873A CN 201610813243 A CN201610813243 A CN 201610813243A CN 106375873 A CN106375873 A CN 106375873A
Authority
CN
China
Prior art keywords
file
burst
hls
playing
local
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
CN201610813243.6A
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.)
Hangzhou Arcvideo Technology Co ltd
Original Assignee
Hangzhou Arcvideo 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 Hangzhou Arcvideo Technology Co ltd filed Critical Hangzhou Arcvideo Technology Co ltd
Priority to CN201610813243.6A priority Critical patent/CN106375873A/en
Publication of CN106375873A publication Critical patent/CN106375873A/en
Pending legal-status Critical Current

Links

Classifications

    • 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/60Network streaming of media packets
    • H04L65/61Network streaming of media packets for supporting one-way streaming services, e.g. Internet radio
    • H04L65/612Network streaming of media packets for supporting one-way streaming services, e.g. Internet radio for unicast
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/06Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]

Abstract

The invention discloses an HLS video file downloading, storing and playing method. The HLS video file downloading, storing and playing method comprises two parts including downloading management and local playing; after being downloaded, all ts fragments are spliced into a single file, thereby greatly facilitating file management; then, downloaded HLS stream media video data is read and played in a local file manner; an extra http service does not need to be created; resource occupation, the data transmission efficiency and the playing performance of a player are well improved; in the method, a TS fragment splicing rule accords with HLS standards; and for users, analysis of a m3u8 file rewritten through the method, and the playing logic for playing the spliced video file by adopting a local http service do not need to be modified additionally.

Description

A kind of hls video file downloads storage and the method play
Technical field
The present invention relates to a kind of hls video file downloads storage and the method play.
Background technology
On mobile terminal, hls streaming media video is downloaded the mode play and is typically to create a local http service, Hls corresponding m3u8 file and ts burst sequentially download to certain file that this service is specified, then by the side of local http Formula accesses the hls stream medium data playing download.Usual one two hours about film, with the burst length of 10 seconds Meter, has 720 slicing files, burst duration is shorter, and the number of slicing files is also bigger.By that analogy, 15 film bursts The sum of file will be up to ten thousand, for the data base administration of mobile terminal, need to record all of burst of each video flowing Information, data content to be recorded is in 1:700 times of growth, is all greatly to bear for resource occupation or file management Load.
Content of the invention
It is an object of the invention to overcoming of the prior art not enough and providing a kind of hls video file to download storage and broadcast The method put.
For achieving the above object, on the one hand, a kind of hls video file that the present invention provides downloads storage and the side playing Method, including download management and two parts of local broadcasting,
Download management part comprises the steps:
Initiate http request, download the incoming corresponding m3u8 file of hls video file url;
Parsing m3u8 file content, creates the url list of ts burst to be downloaded;
Process url list, the http request of corresponding ts burst is initiated in circulation, until downloading all of ts burst;
Locally playback unit is divided and is comprised the steps:
Open m3u8 file, parse m3u8 file content, and hls video file is gone out according to the duration calculation of each ts burst Total duration;
Create ts burst list to be played;
According to ts burst list, order decoding is read the Voice & Video information of all ts bursts and is decoded, renders Play.
Storage and the method play are downloaded according to a kind of hls video file that the present invention provides, after the download is complete institute Some ts bursts are spliced into monofile, greatly facilitate file management;Read by way of local file again under broadcasting The hls streaming media video data carrying, need not create extra http service, for resource occupation, data transmission efficiency, Yi Jibo The broadcast performance putting device has preferable improvement, and in the method, the rule of ts burst splicing meets hls specification, to user For, revised m3u8 document analysis and spliced video file is play using local http service in this approach Play logic and need not make extra modification.
Specific embodiment
Embodiments of the invention are described below in detail.
One embodiment of the invention provides a kind of hls video file and downloads storage and the method play, including download management Play two parts with local.
Specifically, download management part comprises the steps:
Step 1.1, initiate http request first, download incoming hls url corresponding m3u8 file, such as download File entitled sample.m3u8 content is as follows:
Step 1.2, the content of parsing sample.m3u8 file, create the http url row of a ts burst to be downloaded Table.Create a destination folder, such as d:/download/sub1/sub2/, create target to be rewritten under this catalogue M3u8 file, such as target.m3u8.
Url list in step 1.3, start to process step 1.1, initiates http request once again, downloads http: // Sample.testdomain.com/sub1/sub2/1.ts corresponding ts slicing files, to catalogue d:/download/sub1/ Sub2/ (directory address herein is only a kind of example of the present embodiment), the file designation of download is merge.ts, and download completes Record the total length of this document afterwards, the content rewriting target.m3u8 is as follows:
Herein it should be noted that 20,868 0 expression this ts burst positions in whole target ts file offset as 0, point Leaf length is 20868.
Url list in step 1.4, subsequent treatment steps 1.1, continues to initiate http request, downloads http: // Sample.testdomain.com/sub1/sub2/2.ts corresponding ts slicing files, are appended to merge.ts tail of file, The total length of this document is recorded, the content rewriting target.m3u8 is as follows after the completion of download:
Herein it should be noted that being incremented by with burst, newly add burst should be incremented by the beginning in target ts file Deviation post.
Url list in step 1.5, circular treatment step 1.2, until all bursts are downloaded completing, final The content of target.m3u8 is as follows
It should be noted that source m3u8 file, if any label #ext-x-discontinuity, needs slavish copying to arrive target Before corresponding ts burst description in m3u8 file, otherwise can lose the changes such as the timestamp that this label refers to or coded format Information, causes player plays to arrive and processes extremely during this burst content.
Specifically, local playback unit is divided and is comprised the steps:
Step 2.1, opened by way of local file under d:/download/sub1/sub2/ catalogue Target.m3u8 file, resolution file content, the duration according to each ts burst is (corresponding after #extinf label before burst description Floating-point values), calculate the total duration of hls video file, create ts burst list to be played.
Step 2.2, the target ts file opened in the way of local file under d:/download/sub1/sub2/ catalogue Merge.ts, according to the ts burst list creating in step 2.1, reads 21268 bytes of first burst, sends into ts file Resolver, obtain audio frequency, the basic description information of video, pass to corresponding audio frequency, video decoding and rendering module do Initialization.The data content of first burst, after the process of ts document parser, framing can become audio frequency, frame of video, then send To decoder decoding, carry out again rendering broadcasting.
Step 2.3, according to the ts burst list creating in step 2.1, continuation order reads each ts burst, such as second Individual burst is 18800 bytes immediately after first burst 21268 byte, the content of this burst is sent into the parsing of ts file Device, the audio frequency after resolver framing, frame of video are given decoder decoding, are carried out rendering broadcasting again.If during run into # Ext-x-discontinuity label, ts document parser will do corresponding timestamp and correct, or notifies decoder coding letter Breath may change, and decoder resets the basic parameter of decoding according to practical situation.
Ts burst end of list (EOL) is recycled to this.
Special instruction, if client has done seek operation in playing process, need according to incoming seek when Between point, in step 2.1 create ts burst list in, calculate the ts burst wanting redirect broadcasting, the time shafts of broadcasting are repaiied The duration summation that before being changed to redirect rear ts burst, all ts bursts add up, then reads the ts burst content after redirecting, by it Send into ts document parser, do sub-frame processing, then do decoding and play.
Storage and the method play are downloaded according to a kind of hls video file that the present invention provides, after the download is complete institute Some ts bursts are spliced into monofile, greatly facilitate file management;Read by way of local file again under broadcasting The hls streaming media video data carrying, need not create extra http service, for resource occupation, data transmission efficiency, Yi Jibo The broadcast performance putting device has preferable improvement, and in the method, the rule of ts burst splicing meets hls specification, to user For, revised m3u8 document analysis and spliced video file is play using local http service in this approach Play logic and need not make extra modification.
Although the partly specific implementation section of the present invention has been shown and described above it is to be understood that above-mentioned Specific citing real-time partial is exemplary it is impossible to be interpreted as limitation of the present invention, and those of ordinary skill in the art exists Above-described embodiment can be changed within the scope of the invention in the case of principle without departing from the present invention and objective, repair Change, replace and modification.

Claims (1)

1. a kind of hls video file downloads storage and the method for broadcasting plays two it is characterised in that including download management with local Individual part,
Described download management part comprises the steps:
Initiate http request, download the incoming corresponding m3u8 file of hls video file url;
Parsing m3u8 file content, creates the url list of ts burst to be downloaded;
Process url list, the http request of corresponding ts burst is initiated in circulation, until downloading all of ts burst;
Described local playback unit is divided and is comprised the steps:
Open described m3u8 file, the described m3u8 file content of parsing, and described hls is gone out according to the duration calculation of each ts burst and regard The total duration of frequency file;
Create ts burst list to be played;
According to ts burst list, order decoding is read the Voice & Video information of all ts bursts and is decoded, renders broadcasting.
CN201610813243.6A 2016-08-31 2016-08-31 HLS video file downloading, storing and playing method Pending CN106375873A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610813243.6A CN106375873A (en) 2016-08-31 2016-08-31 HLS video file downloading, storing and playing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610813243.6A CN106375873A (en) 2016-08-31 2016-08-31 HLS video file downloading, storing and playing method

Publications (1)

Publication Number Publication Date
CN106375873A true CN106375873A (en) 2017-02-01

Family

ID=57898989

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610813243.6A Pending CN106375873A (en) 2016-08-31 2016-08-31 HLS video file downloading, storing and playing method

Country Status (1)

Country Link
CN (1) CN106375873A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107071548A (en) * 2017-04-20 2017-08-18 北京搜狐新媒体信息技术有限公司 A kind of method for processing video frequency and system
CN108174284A (en) * 2017-12-29 2018-06-15 航天科工智慧产业发展有限公司 A kind of method of the decoding video based on android system
CN108495190A (en) * 2018-01-29 2018-09-04 北京奇艺世纪科技有限公司 A kind of on-demand control method and device of Online Video
CN111356028A (en) * 2020-03-16 2020-06-30 南京巨鲨显示科技有限公司 Method and device for realizing file sequence on demand by streaming media service
CN112601131A (en) * 2020-12-10 2021-04-02 杭州当虹科技股份有限公司 HLS video slice file storage optimization method
CN112671694A (en) * 2019-10-16 2021-04-16 中兴通讯股份有限公司 HLS playing method, client, server and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090217318A1 (en) * 2004-09-24 2009-08-27 Cisco Technology, Inc. Ip-based stream splicing with content-specific splice points
CN103096131A (en) * 2013-02-06 2013-05-08 天脉聚源(北京)传媒科技有限公司 Processing method and processing device of live broadcast stream
CN103826159A (en) * 2013-12-04 2014-05-28 Tcl集团股份有限公司 M3U8 format video local offline play method and terminal
CN104349176A (en) * 2013-07-30 2015-02-11 中国电信股份有限公司 Self-adaptive stream media system, downloading method and stream media server, user terminal
CN105898527A (en) * 2015-11-18 2016-08-24 乐视网信息技术(北京)股份有限公司 Advertisement video splicing method and video server

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090217318A1 (en) * 2004-09-24 2009-08-27 Cisco Technology, Inc. Ip-based stream splicing with content-specific splice points
US9197857B2 (en) * 2004-09-24 2015-11-24 Cisco Technology, Inc. IP-based stream splicing with content-specific splice points
CN103096131A (en) * 2013-02-06 2013-05-08 天脉聚源(北京)传媒科技有限公司 Processing method and processing device of live broadcast stream
CN104349176A (en) * 2013-07-30 2015-02-11 中国电信股份有限公司 Self-adaptive stream media system, downloading method and stream media server, user terminal
CN103826159A (en) * 2013-12-04 2014-05-28 Tcl集团股份有限公司 M3U8 format video local offline play method and terminal
CN105898527A (en) * 2015-11-18 2016-08-24 乐视网信息技术(北京)股份有限公司 Advertisement video splicing method and video server

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107071548A (en) * 2017-04-20 2017-08-18 北京搜狐新媒体信息技术有限公司 A kind of method for processing video frequency and system
CN107071548B (en) * 2017-04-20 2020-08-28 北京搜狐新媒体信息技术有限公司 Video processing method and system
CN108174284A (en) * 2017-12-29 2018-06-15 航天科工智慧产业发展有限公司 A kind of method of the decoding video based on android system
CN108174284B (en) * 2017-12-29 2020-09-15 航天科工智慧产业发展有限公司 Android system-based video decoding method
CN108495190A (en) * 2018-01-29 2018-09-04 北京奇艺世纪科技有限公司 A kind of on-demand control method and device of Online Video
CN108495190B (en) * 2018-01-29 2021-08-20 北京奇艺世纪科技有限公司 On-line video on-demand control method and device
CN112671694A (en) * 2019-10-16 2021-04-16 中兴通讯股份有限公司 HLS playing method, client, server and storage medium
WO2021073539A1 (en) * 2019-10-16 2021-04-22 中兴通讯股份有限公司 Hls playback method, client, server and storage medium
CN111356028A (en) * 2020-03-16 2020-06-30 南京巨鲨显示科技有限公司 Method and device for realizing file sequence on demand by streaming media service
CN112601131A (en) * 2020-12-10 2021-04-02 杭州当虹科技股份有限公司 HLS video slice file storage optimization method

Similar Documents

Publication Publication Date Title
CN106375873A (en) HLS video file downloading, storing and playing method
JP5288710B2 (en) Information storage medium recording multimedia data, reproducing method and reproducing apparatus thereof
US10645466B2 (en) Video file universal identifier for metadata resolution
US8516144B2 (en) Startup bitrate in adaptive bitrate streaming
KR101885852B1 (en) Method and apparatus for transmitting and receiving content
US7657428B2 (en) System and method for seamless switching of compressed audio streams
US10271074B2 (en) Live to video on demand normalization
US20060092938A1 (en) System for broadcasting multimedia content
CN105049896B (en) A kind of flow media advertisement insertion method and system based on HLS protocol
CN105187896B (en) The media file playing method and system more being segmented
WO2017028675A1 (en) Playing method, device and system for live streaming channel
US9832493B2 (en) Method and apparatus for processing audio/video file
US20130219074A1 (en) System and method for dynamic file availability during encoding
JP6338709B2 (en) Streaming apparatus and method thereof, streaming service system using the same, and computer-readable recording medium (streaming apparatus and method thereof, streaming service system using the streaming medium and computer readable)
WO2007053957A1 (en) Transcoder for live streams and on demand media
WO2017185601A1 (en) Method and device for providing and downloading video
US20170041355A1 (en) Contextual information for audio-only streams in adaptive bitrate streaming
CN105187897B (en) The media file span playback method and system more being segmented
EP2453652B1 (en) Transmission method, receiving method and device for scalable video coding files
US20070083608A1 (en) Delivering a data stream with instructions for playback
US10679667B2 (en) Virtual video editing
WO2012071932A1 (en) Method and system for quick launch of segmented program
JP2006238003A (en) Demultiplexing device
CN110392276B (en) Live broadcast recording and broadcasting method based on Real Time Messaging Protocol (RTMP) synchronous transmission MIDI
CN108259987A (en) Mobile terminal low delay DST PLAYER and playback method

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information
CB02 Change of applicant information

Address after: 310000 A Block, 16th Floor, E Building, Paradise Software Park, No. 3 Xidoumen Road, Hangzhou City, Zhejiang Province

Applicant after: Hangzhou Dang Hong Polytron Technologies Inc

Address before: 310000 B2010, two floor, North (two), six and 368 Road, Binjiang District, Hangzhou, Zhejiang.

Applicant before: HANGZHOU DANGHONG TECHNOLOGY CO., LTD.

RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20170201