CN104168488A - Video transcoding method and device - Google Patents

Video transcoding method and device Download PDF

Info

Publication number
CN104168488A
CN104168488A CN201410437451.1A CN201410437451A CN104168488A CN 104168488 A CN104168488 A CN 104168488A CN 201410437451 A CN201410437451 A CN 201410437451A CN 104168488 A CN104168488 A CN 104168488A
Authority
CN
China
Prior art keywords
transcoding
processor
equipment
cpu core
core number
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.)
Granted
Application number
CN201410437451.1A
Other languages
Chinese (zh)
Other versions
CN104168488B (en
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.)
Beijing QIYI Century Science and Technology Co Ltd
Original Assignee
Beijing QIYI Century Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing QIYI Century Science and Technology Co Ltd filed Critical Beijing QIYI Century Science and Technology Co Ltd
Priority to CN201410437451.1A priority Critical patent/CN104168488B/en
Priority claimed from CN201410437451.1A external-priority patent/CN104168488B/en
Publication of CN104168488A publication Critical patent/CN104168488A/en
Application granted granted Critical
Publication of CN104168488B publication Critical patent/CN104168488B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The invention discloses a video transcoding method and device. The video transcoding method comprises the steps that various transcoding devices storing first video files to be transcoded in a storage are determined, and any transcoding device in the determined various transcoding devices comprises a storage and a processor; the processing performance of the processors of the various transcoding devices is obtained; according to the obtained processing performance, a transcoding device for carrying out a transcoding mask is selected from the determined transcoding devices; and the processor in the selected transcoding device is controlled to carry out transcoding on the first video files to be transcoded stored in the storage of the transcoding device, and the video files obtained by transcoding are stored to the storage of the transcoding device. According to the technical scheme, during video transcoding, video file transmission only needs to carried out between the processor and the storage in one transcoding device, the problem that a network is used for transmission of the files is avoided, transcoding time is saved, and transcoding efficiency is improved.

Description

