CN105357544A - HLS-based multimedia file processing method and server - Google Patents

HLS-based multimedia file processing method and server Download PDF

Info

Publication number
CN105357544A
CN105357544A CN201510718500.3A CN201510718500A CN105357544A CN 105357544 A CN105357544 A CN 105357544A CN 201510718500 A CN201510718500 A CN 201510718500A CN 105357544 A CN105357544 A CN 105357544A
Authority
CN
China
Prior art keywords
file
section
tmpfs
stored
sub
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
CN201510718500.3A
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.)
Inspur Software Group Co Ltd
Original Assignee
Inspur Software Group 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 Inspur Software Group Co Ltd filed Critical Inspur Software Group Co Ltd
Priority to CN201510718500.3A priority Critical patent/CN105357544A/en
Publication of CN105357544A publication Critical patent/CN105357544A/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/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/239Interfacing the upstream path of the transmission network, e.g. prioritizing client content requests
    • H04N21/2393Interfacing the upstream path of the transmission network, e.g. prioritizing client content requests involving handling client requests
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/231Content storage operation, e.g. caching movies for short term storage, replicating data over plural servers, prioritizing data for deletion
    • H04N21/23113Content storage operation, e.g. caching movies for short term storage, replicating data over plural servers, prioritizing data for deletion involving housekeeping operations for stored content, e.g. prioritizing content for deletion because of storage space restrictions
    • 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/234336Processing 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 media transcoding, e.g. video is transformed into a slideshow of still pictures or audio is converted into text
    • 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

Abstract

The invention provides a multimedia file processing method and a server based on HLS, wherein the method comprises the following steps: constructing a tmpfs file system; constructing at least one folder in a tmpfs file system; transcoding the target multimedia file into at least one slice file, and storing all the slice files under at least one folder; for each slice file, storing the file information of the current slice file into a database; respectively receiving play request instructions from at least two clients, generating an index file M3U8 corresponding to each client, and returning the generated M3U8 to the corresponding client; respectively receiving file request instructions from at least two clients, acquiring a target slice file from a tmpfs file system according to the file request instructions and providing the target slice file to the corresponding client. Through the technical scheme of the invention, the user experience can be improved.

Description

