WO2014082505A1 - 转码方法及系统、分布式文件装置 - Google Patents

转码方法及系统、分布式文件装置 Download PDF

Info

Publication number
WO2014082505A1
WO2014082505A1 PCT/CN2013/085388 CN2013085388W WO2014082505A1 WO 2014082505 A1 WO2014082505 A1 WO 2014082505A1 CN 2013085388 W CN2013085388 W CN 2013085388W WO 2014082505 A1 WO2014082505 A1 WO 2014082505A1
Authority
WO
WIPO (PCT)
Prior art keywords
task
transcoding
data
information
transcoder
Prior art date
Application number
PCT/CN2013/085388
Other languages
English (en)
French (fr)
Inventor
庄奇东
何春晓
苏元朋
Original Assignee
腾讯科技(深圳)有限公司
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 腾讯科技(深圳)有限公司 filed Critical 腾讯科技(深圳)有限公司
Publication of WO2014082505A1 publication Critical patent/WO2014082505A1/zh
Priority to US14/711,928 priority Critical patent/US10291673B2/en

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/60Network streaming of media packets
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/21Server components or server architectures
    • H04N21/222Secondary servers, e.g. proxy server, cable television Head-end
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/18File system types
    • G06F16/182Distributed file systems
    • G06F16/1824Distributed file systems implemented using Network-attached Storage [NAS] architecture
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5061Partitioning or combining of resources
    • G06F9/5066Algorithms for mapping a plurality of inter-dependent sub-tasks onto a plurality of physical CPUs
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/60Network streaming of media packets
    • H04L65/75Media network packet handling
    • H04L65/765Media network packet handling intermediate
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/06Notations for structuring of protocol data, e.g. abstract syntax notation one [ASN.1]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/234Processing of video elementary streams, e.g. splicing of video streams, manipulating MPEG-4 scene graphs
    • H04N21/2343Processing of video elementary streams, e.g. splicing of video streams, manipulating MPEG-4 scene graphs involving reformatting operations of video signals for distribution or compliance with end-user requests or end-user device requirements
    • H04N21/234309Processing of video elementary streams, e.g. splicing of video streams, manipulating MPEG-4 scene graphs involving reformatting operations of video signals for distribution or compliance with end-user requests or end-user device requirements by transcoding between formats or standards, e.g. from MPEG-2 to MPEG-4 or from Quicktime to Realvideo