A kind of video transcoding method and device
Technical field
The present invention relates to technical field of video processing, particularly a kind of video transcoding method and device.
Background technology
Along with the fast development of network multimedia technology, the broadcasting form of video file is no longer confined to certain specific video code flow, progressively occur that SD video code flow, HD video code stream, ultra high-definition video code flow etc. meet the video code flow of heterogeneous networks playing environment, this just needs Video service provider to utilize trans-coding system to carry out transcoding to video file, thereby obtain the video code flow of various definition, play for video player.
In order to improve transcoding efficiency, trans-coding system is made up of multiple machines.Machine in existing trans-coding system is divided into two parts, and a part is as transcoding equipment, and a part is as memory device.Preserve and need transcoding video file as memory in the machine of memory device, in order to prevent that equipment fault from causing loss of data, under normal circumstances, treat that transcoding video file has backup in multiple memory devices for one.In the time that needs carry out video code conversion, as the processor in the machine of transcoding equipment, can select to read the transcoding video file for the treatment of of preserving in one of them memory device and carry out transcoding, and the video file that transcoding is obtained sends in the memory of the machine of memory device and stores.
But, often carry out reading or sending of primary video file, all need to use network to transmit video file, file transfer can expend the more time, and then causes whole transcoding process consuming time longer, and efficiency is lower.
Summary of the invention
In order to address the above problem, the embodiment of the invention discloses a kind of video transcoding method and device, concrete technical scheme is as follows:
A kind of video transcoding method, comprising:
Determine and in memory, store first each transcoding equipment for the treatment of transcoding video file, wherein, any transcoding equipment in determined each transcoding equipment includes memory and processor;
Obtain the handling property of the processor of determined each transcoding equipment;
According to obtained handling property, from determined each transcoding equipment, select one for carrying out the transcoding equipment of transcoding task;
Control processor in selected transcoding equipment and treat that to being stored in first in the memory of this transcoding equipment transcoding video file carries out transcoding, and the video file that transcoding is obtained stores in the memory of this transcoding equipment.
Optionally, the handling property of described processor, comprising:
Check figure in the central processor CPU of current free time of processor, and/or total CPU core number in processor.
Optionally, the handling property of described processor is the interior check figure of central processor CPU of current free time of processor;
The handling property of the processor of the determined each transcoding equipment of described acquisition, comprising:
Obtain the current load value of processor of determined each transcoding equipment, and total CPU core number in this processor;
According to default processor load value and the corresponding relation of CPU core number, determine the load value current with obtained processor corresponding, the CPU core number of the current use of processor of determined each transcoding equipment;
According to total CPU core number in the CPU core number of the current use of processor of determined each transcoding equipment and the processor that obtains, calculate the CPU core number of the current free time of processor of determined each transcoding equipment.
Optionally, the handling property of described processor is CPU core number total in processor;
Described according to obtained handling property, from determined each transcoding equipment, select one for carrying out the transcoding equipment of transcoding task, comprising:
According to obtained handling property, from determined each transcoding equipment, select the transcoding equipment that total CPU core number is maximum, as the transcoding equipment for carrying out transcoding task.
Optionally, the handling property of described processor is the CPU core number of current free time of processor;
Described according to obtained handling property, from determined each transcoding equipment, select one for carrying out the transcoding equipment of transcoding task, comprising:
Determine that described first treats the CPU core number that transcoding video file transcoding is required;
Whether the CPU core number that judges the current free time of processor of determined each transcoding equipment is all less than described first is treated the CPU core number that transcoding video file transcoding is required;
If so, suspend the transcoding task of at least one transcoding equipment in determined transcoding equipment, reclaim CPU core, from reclaiming the transcoding equipment of CPU core, select a transcoding equipment as the transcoding equipment for carrying out transcoding task;
Otherwise, from determined transcoding equipment, select the CPU core number of a current free time to be not less than the described first transcoding equipment for the treatment of under the processor of the required CPU core number of transcoding video file transcoding, as the transcoding equipment for carrying out transcoding task.
Optionally, described definite described first treats the CPU core number that transcoding video file transcoding is required, comprising:
Obtain the video code rate after the described first file size until transcoding video file, transcoding mode and transcoding;
According to the video code rate after obtained file size, transcoding mode and transcoding, calculate described first and treat the CPU core number that transcoding video file transcoding is required.
A kind of video code conversion device, comprising:
Transcoding equipment determination module, for determining that memory stores first each transcoding equipment for the treatment of transcoding video file, wherein, any transcoding equipment in determined each transcoding equipment includes memory and processor;
Handling property acquisition module, for obtaining the handling property of processor of the determined each transcoding equipment of described transcoding equipment determination module;
Transcoding equipment is selected module, for the handling property obtaining according to described handling property acquisition module, from determined each transcoding equipment, selects one for carrying out the transcoding equipment of transcoding task;
Transcoding control module, treat that to being stored in first in the memory of this transcoding equipment transcoding video file carries out transcoding for controlling processor that described transcoding equipment selects the selected transcoding equipment of module, and the video file that transcoding is obtained stores in the memory of this transcoding equipment into.
Optionally, the handling property of described processor, comprising:
Check figure in the central processor CPU of current free time of processor, and/or total CPU core number in processor.
Optionally, the handling property of described processor is the interior check figure of central processor CPU of current free time of processor; Described handling property acquisition module, comprising:
Obtain submodule, for obtaining the current load value of processor of the determined each transcoding equipment of described transcoding equipment determination module, and total CPU core number in this processor;
First determines submodule, for according to default processor load value and the corresponding relation of CPU core number, definite load value current with obtained processor corresponding, the CPU core number of the current use of processor of determined each transcoding equipment;
Calculating sub module, for according to described first determine the determined each transcoding equipment of submodule the current use of processor CPU core number and described in obtain the total CPU core number of processor that submodule obtains, calculate the CPU core number of the current free time of processor of determined each transcoding equipment.
Optionally, the handling property of described processor is CPU core number total in processor; Described transcoding equipment is selected module, specifically for:
According to obtained handling property, from determined each transcoding equipment, select the transcoding equipment that total CPU core number is maximum, as the transcoding equipment for carrying out transcoding task.
Optionally, the handling property of described processor is the CPU core number of current free time of processor; Described transcoding equipment is selected module, comprising:
Second determines submodule, for determining that described first treats the CPU core number that transcoding video file transcoding is required;
Judge submodule, for judging whether the CPU core number of current free time of processor of determined each transcoding equipment is all less than described second and determines that submodule determined first treats the CPU core number that transcoding video file transcoding is required;
The first chooser module, for in the described judged result that judges submodule be, suspend the transcoding task of at least one transcoding equipment in determined transcoding equipment, reclaim CPU core, from reclaiming the transcoding equipment of CPU core, select a transcoding equipment as the transcoding equipment for carrying out transcoding task;
The second chooser module, for in the described judged result that judges submodule be no, from determined transcoding equipment, select the CPU core number of a current free time to be not less than the described first transcoding equipment for the treatment of under the processor of the required CPU core number of transcoding video file transcoding, as the transcoding equipment for carrying out transcoding task.
Optionally, described second determines submodule, comprising:
Acquiring unit, for obtaining the video code rate after the described first file size until transcoding video file, transcoding mode and transcoding;
Computing unit, for the video code rate after the file size, transcoding mode and the transcoding that obtain according to described acquiring unit, calculates described first and treats the CPU core number that transcoding video file transcoding is required.
Application technique scheme, the video transcoding method that the embodiment of the present invention provides and device, in definite memory, store first after each transcoding equipment of transcoding video file, can obtain the handling property of the processor of determined each transcoding equipment, according to obtained handling property, from determined each transcoding equipment, select one for carrying out the transcoding equipment of transcoding task, and control processor in selected transcoding equipment and treat that to being stored in first in the memory of this transcoding equipment transcoding video file carries out transcoding, the video file that transcoding is obtained stores in the memory of this transcoding equipment.
Compared with prior art, in the time carrying out video code conversion, between processor that only need be in a transcoding equipment and memory, carry out the transmission of video file, avoided use network to transmit file, saved the transcoding time, improved transcoding efficiency.
Brief description of the drawings
In order to be illustrated more clearly in the embodiment of the present invention or technical scheme of the prior art, to the accompanying drawing of required use in embodiment or description of the Prior Art be briefly described below, apparently, accompanying drawing in the following describes is only some embodiments of the present invention, for those of ordinary skill in the art, do not paying under the prerequisite of creative work, can also obtain according to these accompanying drawings other accompanying drawing.
The flow chart of a kind of video transcoding method that Fig. 1 provides for the embodiment of the present invention;
The flow chart of a kind of execution mode of S102 in Fig. 1 that Fig. 2 provides for the embodiment of the present invention;
The flow chart of a kind of execution mode of S103 in Fig. 1 that Fig. 3 provides for the embodiment of the present invention;
The flow chart of a kind of execution mode of S103a in Fig. 3 that Fig. 4 provides for the embodiment of the present invention;
The structural representation of a kind of video code conversion device that Fig. 5 provides for the embodiment of the present invention;
A kind of structural representation of handling property acquisition module 502 in Fig. 5 that Fig. 6 provides for the embodiment of the present invention;
Fig. 5 transit code equipment that Fig. 7 provides for the embodiment of the present invention is selected a kind of structural representation of module 503;
Second a kind of structural representation of determining submodule 503a in Fig. 7 that Fig. 8 provides for the embodiment of the present invention.
Embodiment
In order to make those skilled in the art understand better the technical scheme in the present invention, 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 only the present invention's part embodiment, instead of whole embodiment.Based on the embodiment in the present invention, those of ordinary skill in the art, not making the every other embodiment obtaining under creative work prerequisite, belong to the scope of protection of the invention.
Along with the continuous increase of the universal and network bandwidth of Online Video service, Online Video service provider is faced with increasing high definition, the contour bit-rate video transcoding of ultra high-definition demand.Existing video code conversion system, in the time carrying out video code conversion, transcoding equipment need to be treating that transcoding video gets this locality and carries out transcoding from storing this memory device for the treatment of transcoding video; After transcoding completes, the video file that this transcoding equipment need to obtain transcoding is again sent to this memory device.Often carry out obtaining or sending of primary video, all need to use Internet Transmission, cause transcoding process consuming time longer, transcoding efficiency is lower.In order to improve transcoding efficiency, the embodiment of the present invention provides a kind of video transcoding method and device.
First a kind of video transcoding method embodiment of the present invention being provided is below introduced.
As shown in Figure 1, a kind of video transcoding method that the embodiment of the present invention provides, can comprise:
S101, determines and in memory, stores first each transcoding equipment for the treatment of transcoding video file, wherein, any transcoding equipment in determined each transcoding equipment includes memory and processor.
It should be noted that, in order to prevent that transcoding equipment fault from causing loss of data, generally, treat that transcoding video file has backup in multiple transcoding equipment for one.The memory of transcoding equipment is for video file is stored, and the processor of transcoding equipment, for according to transcoding parameter, carries out transcoding to video file, and wherein, transcoding parameter, can comprise: the code check after transcoding, transcoding mode etc.
Transcoding mode, can comprise: non-cloud transcoding mode and cloud transcoding mode; Wherein, described cloud transcoding mode can comprise: Video segmentation, section transcoding and gather, in flakes transcoding, picture transcoding, captions transcoding; Every kind of needed resource of transcoding mode is all different.
In embodiments of the present invention, determining that first after transcoding video file, can store this first list for the treatment of the device identification of the transcoding equipment at the memory place of transcoding video file according to default including, determine and in memory, store this first each transcoding equipment for the treatment of transcoding video file;
Or, can send one for inquiring whether this transcoding equipment this locality stores the described first inquiry instruction for the treatment of transcoding video file to the transcoding equipment in trans-coding system, message according to each transcoding equipment for this instruction feedback, determine and in memory, store this first each transcoding equipment for the treatment of transcoding video file, the message of transcoding equipment feedback is used for representing that this transcoding equipment this locality stores described first and treats transcoding video file, or this transcoding equipment this locality does not store described first and treats transcoding video file.
S102, obtains the handling property of the processor of determined each transcoding equipment.
In definite memory, store first after each transcoding equipment of transcoding video file, need to obtain the handling property of the processor of determined each transcoding equipment, such as, first treats that transcoding video file is stored in transcoding equipment 1, transcoding equipment 2, and in the memory of transcoding equipment 3 these 3 transcoding equipment, at this moment need handling property, the handling property of processor of transcoding equipment 2 and the handling property of the processor of transcoding equipment 3 of the processor that obtains transcoding equipment 1.
Optionally, the handling property of described processor, can comprise:
Check figure in the central processor CPU of current free time of processor, and/or total CPU core number in processor.
Now, the handling property of the processor of transcoding equipment 1 can be the interior check figure of central processor CPU of the current free time of processor of this transcoding equipment; Or can be CPU core number total in the processor of this transcoding equipment; Or can be total CPU core number in check figure and processor thereof in the central processor CPU of current free time of processor of this transcoding equipment.
S103, according to obtained handling property, from determined each transcoding equipment, selects one for carrying out the transcoding equipment of transcoding task.
In actual applications, can, according to check figure in the central processor CPU of obtained current free time of processor, from determined each transcoding equipment, select one for carrying out the transcoding equipment of transcoding task; Further, can be from determined each transcoding equipment, select the interior maximum transcoding equipment of check figure of central processor CPU of a current free time of selection, as the transcoding equipment for carrying out transcoding task.
In addition, also can, according to CPU core number total in obtained processor, from determined each transcoding equipment, select one for carrying out the transcoding equipment of transcoding task; Further, can be from determined each transcoding equipment, select the maximum transcoding equipment of CPU core number total in a selection processor, as the transcoding equipment for carrying out transcoding task.
In addition, also can, according to CPU core number total in check figure and processor in the central processor CPU of obtained current free time of processor, from determined each transcoding equipment, select one for carrying out the transcoding equipment of transcoding task.
S104, controls processor in selected transcoding equipment and treat that to being stored in first in the memory of this transcoding equipment transcoding video file carries out transcoding, and the video file that transcoding is obtained stores in the memory of this transcoding equipment.
In embodiments of the present invention, after the transcoding equipment of having determined for carrying out transcoding task, the processor that can control this transcoding equipment obtains first and treats that transcoding video file carries out transcoding from the memory of this transcoding equipment, and executing after transcoding task, the video file that transcoding is obtained sends to this memory.Compared with existing trans-coding system, above-mentioned transcoding process takes full advantage of processor resource and the memory resource of a transcoding equipment, has avoided the waste that the hardware resource free time of transcoding equipment causes.
Preferably, first in the embodiment of the present invention treats that transcoding video file can carry priority tag.Further, in the time that video file is carried out to transcoding, the processor that can control in transcoding equipment carries out preferential transcoding to the video file that carries priority tag.
As can be seen here, the video transcoding method that the embodiment of the present invention provides, in definite memory, store first after each transcoding equipment of transcoding video file, can obtain the handling property of the processor of determined each transcoding equipment, according to obtained handling property, from determined each transcoding equipment, select one for carrying out the transcoding equipment of transcoding task, and control processor in selected transcoding equipment and treat that to being stored in first in the memory of this transcoding equipment transcoding video file carries out transcoding, the video file that transcoding is obtained stores in the memory of this transcoding equipment.
Compared with prior art, in the time carrying out video code conversion, between processor that only need be in a transcoding equipment and memory, carry out the transmission of video file, avoided use network to transmit file, saved the transcoding time, improved transcoding efficiency.
Optionally, in one embodiment of the invention, the handling property of described processor is the interior check figure of the central processor CPU of current free time of processor; As shown in Figure 2, above-mentioned S102, can comprise:
S102a, obtains the current load value of processor of determined each transcoding equipment, and total CPU core number in this processor.
Optionally, in an execution mode of the embodiment of the present invention, under linux operating system, can use cat/proc/cpuinfo|grep " processor " | wc – l order, directly obtains CPU core number total in processor.
Can use uptime order, directly obtain the current load value of processor.
Treat that transcoding video file is at transcoding equipment 1, transcoding equipment 2 such as first, and have backup in transcoding equipment 3, the current load value of processor of transcoding equipment 1 is 5, and in this processor, total CPU core number is 32; The current load value of processor of transcoding equipment 2 is 7.03, and in this processor, total CPU core number is 40; The current load value of processor of transcoding equipment 3 is 9, and in this processor, total CPU core number is 24.
S102b, according to default processor load value and the corresponding relation of CPU core number, determine the load value current with obtained processor corresponding, the CPU core number of the current use of processor of determined each transcoding equipment.
It should be noted that, there are mapping relations in the processor load value of transcoding equipment and the processor cores usage quantity of this transcoding equipment, and such as the processor load value of transcoding equipment 1 is 5, the CPU core number that this processor uses is accordingly 5; The processor load value of transcoding equipment 2 is 7.03, and the CPU core number that this processor uses is accordingly 7; The processor load value of transcoding equipment 3 is 9, and the CPU core number that this processor uses is accordingly 9.
S102c, according to total CPU core number in the CPU core number of the current use of processor of determined each transcoding equipment and the processor that obtains, calculates the CPU core number of the current free time of processor of determined each transcoding equipment.
After the CPU core number and total CPU core number thereof of the current use of processor that obtains each transcoding equipment, can pass through difference computing, obtain the CPU core number of the current free time of processor of each transcoding equipment; Such as the CPU core number of the current use of transcoding equipment 1 processor is 27, the total CPU core number of its processor is 33, and the CPU core number of its current free time of processor is 15.
Optionally, in one embodiment of the invention, the handling property of described processor is CPU core number total in processor; As shown in Figure 3, above-mentioned S103, can comprise:
S103a, determines that first treats the CPU core number that transcoding video file transcoding is required.
In order reasonably to utilize the processor resource of transcoding equipment, can be in advance treat that to first the required CPU core number of transcoding video file transcoding estimates.
Optionally, in execution mode of the embodiment of the present invention, can be according to the video code rate after the file size of video file, transcoding mode and transcoding, calculate the required CPU core number of this video file transcoding.As shown in Figure 4, above-mentioned S103a, can comprise:
S103a-1, obtains the video code rate after the described first file size until transcoding video file, transcoding mode and transcoding.
S103a-2, according to the video code rate after obtained file size, transcoding mode and transcoding, calculates described first and treats the CPU core number that transcoding video file transcoding is required.
Such as video file size is 1G, transcoding mode is the non-cloud transcoding of video, and the code check after transcoding is 800kbps, and calculating the required CPU core number of this video file transcoding is 4core.
In actual applications, concrete implementation can be: first based on experience value, the required CPU core number of each video file transcoding is set to fixed value such as 4core; The video file for the treatment of transcoding according to video informations such as the code checks after transcoding mode and transcoding afterwards carries out transcoding, the information of above-mentioned video is deposited in the processor with learning functionality simultaneously.Be understandable that, transcoding mode is CPU intensity, and the code check after transcoding is higher, and the required CPU core number of transcoding is just more, otherwise just lower.
Then, monitor the cpu usage of whole transcoding process, and regularly report the processor with resource analysis function, carry out resources smoothing processing, obtain the CPU average service rate of whole transcoding process; Afterwards CPU average service rate in the transcoding duration of each video file and its transcoding process is added up, draw an optimal balance point, wherein, CPU average service rate and CPU core are used number to have corresponding relation.
After the transcoding training of a collection of video file being carried out to above-mentioned flow process, obtain the Sample Storehouse of the data that comprise enough video samples and CPU core use number.In mixing transcoding environment, can will treat that the video file in transcoding video file and sample does analogy, count corresponding relation according to video file given in Sample Storehouse and the required CPU core of this video file transcoding, obtain the CPU core usage quantity actual required close to this video file transcoding; , in this video file transcoding process, actual this video file transcoding required CPU core usage quantity can be reported simultaneously, count corresponding relation in order to constantly to improve the required CPU core of video file and this video file transcoding in Sample Storehouse.
S103b, whether the CPU core number that judges the current free time of processor of determined each transcoding equipment is all less than first is treated the CPU core number that transcoding video file transcoding is required; If so, forward S103c to, otherwise forward S103d to.
S103c, suspends the transcoding task of at least one transcoding equipment in determined transcoding equipment, reclaims CPU core, from reclaiming the transcoding equipment of CPU core, selects a transcoding equipment as the transcoding equipment for carrying out transcoding task.
Optionally, in embodiments of the present invention, a transcoding equipment, can comprise: multiple transcoding tasks; Described transcoding task carries priority tag, or type identification; Further, be all less than first in the time that the required CPU core of transcoding video file transcoding is counted at the CPU core number of current free time of processor of determined each transcoding equipment, can suspend a transcoding task that transcoding equipment medium priority is lower; Further, can suspend the multinomial transcoding task that priority is lower.
In addition also can suspend, the transcoding task of a certain type in a transcoding equipment; Or also can suspend the higher transcoding task of CPU core occupancy in a transcoding equipment.
Optionally, in embodiments of the present invention, treat that for described first transcoding video file needs immediately by the situation of transcoding, CPU core number in current free time of processor of determined each transcoding equipment is all less than first in the time that the required CPU core of transcoding video file transcoding is counted, can suspend many transcoding tasks in transcoding equipment, reclaim CPU core, avoid a transcoding equipment to reclaim after CPU core, still can not meet first and treat the CPU core quantity that transcoding video file transcoding is required.
S103d, from determined transcoding equipment, selects the CPU core number of a current free time to be not less than the first transcoding equipment for the treatment of under the processor of the required CPU core number of transcoding video file transcoding, as the transcoding equipment for carrying out transcoding task.
Optionally, in an execution mode of the embodiment of the present invention, can select the maximum transcoding equipment of CPU core number of a current free time, as the transcoding equipment for carrying out transcoding task.
Optionally, in an execution mode of the embodiment of the present invention, can select the CPU core number of a current free time to be not less than and close to the first transcoding equipment for the treatment of the required CPU core number of transcoding video file transcoding, as the transcoding equipment for carrying out transcoding task.So both ensure normally carrying out of transcoding task, taken full advantage of again the CPU of transcoding equipment.Such as, first treats that transcoding video file all has backup in transcoding equipment 1, transcoding equipment 2, transcoding equipment 3, the CPU core number of 1 current free time of transcoding equipment is 8core, the CPU core number of 2 current free time of transcoding equipment is 4core, the CPU core number of 3 current free time of transcoding equipment is 6core, first treats that the required CPU core number of transcoding video file transcoding is 5core, and the transcoding equipment 2 that the CPU core number that can select the current free time is 6core, as the transcoding equipment for carrying out transcoding task.
Corresponding to the embodiment of the method shown in Fig. 1, the embodiment of the present invention also provides a kind of video code conversion device.
As shown in Figure 5, a kind of video code conversion device that the embodiment of the present invention provides, can comprise:
Transcoding equipment determination module 501, for determining that memory stores first each transcoding equipment for the treatment of transcoding video file, wherein, any transcoding equipment in determined each transcoding equipment includes memory and processor;
Handling property acquisition module 502, for obtaining the handling property of processor of described transcoding equipment determination module 501 determined each transcoding equipment;
Transcoding equipment is selected module 503, for the handling property obtaining according to described handling property acquisition module 502, from determined each transcoding equipment, selects one for carrying out the transcoding equipment of transcoding task;
Transcoding control module 504, treat that to being stored in first in the memory of this transcoding equipment transcoding video file carries out transcoding for controlling processor that described transcoding equipment selects the selected transcoding equipment of module 503, and the video file that transcoding is obtained stores in the memory of this transcoding equipment into.
As can be seen here, the video code conversion device that the embodiment of the present invention provides, in definite memory, store first after each transcoding equipment of transcoding video file, can obtain the handling property of the processor of determined each transcoding equipment, according to obtained handling property, from determined each transcoding equipment, select one for carrying out the transcoding equipment of transcoding task, and control processor in selected transcoding equipment and treat that to being stored in first in the memory of this transcoding equipment transcoding video file carries out transcoding, the video file that transcoding is obtained stores in the memory of this transcoding equipment.
Compared with prior art, in the time carrying out video code conversion, between processor that only need be in a transcoding equipment and memory, carry out the transmission of video file, avoided use network to transmit file, saved the transcoding time, improved transcoding efficiency.
Optionally, in one embodiment of the invention, the handling property of described processor, can comprise:
Check figure in the central processor CPU of current free time of processor, and/or total CPU core number in processor.
Optionally, in one embodiment of the invention, the handling property of described processor is the interior check figure of the central processor CPU of current free time of processor; As shown in Figure 6, described handling property acquisition module 502, can comprise:
Obtain submodule 502a, for obtaining the current load value of processor of described transcoding equipment determination module 501 determined each transcoding equipment, and total CPU core number in this processor;
First determines submodule 502b, for according to default processor load value and the corresponding relation of CPU core number, definite load value current with obtained processor corresponding, the CPU core number of the current use of processor of determined each transcoding equipment;
Calculating sub module 502c, for according to described first determine the determined each transcoding equipment of submodule 502b the current use of processor CPU core number and described in obtain the total CPU core number of processor that submodule 502a obtains, calculate the CPU core number of the current free time of processor of determined each transcoding equipment.
Optionally, in one embodiment of the invention, the handling property of described processor is CPU core number total in processor; As shown in Figure 7, described transcoding equipment is selected module 503, can be specifically for:
According to obtained handling property, from determined each transcoding equipment, select the transcoding equipment that total CPU core number is maximum, as the transcoding equipment for carrying out transcoding task.
Optionally, in one embodiment of the invention, the handling property of described processor is the CPU core number of current free time of processor; As shown in Figure 7, described transcoding equipment is selected module 503, can comprise:
Second determines submodule 503a, for determining that described first treats the CPU core number that transcoding video file transcoding is required;
Judge submodule 503b, for judging whether the CPU core number of current free time of processor of determined each transcoding equipment is all less than described second and determines that submodule 503a determined first treats the CPU core number that transcoding video file transcoding is required;
The first chooser module 503c, for in the described judged result that judges submodule 503b be, suspend the transcoding task of at least one transcoding equipment in determined transcoding equipment, reclaim CPU core, from reclaiming the transcoding equipment of CPU core, select a transcoding equipment as the transcoding equipment for carrying out transcoding task;
The second chooser module 503d, for in the described judged result that judges submodule 503b be no, from determined transcoding equipment, select the CPU core number of a current free time to be not less than the described first transcoding equipment for the treatment of under the processor of the required CPU core number of transcoding video file transcoding, as the transcoding equipment for carrying out transcoding task.
Optionally, in one embodiment of the invention, as shown in Figure 8, described second determines submodule 503a, can comprise:
Acquiring unit 503a-1, for obtaining the video code rate after the described first file size until transcoding video file, transcoding mode and transcoding;
Computing unit 503a-2, for the video code rate after the file size, transcoding mode and the transcoding that obtain according to described acquiring unit 503a-1, calculates described first and treats the CPU core number that transcoding video file transcoding is required.
For device embodiment, because it is substantially similar in appearance to embodiment of the method, so description is fairly simple, relevant part is referring to the part explanation of embodiment of the method.
For convenience of description, while describing above device, being divided into various modules with function describes respectively.Certainly, in the time that enforcement is of the present invention, the function of each module can be realized in same or multiple software and/or hardware.
It should be noted that, in this article, relational terms such as the first and second grades is only used for an entity or operation to separate with another entity or operating space, and not necessarily requires or imply and between these entities or operation, have the relation of any this reality or sequentially.And, term " comprises ", " comprising " or its any other variant are intended to contain comprising of nonexcludability, thereby the process, method, article or the equipment that make to comprise a series of key elements not only comprise those key elements, but also comprise other key elements of clearly not listing, or be also included as the intrinsic key element of this process, method, article or equipment.The in the situation that of more restrictions not, the key element being limited by statement " comprising ... ", and be not precluded within process, method, article or the equipment that comprises described key element and also have other identical element.
Each embodiment in this specification all adopts relevant mode to describe, between each embodiment identical similar part mutually referring to, what each embodiment stressed is and the difference of other embodiment.Especially,, for device embodiment, because it is substantially similar in appearance to embodiment of the method, so description is fairly simple, relevant part is referring to the part explanation of embodiment of the method.
One of ordinary skill in the art will appreciate that all or part of step realizing in said method execution mode is can carry out the hardware that instruction is relevant by program to complete, described program can be stored in computer read/write memory medium, here the alleged storage medium obtaining, as: ROM/RAM, magnetic disc, CD etc.
The foregoing is only preferred embodiment of the present invention, be not intended to limit protection scope of the present invention.All any amendments of doing within the spirit and principles in the present invention, be equal to replacement, improvement etc., be all included in protection scope of the present invention.