A kind of multimedia file processing method based on HLS and server
Technical field
The present invention relates to multimedia technology field, particularly a kind of multimedia file processing method based on HLS and server.
Background technology
HLS (HTTPLiveStreaming, dynamic code rate adaptive technique) be the current technical way for realizing play multimedia file, by in the server by destination multimedia file (such as, audio frequency, video) be transcoded into multiple section file, then the section file after transcoding is stored in disk, by the transcoding time point of each section file, the fileinfos such as playing duration and the store path on disk are deposited in a database, when there is client and needing to play destination multimedia file, namely server can generate a file directory index file according to the broadcasting demand of client, client reads corresponding section file by this file directory index file and plays destination multimedia file to complete from the disk of server.
In technique scheme, section file is stored in the disk of server, when playing the destination multimedia file on this disk when multiple client simultaneously, namely need to carry out read-write operation frequently to this disk, cause the response speed of server slower, even occur that IO bottleneck causes part client can not successfully play destination multimedia file, Consumer's Experience is poor.
Summary of the invention
In view of this, the invention provides a kind of multimedia file processing method based on HLS and server, can Consumer's Experience be promoted.
First aspect, the invention provides a kind of multimedia file processing method based on HLS, comprising:
S0: build tmpfs file system;
S1: build at least one file in tmpfs file system;
S2: obtain destination multimedia file, is transcoded at least one section file, under file of all cutting into slices is stored at least one file by destination multimedia file;
S3: for each the section file be stored under at least one file, by the file information storage of current slice file in database;
S4: receive the playing request instruction from least two clients respectively, respectively according to the fileinfo of each the section file stored in different playing request instructions and database, generate the index file M3U8 corresponding respectively to each client, the M3U8 of generation is back to corresponding client;
S5: receive the file request instruction triggered according to the M3U8 of correspondence from least two clients respectively, carry the fileinfo of target slice file in described file request instruction, from tmpfs file system, obtain target slice file according to the fileinfo of target slice file and client to correspondence provides target slice file.
Further,
Described in file system, build at least one file after, also comprise: under at least one file, build at least two sub-folders, each sub-folder is respectively used to be stored in the section file of transcoding in different time sections;
Described file of all cutting into slices is stored at least one file under, comprise: the transcoding time determining each section file, each section file is stored in the sub-folder under at least one file by the transcoding time point respectively corresponding respectively according to each section file.
Further,
Described destination multimedia file is transcoded at least one section file after, comprise further: for each section file, according to YYMMDDHHMMSS_LENGTH.TS form, current slice file is named;
After described structure at least two sub-folders, comprise further: for each sub-folder, according to YYMMDDHH form, current sub-folder is named;
Wherein, YYMMDDHHMMSS is for characterizing the transcoding time point of current slice file, LENGTH for characterizing the playing duration of current slice file, TS for characterizing the file format of current slice file, and YYMMDDHHMM is for time range corresponding to the transcoding time point that characterizes each the section file stored in current sub-folder.
Further, described by the file information storage of current slice file in database, comprising:
The file name of current slice file, store path and transcoding time are stored in database.
Further, described structure tmpfs file system, comprising:
Perform as issued orders to build tmpfs file system:
#mounttmpfs/tmpfs/inspur_shift-ttmpfs;
#mounttmpfs/tmpfs/inspur_shift-ttmpfs-osize=3g。
Second aspect, the invention provides a kind of server, comprising:
First construction unit, for building tmpfs file system;
Second construction unit, for building at least one file in tmpfs file system;
First processing unit, for obtaining destination multimedia file, is transcoded at least one section file, under file of all cutting into slices is stored at least one file by destination multimedia file;
Database, for for each the section file be stored under at least one file, by the file information storage of current slice file in database;
Second processing unit, for receiving the playing request instruction from least two clients respectively, respectively according to the fileinfo of each the section file stored in different playing request instructions and database, generate the index file M3U8 corresponding respectively to each client, the M3U8 of generation is back to corresponding client;
3rd processing unit, for receiving the file request instruction triggered according to the M3U8 of correspondence from least two clients respectively, carry the fileinfo of target slice file in described file request instruction, from tmpfs file system, obtain target slice file according to the fileinfo of target slice file and client to correspondence provides target slice file.
Further,
Described second construction unit, is further used under at least one file, builds at least two sub-folders, and each sub-folder is respectively used to be stored in the section file of transcoding in different time sections;
Described first processing unit, for determining the transcoding time of each section file, each section file is stored in the sub-folder under at least one file by the transcoding time point respectively corresponding respectively according to each section file.
Further,
Described first processing unit, is further used for, for each section file, naming current slice file according to YYMMDDHHMMSS_LENGTH.TS form; ;
Described second construction unit, is further used for, for each sub-folder, naming current sub-folder according to YYMMDDHH form;
Wherein, YYMMDDHHMMSS is for characterizing the transcoding time point of current slice file, LENGTH for characterizing the playing duration of current slice file, TS for characterizing the file format of current slice file, and YYMMDDHHMM is for time range corresponding to the transcoding time point that characterizes each the section file stored in current sub-folder.
Further,
Described database, for being stored to the file name of current slice file, store path and transcoding time in database.
Further,
Described first construction unit, for performing as issued orders to build tmpfs file system:
#mounttmpfs/tmpfs/inspur_shift-ttmpfs;
#mounttmpfs/tmpfs/inspur_shift-ttmpfs-osize=3g。
The invention provides a kind of multimedia file processing method based on HLS and server, by building tmpfs file system, section file corresponding for destination multimedia file is stored at least one file under tmpfs file system, and by the file information storage of each section file under tmpfs file system in database, when receiving the playing request instruction from least two clients respectively, the index file M3U8 of each client corresponding is respectively generated according to the fileinfo of each the section file stored in playing request instruction and database, respectively the index file of generation is back to corresponding client, the file request instruction of carrying the fileinfo of target slice file is triggered by M3U8 to make client, when receiving the file request instruction from client, corresponding target slice file can be read from tmpfs file system according to the fileinfo of the target slice file carried in file request instruction, and provide target slice file to the client of correspondence, because tmpfs is a kind of file system based on internal memory, the section file of destination multimedia file is all stored in internal memory, therefore, access procedure for section file corresponds to the read-write operation to internal memory, memory read-write speed, the response speed of server can be improved, and then promote Consumer's Experience.
Accompanying drawing explanation
In order to be illustrated more clearly in the embodiment of the present invention or technical scheme of the prior art, be briefly described to the accompanying drawing used required in embodiment or description of the prior art below, apparently, accompanying drawing in the following describes is some embodiments of the present invention, for those of ordinary skill in the art, under the prerequisite not paying creative work, other accompanying drawing can also be obtained according to these accompanying drawings.
Fig. 1 is the flow chart of a kind of multimedia file processing method based on HLS that one embodiment of the invention provides;
Fig. 2 is the flow chart of the another kind that provides of one embodiment of the invention based on the multimedia file processing method of HLS;
Fig. 3 is a kind of storage organization schematic diagram of file under tmpfs file system of cutting into slices that one embodiment of the invention provides;
Fig. 4 is the fileinfo storage organization schematic diagram in a database of a kind of file of cutting into slices that one embodiment of the invention provides;
Fig. 5 is the structural representation of a kind of M3U8 that one embodiment of the invention provides;
Fig. 6 is a kind of server that one embodiment of the invention provides.
Embodiment
For making the object of the embodiment of the present invention, technical scheme and advantage clearly; below in conjunction with the accompanying drawing in the embodiment of the present invention; technical scheme in the embodiment of the present invention is clearly and completely described; obviously; described embodiment is the present invention's part embodiment, instead of whole embodiments, based on the embodiment in the present invention; the every other embodiment that those of ordinary skill in the art obtain under the prerequisite not making creative work, all belongs to the scope of protection of the invention.
As shown in Figure 1, embodiments provide a kind of multimedia file processing method based on HLS, the method can comprise the following steps:
S0: build tmpfs file system;
S1: build at least one file in tmpfs file system;
S2: obtain destination multimedia file, is transcoded at least one section file, under file of all cutting into slices is stored at least one file by destination multimedia file;
S3: for each the section file be stored under at least one file, by the file information storage of current slice file in database;
S4: receive the playing request instruction from least two clients respectively, respectively according to the fileinfo of each the section file stored in different playing request instructions and database, generate the index file M3U8 corresponding respectively to each client, the M3U8 of generation is back to corresponding client;
S5: receive the file request instruction triggered according to the M3U8 of correspondence from least two clients respectively, carry the fileinfo of target slice file in described file request instruction, from tmpfs file system, obtain target slice file according to the fileinfo of target slice file and client to correspondence provides target slice file.
In one embodiment of the invention, by building tmpfs file system, section file corresponding for destination multimedia file is stored at least one file under tmpfs file system, and by the file information storage of each section file under tmpfs file system in database, when receiving the playing request instruction from least two clients respectively, the index file M3U8 of each client corresponding is respectively generated according to the fileinfo of each the section file stored in playing request instruction and database, respectively the index file of generation is back to corresponding client, the file request instruction of carrying the fileinfo of target slice file is triggered by M3U8 to make client, when receiving the file request instruction from client, corresponding target slice file can be read from tmpfs file system according to the fileinfo of the target slice file carried in file request instruction, and provide target slice file to the client of correspondence, because tmpfs is a kind of file system based on internal memory, the section file of destination multimedia file is all stored in internal memory, therefore, access procedure for section file corresponds to the read-write operation to internal memory, memory read-write speed, the response speed of server can be improved, and then promote Consumer's Experience.
Further, conveniently section file is managed, store too many section file under preventing a file and affect the efficiency accessing section file in tmpfs file system, by arranging different files to deposit the section file of transcoding in different time sections; Particularly, in a preferred embodiment of the invention, described in file system, build at least one file after, also comprise: under at least one file, build at least two sub-folders, each sub-folder is respectively used to be stored in the section file of transcoding in different time sections;
Described file of all cutting into slices is stored at least one file under, comprise: the transcoding time determining each section file, each section file is stored in the sub-folder under at least one file by the transcoding time point respectively corresponding respectively according to each section file.
Further, conveniently management and generate M3U8 file carrying out time shift, when reviewing, in a preferred embodiment of the invention, described destination multimedia file is transcoded at least one section file after, comprise further: for each section file, according to YYMMDDHHMMSS_LENGTH.TS form, current slice file is named;
After described structure at least two sub-folders, comprise further: for each sub-folder, according to YYMMDDHH form, current sub-folder is named;
Wherein, YYMMDDHHMMSS is for characterizing the transcoding time point of current slice file, LENGTH for characterizing the playing duration of current slice file, TS for characterizing the file format of current slice file, and YYMMDDHHMM is for time range corresponding to the transcoding time point that characterizes each the section file stored in current sub-folder.
Further, from tmpfs file system, corresponding section file is got to realize playing destination multimedia file by the M3U8 generated in order to make client, in a preferred embodiment of the invention, described by the file information storage of current slice file in database, comprising:
The file name of current slice file, store path and transcoding time are stored in database.
Further, in a preferred embodiment of the invention, realizing building tmpfs file system by such as under type, performing as issued orders to build tmpfs file system:
#mounttmpfs/tmpfs/inspur_shift-ttmpfs;
#mounttmpfs/tmpfs/inspur_shift-ttmpfs-osize=3g。
For making the object, technical solutions and advantages of the present invention clearly, below in conjunction with drawings and the specific embodiments, the present invention is described in further detail.
As shown in Figure 2, embodiments provide a kind of multimedia file processing method based on HLS, the method can comprise the following steps:
Step 201, builds tmpfs file system.
Tmpfs file system is a kind of file system based on internal memory, it and virtual disk ramdisk comparing class seemingly picture, but incomplete same, and the same with ramdisk, tmpfs can use internal memory, namely stores data by setting up corresponding file on internal memory.
Particularly, in one embodiment of the invention, build tmpfs file system by performing as given an order: #mounttmpfs/tmpfs/inspur_shift-ttmpfs;
#mounttmpfs/tmpfs/inspur_shift-ttmpfs-osize=3g。
Step 202, builds at least one file in tmpfs file system.
In the embodiment of the present invention, corresponding file can be built in conjunction with actual demand, such as, build file shandongweishi with corresponding Shandong satellite TV channel, accordingly, other different files can be built with channels corresponding different respectively.
For example, under/tmpfs/inspur_shift catalogue, different files can be created, such as: shandongweishi corresponding Shandong satellite TV channel, and for example CCTV-1_profile2 etc.; Wherein profile2 is for identifying the program of same channel different resolution; Accordingly, can specify that profile1 identifies 1080P, profile2 and identifies 720P, profile3 mark 480P; Certainly, in situation in the cards, other corresponding relation also can be set.
Step 203, sets up at least two sub-folders under at least one file.
In one embodiment of the invention, conveniently section file being managed, and conveniently realize time shift, the function such as to review, depositing section file respectively by arranging multiple sub-folder.
Step 204, names each sub-folder.
In one embodiment of the invention, the function such as conveniently realize time shift, review, can arrange different files to deposit section file according to the transcoding time sequencing of section file.
Particularly, the name form of each sub-folder can comprise: YYMMDDHH form, may correspond to a concrete sub-folder name under such as changing form to be called: 2015093013, here, namely this file can be used for the section file depositing transcoding between 30,14: 0 13 o'clock on the 30th 0 minute to 2015 on September of September in 2015.
It should be noted that, in step 203 and step 204, also can automatically generating by arranging fixed time interval the section file that a sub-folder stores transcoding in the next time interval.
It should be noted that, the time range that the section file transcoding time point deposited under each sub-folder is corresponding can rationally be arranged, such as, this file also can be used for the section file of transcoding between storage 30,15: 0 13 o'clock on the 30th 0 minute to 2015 on September of September in 2015.
It should be noted that, time, the time interval etc. can with the server time of correspondence for normative references.
Step 205, obtains destination multimedia file.
Multimedia file can comprise the files in stream media such as audio/video.
Step 206, is transcoded at least one section file by destination multimedia file.
Step 207, determines the transcoding time point of each section file.
In one embodiment of the invention, the time point that each section file is corresponding can with the server time of correspondence for normative reference; Certainly, other normative reference also can be adopted, as long as consistent with the normative reference required in step 204.
Step 208, names each section file.
In the embodiment of the present invention, following form can be adopted name corresponding section file: YYMMDDHHMMSS_LENGTH.TS, wherein, YYMMDDHHMMSS is for characterizing the transcoding time point of current slice file, LENGTH for characterizing the playing duration of current slice file, TS for characterizing the file format of current slice file; For example, be the section file in 13: 40: 40 on the 30th September in 2015 for transcoding time point, and 5 of the playing duration of this section file seconds, then following title can be used to name this section file: 20150930134040_5.000.ts.
Step 209, is stored to each section file in corresponding sub-folder according to the file name of each section file respectively.
For example, the section file 20150930134040_5.000.TS in step 208 can be stored in the file 2015093013 described in step 204.
The storage format of section file in tmpfs file system can with reference to figure 3.
Step 210, by the file information storage of each section file in database.
In the embodiment of the present invention, fileinfo can comprise: the file name of current slice file, store path and transcoding time point.
The fileinfo storage format in a database that section file is corresponding can with reference to figure 4.
It should be noted that, corresponding monitoring thread monitoring tmpfs file system can be set, the fileinfo namely simultaneously upgraded in corresponding database once tmpfs file system changes here.
Step 211, receives the playing request instruction that client sends, and generates M3U8, and M3U8 is back to corresponding client.
In the embodiment of the present invention, the playing request instruction from least two clients can be received respectively, respectively according to the fileinfo of each the section file stored in different playing request instructions and database, generate the index file M3U8 corresponding respectively to each client, the M3U8 of generation is back to corresponding client.
M3U8 file is the M3U file of UTF-8 coded format, be a text-only file, the fileinfo that text file record needs the destination multimedia file play corresponding.
The file format of the M3U8 file generated can with reference to figure 5.
Step 212, receives the file request instruction that client sends, and obtains target slice file and client to correspondence provides target slice file according to file request instruction from tmpfs file system.
In one embodiment of the invention, the file request instruction triggered according to the M3U8 of correspondence from least two clients can be received respectively, carry the fileinfo of target slice file in described file request instruction, from tmpfs file system, obtain target slice file according to the fileinfo of target slice file and client to correspondence provides target slice file.
Have recorded the fileinfo needing the destination multimedia file of broadcasting corresponding in M3U8, client can find the memory address of corresponding section file in tmpfs file system to play according to its index.
Can file request instruction comprise form as described below: http: // 192.168.3.77/icdn-srm/live/CCTV-1_profile2/live.m3u8 in the embodiment of the present invention? segmentserverid=cctv1; Wherein, segmentserverid is for marking which channel of request, CCTV-1_profile2 for the program of which resolution corresponding to identification request channel; Certainly, the request instruction of the corresponding different-format of server possibility of different size.
By each step described in above-described embodiment, live or the program request of the multimedia file such as audio frequency, video based on HLS can be realized, and by building tmpfs file system, when play multimedia file, correspondence is cut into slices in the access procedure of file, realize access section file on internal memory, because on internal memory, namely accessing file corresponds to the read-write operation for internal memory, read or write speed for internal memory is very fast, therefore, the corresponding speed of server can be improved, there is provided corresponding section file to client fast, can Consumer's Experience be improved.
As shown in Figure 6, embodiments provide a kind of server, comprising:
First construction unit 601, for building tmpfs file system;
Second construction unit 602, for building at least one file in tmpfs file system;
First processing unit 603, for obtaining destination multimedia file, is transcoded at least one section file, under file of all cutting into slices is stored at least one file by destination multimedia file;
Database 604, for for each the section file be stored under at least one file, by the file information storage of current slice file in database;
Second processing unit 605, for receiving the playing request instruction from least two clients respectively, respectively according to the fileinfo of each the section file stored in different playing request instructions and database, generate the index file M3U8 corresponding respectively to each client, the M3U8 of generation is back to corresponding client;
3rd processing unit 606, for receiving the file request instruction triggered according to the M3U8 of correspondence from least two clients respectively, carry the fileinfo of target slice file in described file request instruction, from tmpfs file system, obtain target slice file according to the fileinfo of target slice file and client to correspondence provides target slice file.
Further, conveniently the section file of transcoding is managed, in one mode in the cards, described second construction unit 602, be further used under at least one file, build at least two sub-folders, each sub-folder is respectively used to be stored in the section file of transcoding in different time sections;
Described first processing unit 603, for determining the transcoding time of each section file, each section file is stored in the sub-folder under at least one file by the transcoding time point respectively corresponding respectively according to each section file.
Further, conveniently management and generate M3U8 file carrying out time shift, when reviewing, in one mode in the cards, described first processing unit 603, be further used for, for each section file, naming current slice file according to YYMMDDHHMMSS_LENGTH.TS form; ;
Described second construction unit 602, is further used for, for each sub-folder, naming current sub-folder according to YYMMDDHH form;
Wherein, YYMMDDHHMMSS is for characterizing the transcoding time point of current slice file, LENGTH for characterizing the playing duration of current slice file, TS for characterizing the file format of current slice file, and YYMMDDHHMM is for time range corresponding to the transcoding time point that characterizes each the section file stored in current sub-folder.
Further, from tmpfs file system, corresponding section file is got to realize playing destination multimedia file by the M3U8 generated in order to make client, in one mode in the cards, described database 604, for being stored to the file name of current slice file, store path and transcoding time in database.
Further, in one mode in the cards, described first construction unit 601, for performing as issued orders to build tmpfs file system:
#mounttmpfs/tmpfs/inspur_shift-ttmpfs;
#mounttmpfs/tmpfs/inspur_shift-ttmpfs-osize=3g。
The content such as information interaction, implementation between each unit in said apparatus, due to the inventive method embodiment based on same design, particular content can see in the inventive method embodiment describe, repeat no more herein.
The embodiment of the present invention at least has following beneficial effect:
1, by building tmpfs file system, section file corresponding for destination multimedia file is stored at least one file under tmpfs file system, and by the file information storage of each section file under tmpfs file system in database, when receiving the playing request instruction from least two clients respectively, the index file M3U8 of each client corresponding is respectively generated according to the fileinfo of each the section file stored in playing request instruction and database, respectively the index file of generation is back to corresponding client, the file request instruction of carrying the fileinfo of target slice file is triggered by M3U8 to make client, when receiving the file request instruction from client, corresponding target slice file can be read from tmpfs file system according to the fileinfo of the target slice file carried in file request instruction, and provide target slice file to the client of correspondence, because tmpfs is a kind of file system based on internal memory, the section file of destination multimedia file is all stored in internal memory, therefore, access procedure for section file corresponds to the read-write operation to internal memory, memory read-write speed, the response speed of server can be improved, and then promote Consumer's Experience.
2, by building at least two sub-folders to store the section file of different time sections transcoding respectively, the section file stored under corresponding sub-folder and current sub-folder all joins with the transcoding time correlation of file of cutting into slices, and is convenient to time shift, generation M3U8. when reviewing
3, when playing destination multimedia file, transfer the read-write operation for disk in playing process to read or write speed for internal memory, for the read or write speed of internal memory faster than the read or write speed for disk, therefore, the response time of server can be improved, when realizing high concurrent live or program request, provide section file to the client of correspondence fast.
It should be noted that, in this article, the relational terms of such as first and second and so on is only used for an entity or operation to separate with another entity or operating space, and not necessarily requires or imply the relation that there is any this reality between these entities or operation or sequentially.And, term " comprises ", " comprising " or its any other variant are intended to contain comprising of nonexcludability, thus make to comprise the process of a series of key element, method, article or equipment and not only comprise those key elements, but also comprise other key elements clearly do not listed, or also comprise by the intrinsic key element of this process, method, article or equipment.When not more restrictions, the key element " being comprised a 〃 〃 〃 〃 〃 〃 " limited by statement, and be not precluded within process, method, article or the equipment comprising described key element and also there is other identical factor.
Finally it should be noted that: the foregoing is only preferred embodiment of the present invention, only for illustration of technical scheme of the present invention, be not intended to limit protection scope of the present invention.All any amendments done within the spirit and principles in the present invention, equivalent replacement, improvement etc., be all included in protection scope of the present invention.