Definitions

  • the present invention relates to a transcoding method and system for use in a computer network, and a distributed file device. Background technique
  • Mailbox file transfer station offline download and other services have a large number of media files in various formats.
  • a terminal such as a personal computer or mobile phone to play online
  • a supported format such as a player can be viewed.
  • the major video service companies purchase a dedicated video transcoding server and a dedicated storage server.
  • the server transmits the data to the video transcoding server for transcoding.
  • the transcoded video file is transferred to the storage server for storage.
  • the video transcoding server generally adopts serial transcoding, and it takes tens of minutes to transcode a movie, and multiple file transmissions during the period (first transmitted by the server to the video transcoding server, then by the video)
  • the transcoding server transmits to the storage server, and finally the storage server transmits it to the client.
  • It also takes a long time to refer to it.
  • the present invention provides a transcoding method and system for use in a computer network that is capable of multiplexing idle computing resources.
  • Embodiments of the present invention can solve some or all of the problems of the existing network audio and video transcoding methods, such as time consuming, low efficiency, high hardware cost, and poor expansion capability.
  • Embodiments of the present invention can be easily scaled as needed, both for a computing cluster composed of a small number of computers, and for a cloud transcoding method in a cloud environment composed of a large number of computers.
  • a transcoding method for use in a computer network comprising: receiving, by a task manager in the computer network, a transcoding task, the transcoding task having task information;
  • the task information generates task allocation information; according to the task allocation information, respectively acquiring source data of a corresponding media segment of the media file, and the source data is transcoded into a target format data by multiple transcoders, and saved And a storage server in the computer network, wherein the transcoder comprises a processor of the storage server.
  • a distributed file device including a storage server and a plurality of transcoders.
  • the storage server includes: a source data storage module for storing source data; and an upload data storage module for storing the transcoded data.
  • the transcoder is configured to obtain source data of the corresponding media segment of the media file from the source data storage module according to the received task information and the task allocation information, and transcode the data into the target format data.
  • the transcoder includes a processor of the storage server.
  • the above technical solution constructs the work of transcoding on an audio and video storage server with idle computing resources, fully utilizes existing resources, and greatly saves hardware costs.
  • the slice is placed at the same time as the transcoding task is executed, which improves the degree of parallelism and can effectively reduce the transcoding time.
  • the MapReduce system cannot meet certain real-time requirements.
  • the system has good scalable lines through distributed file systems and/or network protocols.
  • an unlimited amount of video data can be processed, and existing systems have been proven to handle audio and video resources at the PB level.
  • the transcoding work is done on the storage machine, avoiding most of the data transmission/copying, and the effect is close to the local computing, achieving the ideal purpose of the "computing to storage migration" cloud computing.
  • transcoding task the fragmentation task obtained by each transcoder, and each worker thread in each transcoder fragmentation task, which can effectively avoid the existing network service that affects the storage server.
  • FIG. 1 is a schematic structural diagram of a cloud transcoding system for multiplexing idle computing resources according to an embodiment of the present invention
  • FIG. 2 is a schematic diagram of a working process of a process working module according to an embodiment of the present invention
  • FIG. 3 is a flow chart of a cloud transcoding method for multiplexing idle computing resources according to an embodiment of the present invention. detailed description
  • Cloud transcoding is a media transcoding based on cloud computing and cloud storage platforms.
  • Cloud computing is an Internet-based computing method in which shared hardware and software resources and information can be provided to computers and other devices on demand.
  • Cloud storage is the storage part of cloud computing, which is a virtualized, easily scalable storage resource pool. Users use storage resource pools through cloud computing, but not all storage parts of cloud computing can be separated.
  • embodiments of the present invention can be easily scaled as needed, not only for cloud environments composed of a large number of computers, but also for computing clusters composed of a small number of computers.
  • I / O (hard disk / memory) intensive machine refers to the system's CPU performance is relatively better than the hard disk / memory performance, that is, most of the system operation is the CPU is waiting for I / O read / write, CPU The occupancy rate is low.
  • the main idea of the main idea of the present invention is to consider the storage location of the transcoded audio and video files - the storage server (usually composed of a cluster of a large number of storage machines) - because it only serves to store data, there is a large amount of CPU idle storage. Machines, these machines are generally less than 20% CPU-intensive because they are I/O-intensive machines.
  • the distributed file system (Distributed File System) of the present invention means that the physical storage resources managed by the file system are not necessarily directly connected to the local node, but are connected to the node through the computer network. From the internal implementation point of view, the distributed system is no longer responsible for managing the local disk as the ordinary file system. Its file content and directory structure are not stored on the local disk, but transmitted to the remote system through the network. Moreover, the same file storage is not only on one machine, but distributed storage on a cluster of machines, providing services collaboratively, which is called distributed. Unlike a stand-alone file system, a distributed file system does not put this data on a single disk and is managed by the upper operating system.
  • the distributed file subsystem and the corresponding management method described in the present invention preferably adopt the distributed system disclosed in the Chinese patent "Distributed System, Distributed Service Processing Method and Related Device" of Application No. 200710307132.9 and corresponding Approach.
  • FIG. 1 is a schematic structural diagram of a cloud transcoding system for multiplexing idle computing resources according to an embodiment of the present invention, including: a task manager 101, a task submitting client 102, a scheduling manager 104, and a distributed file. Subsystem. The system may further include a streaming media server 109. The task submission client 102 is connected to the task manager 101, and the task manager 101, the scheduling manager 104, and the streaming media server 109 are all connected to the distributed file subsystem.
  • the distributed file subsystem further includes: a storage server 108 (including a source data storage module 110, an upload data storage module 111) and a plurality of transcoders 106, and At least one synthesizer 107 can be included as appropriate. As described below, although the storage server 108 and the transcoder 106 are illustrated as different components from a functional perspective in FIG. 1, in an actual system, the processor of the storage server 108 is used as the transcoder 106.
  • the task manager 101 After receiving the Transcoding Job, the task manager 101 first sends the task information to the task submitting client 102, and the task submitting the client 102 to submit the task.
  • the task submission client 102 submits the task information to the schedule manager 104.
  • the schedule manager 104 generates task dispatch information based on the received task information and transmits it to each of the transcoder 106 and the synthesizer 107.
  • the transcoder 106, the synthesizer 107, and the schedule manager 104 form a cloud computing framework 103 that preferably employs a MapReduce framework (such as the Map/Reduce distributed processing framework disclosed in U.S. Patent No. 7,565,332 B1) and variants thereof. Or you can use the open source Hadoop framework, the Sector/Sphere framework, the Typhoon framework, and so on. All of the transcoder 106 and synthesizer 107 are distributed over the computer cluster of the distributed file subsystem.
  • MapReduce framework such as the Map/Reduce distributed processing framework disclosed in U.S. Patent No. 7,565,332 B1
  • All of the transcoder 106 and synthesizer 107 are distributed over the computer cluster of the distributed file subsystem.
  • the scheduling manager 104 is responsible for the task and resource scheduling and management of the cloud computing framework 103.
  • the function is to determine the number of jobs that need to be executed in parallel according to the source files to be transcoded in the received task information.
  • the number of jobs is divided by the length of time of the source file, and task assignment information is formed and sent to each transcoder 106 and synthesizer 107. That is to say, the transcoder 106 and the synthesizer 107 learn the work that they are responsible for by the received task allocation information, thereby forming a process working module 105.
  • the process working module 105 includes a plurality of transcoders 106 and At least one synthesizer 107.
  • one process working module 105 in the illustration of this embodiment only shows one synthesizer 107, one into The process module 105 generally includes only one synthesizer 107.
  • a process work module 105 may also include a plurality of synthesizers 107.
  • the work of the transcoder 106 is responsible for transcoding a single piece of media. After forming the work module 105 based on the task assignment information, the transcoder 106 obtains the task information from the task manager 101.
  • Table 1 is a schematic diagram of the structure of the task information.
  • the task information may include the type of the task, the location of the file (such as the url address of the source file, the Universal Resource Locator, the uniform resource locator), the starting position of the audio and video, and the duration.
  • the transmission of the transcoding task information of the present invention preferably adopts the asn (Abstract Syntax Notation) protocol.
  • the asn protocol has the advantages of rich and standardized semantic expression and unified coding rules.
  • the communication between the transcoder 106 and the task manager 101 preferably employs the asn protocol, and the illustration of the asn protocol message corresponding to the round-trip communication between the transcoder 106 and the task manager 101 is as follows:
  • the transcoder 106 After acquiring the task information from the task manager 101, the transcoder 106 directly downloads the source file segment from the source data storage module 110 according to the source file storage address and the task allocation information, and then transcodes the source file segment, and then transcodes the source file segment. Save to the upload data storage module 111. Therefore, according to this embodiment of the present invention, it is not necessary to pre-slice the media file, but the slice is placed at the same time as the task of the transcoder 106 is executed, and the transcoding program can read the source file by time offset, so that Increased parallelism and reduced transcoding time.
  • the target format of the slice file can be unified into the mpegts format, which makes processing easier in subsequent merges. It has been proved by experiments that media format transcoding in this format is combined and copied to a container such as mp4, which is only about 0.01%--1% larger than the file size obtained after serial transcoding, at a very small price.
  • the time overhead of the GOP (Group of Pictures) sequence is analyzed during the merging, and the audio and video are not synchronized or jittered.
  • the transcoder 106 downloads the source file fragment from the source data storage module 110, it obtains from the header for multimedia files that can obtain a specific complete header, such as MP4 and TFLV formats. All key frames (the H.264 encoding format is an IDR frame, and the rest are I frames) time points, and then several consecutive GOP partitions that can form a close time T (preferably take 30s) are obtained, and each transcoder 106 is obtained.
  • the processed information including the start time point and the end time point (or a long time slice). For files that cannot obtain the above headers, they are strictly divided into slices for a long time T.
  • the transcoder 106 can directly pull the media segment of the corresponding time period from the source data storage module 110, and the cost of analyzing the video is reduced to an almost negligible degree (because the head of the video file is relative to the video) It is usually small in size).
  • the present invention preferably utilizes a periodic interrupt routine to control CPU usage by: periodically and relatively fine-grained sending a stop process signal (SIGSTOP) and a resume process signal (SIGCONT) to a thread running on each CPU core of the transcoding program.
  • SIGSTOP stop process signal
  • SIGCONT resume process signal
  • the transcoding program is controlled at 80% per logical CPU, so that the normal operation of the storage indexing service process is not affected. In other embodiments, this utilization limit can be set at other suitable values.
  • the synthesizer 107 After all of the transcoders 106 in a process work module 105 have stored the transcoded file segments into the upload data storage module 111, the synthesizer 107 begins executing the tasks. The synthesizer 107 combines the data after transcoding the transcoder 1.06 in the process working module 105 according to the task allocation information sent by the scheduling manager 104 to form a transcoded media file, and stores the uploaded data.
  • the storage module 111 is executing the tasks. The synthesizer 107 combines the data after transcoding the transcoder 1.06 in the process working module 105 according to the task allocation information sent by the scheduling manager 104 to form a transcoded media file, and stores the uploaded data.
  • the storage module 111 The storage module 111.
  • the transcoder 106 stores the transcoded file segment in the upload data storage module 111
  • the corresponding storage address information (the machine, path, and other information of the current audio and video) is sent to the same process.
  • the synthesizer 107 of the module 105, and then the synthesizer 107 obtains the transcoded data from the upload data storage module 111 according to the received storage address information, and synthesizes the data, and then re-uploads the complete media file to the upload.
  • the data storage module 111 is provided for download by the user.
  • the synthesizer 107 can have more than one, for example, for long video files, "tree" can be merged by merging and sorting.
  • the synthesizer 107 and the upload data storage module 111 also belong to the distributed file subsystem and belong to the same group of machines, the synthesizer 107 has a very fast speed for downloading and uploading data from the upload data storage module 111 (similar to LAN data transmission).
  • the synthesizer 107 combines the media slice files based on the computer hard disk/memory I/O. If there is no restriction, the highest value of the disk sequential read and write may be achieved, and the image storage service runs normally. Therefore, in one embodiment, input/output (I/O) control, particularly read/write speed control, can be performed on the merging operation of the synthesizer 107, for example, on a separate model.
  • I/O input/output
  • the present invention provides a breakthrough in the manner in which the shared meta-information is transmitted, i.e., the task of the transcoder 106 and the synthesizer 107 is assigned by the dispatch manager 104, "waking up” and “notifying” each transcoder 106 from the task manager 101. Pulling the part of the task information that you need to transcode, which greatly reduces the amount of data transmission, and at the same time achieves concurrency. That is to say, the embodiment of the present invention also has an important advantage in that several steps that must be serialized in the prior system are turned into parallel.
  • the "viewing angle" is different, the file path form seen by the task manager 101 and the transcoder 106 and the synthesizer 107 is different, and the "real task" of the present invention (the transcoder 106 from the task)
  • the manager 101 acquires the task information) and the "virtual task” (the scheduling manager 104 assigns the task allocation information to the transcoder 106 and the synthesizer 107) separately, and another advantage is to avoid exposing the real path and improving security. Sex.
  • the uploading and downloading of the file may use the http protocol, that is, the communication between the transcoder 106 and the upload data storage module 111, the communication between the transcoder 106 and the source data storage module 110, and the synthesizer 107 and the upload data storage.
  • the communication between modules 111 can use the http protocol. In one embodiment, this can be accomplished by deploying a lightweight, protocol-compliant server on the respective storage server.
  • the storage server 108 of the present embodiment is illustrated as including a source data storage module 110 and an upload data storage module 111, which are divided by the type of the stored file (untranscoded and transcoded) for convenience of explanation. But in the actual structure, the source data storage module 110 and the upper The data storage module 111 is distributed on the cluster of the distributed file system, and usually does not need to clearly divide the storage space of the two, but can be adjusted according to actual needs.
  • the streaming media server 109 is not an essential component of the present invention for receiving media fragments that are transcoded by the transcoder 107 in real time and for transmission to the client.
  • the streaming media server 109 can be immediately sent a status message to notify the streaming media server 109 to download the transcode from it.
  • the media shards are immediately sent to the user as streams or files, thus enabling the "side-by-side" requirements and lowering the user wait time.
  • Traditional MapReduce systems do not meet real-time requirements. The present invention accomplishes this by deploying the system on a storage machine, in addition to the mechanisms described above.
  • the synthesizer 107 may not be necessary for the synthesizer 107 to merge files, or the merged files do not need to be copied into a specific package format, and the synthesizer 107 can do less or Do not work. This selection may be determined by a specific field in the task information output by the task manager 101 (as in the "type" field in Table 1).
  • the invention also provides a distributed file device, which comprises the above source data storage module, an upload data storage module, a plurality of transcoders, and may comprise at least one synthesizer.
  • the structure, function and working principle of the distributed file device are the same as those of the distributed file subsystem of the cloud transcoding system for multiplexing the idle computing resources, and are not described here.
  • the present invention also provides a cloud transcoding method for multiplexing idle computing resources. Referring to FIG. 3, steps S301-S303, and may further include step S304.
  • the task information may include, for example, the type of the file to be transcoded, the location of the file (eg, source text) The url address of the piece), the starting position of the audio and video, the duration, and so on.
  • S302 Generate task allocation information according to the task information.
  • the purpose of generating task assignment information is to determine the number of jobs that the file to be transcoded needs to be executed in parallel; in one embodiment, the number of jobs is divided by the length of time of the source file.
  • the distributed processor and distributed disk described herein are the processors and disks of the distributed file system, that is, the distributed processor and the distributed disk belong to the same group of server clusters. Since the computer storing the media file has a large number of free CPUs, the present invention utilizes the CPU of the space to perform the transcoding work, which not only saves a lot of cost, but also can be transcoded near the storage point of the file, thereby greatly improving the transcoding efficiency. .
  • the transfer of the transcoding task information preferably uses the asn protocol, which has the advantages of rich and standardized semantic expression and unified coding rules.
  • Table 1 is a schematic diagram of the structure of the task information.
  • the file upload and download is preferably implemented using the http protocol, which can be achieved by deploying a lightweight, corresponding protocol server on the corresponding storage server.
  • the transcoding work utilizes the idle CPU resources of the storage machine, it can be transcoded at the storage point of the source file (similar to the data transmission between the local networks), and the off-site pull is greatly reduced compared with the prior art. Time and bandwidth consumption of the source file.
  • the CPU utilization can be accurately controlled to control the CPU usage within a preset range.
  • the CPU usage is controlled by a periodic interrupt program, which is: a thread running on each CPU core of the transcoding program.
  • the stop process signal (SIGSTOP) and the resume process signal (SIGCONT) are sent periodically and finely, and the CPU usage of the program is controlled by controlling the ratio of the length of time between the two, and can also be performed on a multi-logic CPU.
  • the transcoding program is controlled to 80% or other suitable value in each logical CPU, so as to ensure that the normal operation of the storage indexing service process is not affected.
  • the transcoded data is combined according to the task information and the allocation information to form a transcoded media file, and saved to a distributed disk.
  • the process of merging the transcoded data may be: first obtaining storage address information of the transcoded data in the distributed disk; and then acquiring corresponding transcoded data in the distributed disk according to the storage address information. The data after the transcoding is then combined.
  • the data is read from the distributed disk, and then merged and stored in the distributed disk again.
  • This series of actions are completed by the CPU and memory of the same group of machines, so the file upload and download are very fast.
  • Speed (similar to LAN data transfer).
  • the merge operation of the media shard file is based on the calculation of the disk/memory I/O. If there is no restriction, the highest value of the disk sequential read and write may be achieved, and the image storage service runs normally. Therefore, I/O control can be performed on the merge operation of the synthesizer 107, for example, on a separate model.
  • the implementation of I/O control is similar to the way CPU usage control is described above.
  • the invention utilizes the CPU of the storage server to complete the distributed transcoding, which not only saves the hardware cost, fully utilizes the existing resources, but also greatly accelerates the data transmission and copying, and improves the transcoding efficiency.