Claims (12)

1. a video transcoding method, is characterized in that, comprising:
Determine and in memory, store first each transcoding equipment for the treatment of transcoding video file, wherein, any transcoding equipment in determined each transcoding equipment includes memory and processor;
Obtain the handling property of the processor of determined each transcoding equipment;
According to obtained handling property, from determined each transcoding equipment, select one for carrying out the transcoding equipment of transcoding task;
Control processor in selected transcoding equipment and treat that to being stored in first in the memory of this transcoding equipment transcoding video file carries out transcoding, and the video file that transcoding is obtained stores in the memory of this transcoding equipment.
2. method according to claim 1, is characterized in that, the handling property of described processor, comprising:
Check figure in the central processor CPU of current free time of processor, and/or total CPU core number in processor.
3. method according to claim 2, is characterized in that, the handling property of described processor is the interior check figure of the central processor CPU of current free time of processor;
The handling property of the processor of the determined each transcoding equipment of described acquisition, comprising:
Obtain the current load value of processor of determined each transcoding equipment, and total CPU core number in this processor;
According to default processor load value and the corresponding relation of CPU core number, determine the load value current with obtained processor corresponding, the CPU core number of the current use of processor of determined each transcoding equipment;
According to total CPU core number in the CPU core number of the current use of processor of determined each transcoding equipment and the processor that obtains, calculate the CPU core number of the current free time of processor of determined each transcoding equipment.
4. method according to claim 2, is characterized in that, the handling property of described processor is CPU core number total in processor;
Described according to obtained handling property, from determined each transcoding equipment, select one for carrying out the transcoding equipment of transcoding task, comprising:
According to obtained handling property, from determined each transcoding equipment, select the transcoding equipment that total CPU core number is maximum, as the transcoding equipment for carrying out transcoding task.
5. method according to claim 2, is characterized in that, the handling property of described processor is the CPU core number of current free time of processor;
Described according to obtained handling property, from determined each transcoding equipment, select one for carrying out the transcoding equipment of transcoding task, comprising:
Determine that described first treats the CPU core number that transcoding video file transcoding is required;
Whether the CPU core number that judges the current free time of processor of determined each transcoding equipment is all less than described first is treated the CPU core number that transcoding video file transcoding is required;
If so, suspend the transcoding task of at least one transcoding equipment in determined transcoding equipment, reclaim CPU core, from reclaiming the transcoding equipment of CPU core, select a transcoding equipment as the transcoding equipment for carrying out transcoding task;
Otherwise, from determined transcoding equipment, select the CPU core number of a current free time to be not less than the described first transcoding equipment for the treatment of under the processor of the required CPU core number of transcoding video file transcoding, as the transcoding equipment for carrying out transcoding task.
6. method according to claim 5, is characterized in that, described definite described first treats the CPU core number that transcoding video file transcoding is required, comprising:
Obtain the video code rate after the described first file size until transcoding video file, transcoding mode and transcoding;
According to the video code rate after obtained file size, transcoding mode and transcoding, calculate described first and treat the CPU core number that transcoding video file transcoding is required.
7. a video code conversion device, is characterized in that, comprising:
Transcoding equipment determination module, for determining that memory stores first each transcoding equipment for the treatment of transcoding video file, wherein, any transcoding equipment in determined each transcoding equipment includes memory and processor;
Handling property acquisition module, for obtaining the handling property of processor of the determined each transcoding equipment of described transcoding equipment determination module;
Transcoding equipment is selected module, for the handling property obtaining according to described handling property acquisition module, from determined each transcoding equipment, selects one for carrying out the transcoding equipment of transcoding task;
Transcoding control module, treat that to being stored in first in the memory of this transcoding equipment transcoding video file carries out transcoding for controlling processor that described transcoding equipment selects the selected transcoding equipment of module, and the video file that transcoding is obtained stores in the memory of this transcoding equipment into.
8. device according to claim 7, is characterized in that, the handling property of described processor, comprising:
Check figure in the central processor CPU of current free time of processor, and/or total CPU core number in processor.
9. device according to claim 8, is characterized in that, the handling property of described processor is the interior check figure of the central processor CPU of current free time of processor; Described handling property acquisition module, comprising:
Obtain submodule, for obtaining the current load value of processor of the determined each transcoding equipment of described transcoding equipment determination module, and total CPU core number in this processor;
First determines submodule, for according to default processor load value and the corresponding relation of CPU core number, definite load value current with obtained processor corresponding, the CPU core number of the current use of processor of determined each transcoding equipment;
Calculating sub module, for according to described first determine the determined each transcoding equipment of submodule the current use of processor CPU core number and described in obtain the total CPU core number of processor that submodule obtains, calculate the CPU core number of the current free time of processor of determined each transcoding equipment.
10. device according to claim 8, is characterized in that, the handling property of described processor is CPU core number total in processor; Described transcoding equipment is selected module, specifically for:
According to obtained handling property, from determined each transcoding equipment, select the transcoding equipment that total CPU core number is maximum, as the transcoding equipment for carrying out transcoding task.
11. devices according to claim 8, is characterized in that, the handling property of described processor is the CPU core number of current free time of processor; Described transcoding equipment is selected module, comprising:
Second determines submodule, for determining that described first treats the CPU core number that transcoding video file transcoding is required;
Judge submodule, for judging whether the CPU core number of current free time of processor of determined each transcoding equipment is all less than described second and determines that submodule determined first treats the CPU core number that transcoding video file transcoding is required;
The first chooser module, for in the described judged result that judges submodule be, suspend the transcoding task of at least one transcoding equipment in determined transcoding equipment, reclaim CPU core, from reclaiming the transcoding equipment of CPU core, select a transcoding equipment as the transcoding equipment for carrying out transcoding task;
The second chooser module, for in the described judged result that judges submodule be no, from determined transcoding equipment, select the CPU core number of a current free time to be not less than the described first transcoding equipment for the treatment of under the processor of the required CPU core number of transcoding video file transcoding, as the transcoding equipment for carrying out transcoding task.
12. devices according to claim 11, is characterized in that, described second determines submodule, comprising:
Acquiring unit, for obtaining the video code rate after the described first file size until transcoding video file, transcoding mode and transcoding;
Computing unit, for the video code rate after the file size, transcoding mode and the transcoding that obtain according to described acquiring unit, calculates described first and treats the CPU core number that transcoding video file transcoding is required.
CN201410437451.1A 2014-08-29 A kind of video transcoding method and device Active CN104168488B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410437451.1A CN104168488B (en) 2014-08-29 A kind of video transcoding method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410437451.1A CN104168488B (en) 2014-08-29 A kind of video transcoding method and device