Claims (10)

1. based on a multimedia file processing method of dynamic code rate adaptive technique HLS, it is characterized in that, comprising: build tmpfs file system; Also comprise:
At least one file is built in tmpfs file system;
Obtain destination multimedia file, destination multimedia file is transcoded at least one section file, under file of all cutting into slices is stored at least one file;
For each the section file be stored under at least one file, by the file information storage of current slice file in database;
Receive the playing request instruction from least two clients respectively, respectively according to the fileinfo of each the section file stored in different playing request instructions and database, generate the index file M3U8 corresponding respectively to each client, the M3U8 of generation is back to corresponding client;
Receive the file request instruction triggered according to the M3U8 of correspondence from least two clients respectively, carry the fileinfo of target slice file in described file request instruction, from tmpfs file system, obtain target slice file according to the fileinfo of target slice file and client to correspondence provides target slice file.
2. method according to claim 1, is characterized in that,
Described in file system, build at least one file after, also comprise: under at least one file, build at least two sub-folders, each sub-folder is respectively used to be stored in the section file of transcoding in different time sections;
Described file of all cutting into slices is stored at least one file under, comprise: the transcoding time determining each section file, each section file is stored in the sub-folder under at least one file by the transcoding time point respectively corresponding respectively according to each section file.
3. method according to claim 2, is characterized in that,
Described destination multimedia file is transcoded at least one section file after, comprise further: for each section file, according to YYMMDDHHMMSS_LENGTH.TS form, current slice file is named;
After described structure at least two sub-folders, comprise further: for each sub-folder, according to YYMMDDHH form, current sub-folder is named;
Wherein, YYMMDDHHMMSS is for characterizing the transcoding time point of current slice file, LENGTH for characterizing the playing duration of current slice file, TS for characterizing the file format of current slice file, and YYMMDDHHMM is for time range corresponding to the transcoding time point that characterizes each the section file stored in current sub-folder.
4. method according to claim 1, is characterized in that, described by the file information storage of current slice file in database, comprising:
The file name of current slice file, store path and transcoding time point are stored in database.
5., according to described method arbitrary in Claims 1-4, it is characterized in that, described structure tmpfs file system, comprising:
Perform as issued orders to build tmpfs file system:
#mounttmpfs/tmpfs/inspur_shift-ttmpfs;
#mounttmpfs/tmpfs/inspur_shift-ttmpfs-osize=3g。
6. a server, is characterized in that, comprising:
First construction unit, for building tmpfs file system;
Second construction unit, for building at least one file in tmpfs file system;
First processing unit, for obtaining destination multimedia file, is transcoded at least one section file, under file of all cutting into slices is stored at least one file by destination multimedia file;
Database, for for each the section file be stored under at least one file, by the file information storage of current slice file in database;
Second processing unit, for receiving the playing request instruction from least two clients respectively, respectively according to the fileinfo of each the section file stored in different playing request instructions and database, generate the index file M3U8 corresponding respectively to each client, the M3U8 of generation is back to corresponding client;
3rd processing unit, for receiving the file request instruction triggered according to the M3U8 of correspondence from least two clients respectively, carry the fileinfo of target slice file in described file request instruction, from tmpfs file system, obtain target slice file according to the fileinfo of target slice file and client to correspondence provides target slice file.
7. server according to claim 6, is characterized in that,
Described second construction unit, is further used under at least one file, builds at least two sub-folders, and each sub-folder is respectively used to be stored in the section file of transcoding in different time sections;
Described first processing unit, for determining the transcoding time of each section file, each section file is stored in the sub-folder under at least one file by the transcoding time point respectively corresponding respectively according to each section file.
8. server according to claim 7, is characterized in that,
Described first processing unit, is further used for, for each section file, naming current slice file according to YYMMDDHHMMSS_LENGTH.TS form; ;
Described second construction unit, is further used for, for each sub-folder, naming current sub-folder according to YYMMDDHH form;
Wherein, YYMMDDHHMMSS is for characterizing the transcoding time point of current slice file, LENGTH for characterizing the playing duration of current slice file, TS for characterizing the file format of current slice file, and YYMMDDHHMM is for time range corresponding to the transcoding time point that characterizes each the section file stored in current sub-folder.
9. server according to claim 6, is characterized in that,
Described database, for being stored to the file name of current slice file, store path and transcoding time in database.
10., according to described server arbitrary in claim 6 to 9, it is characterized in that,
Described first construction unit, for performing as issued orders to build tmpfs file system:
#mounttmpfs/tmpfs/inspur_shift-ttmpfs;
#mounttmpfs/tmpfs/inspur_shift-ttmpfs-osize=3g。
CN201510718500.3A 2015-10-29 2015-10-29 HLS-based multimedia file processing method and server Pending CN105357544A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510718500.3A CN105357544A (en) 2015-10-29 2015-10-29 HLS-based multimedia file processing method and server

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510718500.3A CN105357544A (en) 2015-10-29 2015-10-29 HLS-based multimedia file processing method and server