Abstract

一种用于计算机网络中的转码方法包括:由所述计算机网络中的任务管理器接收转码任务,所述转码任务具有任务信息;根据所述任务信息生成任务分配信息;根据所述任务分配信息,分别获取媒体文件的相应媒体片段的源数据,由多个转码器将所述源数据并行转码成目标格式的数据,并保存到所述计算机网络中的存储服务器,其中,所述转码器包括所述存储服务器的处理器。利用存储服务器空闲的CPU完成分布式转码,不仅节省了硬件成本,充分利用了现有资源,而且大大加快了数据的传输和拷贝,提高了转码效率。

Description

转码方法及系统、 分布式文件装置 技术领域
本发明涉及一种用于计算机网络中的转码方法及系统、 分布式文件 装置。 背景技术
邮箱文件中转站、 离线下载等业务有大量的各种格式的视频等媒体文 件, 当用户需要在线使用个人计算机或手机等终端播放时, 需要先下载文 件, 然后将下载的文件转码成手机终端或者播放器等支持的格式才可以观 看。
为了让用户端无需转码而直接可以在线播放, 各大视频业务公司的做 法是购置专用的视频转码服务器以及专用的存储服务器, 服务端将数据传 送到视频转码服务器进行转码, 再把转码后的视频文件传送到存储服务器 储存, 以供用户下载。 这种离线转码的方式让用户端下载视频文件后无需 进行转码, 可以直接通过终端或页面进行播放。
但是上述方式中, 视频转码服务器一般是采取串行转码, 转码一部影 片往往需要数十分钟, 而且期间的多次文件传输(先由服务端传输给视频 转码服务器, 再由视频转码服务器传输给存储服务器, 最后由存储服务器 传输给用户端)也会付出较长的时间代介。
为了提高转码效率, 业界已经提出了一些相关技术。 然而, 另一方面, 这些相关技术中的设计均未考虑转码和存储之间的关系, 均需要专门的硬 件来做分割、 转码与合并操作, 增加了硬件成本, 也增加了转码复杂程度。 此外, 许多现有分布式转码系统均 ^^于 C/S ( Client/Server, 用户端 /服务 器)模式, 只要稍稍改变系统中机器数目, 分布式程序就要重新编码部署, 可扩展性差。 转码和合并机器上的 CPU、 I/O负载难以控制。
综上所述, 现有的网络音视频转码方式存在耗时多、 效率低、 硬件成 本高、 拓展能力差等问题。 发明内容
本发明提供了一种用于计算机网络中的转码方法及系统, 能够复用 空闲计算资源。 根据本发明的实施例能够解决现有的网络音视频转码方 式存在耗时多、 效率低、 硬件成本高、 拓展能力差等问题中的一部分或全 部。 本发明的实施例可以方便地根据需要调整规模, 既适用于由少量计算 机组成的计算集群, 也适于在由大量计算机构成的云环境下作为一种云转 码方法。
根据本发明的一种实施例, 提供了一种用于计算机网络中的转码 方法, 包括: 由所述计算机网络中的任务管理器接收转码任务, 所述 转码任务具有任务信息; 根据所述任务信息生成任务分配信息; 根据 所述任务分配信息, 分别获取媒体文件的相应媒体片段的源数据, 由 多个转码器将所述源数据并行转码成目标格式的数据, 并保存到所述 计算机网络中的存储服务器, 其中, 所述转码器包括所述存储服务器 的处理器。 根据本发明的另一种实施例, 提供了一种用于计算机网络中的转 码系统, 包括: 任务管理器, 用于接收转码任务, 所述转码任务具有 任务信息; 调度管理器, 用于根据所述任务信息生成任务分配信息; 存储服务器, 所述存储服务器用于存储对媒体文件转码后的目标格式 的数据, 其中, 所述存储服务器的处理器作为多个转码器, 用于根据 所述任务信息以及所述任务分配信息, 分别获取所述媒体文件的相应 媒体片段的源数据, 并转码成 II标格式的数据。
根据本发明的再一种实施例, 提供了一种分布式文件装置, 包括 存储服务器和多个转码器。 其中, 存储服务器包括: 源数据存储模组, 用于存放源数据; 上传数据存储模组, 用于存放转码后的数据。 转码 器用于根据接收到的任务信息以及任务分配信息, 分别从所述源数据 存储模组中获取媒体文件的相应媒体片段的源数据, 并转码成目标格 式的数据。 其中, 所述转码器包括所述存储服务器的处理器。
上述技术方案将转码的工作构建在具有空闲计算资源的音视频存储服 务器上, 充分利用了现有资源, 大大节约了硬件成本。
另外, 不需要对媒体文件进行预切片, 而是把切片放在了转码任务执 行的同时时完成, 这样提高了并行度, 能有效降低转码时间。
另夕卜, 在分片转码和分片合成阶段,分别实现对 CPU占用和硬盘 /内存 的精确控制, 防止影响现网机器的原有服务。
另外, 对于特定业务场景, 还可较容易地通过修改参数, 满足传统
MapReduce系统不能满足的一定实时性的要求。
另外, 系统具有良好的可扩展行,通过分布式文件系统和 /或网络协议, 理论上可处理无限量的视频数据,现有系统已证实可以处理 PB级别的音视 频资源。
另外, 转码工作在存储机器上完成, 避免了大部分数据传输 /拷贝, 效 果接近于本地计算, 实现了 "计算向存储迁移" 这个云计算的理想目的。
另外, 可以对转码任务、 每个转码器获得的分片任务、 每个转码器分 片任务里的各个工作线程实现精确控制, 可以有效避免影响存储服务器的 现网服务。
当然, 实施本发明的任一产品并不一定需要同时达到以上所述的所有 优点。
上述说明仅是本发明技术方案的概述, 为了能够更清楚了解本发明的 技术手段, 而可依照说明书的内容予以实施, 并且为了让本发明的上述和 其他曰的、 特征和优点能够更明显易懂, 以下特举较佳实施例, 并配合附 图, 详细说明如下。 附图说明
图 1为本发明实施例的一种复用空闲计算资源的云转码系统的架构 图;
图 2为本发明实施例的一种进程工作模组的工作示意图;
图 3为本发明实施例的一种复用空闲计算资源的云转码方法的流程 图。 具体实施方式
为更进一步阐述本发明达成预定发明目的所采取的技术手段及功效,以 下结合附图及较佳实施例,对依据本发明提出的转码方法及系统、 分布式 文件装置其具体实施方式、 方法、 步骤及功效, 详细说明如后。
有关本发明的前述及其他技术内容、 特点及功效, 在以下配合参考图 式的较佳实施例详细说明中将可清楚的呈现。 通过具体实施方式的说明, 当可对本发明为达成预定目的所采取的技术手段及功效得以更加深入且具 体的了解, 然而所附图式仅是提供参考与说明之用, 并非用来对本发明加 以限制。
以下的说明将以云转码环境为例。 云转码是基于云计算和云存储平台 进行的媒体转码。 云计算是一种基于互联网的计算方式, 通过这种方式, 共享的软硬件资源和信息可以按需求提供给计算机和其他设备。 云存储是 云计算的存储部分, 即虛拟化的、 易于扩展的存储资源池; 用户通过云计 算使用存储资源池, 但并非所有的云计算的存储部分都是可以分离的。 但 是应当注意, 本发明的实施例可以方便地根据需要调整规模, 不仅适用于 由大量计算机构成的云环境, 也适用于由少量计算机组成的计算集群。
I/O (硬盘 /内存)密集型机器指的是系统的 CPU效能相对硬盘 /内存的效 能要好 4艮多, 即系统运作的大部分的状况是 CPU在等待 I/O的读 /写, CPU 占用率较低。 本发明主要思想的出发点是考虑到转码后的音视频文件的存 储所在地- -存储服务器(通常由大量存储机器的集群构成)一由于只起到 存储数据的作用, 因而有大量 CPU空闲的存储机器, 这些机器因为是 I/O 密集型机器, 其 CPU利用率一般低于 20%, 如果使用这些空闲 CPU进行 转码, 可以节约大量成本, 还可以在文件的存储点就近转码, 减少异地拉 取的时间、 带宽消耗。 不仅可以节省硬件成本, 充分利用现有资源, 还可 以实现云计算的理想目标一 "计算向存储迁移"。
此外, 本发明涉及的分布式文件系统(Distributed File System )是指文 件系统管理的物理存储资源不一定直接连接在本地节点上, 而是通过计算 机网络与节点相连。 从内部实现来看, 分布式的系统不再和普通文件系统 一样负责管理本地磁盘, 它的文件内容和目录结构都不是存储在本地磁盘 上, 而是通过网络传输到远端系统上。 并且, 同一个文件存储不只是在一 台机器上, 而是在一簇机器上分布式存储, 协同提供服务, 正所谓分布式。 与单机的文件系统不同, 分布式文件系统不是将这些数据放在一块磁盘上, 由上层操作系统来管理。 而是存放在一个服务器集群上, 由集群中的服务 器, 各尽其责, 通力合作, 提供整个文件系统的服务。 因此, 使用分布式 转码, 可以近似线性的降低转码耗时, 提高用户体验, 并且分布式计算框 架的资源管理、 调度方案能有效的利用硬件资源, 降低故障的影响。 本发 明中所述的分布式文件子系统及相应的管理方法优选采用申请号为 200710307132.9的中国专利 "分布式系统、 分布式业务处理方法及相关装 置" 中所揭示的的分布式系统及相应的处理方法。
请参见图 1,其为本发明实施例的一种复用空闲计算资源的云转码系 统的架构图, 其包括: 任务管理器 101、 任务提交客户端 102、 调度管 理器 104 以及分布式文件子系统。 该系统还可以进一步包括流化媒体 服务器 109。 任务提交客户端 102与任务管理器 101连接, 任务管理 器 101、 调度管理器 104和流化媒体服务器 109均与分布式文件子系 统连接。 其中分布式文件子系统又进一步包括: 存储服务器 108 (包括 源数据存储模组 110、 上传数据存储模组 111 ) 和多个转码器 106, 并 可以视情况包括至少一个合成器 107。 如下所述, 尽管图 1 中从功能 角度将存储服务器 108与转码器 106图示为不同的部件, 但是在实际 系统中, 由存储服务器 108的处理器被用作转码器 106。
任务管理器 101接到转码任务(Transcoding Job )后, 首先把任务 信息发给任务提交客户端 102, 由任务提交客户端 102来提交任务。 任务提交客户端 102将任务信息提交给调度管理器 104。 调度管理器 104 根据接收到的任务信息生成任务分配信息 ( task dispatch information ) , 并发送给各个转码器 106和合成器 107。
转码器 106、 合成器 107以及调度管理器 104形成了一个云计算 框架 103 , 其优选采用 MapReduce框架(如专利号为 US7650331B1的 美国专利中公开的 Map/Reduce分布式处理框架)及其变种实现, 或者 也可以釆用开源的 Hadoop框架、 Sector/Sphere框架、 Typhoon框架等。 其中所有的转码器 106和合成器 107都分布在分布式文件子系统的计 算机机群上。
请结合参见图 2, 调度管理器 104 负责云计算框架 103的任务、 资源的调度和管理, 其作用是根据接收到的任务信息中待转码的源文 件, 确定需要并行执行的工作数(优选通过源文件的时间长度来划分 工作数) , 并形成任务分配信息发送给各个转码器 106和合成器 107。 也即是说, 转码器 106和合成器 107通过接收到的任务分配信息获知 自身负责的工作, 从而形成进程工作模组 105 , —个进程工作模组 105 中包括多个转码器 106和至少一个合成器 107。 为便于描述, 本实施 例的图示中一个进程工作模组 105仅绘示了一个合成器 107, —个进 程工作模组 105通常情况下仅包含一个合成器 107即可, 特殊时候如 任务控制不精确的情况下, 一个进程工作模组 105也可以包含多个合 成器 107。 转码器 106的工作是负责转码一个个媒体片段。 在根据任务分配 信息形成工作模组 105之后, 转码器 106会从任务管理器 101处获取 任务信息。 表 1为一种任务信息的结构示意, 任务信息可以包括任务的类 型、 文件的位置(如源文件的 url地址, Universal Resource Locator, 统一资 源定位符)、 音视频的起始位置、 时长等。
Figure imgf000009_0002
Figure imgf000009_0001
本发明转码任务信息的传递优选采用 asn (抽象语法标记, Abstract Syntax Notation )协议。 asn协议具有丰富且规范的语义表达和统一的编码 规则等优点。 转码器 106和任务管理器 101之间的通讯优选采用 asn协 议,转码器 106与任务管理器 101往返通信对应的 asn协议消息的示意如 下所示:
ReqDTranscodeSubmitTask:: = SEQUENCE
{
appid INTEGER, —业务类型(video-hls:0, ftn-mail:l, ftn-xuanfeng:2)
filename OCTET STRING,
filetype OCTET STRING, 目的格式 (mp4|flv|Ms)
profile INTEGER, 编码配置
rsptype INTEGER, 是否回复结果 (;成功提交即返回 :0, 转码 完成返回: 1);
reserved OCTET STRING
}
RspDTranscodeSubmitTask:: = SEQUENCE
{
retcode INTEGER,
retmsg OCTET STRING,
reserved OCTET STRING
转码器 106从任务管理器 101获取任务信息后, 根据其中的源文 件存储地址以及任务分配信息, 直接从源数据存储模组 110 中下载源 文件片段,接着对源文件片段进行转码,然后保存到上传数据存储模组 111 中。 因此, 根据本发明的该实施例, 不需要对媒体文件进行预切片, 而 是把切片放在了转码器 106任务执行的同时完成, 转码程序可以按时间偏 移读取源文件, 这样提高了并行度, 能有效降低转码时间。 由于 mepgts格 式具有可以自由合并的属性, 片文件的目标格式可以统一为 mpegts格式, 这样在后续合并的时候处理更简单。 经实验证明, 这种格式的媒体分片转 码再合并, 拷贝到 mp4等容器后得到的文件只比串行转码后得到的文件体 积大约 0.01%--1% , 以极小的代价换取了合并时分析 GOP ( Group of Pictures, 画面组)序列的时间开销, 且媒体不会出现音视频不同步、 抖动 等现象。
转码器 106从源数据存储模组 110中下载源文件片段时, 对于能够 获得特定完整头部的多媒体文件, 比如 MP4和 TFLV格式, 则从头部获得 所有关键帧(H.264编码格式为 IDR帧, 其余为 I帧)时间点, 然后按连续 若干个能够组成接近时间 T (实现时优选取 30s ) 的若干 GOP划分, 获得 各个转码器 106要处理的信息, 包括起始时间点和结束时间点 (或片长时 间)。 对于不能获得上述头部的文件, 则严格按片长时间 T划分。 这种方式 使得转码器 106可以直接从源数据存储模组 110中拉取相应时间段的 媒体片段, 而分析视频的代价降到几乎可以忽略的程度(因为视频文件的 头 (head )相对视频大小而言一般很小)。
由于转码器 106的转码工作是利用了存储机器的空闲 CPU资源, 因 而可以在源文件的存储点就近转码(类似于局域网之间的数据传输), 相对 于现有技术, 大大缩减了异地拉取源文件的时间和带宽消耗。 但是, 为了 不影响存储业务的正常运行, 可以在 CPU 资源的利用上做精确控制, 将 CPU 占用率控制在预设范围内。 本发明优选利用周期性的中断程序控 制 CPU占用率, 具体做法是: 对转码程序在各个 CPU核心上运行的线程 周期性且比较细粒度地发送停止进程信号 (SIGSTOP ) 和恢复进程信号 ( SIGCONT ), 通过控制两者之间的时间长度比例来控制程序的 CPU占用 率, 同时也可以做到在多逻辑 CPU上的负载均衡。 本系统的示例性具体实 现中, 把转码程序在每个逻辑 CPU的利用率都控制在了 80%, 这样就可以 保证不会影响存储索引服务进程的正常运行。 在其他实施例中, 这一利用 率的限制可以设定在其他合适的值。此外,在精确控制 CPU利用率的同时, 可以用实验确定每种不同类型服务器的最佳转码线程数, 并把转码线程绑 定到特定逻辑 CPU, 这样防止了转码线程在不同逻辑 CPU之间发生漂移, 充分利用了高速緩冲存储器 (cache )和数据和指令流水线(pipeline ), ― 定程度上提高了性能。
一个进程工作模组 105中的所有转码器 106都将转码完成的文件 片段存入上传数据存储模组 111之后, 合成器 107开始执行任务。 合 成器 107根据调度管理器 104发送来的任务分配信息, 将其所在进程 工作模组 105中的转码器 1.06转码后的数据进行合并, 形成转码后的 媒体文件, 并存入上传数据存储模组 111。
具体来说,在转码器 106将转码完成的文件片段存入上传数据存储 模组 111后, 会将相应的存储地址信息 (当前音视频所在机器、 路径和 其它信息)发送给同一进程工作模组 105的合成器 107,然后合成器 107 根据接收到的存储地址信息从上传数据存储模组 111 中获取转码后的 数据, 并进行合成, 然后将完整的媒体文件封装后重新上传到上传数 据存储模组 111中, 以供用户下载。
特别的, 一个进程工作模组 105 中, 合成器 107可以不止一个, 比 如对于长视频文件, 可以通过归并排序的方式进行 "树形', 合并。
由于合成器 107和上传数据存储模组 111也都属于分布式文件子系 统, 属于同一组机群, 因而合成器 107从上传数据存储模组 111 中下 载和上传数据都具有很快的速度 (类似于局域网的数据传输) 。 合成 器 107对媒体分片文件的合并操作是基于计算机硬盘 /内存 I/O的,不加限 制的话可能会达到磁盘顺序读写的最高值, 影像存储业务的正常运行。 所 以, 在一种实施例中, 可以对合成器 107的合并操作进行输入 /输出 (I/O ) 控制, 尤其是读写速度控制, 例如可以在单独的机型上进行。
值得注意的是, 因为一个云计算框架 103 (即 Map/Reduce集群) 中 可能同时在处理几十甚至上百个转码任务, 如果把每个转码任务中每个转 码器 106和合成器 107所要处理的任务的详细信息都发送到任务提交客 户端 102, 再发送到调度管理器 104, 再由其派发到每个转码器 106和合 成器 107所在机器的话, 则数据的传输量可能会很大, 影响效率。 本发明 突破性地引入了发送共用元信息的方式, 即由调度管理器 104分配好转码 器 106和合成器 107的任务, "唤醒" 并 "通知" 各个转码器 106从任 务管理器 101上拉取自己所需转码的那一部分任务信息, 从而大大减少了 数据传输量, 且同时做到了并发。 也即是说, 本发明的实施例还具有一个 重要优点, 就是把以往系统中的必须串行的几个步骤, 都变成了并行。
另一方面, 因为 "视角" 不同, 任务管理器 101和转码器 106、 合成 器 107看到的文件路径形式是不一样的, 本发明的这种 "实任务"(转码器 106从任务管理器 101获取任务信息)和 "虚任务" (调度管理器 104向 转码器 106和合成器 107分配任务分配信息)分开的方式, 另一种好处 是避免把真实的路径暴露在外, 提高安全性。
文件的上传下载可以采用 http协议, 即转码器 106与上传数据存储 模组 111之间的通讯、转码器 106与源数据存储模组 110之间的通讯、 以及合成器 107与上传数据存储模组 111之间的通讯均可以采用 http 协议。 在一种实施例中, 这可以通过在相应存储服务器上部署轻量级的相 应协议的服务器来实现。
本实施例的存储服务器 108被图示为包括源数据存储模组 110和上传 数据存储模组 111 , 这是为了便于说明而以所存文件的类型 (未转码 和已转码) 进行划分的。 但在实际结构中, 源数据存储模组 110和上 传数据存储模组 111 均是分布在分布式文件之系统的机群上的, 通常 是无需明显划分两者的存储空间, 而可以根据实际需要来进行调整。
流化媒体服务器 109对于本发明来说并非一个必须的部件, 其用于实 时接收所述转码器 107 转码完成的媒体片段, 并发送给用户端。 在某 些有实时性要求的场合, 当前面若干个转码器 107完成转码工作之后, 可 立即给流化媒体服务器 109发送状态消息, 通知流化媒体服务器 109从其 上下载转码完成的媒体分片, 立即以流或文件的方式发送给用户, 这样就 可实现 "边看边下" 等要求, 而且把用户等待时间降到更低。 传统的 MapReduce 系统并不能满足实时性的要求。 本发明通过把系统部署在存储 机器上, 外加上述机制可以实现这一需求。 而在这种 "边看边下" 的情况 下, 可能并不需要合成器 107合并文件, 或者合并后的文件并不需要再拷 贝成特定的封装格式, 这时合成器 107就可以少做或不做工作。 这种选择 可以是通过任务管理器 101输出的任务信息中的特定字段来决定的(如表 1中的 "type" 字段)。
本发明还提出一种分布式文件装置, 其包括上述源数据存储模组、 上传数据存储模组、 多个转码器, 并可以包括至少一个合成器。 该分 布式文件装置的结构、 功能及工作原理与前述复用空闲计算资源的云 转码系统的分布式文件子系统相同, 在此不再赘述。
本发明还提出一种复用空闲计算资源的云转码方法, 请参见图 3 , 其步骤 S301 - S303, 并可以进一步包括步骤 S304。
S301 , 接收转码任务, 所述转码任务具有任务信息。
任务信息例如可以包括待转码媒体文件的类型、 文件的位置 (如源文 件的 url地址)、 音视频的起始位置、 时长等。
5302, 根据所述任务信息生成任务分配信息。
生成任务分配信息的目的是确定待转码的文件需要并行执行的工 作数; 在一种实施例中, 通过源文件的时间长度来划分工作数。
5303 ,根据所述任务信息以及所述任务分配信息,从分布式磁盘中 分别获取相应媒体片段的源数据, 通过分布式处理器并行转码成目标 格式的数据后保存到分布式磁盘。
这里所述的分布式处理器和分布式磁盘即为分布式文件系统的处理 器和磁盘, 即分布式处理器和分布式磁盘均属于同一组服务器机群。 由于 存储媒体文件的计算机上有大量空闲的 CPU, 所以本发明利用这部分空间 的 CPU进行转码工作, 不仅节约了大量成本, 还可以在文件的存储点就近 转码, 大大提高了转码效率。
本发明中转码任务信息的传递优选釆用 asn协议, asn协议具有丰富且 规范的语义表达和统一的编码规则等优点。 表 1是任务信息的结构示意。 而文件的上传下载优选釆用 http协议, 这可以通过在相应存储服务器上部 署轻量级的相应协议的服务器来实现。
此外, 由于转码工作是利用了存储机器的空闲 CPU资源, 因而可以 在源文件的存储点就近转码(类似于局域网之间的数据传输), 相对于现有 技术, 大大缩减了异地拉取源文件的时间和带宽消耗。 为了不影响存储业 务的正常运行, 可以在 CPU资源的利用上 4故精确控制, 将 CPU占用率控 制在预设范围内。 在本发明的一种实施例中, 利用周期性的中断程序控 制 CPU占用率, 具体做法是: 对转码程序在各个 CPU核心上运行的线程 周期性且比较细粒度地发送停止进程信号 (SIGSTOP ) 和恢复进程信号 ( SIGCONT ), 通过控制两者之间的时间长度比例来控制程序的 CPU占用 率, 同时也可以做到在多逻辑 CPU上的负栽均衡。 在具体实现中, 把转码 程序在每个逻辑 CPU的利用率都控制在了 80%或其他合适的值, 这样就可 以保证不会影响存储索引服务进程的正常运行。 此外, 在精确控制 CPU利 用率的同时, 可以用实验确定每种不同类型服务器的最佳转码线程数, 并 把转码线程绑定到特定逻辑 CPU,这样防止了转码线程在不同逻辑 CPU之 间发生漂移, 充分利用了高速緩冲存储器 (cache )和数据和指令流水线 ( pipeline ), 一定程度上提高了性能。
在可选的步骤 S304, 根据所述任务信息以及所述分配信息, 将转码 后的数据进行合并, 形成转码后的媒体文件, 并保存到分布式磁盘。
将转码后的数据进行合并的过程具体可以为: 先获取转码后的数 据在分布式磁盘中的存储地址信息; 接着根据所述存储地址信息获取 分布式磁盘中相应的转码后的数据; 然后所述将转码后的数据进行合 并。
合并过程中, 从分布式磁盘中读取数据, 合并后再次存入分布式磁 盘, 这一系列的动作均是由同一组机群的 CPU和存储器完成, 因而文 件的上传和下载都具有很快的速度 (类似于局域网的数据传输) 。 对 媒体分片文件的合并搡作是基于计算才 更盘 /内存 I/O的, 不加限制的话可 能会达到磁盘顺序读写的最高值, 影像存储业务的正常运行。 所以, 可以 对合成器 107的合并操作进行 I/O控制, 例如在单独的机型上进行。 I/O控 制的实现方式类似于上文所述 CPU占用率控制的方式。 此外, 在一些有实时性要求的场合(如用户需要边看边下载), 可以根 据任务信息中的特定字段(如表 1中的 "type" 字段), 在媒体片段的源数 据转码完成后, 可以直接以流或文件的方式发送给用户端, 这样就可实 现 "边看边下" 等要求, 而且把用户等待时间降到更低。 而在这种 "边看 边下" 的情况下, 可能并不需要合并文件, 或者合并后的文件并不需要再 拷贝成特定的封装格式, 这时就可以少做或不做工作, 进一步减少 CPU的 负担。
本发明利用存储服务器空闲的 CPU完成分布式转码, 不仅节省了硬件 成本, 充分利用了现有资源, 而且大大加快了数据的传输和拷贝, 提高了 转码效率。
以上所述, 仅是本发明的较佳实施例而已, 并非对本发明作任何形式 上的限制, 虽然本发明已以较佳实施例揭露如上, 然而并非用以限定本发 明, 任何熟悉本专业的技术人员, 在不脱离本发明技术方案范围内, 当可 利用上述揭示的技术内容作出些许更动或修饰为等同变化的等效实施例, 但凡是未脱离本发明技术方案内容, 依据本发明的技术实质对以上实施例 所作的任何简单修改、 等同变化与修饰, 均仍属于本发明技术方案的范围 内。

Claims

权 利 要 求 书
1、 一种用于计算机网络中的转码方法, 包括:
由计算机网络中的任务管理器接收转码任务, 所述转码任务具有 任务信息;
根据所述任务信息生成任务分配信息;
根据所述任务分配信息, 分别获取媒体文件的相应媒体片段的源 数据, 由多个转码器将所述源数据并行转码成目标格式的数据, 并保 存到所述计算机网络中的存储服务器,
其中, 所述转码器包括所述存储服务器的处理器。
2、 如权利要求 1所述的方法, 还包括: 根据所述任务信息以及所 述任务分配信息, 将转码后的数据进行合并, 形成转码后的媒体文件。
3、 如权利要求 2所述的方法, 其中, 所述将转码后的数据进行合 并的步骤包括:
获取转码后的数据在所述存储服务器中的存储地址信息; 根据所述存储地址信息获取所述存储服务器中相应的转码后的数 据;
将所获取的转码后的数据进行合并。
4、 如权利要求 1所述的方法, 其中, 所述存储服务器中数据的上 传与下载的通讯采用 http协议。
5、 如权利要求 1所述的方法, 其中, 所述根据所述任务信息生成 任务分配信息的步骤包括:
根据任务信息中源文件的时间长度确定需要执行的并行工作数, 并形成所述任务分配信息。
6、如权利要求 1所述的方法,其中,所述任务信息的传递采用 asn 协议。
7、 如权利要求 1所述的方法, 还包括: 实时将转码完成的媒体片 段发送给用户端。
8、 如权利要求 1所述的方法, 其中, 在进行转码时, 将转码对所 述处理器的占用率控制在预设范围内。
9、 如权利要求 8所述的方法, 其中, 将所述占用率控制在预设范 围内的步骤包括: 对所述处理器的各个核心上运行的转码线程周期性 的发送停止进程信号和恢复进程信号, 并通过控制所述停止进程信号 和所述恢复进程信号之间的时间长度, 将所述占用率控制在预设范围 内。
10、 如权利要求 2所述的方法, 其中, 在进行数据合并时, 对硬 盘 /内存的读写速度进行控制。
11、 如权利要求 10所述的方法, 其中, 将转码后的数据进行合并 的步骤是在与进行转码的计算机不同的单独计算机上进行的。
12、 如权利要求 1所述的方法, 其中, 所述媒体片段是在不对所 述媒体文件进行预切片的情况下根据所述任务信息和所述任务分配信 息直接从所述媒体文件读取的。
13、 如权利要求 1所述的方法, 其中, 所述任务信息包括下述一 项或多项: 任务的类型、 媒体文件的位置、 媒体片段的起始位置、 媒 体片段的时长。
14、 一种用于计算机网络中的转码系统, 包括: 任务管理器, 用于接收转码任务, 所述转码任务具有任务信息; 调度管理器, 用于根据所述任务信息生成任务分配信息; 存储服务器, 所述存储服务器用于存储对媒体文件转码后的目标 格式的数据,
其中, 所述存储服务器的处理器作为多个转码器, 用于根据所述 任务信息以及所述任务分配信息, 分别获取所述媒体文件的相应媒体 片段的源数据, 并转码成目标格式的数据。
15、 如权利要求 14所述的转码系统, 还包括: 至少一个合成器, 且至少一个合成器与多个转码器形成一个进程工作模组, 所述合成器 用于根据所述任务分配信息, 将所在进程工作模组中的转码器转码后 的数据进行合并, 形成转码后的媒体文件。
16、 如权利要求 15所述的转码系统, 其中, 所述转码器将转码后 的数据存入所述存储服务器并将相应的存储地址信息发送给同一进程 工作模组的合成器, 所述合成器通过所述存储地址信息从所述存储服 务器中获取相应的转码后的数据, 并进行合成。
17、 如权利要求 14所述的转码系统, 其中, 所述转码器与所述存 储服务器之间的通讯以及所述合成器与所述存储服务器之间的通讯采 用 http协议。
18、 如权利要求 14所述的转码系统, 其中, 所述调度管理器根据 任务信息中源文件的时间长度确定需要执行的并行工作数, 以形成所 述任务分配信息。
19、 如权利要求 14所述的转码系统, 其中, 所述转码器和所述任 务管理器之间的通讯采用 asn协议。
20、 如权利要求 14所述的转码系统, 其中, 还包括:
流化媒体服务器,用于实时接收所述转码器转码完成的媒体片段, 并发送给用户端。
21、 如权利要求 14所述的转码系统, 其中, 所述转码器在进行转 码时的处理器占用率被控制在预设范围内。
22、 如权利要求 21所述的转码系统, 其中, 所述转码器利用周期 性的中断程序控制所述占用率。
23、 如权利要求 15所述的转码系统, 其中, 在所述合成器进行数 据合并时, 硬盘 /内存的读写速度受到控制。
24、 如权利要求 23所述的转码系统, 其中, 所述合成器为所述计 算机网络中单独的计算机。
25、 一种分布式文件装置, 包括:
存储服务器, 包括:
源数据存储模组, 用于存放源数据;
上传数据存储模组, 用于存放转码后的数据;
多个转码器, 用于根据接收到的任务信息以及任务分配信息, 分 别从所述源数据存储模组中获取媒体文件的相应媒体片段的源数据, 并转码成目标格式的数据,
其中, 所述转码器包括所述存储服务器的处理器。
26、 如权利要求 25所述的分布式文件装置, 还包括至少一个合成 器, 且至少一个合成器与多个转码器形成一个进程工作模组, 所述合 成器用于根据所述任务分配信息, 将所在进程工作模组中的转码器转 码后的数据进行合并, 形成转码后的媒体文件。
27、 如权利要求 25所述的分布式文件装置, 其中, 所述转码器将 转码后的数据存入所述上传数据存储模组并将相应的存储地址信息发 送给同一进程工作模组的合成器, 所述合成器通过所述存储地址信息 从所述上传数据存储模组中获取相应的转码后的数据, 并进行合成。
28、 如权利要求 26所述的分布式文件装置, 其中, 所述转码器与 所述上传数据存储模组之间的通讯、 所述转码器与所述源数据存储模 组之间的通讯、 以及所述合成器与所述上传数据存储模组之间的通讯 采用 http协议。
29、 如权利要求 25所述的分布式文件装置, 其中, 所述任务分配 信息是通过根据任务信息中源文件的时间长度确定需要执行的并行工 作数而形成的。
30、 如权利要求 25所述的分布式文件装置, 其中, 所述转码器在 进行转码时的处理器占用率被控制在预设范围内。
31、 如权利要求 30所述的分布式文件装置, 其中, 所述转码器利 用周期性的中断程序控制所述占用率。
32、 如权利要求 25所述的分布式文件装置, 其中, 在所述合成器 进行数据合并时, 硬盘 /内存的读写速度受到控制。
33、 如权利要求 32所述的分布式文件装置, 其中, 所述合成器为 所述分布式文件装置中单独的计算机。
PCT/CN2013/085388 2012-11-27 2013-10-17 转码方法及系统、分布式文件装置 WO2014082505A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US14/711,928 US10291673B2 (en) 2012-11-27 2015-05-14 Transcoding method and system, and distributed file apparatus

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201210490708.0A CN103838779B (zh) 2012-11-27 2012-11-27 复用空闲计算资源的云转码方法及系统、分布式文件装置
CN201210490708.0 2012-11-27

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US14/711,928 Continuation US10291673B2 (en) 2012-11-27 2015-05-14 Transcoding method and system, and distributed file apparatus

Publications (1)

Publication Number Publication Date
WO2014082505A1 true WO2014082505A1 (zh) 2014-06-05

Family

ID=50802288

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2013/085388 WO2014082505A1 (zh) 2012-11-27 2013-10-17 转码方法及系统、分布式文件装置

Country Status (3)

Country Link
US (1) US10291673B2 (zh)
CN (1) CN103838779B (zh)
WO (1) WO2014082505A1 (zh)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104168488A (zh) * 2014-08-29 2014-11-26 北京奇艺世纪科技有限公司 一种视频转码方法及装置
CN104967619A (zh) * 2015-06-17 2015-10-07 深圳市腾讯计算机系统有限公司 文件推送方法、装置和系统
CN104168488B (zh) * 2014-08-29 2018-02-09 北京奇艺世纪科技有限公司 一种视频转码方法及装置
CN115002514A (zh) * 2022-05-27 2022-09-02 浙江大学 基于云原生控制器的spark视频转码系统及视频转码方法

Families Citing this family (38)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104252394A (zh) * 2014-09-05 2014-12-31 江苏维罗可思信息科技有限公司 在线云转码服务系统软件
CN105407413B (zh) * 2014-09-11 2019-03-08 腾讯科技(深圳)有限公司 一种分布式视频转码方法及相关设备、系统
CN104378665B (zh) * 2014-11-24 2018-02-27 深圳市天威视讯股份有限公司 一种基于数字电视的分布式转码系统及方法
CN104469396B (zh) * 2014-12-24 2018-01-05 北京中科大洋信息技术有限公司 一种分布式转码系统和方法
CN105992020A (zh) * 2015-07-24 2016-10-05 乐视云计算有限公司 一种分配视频转换资源的方法及系统
CN105354254A (zh) * 2015-10-21 2016-02-24 杭州施强网络科技有限公司 一种利用节点服务器进行文档文件格式转换的方法
CN105357546A (zh) * 2015-11-17 2016-02-24 国云科技股份有限公司 一种基于云计算的视频转码方法
CN106851400B (zh) * 2015-12-03 2021-02-05 山大鲁能信息科技有限公司 微课视频分布式转码方法及系统
CN105657451B (zh) * 2016-01-14 2018-06-22 世纪龙信息网络有限责任公司 上传视频文件同时进行转码的方法与系统
CN107291370B (zh) * 2016-03-30 2021-06-04 杭州海康威视数字技术股份有限公司 一种云存储系统调度方法和装置
US10387367B2 (en) 2016-05-26 2019-08-20 Red Hat, Inc. Distributed file system with integrated file object conversion
US11412272B2 (en) 2016-08-31 2022-08-09 Resi Media Llc System and method for converting adaptive stream to downloadable media
US10511864B2 (en) 2016-08-31 2019-12-17 Living As One, Llc System and method for transcoding media stream
CN106791932B (zh) * 2017-01-06 2019-08-30 广州亦云信息技术股份有限公司 分布式转码系统、方法及其装置
US10531134B2 (en) 2017-11-10 2020-01-07 Akamai Technologies, Inc. Determining a time budget for transcoding of video
KR102006449B1 (ko) 2017-11-29 2019-08-01 네이버 주식회사 분산 트랜스코딩 방법 및 분산 트랜스코딩 시스템
CN108134660B (zh) * 2017-12-19 2021-04-09 新疆石油管理局数据公司 一种油井数据处理方法及周期设置方法和设备
US11653040B2 (en) * 2018-07-05 2023-05-16 Mux, Inc. Method for audio and video just-in-time transcoding
US11695978B2 (en) 2018-07-05 2023-07-04 Mux, Inc. Methods for generating video-and audience-specific encoding ladders with audio and video just-in-time transcoding
CN110830826A (zh) * 2018-08-08 2020-02-21 视联动力信息技术股份有限公司 视频转码设备调度方法及系统
CN109471715B (zh) * 2018-09-17 2021-10-29 咪咕视讯科技有限公司 一种转码任务的调度方法、装置及存储介质
CN109195012A (zh) * 2018-11-07 2019-01-11 成都索贝数码科技股份有限公司 一种基于对象存储分片转码/合成闪拼成mp4文件的方法
CN111246215A (zh) * 2018-11-28 2020-06-05 深圳市炜博科技有限公司 一种视频格式转换的方法及终端
CN109862402B (zh) * 2019-01-31 2020-03-27 深圳爱克莱特科技股份有限公司 多媒体数据处理装置
CN110278282A (zh) * 2019-07-01 2019-09-24 成都启英泰伦科技有限公司 一种语音大数据存储调用方法
US11611784B2 (en) * 2019-08-02 2023-03-21 Dao Lab Limited System and method for transferring large video files with reduced turnaround time
CN111314777B (zh) * 2019-12-06 2021-03-30 北京沃东天骏信息技术有限公司 视频生成方法及装置、计算机存储介质、电子设备
CN111083408B (zh) * 2019-12-20 2022-08-05 苏州浪潮智能科技有限公司 一种视频存储业务的处理方法、系统及设备
CN111158887B (zh) * 2019-12-31 2023-11-17 中国银行股份有限公司 一种集中式数据分布式处理方法及装置
CN111427686B (zh) * 2020-03-23 2023-03-24 贵阳块数据城市建设有限公司 一种处理器多线程并发方法
CN112423024A (zh) * 2020-11-18 2021-02-26 北京乐学帮网络技术有限公司 一种视频转码方法、装置、计算机设备和存储介质
CN112584103A (zh) * 2020-12-07 2021-03-30 武汉微创光电股份有限公司 一种大规模监控视频转码上云的方法及系统
CN112689171B (zh) * 2020-12-16 2023-06-13 创盛视联数码科技(北京)有限公司 一种视频播放系统
CN112866713B (zh) * 2021-01-19 2022-09-16 北京睿芯高通量科技有限公司 一种转码一体机系统以及转码方法
CN113055680B (zh) * 2021-03-16 2021-12-21 西南科技大学 一种分布式转码方法
CN115174535A (zh) * 2022-06-24 2022-10-11 上海网达软件股份有限公司 基于Kubernetes实现文件转码POD调度方法、系统、设备及存储介质
CN115277579B (zh) * 2022-07-25 2024-03-19 广州品唯软件有限公司 仓库视频调取方法及云平台
CN117055880A (zh) * 2023-08-22 2023-11-14 广东保伦电子股份有限公司 一种基于容器化部署的文档转码方法、装置及存储介质

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2007117747A2 (en) * 2006-01-30 2007-10-18 Scientific-Atlanta, Inc. Systems and methods for transcoding bit streams
CN102123279A (zh) * 2010-12-28 2011-07-13 乐视网信息技术(北京)股份有限公司 一种分布式实时转码方法与系统
CN102595652A (zh) * 2011-01-05 2012-07-18 中兴通讯股份有限公司 支持数字电视的移动终端和实现方法
CN102780918A (zh) * 2012-08-15 2012-11-14 华数传媒网络有限公司 一种视频分布式转换编码格式方法

Family Cites Families (24)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3155991B2 (ja) * 1997-04-09 2001-04-16 日本アイ・ビー・エム株式会社 集約演算実行方法及びコンピュータ・システム
US6609131B1 (en) * 1999-09-27 2003-08-19 Oracle International Corporation Parallel partition-wise joins
US7590644B2 (en) * 1999-12-21 2009-09-15 International Business Machine Corporation Method and apparatus of streaming data transformation using code generator and translator
AU2002365812A1 (en) * 2001-12-04 2003-06-17 Powerllel Corporation Parallel computing system, method and architecture
US7133905B2 (en) * 2002-04-09 2006-11-07 Akamai Technologies, Inc. Method and system for tiered distribution in a content delivery network
US7082495B2 (en) * 2002-06-27 2006-07-25 Microsoft Corporation Method and apparatus to reduce power consumption and improve read/write performance of hard disk drives using non-volatile memory
US20040078369A1 (en) * 2002-07-02 2004-04-22 American Management Systems, Incorporated Apparatus, method, and medium of a commodity computing high performance sorting machine
US8850223B1 (en) * 2002-07-19 2014-09-30 F5 Networks, Inc. Method and system for hard disk emulation and cryptographic acceleration on a blade server
US7650331B1 (en) * 2004-06-18 2010-01-19 Google Inc. System and method for efficient large-scale data processing
US8280944B2 (en) * 2005-10-20 2012-10-02 The Trustees Of Columbia University In The City Of New York Methods, media and systems for managing a distributed application running in a plurality of digital processing devices
US7865898B2 (en) * 2006-01-27 2011-01-04 Oracle America, Inc. Repartitioning parallel SVM computations using dynamic timeout
US8275814B2 (en) * 2006-07-12 2012-09-25 Lg Electronics Inc. Method and apparatus for encoding/decoding signal
CN101197754B (zh) 2007-12-27 2011-11-16 腾讯科技(深圳)有限公司 分布式系统、分布式业务处理方法及相关装置
CN101909046A (zh) * 2009-11-17 2010-12-08 新奥特(北京)视频技术有限公司 一种多媒体转码服务器及一种多媒体转码系统
US9268613B2 (en) * 2010-12-20 2016-02-23 Microsoft Technology Licensing, Llc Scheduling and management in a personal datacenter
US8583818B2 (en) * 2011-01-31 2013-11-12 Cbs Interactive Inc. System and method for custom segmentation for streaming video
US8700683B2 (en) * 2011-10-24 2014-04-15 Nokia Corporation Method and apparatus for providing a key-value based storage interface
KR101136564B1 (ko) * 2011-10-24 2012-04-19 이기택 Ssd를 사용한 vod 서비스 방법
US9432704B2 (en) * 2011-11-06 2016-08-30 Akamai Technologies Inc. Segmented parallel encoding with frame-aware, variable-size chunking
CN102497359B (zh) * 2011-12-02 2014-06-04 山东大学 一种基于瘦客户端流媒体服务系统的运行方法
US9063938B2 (en) * 2012-03-30 2015-06-23 Commvault Systems, Inc. Search filtered file system using secondary storage, including multi-dimensional indexing and searching of archived files
US9112922B2 (en) * 2012-08-28 2015-08-18 Vantrix Corporation Method and system for self-tuning cache management
US9516078B2 (en) * 2012-10-26 2016-12-06 Cisco Technology, Inc. System and method for providing intelligent chunk duration
US8928804B2 (en) * 2012-11-19 2015-01-06 Broadcom Corporation Managing encoder parameters for parallel transcoding

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2007117747A2 (en) * 2006-01-30 2007-10-18 Scientific-Atlanta, Inc. Systems and methods for transcoding bit streams
CN102123279A (zh) * 2010-12-28 2011-07-13 乐视网信息技术(北京)股份有限公司 一种分布式实时转码方法与系统
CN102595652A (zh) * 2011-01-05 2012-07-18 中兴通讯股份有限公司 支持数字电视的移动终端和实现方法
CN102780918A (zh) * 2012-08-15 2012-11-14 华数传媒网络有限公司 一种视频分布式转换编码格式方法

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104168488A (zh) * 2014-08-29 2014-11-26 北京奇艺世纪科技有限公司 一种视频转码方法及装置
CN104168488B (zh) * 2014-08-29 2018-02-09 北京奇艺世纪科技有限公司 一种视频转码方法及装置
CN104967619A (zh) * 2015-06-17 2015-10-07 深圳市腾讯计算机系统有限公司 文件推送方法、装置和系统
WO2016202123A1 (zh) * 2015-06-17 2016-12-22 腾讯科技(深圳)有限公司 文件推送方法、装置和系统
CN104967619B (zh) * 2015-06-17 2018-09-04 深圳市腾讯计算机系统有限公司 文件推送方法、装置和系统
US10805363B2 (en) 2015-06-17 2020-10-13 Tencent Technology (Shenzhen) Company Limited Method, device and system for pushing file
CN115002514A (zh) * 2022-05-27 2022-09-02 浙江大学 基于云原生控制器的spark视频转码系统及视频转码方法
CN115002514B (zh) * 2022-05-27 2023-07-21 浙江大学 基于云原生控制器的spark视频转码系统及视频转码方法

Also Published As

Publication number Publication date
US10291673B2 (en) 2019-05-14
CN103838779B (zh) 2019-02-05
CN103838779A (zh) 2014-06-04
US20150244757A1 (en) 2015-08-27

Similar Documents

Publication Publication Date Title
WO2014082505A1 (zh) 转码方法及系统、分布式文件装置
CA2841377C (en) Video transcoding services provided by searching for currently transcoded versions of a requested file before performing transcoding
US9060207B2 (en) Adaptive video streaming over a content delivery network
WO2017088484A1 (zh) 基于云计算的实时离屏渲染方法、装置及系统
US11374995B2 (en) Multimedia file processing
CN110769278A (zh) 一种分布式视频转码方法及系统
Rodriguez-Gil et al. Interactive live-streaming technologies and approaches for web-based applications
US20190166395A1 (en) Fast Channel Change In A Video Delivery Network
CN112870711B (zh) 一种云游戏的处理方法、装置、设备及存储介质
WO2017107911A1 (zh) 一种视频云平台播放视频的方法及装置
WO2014139269A1 (zh) 基于虚拟桌面的视频播放、处理方法及装置
US10327040B1 (en) Forward error correction for low latency streaming
Cheng et al. A cloud-based transcoding framework for real-time mobile video conferencing system
CN112953850B (zh) 数据传输方法、装置、计算机可读介质及电子设备
Kim et al. Cloud‐based gaming service platform supporting multiple devices
WO2024066828A1 (zh) 一种数据处理方法、装置、设备、计算机可读存储介质及计算机程序产品
Barais et al. Towards microservices architecture to transcode videos in the large at low costs
Kernen et al. Tighter NIC/GPU Integration Yields Next-Level Media Processing Performance
US11146834B1 (en) Server-based encoded version selection
US10735783B1 (en) Intra-rendition latency variation
Panarello et al. A big video data transcoding service for social media over federated clouds
Pan et al. OJUMP: Optimization for joint unicast‐multicast panoramic VR live streaming system
Khan et al. SAND and Cloud-based Strategies for Adaptive Video Streaming
Deneke Scalable distributed video transcoding architecture
WO2022068276A1 (zh) 桌面云系统以及相关方法、装置、设备、介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 13858076

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205N DATED 04/08/2015)

122 Ep: pct application non-entry in european phase

Ref document number: 13858076

Country of ref document: EP

Kind code of ref document: A1