Content of the invention
The embodiment of the present invention provides a kind of media processing method, device and terminal, ensure that the code check of on-demand content, carriesRise the quality of on-demand content, provide the user the media-on-demand service of high-quality high-resolution.
Embodiment of the present invention first aspect provides a kind of media processing method, it may include:
When terminal startup medium living broadcast flow process is detected, obtain the optimal way of described medium living broadcast flow process;
Back up in described medium living broadcast flow process just in live media content according to acquired optimal way;
By backup media content uploading to server, so that described server adopts described in described backup media content updateOn-demand content formed in medium living broadcast flow process.
Preferably, described optimal way includes: burst optimization or global optimization.
Preferably, if described optimal way is burst optimization, described described media are backed up according to acquired optimal wayJust in live media content in live flow process, comprising:
Monitor the network environment of described medium living broadcast flow process;
If it is abnormal to monitor that described network environment occurs, obtain described medium living broadcast flow process in abnormal moment institute's plug-flow extremelyA few media slicing;
The media content being comprised according to default code check backup storage at least one media slicing described.
Preferably, if described optimal way is global optimization, described described media are backed up according to acquired optimal wayJust in live media content in live flow process, comprising:
Record all media contents of institute's plug-flow in described medium living broadcast flow process using default code check;
The media content recorded backup is stored as a media file.
Preferably, described by backup media content uploading to server so that described server adopt described backup mediaOn-demand content formed in medium living broadcast flow process described in content update, comprising:
Judge whether the amount of capacity of backup media content exceedes pre-set threshold value;
If not less than by backup media content uploading to server, so that described server adopts in described backup mediaHold the on-demand content updating formed in described medium living broadcast flow process;
If exceeding, output uploads prompting message, and to upload the upload fed back of prompting message true receiving according to describedWhen recognizing message, by backup media content uploading to server, so that described server adopts described backup media content update instituteState the on-demand content formed in medium living broadcast flow process.
Preferably, the method also includes:
During by backup media content uploading to server, if upload procedure is interrupted, record interrupts the momentThe breakpoint storage location of described backup media content;
When again recovering upload procedure, start continuation from the breakpoint storage location of described backup media content and will back up matchmakerInternal appearance uploads onto the server.
Embodiment of the present invention second aspect provides a kind of media processor, it may include:
Acquiring unit, for when terminal startup medium living broadcast flow process is detected, obtaining the excellent of described medium living broadcast flow processChange mode;
Backup units, for backing up in described medium living broadcast flow process just in live media according to acquired optimal wayContent;
Optimize unit, for by backup media content uploading to server so that described server adopt described backup matchmakerOn-demand content formed in medium living broadcast flow process described in body content update.
Preferably, described optimal way includes: burst optimization or global optimization.
Preferably, if described optimal way is burst optimization, described backup units include:
Monitoring means, for monitoring the network environment of described medium living broadcast flow process;
Burst acquiring unit, if abnormal for monitoring that described network environment occurs, obtain described medium living broadcast flow process and existsAt least one media slicing of abnormal moment institute's plug-flow;
First redundant memory cell, for comprised according to default code check backup storage at least one media slicing describedMedia content.
Preferably, if described optimal way is global optimization, described backup units include:
Recording elements, for recording all media contents of institute's plug-flow in described medium living broadcast flow process using default code check;
Second redundant memory cell, for being stored as a media file by the media content recorded backup.
Preferably, described optimization unit includes:
Judging unit, whether the amount of capacity for judging backup media content exceedes pre-set threshold value;
Uploading unit, if for not less than by backup media content uploading to server, so that described server adopts instituteState the on-demand content formed in medium living broadcast flow process described in backup media content update;If or for exceeding, output uploadsPrompting message, and receive according to described upload the upload fed back of prompting message and confirm message when, by backup media contentUpload onto the server, so that described server adopts formed in medium living broadcast flow process described in described backup media content updateOn-demand content.
Preferably, this device also includes:
Breakpoint transmission unit, for during by backup media content uploading to server, if upload procedure occursInterrupt, record interrupts the breakpoint storage location of backup media content described in the moment, when again recovering upload procedure, from described standbyThe breakpoint storage location of part media content starts to continue backup media content uploading to server.
The embodiment of the present invention third aspect provides a kind of terminal, it may include the media handling dress described in above-mentioned second aspectPut.
The embodiment of the present invention backs up just in live media content in described medium living broadcast flow process in medium living broadcast flow process, willBackup media content uploading is to server, so that described server adopts medium living broadcast stream described in described backup media content updateOn-demand content formed in journey;Because local backup need not consider the impact of network environment, it is possible to obtain the backup of high code checkMedia content, to be updated using the backup media content of high code check and to replace the on-demand content that medium living broadcast flow process is formed, Ke YibaoThe code check of card on-demand content, the play quality of lifting on-demand content, the media-on-demand of high-quality high-resolution can be provided the userService.
Specific embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is carried out clear, completeSite preparation description is it is clear that described embodiment is only a part of embodiment of the present invention, rather than whole embodiments.It is based onEmbodiment in the present invention, it is every other that those of ordinary skill in the art are obtained under the premise of not making creative workEmbodiment, broadly falls into the scope of protection of the invention.
Medium living broadcast refers to that the synchronous action carrying out is realized in recording, transmission and broadcast by terminal-pair media program.ThisPlace, terminal may include but be not limited to: the equipment such as TV, radio station, smart mobile phone, pad (panel computer).The embodiment of the present invention providesA kind of medium living broadcast system, refers to Fig. 1, and the structure of this system mays include: main broadcaster's terminal, server and at least one sightSee terminal;Under this system architecture, a complete medium living broadcast flow process mainly includes following interactive step:
1st, main broadcaster end side
(1) gather.Main broadcaster's terminal or the app running in main broadcaster's terminal and supporting medium living broadcast function(application, application program) client gathers live required original media content, and media content herein may includeAudio, video data.In implementing, it is possible to use main broadcaster's terminal built-in or external camera collection video data, using main broadcaster eventuallyEnd is built-in or External microphone gathers voice data;Wherein, described video data can for rgb (red green blue, red greenBlue color pattern) data of form or a kind of data of yuv (colour coding method) form, voice data can be pcmThe data of (pulse-code modulation, pulse number is adjusted and compiled) form.
(2) pretreatment.The volume of the original media content being collected is generally larger, in order to lift efficiency of transmission, be easy toPlug-flow, draw stream and store, main broadcaster's terminal needs original media content is carried out to encode, compresses etc. and processing.In implementing, permissibleFrom h.264, h.265 etc. technology is processed to coding video data compression, using mp3, aac (advanced audioCoding, Advanced Audio Coding) etc. technology encoding compression processing is carried out to voice data.
(3) plug-flow.The process of plug-flow is it is desirable to handle is pre- by main broadcaster's terminal by the process of media content transmission to serverAudio, video data after reason is packaged using host-host protocol, becomes flow data, and conventional flow host-host protocol may include but do not limitIn: rtsp (real time streaming protocol, real-time streaming protocol), rtmp (real time messagingProtocol, real-time messages host-host protocol), hls (the live stream protocol of http live streaming, http) etc..With hlsAs a example, its principle is that the whole live media content stream collecting is divided into media slicing little one by one is transmitted;ToolBody ground, is the file of a m3u8 based on the live TV stream of hls, this document comprises several little ts media slicings.Wherein, m3u8 literary compositionThe structure of part can be expressed as follows:
#extm3u
#ext-x-version:1
#ext-x-targetduration:10
#extinf:3,
4.ts
#extint:8,
6.ts
#extint:8,
8.ts
#extint:8,
10.ts
Because medium living broadcast is higher to requirement of real-time, therefore, main broadcaster's terminal near-synchronous ground execution above steps, that is,Often collect the original media content of one section of duration (typically several seconds), coding is carried out to this media content and be encapsulated as a tsA kind of (file format) media slicing, then by this ts media slicing plug-flow to the server of network.
2nd, server side
(1) receive.Server, based on the flow host-host protocol between main broadcaster's terminal, receives that main broadcaster's terminal plug-flow comesIndividual ts media slicing it is to be understood that each ts media slicing belonging to same medium living broadcast flow process possesses identical traffic identifier,And there is sequential successively between each ts media slicing, each ts media slicing possesses respective unique mark.
(2) store.The ts receiving media slicing is chronologically successively stored by server, facilitates viewing terminal to draw streamThus realizing medium living broadcast viewing.Further, after main broadcaster's terminal completes whole plug-flow process, server can also will receiveAll ts media slicings using mp4, hls etc. carry out coding assembling, formed a complete on-demand media file;So, seeSee that terminal can play out from server pull on-demand media file, thus realizing media-on-demand viewing.
3rd, viewing terminal side
(1) draw stream.Viewing terminal can ts media slicing plays out one by one from server pull, thus it is straight to realize mediaBroadcast viewing.
(2) program request.Viewing terminal can also play out from server pull on-demand media file, and this playing process is permissibleRealize the functions such as positioning playing, playback, thus realizing media-on-demand viewing.
By the above-mentioned collection of main broadcaster's terminal, server and viewing terminal, pretreatment, plug-flow, reception, store, draw stream etc.Step, it is possible to achieve complete medium living broadcast flow process.In above-mentioned medium living broadcast flow process, if network environment is poor, for example:The network bandwidth is not or network connection produces shake, in the case, in order to guarantee normally entering of medium living broadcast flow processOK, it usually needs sacrifice the quality of live TV stream, that is, main broadcaster's terminal would generally reduce the code check of media slicing, this meeting in pretreatmentLead to that the quality of the on-demand media file that medium living broadcast flow process finally formed is also poor, user both cannot obtain high-quality high-resolutionMedium living broadcast viewing experience, the media-on-demand viewing experience of high-quality high-resolution cannot be obtained again.
In order to lift the quality of on-demand content, the quality of lifting media-on-demand service and viewing experience, the embodiment of the present inventionIn, back up in described medium living broadcast flow process just in live media content in medium living broadcast flow process, by backup media content uploadingTo server, so that described server adopts the program request formed in medium living broadcast flow process described in described backup media content updateContent;Because local backup need not consider the impact of network environment, it is possible to obtain the backup media content of high code check, using high codeThe backup media content of rate replaces the on-demand content that medium living broadcast flow process formed it is ensured that the code check of on-demand content to update,The play quality of lifting on-demand content, can provide the user the media-on-demand service of high-quality high-resolution.
Based on foregoing description, embodiments provide a kind of media processing method, the method can be as shown in Figure 1Main broadcaster's terminal execution, unless otherwise indicated, embodiment of the present invention subsequent terminal refers to main broadcaster's terminal.Refer to Fig. 2, the method canComprise the following steps s101- step s103.
S101, when terminal startup medium living broadcast flow process is detected, obtains the optimal way of described medium living broadcast flow process.
Terminal starts medium living broadcast flow process and refers to that terminal starts the collection of media content, and executes follow-up pretreatment, plug-flowEtc. live step.The optimal way of described medium living broadcast flow process can include but is not limited to: burst optimization or global optimization.BurstOptimize and refer to be optimized for the media content of involved part of media burst in medium living broadcast flow process.Global optimization refers toMedia content for involved total medium burst in medium living broadcast flow process is optimized.Wherein, to medium living broadcast flow processThe purpose being optimized is: the quality of the on-demand content that lifting medium living broadcast flow process is formed, to lift media-on-demand serviceQuality.In a kind of feasible embodiment of the present invention, the optimal way of medium living broadcast flow process can be by end side userPre-set and be stored in terminal;In the feasible embodiment of the another kind of the present invention, server can pre-set matchmakerThe optimal way of the live flow process of body is simultaneously issued in terminal;So, this step can from terminal store this step can be from terminalThe optimal way of medium living broadcast flow process is obtained in memory space.
S102, backs up in described medium living broadcast flow process just in live media content according to acquired optimal way.
In a kind of feasible embodiment of the present invention, if optimal way is burst optimization, then, the method is being heldDuring row step s102, concrete execution following steps s11-s13.
S11, monitors the network environment of described medium living broadcast flow process.
S12, if it is abnormal to monitor that described network environment occurs, obtains described medium living broadcast flow process in abnormal moment institute's plug-flowAt least one media slicing.
S13, the media content being comprised according to default code check backup storage at least one media slicing described.
In step s11-s13, the network environment of monitoring medium living broadcast flow process can be substantially the net that monitoring terminal is locatedNetwork environment, specifically can be by obtaining network bandwidth parameter, obtaining the modes such as network connection parameter come monitoring network environment;IfNetwork environment normal (i.e. the network bandwidth is enough, network connection is normal), then terminal can process media according to normal code checkBurst simultaneously carries out normal medium living broadcast flow process;If network environment is abnormal, and (i.e. network bandwidth deficiency, network connection disconnect or produceRaw shake), then, in order to ensure normal medium living broadcast flow process, the media that terminal would generally reduce abnormal moment institute's plug-flow divideThe transmission code rate of piece lifting the efficiency of transmission of this media office, i.e. the code of at least one media slicing of abnormal moment institute's plug-flowRate is relatively low, then, this enforcement then needs to back up according to default code check and stores in the media that this at least one media slicing is comprisedHold.Herein it should be noted that assuming that the code check of the media slicing involved by normal medium living broadcast flow process is 64kbps, abnormalThe code check of at least one media slicing of moment institute's plug-flow is usually less than 64kbps, and default code check is generally greater than or equal to64kbps.By the description of above-mentioned embodiment, this embodiment has only backed up matchmaker in the case that network environment is poorThe media content of the part of media burst involved by the live flow process of body.
In the feasible embodiment of the another kind of the present invention, if optimal way is global optimization, then, the method existsDuring execution step s102, concrete execution following steps s21-s22.
S21, records all media contents of institute's plug-flow in described medium living broadcast flow process using default code check.
S22, the media content recorded backup is stored as a media file.
In step s21-s22, a complete media file can be recorded in terminal local according to default code check, this media literary compositionThe media content that part comprises is all media contents of medium living broadcast flow process institute plug-flow.Herein it should be noted that media are civilianThe file format of part can include but is not limited to: mp4 or hls.Default code check can be set according to actual needs, generally setsIt is set to greater than or equal to the transmission code rate involved by the live flow process of normal media.By the description of above-mentioned embodiment, thisEmbodiment has backed up the media content of the total medium burst involved by medium living broadcast flow process.
S103, by backup media content uploading to server, so that described server adopts described backup media content moreThe newly on-demand content formed in described medium living broadcast flow process.
In medium living broadcast flow process, server both can according to the live each ts media slicing of sequential successively storage media,The assembling of each ts media slicing can also be formed complete on-demand media file.For two shown in step s102 kind embodiment partyFormula, the process of the method execution step s103 mays include: in a kind of feasible embodiment of the present invention, if in backup mediaHold the media content at least one media slicing;So, by the media content uploading of this backup media burst to server itAfterwards, server, according to the unique mark of each media slicing, local storage space is got the bid and is known the program request of identical media slicingContent replaces with the media content of corresponding backup media burst.In the feasible embodiment of the another kind of the present invention, if standbyPart media content is complete media file;So, by this backup media files passe to after server, server can be byThe on-demand content of the on-demand media file in local storage space directly replaces with the media content of this backup media file.
In implementing, the method, during execution step s103, specifically executes following steps s31-s33.
S31, judges whether the amount of capacity of backup media content exceedes pre-set threshold value.
S32, if not less than by backup media content uploading to server, so that described server adopts described backup matchmakerOn-demand content formed in medium living broadcast flow process described in body content update.
S33, if exceeding, output upload prompting message, and receive according to described upload prompting message fed back upperWhen passing confirmation message, by backup media content uploading to server, so that described server adopts described backup media content moreThe newly on-demand content formed in described medium living broadcast flow process.
In step s31-s33, pre-set threshold value can be set according to practical situation, for example: pre-set threshold value can be100kb, 500kb etc., if the amount of capacity of backup media content is less than or equal to pre-set threshold value, show backup media contentMore short and small, the occupied network traffics of transmission are less, and transmission comparatively fast and does not affect the use of terminal other functions, then can lead toCross step s32 directly by backup media content uploading to server;If the amount of capacity of backup media content exceedes default valveValue, shows that backup media content is more, and the occupied network traffics of transmission are larger, and transmission more slowly may impact terminal other functionsUse, then the user of end side can be notified by step s33, when user confirms to upload, then by backup media contentReach server.
In implementing, the method, during execution step s103, can also carry out following steps s41-s42.
S41, during by backup media content uploading to server, if upload procedure is interrupted, record interruptsThe breakpoint storage location of backup media content described in the moment.
S42, when again recovering upload procedure, starting continuation from the breakpoint storage location of described backup media content will be standbyPart media content uploading is to server.
Step s41-s42 describes backup media content is carried out with the process of breakpoint transmission, if backup media content existsInterrupted or because network environment occurs Transmission extremely due to artificial during uploading onto the server, then Ke YijiRecord breakpoint storage location, when upload interruption is released from and again recovers upload procedure, then continues to remain from breakpoint storage locationThe backup media content uploading that remaining part is divided is to server.The process of breakpoint transmission can avoid repeating transmitting the resource brought and disappearConsumption, saves transmission time and improves efficiency of transmission.
The media processing method that the embodiment of the present invention is provided, backs up in described medium living broadcast flow process in medium living broadcast flow processJust in live media content, by backup media content uploading to server, so that described server adopts described backup mediaOn-demand content formed in medium living broadcast flow process described in content update;Because local backup need not consider the shadow of network environmentRing, it is possible to obtain the backup media content of high code check, replacement medium living broadcast stream is updated using the backup media content of high code checkThe on-demand content that journey is formed, it is ensured that the code check of on-demand content, the play quality of lifting on-demand content, can provide the userThe media-on-demand service of high-quality high-resolution.
Embodiments provide a kind of terminal, refer to Fig. 3, the internal structure of this terminal may include but be not limited to:Processor, user interface, network interface and memorizer.Wherein, the processor in terminal, user interface, network interface and storageDevice can be connected by bus or other modes, in Fig. 3 shown in the embodiment of the present invention taking connected by bus as a example.
Wherein, user interface is to realize the medium that user is interacted and information exchanges with terminal, and it embodies permissibleIncluding the display screen (display) for output and the keyboard (keyboard) for input etc., it should be noted that thisThe keyboard at place can be both physical keyboard or touch screen dummy keyboard, can also be combined with touch screen virtualphase for entityKeyboard.Processor (or claim cpu (central processing unit, central processing unit)) be terminal calculating core andControl core, it can parse all kinds of instructions in terminal and the Various types of data of processing terminal, for example: cpu can be used for solvingAnalysis user instructs to the switching on and shutting down that terminal is sent, and control terminal carries out switching on and shutting down operation;For another example: cpu can be in terminalAll kinds of interaction datas are transmitted between portion's structure, etc..Memorizer (memory) is the memory device in terminal, is used for depositing programData.It is understood that memorizer herein both can include the internal memory of terminal naturally it is also possible to include terminalThe extended menory supported.Memorizer provides memory space, and this memory space stores the operating system of terminal.The present invention is realApply in example, the memory space of memorizer also stored for media processor.Terminal passes through the media handling dress in run memoryPut the corresponding steps to execute method flow shown in above-mentioned Fig. 2.Refer to Fig. 4, this media processor operation such as lower unit:
Acquiring unit 101, for when terminal startup medium living broadcast flow process is detected, obtaining described medium living broadcast flow processOptimal way.
Backup units 102, for backing up in described medium living broadcast flow process just live according to acquired optimal wayMedia content.
Optimize unit 103, for by backup media content uploading to server so that described server adopt described backupMedia content updates the on-demand content formed in described medium living broadcast flow process.
Wherein, described optimal way includes: burst optimization or global optimization.
In implementing, if described optimal way is burst optimization, this device is running the process of described backup units 102In, carrying out practically such as lower unit:
Monitoring means 1001, for monitoring the network environment of described medium living broadcast flow process.
Burst acquiring unit 1002, if abnormal for monitoring that described network environment occurs, obtains described medium living broadcast streamJourney is at least one media slicing of abnormal moment institute's plug-flow.
First redundant memory cell 1003, for being wrapped according to default code check backup storage at least one media slicing describedThe media content containing.
In implementing, if described optimal way is global optimization, this device is running the process of described backup units 102In, carrying out practically such as lower unit:
Recording elements 1011, for being recorded in all media of institute's plug-flow in described medium living broadcast flow process using default code checkHold.
Second redundant memory cell 1012, for being stored as a media file by the media content recorded backup.
In implementing, this device run described optimization unit 103 during, carrying out practically such as lower unit:
Judging unit 2001, whether the amount of capacity for judging backup media content exceedes pre-set threshold value.
Uploading unit 2002, if for not less than by backup media content uploading to server, so that described server is adoptedWith the on-demand content formed in medium living broadcast flow process described in described backup media content update;If or for exceeding, outputUpload prompting message, and receive according to described upload the upload fed back of prompting message and confirm message when, by backup mediaContent uploading is to server, so that described server adopts institute's shape in medium living broadcast flow process described in described backup media content updateThe on-demand content becoming.
In implementing, this device also can run as lower unit:
Breakpoint transmission unit 104, for during by backup media content uploading to server, if upload procedure is sent outThe raw breakpoint storage location interrupted, record backup media content described in the interruption moment, when again recovering upload procedure, from describedThe breakpoint storage location of backup media content starts to continue backup media content uploading to server.
Because terminal executes the method shown in Fig. 2 by running the media processor that Fig. 4 shows, therefore, dress shown in Fig. 4The function of each unit put can be found in the associated description of each step of method shown in Fig. 2, will not be described here.
Terminal and media processor that the embodiment of the present invention is provided, back up described medium living broadcast in medium living broadcast flow processJust in live media content in flow process, by backup media content uploading to server, so that described server is using described standbyPart media content updates the on-demand content formed in described medium living broadcast flow process;Because local backup need not consider network environmentImpact, it is possible to obtain the backup media content of high code check, using the backup media content of high code check to update replacement media straightBroadcast the on-demand content of flow process formation it is ensured that the code check of on-demand content, the play quality of lifting on-demand content, can be userThe media-on-demand service of high-quality high-resolution is provided.
One of ordinary skill in the art will appreciate that realizing all or part of flow process in above-described embodiment method, it is permissibleInstruct related hardware to complete by computer program, described program can be stored in a computer read/write memory mediumIn, this program is upon execution, it may include as the flow process of the embodiment of above-mentioned each method.Wherein, described storage medium can be magneticDish, CD, read-only memory (read-only memory, rom) or random access memory (random accessMemory, ram) etc..
Above disclosed be only present pre-ferred embodiments, certainly the right model of the present invention can not be limited with thisEnclose, the equivalent variations therefore made according to the claims in the present invention, still belong to the scope that the present invention is covered.