Publications (1)

Publication Number Publication Date
CN105357544A true CN105357544A (en) 2016-02-24

Family

ID=55333383

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510718500.3A Pending CN105357544A (en) 2015-10-29 2015-10-29 HLS-based multimedia file processing method and server

Country Status (1)

Country Link
CN (1) CN105357544A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107426630A (en) * 2017-09-05 2017-12-01 成都索贝数码科技股份有限公司 A kind of high code file medium data access method and system
CN108965910A (en) * 2018-08-09 2018-12-07 网宿科技股份有限公司 A kind of video cache method and player
CN109040769A (en) * 2018-08-22 2018-12-18 广东省南方数字电视无线传播有限公司 Direct broadcast time-shift method and device based on HLS protocol
CN109089174A (en) * 2018-08-16 2018-12-25 咪咕视讯科技有限公司 A kind of processing method and processing device of multimedia data stream, computer storage medium
CN109918471A (en) * 2019-01-28 2019-06-21 平安科技(深圳)有限公司 Archive method, apparatus, computer equipment and storage medium
CN115412777A (en) * 2021-05-28 2022-11-29 北京金山云网络技术有限公司 Streaming media data transmission method, device and system

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101459809A (en) * 2008-11-26 2009-06-17 天柏宽带网络科技(北京)有限公司 Method and system for digital television program playing
CN102932670A (en) * 2012-11-29 2013-02-13 百视通网络电视技术发展有限责任公司 Method and system for segmenting streaming media
CN104080011A (en) * 2014-07-08 2014-10-01 浪潮软件集团有限公司 Method for realizing time shifting system based on HLS protocol
CN104168488A (en) * 2014-08-29 2014-11-26 北京奇艺世纪科技有限公司 Video transcoding method and device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101459809A (en) * 2008-11-26 2009-06-17 天柏宽带网络科技(北京)有限公司 Method and system for digital television program playing
CN102932670A (en) * 2012-11-29 2013-02-13 百视通网络电视技术发展有限责任公司 Method and system for segmenting streaming media
CN104080011A (en) * 2014-07-08 2014-10-01 浪潮软件集团有限公司 Method for realizing time shifting system based on HLS protocol
CN104168488A (en) * 2014-08-29 2014-11-26 北京奇艺世纪科技有限公司 Video transcoding method and device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
ORACLE SOLARIS开发团队: "《Oracle Solaris 10系统管理基础教程》", 30 November 2010, 人民邮电出版社 *

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107426630A (en) * 2017-09-05 2017-12-01 成都索贝数码科技股份有限公司 A kind of high code file medium data access method and system
CN108965910A (en) * 2018-08-09 2018-12-07 网宿科技股份有限公司 A kind of video cache method and player
CN108965910B (en) * 2018-08-09 2022-05-10 网宿科技股份有限公司 Video caching method and player
CN109089174A (en) * 2018-08-16 2018-12-25 咪咕视讯科技有限公司 A kind of processing method and processing device of multimedia data stream, computer storage medium
CN109089174B (en) * 2018-08-16 2020-12-22 咪咕视讯科技有限公司 Multimedia data stream processing method and device and computer storage medium
CN109040769A (en) * 2018-08-22 2018-12-18 广东省南方数字电视无线传播有限公司 Direct broadcast time-shift method and device based on HLS protocol
CN109918471A (en) * 2019-01-28 2019-06-21 平安科技(深圳)有限公司 Archive method, apparatus, computer equipment and storage medium
CN115412777A (en) * 2021-05-28 2022-11-29 北京金山云网络技术有限公司 Streaming media data transmission method, device and system