Publications (2)

Publication Number Publication Date
CN104168488A true CN104168488A (en) 2014-11-26
CN104168488B CN104168488B (en) 2018-02-09

Family

ID=

Cited By (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104935955A (en) * 2015-05-29 2015-09-23 腾讯科技(北京)有限公司 Live video stream transmission method, device and system
CN105162809A (en) * 2015-10-23 2015-12-16 北京理工大学 Real-time video transcoding system based on intermodule communication
CN105357544A (en) * 2015-10-29 2016-02-24 浪潮软件集团有限公司 HLS-based multimedia file processing method and server
CN105872595A (en) * 2016-03-31 2016-08-17 乐视控股(北京)有限公司 Transcoding task distribution method and device
CN106197380A (en) * 2016-09-04 2016-12-07 南京理工大学 Aquatic vegetation monitoring method based on unmanned plane and system
CN107071449A (en) * 2017-05-18 2017-08-18 北京数码视讯科技股份有限公司 A kind of trans-coding system and method
CN108156464A (en) * 2017-12-19 2018-06-12 青岛海信网络科技股份有限公司 A kind of method and device of multipath concurrence transcoding
CN108712422A (en) * 2018-05-18 2018-10-26 网宿科技股份有限公司 A kind of method and apparatus creating transcoding task
CN108845882A (en) * 2018-06-07 2018-11-20 网宿科技股份有限公司 The method and apparatus for realizing cpu load equilibrium based on transcoding task schedule
CN108965884A (en) * 2018-07-13 2018-12-07 网宿科技股份有限公司 A kind of distribution method and controlling equipment, transcoding device of transcoding task
CN110324629A (en) * 2019-06-27 2019-10-11 北京奇艺世纪科技有限公司 Picture code-transferring method, device and electronic equipment
CN111031389A (en) * 2019-12-11 2020-04-17 Oppo广东移动通信有限公司 Video processing method, electronic device and storage medium
CN111052703A (en) * 2017-08-31 2020-04-21 T移动美国公司 Codec selection for resource management
WO2020119515A1 (en) * 2018-12-11 2020-06-18 阿里巴巴集团控股有限公司 Video transcoding method and device
CN111314706A (en) * 2018-12-11 2020-06-19 阿里巴巴集团控股有限公司 Video transcoding method and device
CN114071149A (en) * 2020-07-30 2022-02-18 株洲中车时代电气股份有限公司 Distributed video transcoding method and related device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100257236A1 (en) * 2002-02-15 2010-10-07 Agnoli Giovanni M System, method, and computer program product for media publishing request processing
CN102802024A (en) * 2012-08-28 2012-11-28 曙光信息产业(北京)有限公司 Transcoding method and transcoding system realized in server
CN102859961A (en) * 2009-12-22 2013-01-02 Gvbb控股股份有限公司 Distributed video transcode system with adaptive file processing
CN103150213A (en) * 2011-12-06 2013-06-12 北大方正集团有限公司 Method and device for balancing load
WO2014082505A1 (en) * 2012-11-27 2014-06-05 腾讯科技(深圳)有限公司 Transcoding method and system, and distributed file device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100257236A1 (en) * 2002-02-15 2010-10-07 Agnoli Giovanni M System, method, and computer program product for media publishing request processing
CN102859961A (en) * 2009-12-22 2013-01-02 Gvbb控股股份有限公司 Distributed video transcode system with adaptive file processing
CN103150213A (en) * 2011-12-06 2013-06-12 北大方正集团有限公司 Method and device for balancing load
CN102802024A (en) * 2012-08-28 2012-11-28 曙光信息产业(北京)有限公司 Transcoding method and transcoding system realized in server
WO2014082505A1 (en) * 2012-11-27 2014-06-05 腾讯科技(深圳)有限公司 Transcoding method and system, and distributed file device

Cited By (23)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104935955B (en) * 2015-05-29 2019-01-25 腾讯科技(北京)有限公司 A kind of methods, devices and systems transmitting live video stream
CN104935955A (en) * 2015-05-29 2015-09-23 腾讯科技(北京)有限公司 Live video stream transmission method, device and system
CN105162809A (en) * 2015-10-23 2015-12-16 北京理工大学 Real-time video transcoding system based on intermodule communication
CN105357544A (en) * 2015-10-29 2016-02-24 浪潮软件集团有限公司 HLS-based multimedia file processing method and server
CN105872595A (en) * 2016-03-31 2016-08-17 乐视控股(北京)有限公司 Transcoding task distribution method and device
CN106197380A (en) * 2016-09-04 2016-12-07 南京理工大学 Aquatic vegetation monitoring method based on unmanned plane and system
CN107071449A (en) * 2017-05-18 2017-08-18 北京数码视讯科技股份有限公司 A kind of trans-coding system and method
CN107071449B (en) * 2017-05-18 2019-12-03 北京数码视讯软件技术发展有限公司 A kind of trans-coding system and method
CN111052703A (en) * 2017-08-31 2020-04-21 T移动美国公司 Codec selection for resource management
CN108156464A (en) * 2017-12-19 2018-06-12 青岛海信网络科技股份有限公司 A kind of method and device of multipath concurrence transcoding
CN108712422B (en) * 2018-05-18 2021-05-25 网宿科技股份有限公司 Method and device for creating transcoding task
CN108712422A (en) * 2018-05-18 2018-10-26 网宿科技股份有限公司 A kind of method and apparatus creating transcoding task
CN108845882A (en) * 2018-06-07 2018-11-20 网宿科技股份有限公司 The method and apparatus for realizing cpu load equilibrium based on transcoding task schedule
CN108965884A (en) * 2018-07-13 2018-12-07 网宿科技股份有限公司 A kind of distribution method and controlling equipment, transcoding device of transcoding task
WO2020119515A1 (en) * 2018-12-11 2020-06-18 阿里巴巴集团控股有限公司 Video transcoding method and device
CN111314737A (en) * 2018-12-11 2020-06-19 阿里巴巴集团控股有限公司 Video transcoding method and device
CN111314706A (en) * 2018-12-11 2020-06-19 阿里巴巴集团控股有限公司 Video transcoding method and device
CN111314706B (en) * 2018-12-11 2023-08-25 阿里巴巴集团控股有限公司 Video transcoding method and device
CN110324629B (en) * 2019-06-27 2021-04-09 北京奇艺世纪科技有限公司 Image transcoding method and device and electronic equipment
CN110324629A (en) * 2019-06-27 2019-10-11 北京奇艺世纪科技有限公司 Picture code-transferring method, device and electronic equipment
CN111031389A (en) * 2019-12-11 2020-04-17 Oppo广东移动通信有限公司 Video processing method, electronic device and storage medium
CN111031389B (en) * 2019-12-11 2022-05-20 Oppo广东移动通信有限公司 Video processing method, electronic device and storage medium
CN114071149A (en) * 2020-07-30 2022-02-18 株洲中车时代电气股份有限公司 Distributed video transcoding method and related device

Similar Documents

Publication Publication Date Title
US11762697B2 (en) Method and apparatus for scheduling resource for deep learning framework
US10572285B2 (en) Method and apparatus for elastically scaling virtual machine cluster
CN108768877B (en) Distribution method and device of burst traffic and proxy server
US9979631B2 (en) Dynamic rerouting of service requests between service endpoints for web services in a composite service
US8307366B2 (en) Post-processing phase in a distributed processing system using assignment information
CN103473142B (en) Virtual machine migration method under a kind of cloud computing operating system and device
CN104391749A (en) Resource allocation method and device
CN105740063A (en) Data processing method and apparatus
US8874787B2 (en) Optimized consumption of third-party web services in a composite service
CN104503840A (en) Method and device for optimizing terminal resources
CN105094983A (en) Computer, control equipment and data processing method
CN111181770A (en) Resource allocation method, system, electronic equipment and storage medium
JP2008152618A (en) Job assignment program, method and device
US10698863B2 (en) Method and apparatus for clearing data in cloud storage system
CN103503404A (en) Resource scheduling method, device and system
CN109995787A (en) A kind of data processing method and relevant device
CN109347982A (en) A kind of dispatching method and device of data center
CN105243078A (en) File resource distribution method, system and apparatus
CN108595178A (en) A kind of collecting method, device and equipment based on hook
CN105335376A (en) Stream processing method, device and system
CN108268316A (en) The method and device of job scheduling
CN110557679B (en) Video content identification method, device, medium and system
CN104168488A (en) Video transcoding method and device
CN111555918B (en) Return source optimization method and device and electronic equipment
CN104168488B (en) A kind of video transcoding method and device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant