CN106412615A - Video file storage method and apparatus thereof - Google Patents
Video file storage method and apparatus thereof Download PDFInfo
- Publication number
- CN106412615A CN106412615A CN201510481805.7A CN201510481805A CN106412615A CN 106412615 A CN106412615 A CN 106412615A CN 201510481805 A CN201510481805 A CN 201510481805A CN 106412615 A CN106412615 A CN 106412615A
- Authority
- CN
- China
- Prior art keywords
- file
- content
- server
- byte
- content unit
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 32
- 230000002776 aggregation Effects 0.000 claims abstract description 37
- 238000004220 aggregation Methods 0.000 claims abstract description 37
- 238000010586 diagram Methods 0.000 description 2
- 238000006116 polymerization reaction Methods 0.000 description 2
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/80—Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
- H04N21/83—Generation or processing of protective or descriptive data associated with content; Content structuring
- H04N21/845—Structuring of content, e.g. decomposing content into time segments
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/20—Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
- H04N21/23—Processing of content or additional data; Elementary server operations; Server middleware
- H04N21/231—Content storage operation, e.g. caching movies for short term storage, replicating data over plural servers, prioritizing data for deletion
- H04N21/23109—Content storage operation, e.g. caching movies for short term storage, replicating data over plural servers, prioritizing data for deletion by placing content in organized collections, e.g. EPG data repository
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/80—Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
- H04N21/85—Assembly of content; Generation of multimedia applications
- H04N21/858—Linking data to content, e.g. by linking an URL to a video object, by creating a hotspot
- H04N21/8586—Linking data to content, e.g. by linking an URL to a video object, by creating a hotspot by using a URL
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Databases & Information Systems (AREA)
- Information Transfer Between Computers (AREA)
Abstract
The invention discloses a video file storage method and an apparatus thereof. The method comprises the following steps that a server receives a first file request sent by a terminal; the first file request is used for requesting for a content file stored in the server; the first file request includes an unified resource positioner URL parameter and a byte index parameter; the byte index parameter includes a byte scope of the content file in a content aggregation file; the URL parameter includes address information of the content aggregation file stored in the server; a video file includes the content file and the content file includes at least two content unit files; the server determines the content file according to the first file request; and the server sends the content file to the terminal. The plurality of content unit files are stored in one aggregation file so that a number of file handles used for storing an HLS video file is greatly reduced and a storage capability is increased.
Description
Technical Field
The present invention relates to the field of wireless communication, and in particular, to a method and apparatus for storing video files.
Background
HTTP Live Streaming (HLS) is a HTTP-based Streaming media transport protocol that enables Live and on-demand Streaming media.
In general, an HLS video file includes two parts, one is an m3u8 description file for describing the playing sequence and playing information of ts files, and the other is a ts media file, each ts file is generally played as long as 10 seconds, that is, the content of one HLS includes many ts files. For example, a 2-hour HLS video content corresponds to three code rates of standard definition, high definition and super definition, the HLS video content has one ts every 10 seconds, each code rate has 3600 × 2/10 ═ 720 ts files, and then the HLS video has 720 × 3 ═ 2160 ts files in total.
In the process of implementing the above scheme, a person skilled in the art finds that the HLS video file includes a large number of ts media files and m3u8 description files, however, when storing the HLS video file, each ts media file and m3u8 description file requires one file handle, which results in a large number of file handles to be used for storing the HLS video file, and further reduces the storage capacity of the server.
Disclosure of Invention
In order to solve the technical problem, the invention provides a video file storage method and a video file storage device, which are used for solving the problem of low storage capacity of a server.
In order to achieve the object of the present invention, the present invention provides a video file storage method, comprising:
the method comprises the steps that a server receives a first file request sent by a terminal, wherein the first file request is used for requesting a content file stored in the server and comprises a Uniform Resource Locator (URL) parameter and a byte index parameter, the byte index parameter comprises a byte range of the content file in a content aggregation file, the URL parameter comprises address information of the content aggregation file stored in the server, the video file comprises the content file, and the content file comprises at least two content unit files;
the server determines the content file according to the first file request;
and the server sends the content file to the terminal.
Further, before the server receives the first file request sent by the terminal, the method further includes:
the server receives a second file request sent by the terminal, wherein the second file request comprises the URL parameter;
the server determines an address for storing the video file according to the URL parameter;
the server determines a first description file stored on the address according to the address, wherein the first description file comprises information of the playing sequence of at least two content unit files and byte information of each content unit file in the content aggregation file;
and the server sends the first description file to the terminal.
Further, before the server receives the first file request sent by the terminal, the method further includes:
and the server sequentially stores the at least two content unit files in a byte appending mode to obtain a content aggregation file.
Further, the server sequentially stores the at least two content unit files in a byte appending mode to obtain a content aggregation file, and further includes:
the server stores byte information of each content unit file in the content aggregate file in the first description file, wherein the first description file comprises the playing sequence of the at least two content unit files and the byte information of each content unit file in the content aggregate file.
Further, the server sequentially stores the at least two content unit files in a byte appending manner, and before obtaining the content aggregate file, the method further includes:
the server determines a description file of a video file arranged under a directory according to the directory;
the server determines the at least two content unit files according to the description file, wherein the description file comprises the playing sequence of the at least two content unit files.
The invention provides a video file storage device, comprising:
a receiving module, configured to receive a first file request sent by a terminal, where the first file request is used to request a content file stored in the server, and the first file request includes a uniform resource locator URL parameter and a byte index parameter, where the byte index parameter includes a byte range of the content file in a content aggregation file, the URL parameter includes address information of the content aggregation file stored in the server, the video file includes the content file, and the content file includes at least two content unit files;
the processing module is used for determining the content file according to the first file request;
and the sending module is used for sending the content file to the terminal.
Further, the receiving module is further configured to receive, by the server, a second file request sent by the terminal, where the second file request includes the URL parameter;
the processing module is further used for determining an address for storing the video file according to the URL parameter; determining a first description file stored on the address according to the address, wherein the first description file comprises information of the playing sequence of at least two content unit files and byte information of each content unit file in the content aggregation file;
the sending module is further configured to send the first description file to the terminal.
Further, the processing module is further configured to sequentially store the at least two content unit files in a byte appending manner to obtain a content aggregation file.
Further, the processing module is further configured to store byte information of each content unit file in the content aggregate file in the first description file, where the first description file includes a playing order of the at least two content unit files and byte information of each content unit file in the content aggregate file.
Further, the processing module is further configured to determine, according to a directory, a description file of a video file set in the directory; determining the at least two content unit files according to the description file, wherein the description file comprises the playing sequence of the at least two content unit files
In this embodiment, a server receives a first file request sent by a terminal, where the first file request is used to request a content file stored in the server, the first file request includes a uniform resource locator URL parameter and a byte index parameter, the byte index parameter includes a byte range of the content file in a content aggregate file, the URL parameter includes address information of the content aggregate file stored in the server, the video file includes the content file, and the content file includes at least two content unit files; the server determines the content file according to the first file request; and the server sends the content file to the terminal. The method and the device realize that a plurality of content unit files are stored in one aggregation file, thereby greatly reducing the number of file handles used for storing the HLS video file and further improving the storage capacity.
Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. The objectives and other advantages of the invention will be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
Drawings
The accompanying drawings are included to provide a further understanding of the invention and are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the example serve to explain the principles of the invention and not to limit the invention.
FIG. 1 is a flowchart illustrating a video file storage method according to an embodiment of the present invention;
FIG. 2 is a schematic structural diagram of a video file storage apparatus according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, embodiments of the present invention will be described in detail below with reference to the accompanying drawings. It should be noted that the embodiments and features of the embodiments in the present application may be arbitrarily combined with each other without conflict.
The video file storage method provided by the embodiment of the invention can be particularly applied to storing (HTTP live streaming, HLS for short) video files or reading HLS video files stored in a server. The video file storage method provided by this embodiment may be executed by a video file storage apparatus, which may be separately configured or may be configured on a server, where the apparatus may be implemented by software/hardware. The video file storage means is described in detail below.
Fig. 1 is a schematic flowchart of a video file storage method according to an embodiment of the present invention, and as shown in fig. 1, the video file storage method includes:
step 101, a server receives a first file request sent by a terminal.
In this embodiment, the first file request is used to request a content file stored in the server, where the first file request includes a Uniform Resource Locator (URL) parameter and a byte index parameter, the byte index parameter includes a byte range of the content file in a content aggregation file, the URL parameter includes address information of the content aggregation file stored in the server, the video file includes the content file, and the content file includes at least two content unit files.
It should be noted that the content file in the present embodiment may be a plurality of content unit files, that is, a ts file divided every 10 seconds of the HLS video file.
Step 102, the server determines the content file according to the first file request.
Specifically, the server may determine, according to the URL parameter, address information of the content aggregate file stored in the server, and then determine the content file according to the byte range of the content aggregate file indicated by the byte index parameter.
Step 103, the server sends the content file to the terminal.
In this embodiment, a server receives a first file request sent by a terminal, where the first file request is used to request a content file stored in the server, the first file request includes a uniform resource locator URL parameter and a byte index parameter, the byte index parameter includes a byte range of the content file in a content aggregate file, the URL parameter includes address information of the content aggregate file stored in the server, the video file includes the content file, and the content file includes at least two content unit files; the server determines the content file according to the first file request; and the server sends the content file to the terminal. The method and the device realize that a plurality of content unit files are stored in one aggregation file, thereby greatly reducing the number of file handles used for storing the HLS video file and further improving the storage capacity.
On the basis of the foregoing embodiment, before the server receives the first file request sent by the terminal, the method may further include:
the server receives a second file request sent by the terminal, wherein the second file request comprises the URL parameter;
the server determines an address for storing the video file according to the URL parameter;
the server determines a first description file stored on the address according to the address, wherein the first description file comprises information of the playing sequence of at least two content unit files and byte information of each content unit file in the content aggregation file;
and the server sends the first description file to the terminal.
Further, on the basis of the foregoing embodiment, before the server receives the first file request sent by the terminal, the method further includes:
and the server sequentially stores the at least two content unit files in a byte appending mode to obtain a content aggregation file.
Meanwhile, in the process that the server sequentially stores the at least two content unit files in a byte adding mode to obtain the content aggregation file, the server stores byte information of each content unit file in the content aggregation file in the first description file, wherein the first description file comprises the playing sequence of the at least two content unit files and the byte information of each content unit file in the content aggregation file.
Further, on the basis of the foregoing embodiment, before the server sequentially stores the at least two content unit files in a byte appending manner and obtains the content aggregate file, the method may further include:
the server determines a description file of a video file arranged under a directory according to the directory;
the server determines the at least two content unit files according to the description file, wherein the description file comprises the playing sequence of the at least two content unit files.
Specifically, table 1 shows the directory structure before and after polymerization, and table 2 shows the comparison table of m3u8 documents before and after polymerization.
TABLE 1
TABLE 2
Fig. 2 is a schematic structural diagram of a video file storage apparatus according to an embodiment of the present invention, as shown in fig. 2, the video file storage apparatus includes: a receiving module 21, a processing module 22 and a transmitting module 23. Wherein,
a receiving module 21, configured to receive a first file request sent by a terminal, where the first file request is used to request a content file stored in the server, and the first file request includes a uniform resource locator URL parameter and a byte index parameter, where the byte index parameter includes a byte range of the content file in a content aggregation file, the URL parameter includes address information of the content aggregation file stored in the server, the video file includes the content file, and the content file includes at least two content unit files;
a processing module 22, configured to determine the content file according to the first file request;
a sending module 23, configured to send the content file to the terminal.
In this embodiment, a server receives a first file request sent by a terminal, where the first file request is used to request a content file stored in the server, the first file request includes a uniform resource locator URL parameter and a byte index parameter, the byte index parameter includes a byte range of the content file in a content aggregate file, the URL parameter includes address information of the content aggregate file stored in the server, the video file includes the content file, and the content file includes at least two content unit files; the server determines the content file according to the first file request; and the server sends the content file to the terminal. The method and the device realize that a plurality of content unit files are stored in one aggregation file, thereby greatly reducing the number of file handles used for storing the HLS video file and further improving the storage capacity.
On the basis of the foregoing embodiment, the receiving module 21 is further configured to receive, by the server, a second file request sent by the terminal, where the second file request includes the URL parameter;
the processing module 22 is further configured to determine, according to the URL parameter, an address where the video file is stored; determining a first description file stored on the address according to the address, wherein the first description file comprises information of the playing sequence of at least two content unit files and byte information of each content unit file in the content aggregation file;
the sending module 23 is further configured to send the first description file to the terminal.
Further, on the basis of the foregoing embodiment, the processing module 22 is further configured to sequentially store the at least two content unit files in a byte appending manner, so as to obtain a content aggregation file.
Further, on the basis of the foregoing embodiment, the processing module 22 is further configured to store byte information of each content unit file in the content aggregation file in the first description file, where the first description file includes a playing order of the at least two content unit files and byte information of each content unit file in the content aggregation file.
Further, on the basis of the foregoing embodiment, the processing module 22 is further configured to determine, according to a directory, a description file of a video file set under the directory; determining the at least two content unit files according to the description file, wherein the description file comprises the playing sequence of the at least two content unit files.
In the implementation, a plurality of content unit files are stored in one aggregation file, so that the number of file handles used for storing the HLS video file is greatly reduced, and the storage capacity is improved.
Although the embodiments of the present invention have been described above, the above description is only for the convenience of understanding the present invention, and is not intended to limit the present invention. It will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the invention as defined by the appended claims.
Claims (10)
1. A method for storing a video file, comprising:
the method comprises the steps that a server receives a first file request sent by a terminal, wherein the first file request is used for requesting a content file stored in the server and comprises a Uniform Resource Locator (URL) parameter and a byte index parameter, the byte index parameter comprises a byte range of the content file in a content aggregation file, the URL parameter comprises address information of the content aggregation file stored in the server, the video file comprises the content file, and the content file comprises at least two content unit files;
the server determines the content file according to the first file request;
and the server sends the content file to the terminal.
2. The method according to claim 1, wherein before the server receives the first file request sent by the terminal, the method further comprises:
the server receives a second file request sent by the terminal, wherein the second file request comprises the URL parameter;
the server determines an address for storing the video file according to the URL parameter;
the server determines a first description file stored on the address according to the address, wherein the first description file comprises information of the playing sequence of at least two content unit files and byte information of each content unit file in the content aggregation file;
and the server sends the first description file to the terminal.
3. The method according to claim 2, wherein before the server receives the first file request sent by the terminal, the method further comprises:
and the server sequentially stores the at least two content unit files in a byte appending mode to obtain a content aggregation file.
4. The method according to claim 3, wherein the server sequentially stores the at least two content unit files by byte appending to obtain a content aggregate file, further comprising:
the server stores byte information of each content unit file in the content aggregate file in the first description file, wherein the first description file comprises the playing sequence of the at least two content unit files and the byte information of each content unit file in the content aggregate file.
5. The method according to claim 4, wherein the server sequentially stores the at least two content unit files by byte appending, and further comprises, before obtaining the content aggregate file:
the server determines a description file of a video file arranged under a directory according to the directory;
the server determines the at least two content unit files according to the description file, wherein the description file comprises the playing sequence of the at least two content unit files.
6. A video file storage apparatus, comprising:
a receiving module, configured to receive a first file request sent by a terminal, where the first file request is used to request a content file stored in the server, and the first file request includes a uniform resource locator URL parameter and a byte index parameter, where the byte index parameter includes a byte range of the content file in a content aggregation file, the URL parameter includes address information of the content aggregation file stored in the server, the video file includes the content file, and the content file includes at least two content unit files;
the processing module is used for determining the content file according to the first file request;
and the sending module is used for sending the content file to the terminal.
7. The apparatus according to claim 6, wherein the receiving module is further configured to receive, by the server, a second file request sent by the terminal, where the second file request includes the URL parameter;
the processing module is further used for determining an address for storing the video file according to the URL parameter; determining a first description file stored on the address according to the address, wherein the first description file comprises information of the playing sequence of at least two content unit files and byte information of each content unit file in the content aggregation file;
the sending module is further configured to send the first description file to the terminal.
8. The apparatus of claim 7, wherein the processing module is further configured to sequentially store the at least two content unit files in a byte appending manner to obtain a content aggregation file.
9. The apparatus of claim 8, wherein the processing module is further configured to store byte information of each content unit file in the content aggregate file in the first description file, and wherein the first description file comprises the playing order of the at least two content unit files and byte information of each content unit file in the content aggregate file.
10. The apparatus according to claim 9, wherein the processing module is further configured to determine, according to a directory, a description file of a video file disposed under the directory; determining the at least two content unit files according to the description file, wherein the description file comprises the playing sequence of the at least two content unit files.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510481805.7A CN106412615A (en) | 2015-08-03 | 2015-08-03 | Video file storage method and apparatus thereof |
PCT/CN2016/092733 WO2017020809A1 (en) | 2015-08-03 | 2016-08-01 | Video file storage method and device for same |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510481805.7A CN106412615A (en) | 2015-08-03 | 2015-08-03 | Video file storage method and apparatus thereof |
Publications (1)
Publication Number | Publication Date |
---|---|
CN106412615A true CN106412615A (en) | 2017-02-15 |
Family
ID=57942398
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510481805.7A Pending CN106412615A (en) | 2015-08-03 | 2015-08-03 | Video file storage method and apparatus thereof |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN106412615A (en) |
WO (1) | WO2017020809A1 (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109302621A (en) * | 2017-07-24 | 2019-02-01 | 中兴通讯股份有限公司 | A kind of file polymerization and server |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101389017A (en) * | 2007-09-14 | 2009-03-18 | 中兴通讯股份有限公司 | Method for storing media file in mobile stream media live service |
US20100272419A1 (en) * | 2009-04-23 | 2010-10-28 | General Instrument Corporation | Digital video recorder recording and rendering programs formed from spliced segments |
CN102238434A (en) * | 2011-07-22 | 2011-11-09 | 中兴通讯股份有限公司 | Method and system for segmenting internet protocol television (IPTV) stream media file virtually |
CN104333818A (en) * | 2014-10-17 | 2015-02-04 | 中兴通讯股份有限公司 | Splicing method and splicing system for HTTP real-time streaming media fragment |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101197840A (en) * | 2007-12-29 | 2008-06-11 | 深圳市迅雷网络技术有限公司 | Method, system, device for downloading and storing files and method for generating identification |
US20100312828A1 (en) * | 2009-06-03 | 2010-12-09 | Mobixell Networks Ltd. | Server-controlled download of streaming media files |
CN104283955A (en) * | 2014-09-30 | 2015-01-14 | 百度在线网络技术(北京)有限公司 | Browser, server, downloading system and downloading method |
-
2015
- 2015-08-03 CN CN201510481805.7A patent/CN106412615A/en active Pending
-
2016
- 2016-08-01 WO PCT/CN2016/092733 patent/WO2017020809A1/en active Application Filing
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101389017A (en) * | 2007-09-14 | 2009-03-18 | 中兴通讯股份有限公司 | Method for storing media file in mobile stream media live service |
US20100272419A1 (en) * | 2009-04-23 | 2010-10-28 | General Instrument Corporation | Digital video recorder recording and rendering programs formed from spliced segments |
CN102238434A (en) * | 2011-07-22 | 2011-11-09 | 中兴通讯股份有限公司 | Method and system for segmenting internet protocol television (IPTV) stream media file virtually |
CN104333818A (en) * | 2014-10-17 | 2015-02-04 | 中兴通讯股份有限公司 | Splicing method and splicing system for HTTP real-time streaming media fragment |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109302621A (en) * | 2017-07-24 | 2019-02-01 | 中兴通讯股份有限公司 | A kind of file polymerization and server |
Also Published As
Publication number | Publication date |
---|---|
WO2017020809A1 (en) | 2017-02-09 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8843596B2 (en) | Conversion between streaming media communication protocols | |
EP2807838B1 (en) | Techniques for improved multicast content delivery | |
CN102694831B (en) | Mobile terminal streaming compensation data method and system, content distributing network | |
CN104581374B (en) | A kind of method, node and server for obtaining section file and generating sub- m3u8 files | |
US8903972B2 (en) | Method and apparatus for sharing contents using information of group change in content oriented network environment | |
CN103813185B (en) | A kind of method that segment programs are quickly distributed, server and client | |
JP2015527782A5 (en) | ||
US9479607B2 (en) | Content caching and delivering system with traffic of repetitively requested content reduced | |
CN107431700B (en) | Method and apparatus for indication of partial segments | |
US10412138B2 (en) | Indication for partial segment | |
CN105049931B (en) | The method and system that the video of format non-supporting in mobile terminal is converted | |
CN102883185A (en) | Video-on-demand method and equipment thereof | |
CN106470222A (en) | A kind of document transmission method, device and application server | |
US10560515B2 (en) | Method and apparatus for transmitting and receiving information between servers in contents transmission network system | |
CN104283955A (en) | Browser, server, downloading system and downloading method | |
CN103873956B (en) | Media file playing method, system, player, terminal and media storage platform | |
CN104639985A (en) | Multimedia playing control method and system | |
CN103561013B (en) | The data distribution systems of Streaming Media | |
KR20170121195A (en) | Indications for partial segments | |
US20160330298A1 (en) | System, Terminal, Server, and Method for Data Transmission | |
CN104717555A (en) | Video stream acquiring method and device | |
CN106412615A (en) | Video file storage method and apparatus thereof | |
CN105764093A (en) | Method and device for selecting data compression level | |
KR101973724B1 (en) | Method and apparatus for providing adaptively video service | |
CN110636374A (en) | Method and device for searching information |
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 | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20170215 |
|
RJ01 | Rejection of invention patent application after publication |