Similar Documents

Publication Publication Date Title
CN105357544A (en) HLS-based multimedia file processing method and server
US9852762B2 (en) User interface for video preview creation
US20190253474A1 (en) Media production system with location-based feature
US8776150B2 (en) Implementation method and system for a media-on-demand frame-spanning playing mode in a peer-to-peer network
CN104516892B (en) It is associated with dissemination method, system and the terminal of the user-generated content of rich media information
CN105376612A (en) Video playing method, media equipment, playing equipment and multimedia system
US20160241617A1 (en) Media System
CN103164525B (en) WEB application dissemination method and device
US20140245334A1 (en) Personal videos aggregation
CN104244079A (en) Video download method and device
US10381043B2 (en) Media-production system with social media content interface feature
CN102438004A (en) Method and system for acquiring metadata information of media file and multimedia player
KR100809641B1 (en) Method for exchanging contents between heterogeneous system and contents management system for performing the method
CN103220587A (en) Method and device for obtaining time shifting contents
WO2017028736A1 (en) Method for recording television programs and server
EP2840783B1 (en) Content management apparatus, content management method, program, and content display method
US20150026147A1 (en) Method and system for searches of digital content
US10321180B2 (en) News production system with dynamic character generator output
US20200004833A1 (en) Method and system for managing a time-based database for contextual searching and commenting on multimedia
CN116611948A (en) Method and device for mining identity data, storage medium and electronic equipment
CN117676183A (en) Video storage method, video playing device, video storage equipment and storage medium
US20170308588A1 (en) System and method for providing a searchable platform for online content including metadata
King File Based Workflows: Managing the Unmanageable
De Vos Usability improvements on a Metadata Server for Video on Demand based on Free Software
Benta Leveraging Cloud Computing for IPTV: Moving the Set-Top Box to the Cloud/Potenciacoã da Computão em Cloud Computing Para IPTV: Coloca¸ coãda Set-Top Box na Cloud

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
WD01 Invention patent application deemed withdrawn after publication
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20160224