Multi-resolution output distributed file transcoding method and device

文档序号:1470473 发布日期:2020-02-21 浏览:29次 中文

阅读说明:本技术 一种多分辨率输出的分布式文件转码方法及装置 (Multi-resolution output distributed file transcoding method and device ) 是由 唐杰 张加瑞 李庆瑜 于 2019-10-24 设计创作,主要内容包括:本发明公开了一种多分辨率输出的分布式文件转码方法及装置,该方法包括如下步骤:视频切片模块将视频文件切分成多个第一视频切片,并将所有所述第一视频切片发送至多个第一编码模块;所有所述第一编码模块对其接收到的第一视频切片分别进行一次编码,生成第二视频切片,并将所有所述第二视频切片发送至多个第二编码模块;所述第二编码模块分别将每个所述第二视频切片转码为多个具有不同分辨率的第三视频切片,并将所有第三视频切片发送至多个切片合并模块块;所有所述切片合并模块将具有相同分辨率的所有第三视频切片进行合并输出。本发明将多个进程分配到多台转码服务器上,可以降低单个转码进程的资源需求,增加单个转码服务器的资源利用率。(The invention discloses a distributed file transcoding method and a device with multi-resolution output, wherein the method comprises the following steps: the video slicing module divides a video file into a plurality of first video slices and sends all the first video slices to a plurality of first coding modules; all the first coding modules respectively carry out primary coding on the received first video slices to generate second video slices, and all the second video slices are sent to a plurality of second coding modules; the second coding module respectively transcodes each second video slice into a plurality of third video slices with different resolutions and sends all the third video slices to a plurality of slice merging module blocks; and all the slice merging modules merge and output all the third video slices with the same resolution. The invention distributes a plurality of processes to a plurality of transcoding servers, can reduce the resource requirement of a single transcoding process and increase the resource utilization rate of a single transcoding server.)

1. A distributed file transcoding method with multi-resolution output is characterized by comprising the following steps:

s1: the video slicing module divides a video file into a plurality of first video slices and sends all the first video slices to a plurality of first coding modules;

s2: all the first coding modules respectively carry out primary coding on the received first video slices to generate second video slices, and all the second video slices are sent to a plurality of second coding modules;

s3: the second coding module respectively transcodes each second video slice into a plurality of third video slices with different resolutions and sends all the third video slices to a plurality of slice merging modules, wherein all the third video slices with the same resolution are sent to the same slice merging module;

s4: and all the slice merging modules merge and output all the third video slices with the same resolution.

2. The method for transcoding the multi-resolution output distributed file as claimed in claim 1, wherein in step S1, after the video slicing module slices the video file into a plurality of first video slices, the video slicing module further stores slice position dotting information into the REDIS data buffer, where the slice position dotting information includes start time and duration information of the slicing of the video file.

3. The method for multi-resolution distributed file transcoding of claim 2, wherein in step S2, when all the first encoding modules encode the first video slices received by them once, slice position dotting information is obtained from the REDIS data cache.

4. The method of claim 1, wherein the second encoding module transcodes each of the second video slices into 3 third video slices with different resolutions.

5. A multi-resolution output distributed file transcoding device is characterized by comprising a video slicing module, a plurality of first coding modules, a plurality of second coding modules and a plurality of slice merging modules, wherein,

the video slicing module slices a video file into a plurality of first video slices and sends all the first video slices to a plurality of first coding modules;

the first coding module respectively carries out primary coding on the received first video slices to generate second video slices, and all the second video slices are sent to the plurality of second coding modules;

the second coding module respectively transcodes each second video slice into a plurality of third video slices with different resolutions and sends all the third video slices to a plurality of slice merging modules, wherein all the third video slices with the same resolution are sent to the same slice merging module;

and all the slice merging modules merge and output all the third video slices with the same resolution.

6. The apparatus of claim 5, further comprising a REDIS data buffer for converting the slicing position dotting information into slice position dotting information, wherein the slice position dotting information comprises start time and duration information of slicing of the video file.

7. The device of claim 6, wherein when the first encoding module encodes the received first video slice once, slice position dotting information is obtained from the REDIS data cache.

8. The apparatus of claim 5, wherein the video slicing module, the first encoding module, the second encoding module and/or the slicing and merging module is a POD generated by Kubernets system control.

Technical Field

The present application relates to the field of video data processing technologies, and in particular, to a method and an apparatus for multi-resolution distributed file transcoding.

Background

With the increasing demand of video on demand, such as movies, short videos, etc., it is also a very urgent problem to increase the transcoding capability of bulk video. Distributed file transcoding is a widely used approach in batch processing video file transcoding applications.

The workflow of the distributed file transcoding system comprises the following steps: (1) dotting through the video files, and acquiring start time and duration information of segmentation of all source video files; (2) the transcoding tasks are distributed to a plurality of transcoding servers, certain transcoding resources are distributed, and a single transcoding server can run a plurality of transcoding tasks according to the total resources of the single transcoding server; (3) each transcoding task transcodes and slices the video file according to the acquired time information; (4) and finally, merging all the transcoded slice files to obtain the required transcoded file.

Distributed file transcoding does improve the overall transcoding speed, but there are also some problems: (1) for transcoding requirements of multiple resolutions and multiple code rates, a single process is used for processing, so that more transcoding resources need to be distributed, the transcoding speed of slices can be reduced, and the full utilization of resources of a single transcoding server and the improvement of the overall transcoding speed are not facilitated; (2) when a video file needs to be transcoded in multiple processes, each process needs to perform dotting processing on a source file, and dotting information cannot be shared; (3) when secondary encoding processing is needed for one-input and multiple-output, all output primary encoding information needs to be acquired simultaneously, and the overall transcoding speed is greatly reduced.

Therefore, aiming at the current trend that the demand of video on demand is increasing day by day and the requirement of improving the overall transcoding speed and the utilization rate of transcoding resources, an optimization scheme of a distributed file transcoding system is urgently provided.

Disclosure of Invention

The invention aims to provide a distributed file transcoding method and a distributed file transcoding device for improving the overall transcoding speed and the utilization rate of transcoding resources.

In order to solve the above problems, the present invention provides a distributed file transcoding method with multi-resolution output, which includes the following steps: s1: the video slicing module divides a video file into a plurality of first video slices and sends all the first video slices to a plurality of first coding modules; s2: all the first coding modules respectively carry out primary coding on the received first video slices to generate second video slices, and all the second video slices are sent to a plurality of second coding modules; s3: the second coding module respectively transcodes each second video slice into a plurality of third video slices with different resolutions and sends all the third video slices to a plurality of slice merging modules, wherein all the third video slices with the same resolution are sent to the same slice merging module; s4: and all the slice merging modules merge and output all the third video slices with the same resolution.

Preferably, in step S1, after the video slicing module slices the video file into a plurality of first video slices, the slice position dotting information is further stored in the REDIS data cache, where the slice position dotting information includes start time and duration information of the slicing of the video file.

Preferably, in step S2, when all the first encoding modules encode the received first video slices once, slice position dotting information is obtained from the REDIS data cache.

Preferably, the second encoding module transcodes each of the second video slices into 3 third video slices having different resolutions, respectively.

The invention also provides a distributed file transcoding device with multi-resolution output, which comprises a video slicing module, a plurality of first coding modules, a plurality of second coding modules and a plurality of slice merging modules, wherein the video slicing module divides a video file into a plurality of first video slices and sends all the first video slices to the plurality of first coding modules; the first coding module respectively carries out primary coding on the received first video slices to generate second video slices, and all the second video slices are sent to the plurality of second coding modules; the second coding module respectively transcodes each second video slice into a plurality of third video slices with different resolutions and sends all the third video slices to a plurality of slice merging modules, wherein all the third video slices with the same resolution are sent to the same slice merging module; and all the slice merging modules merge and output all the third video slices with the same resolution.

Preferably, the video file further comprises a REDIS data cache for converting into slice position dotting information, wherein the slice position dotting information includes start time and duration information of video file slicing.

Preferably, when the first encoding module encodes the received first video slice once, slice position dotting information is obtained from the REDIS data cache.

Preferably, the video slicing module, the first encoding module, the second encoding module and/or the slice merging module are POD generated by kubernets system control.

Compared with the prior art, the invention has the following technical effects:

1. the embodiment of the invention aims at the multi-resolution and multi-code-rate transcoding requirements, divides a single transcoding process of each slice into a plurality of transcoding processes to carry out transcoding simultaneously, and distributes the plurality of processes to a plurality of transcoding servers according to resources required by a single transcoding process, so that the resource requirements of the single transcoding process can be reduced, and the resource utilization rate of the single transcoding server is increased.

2. The embodiment of the invention adopts a dotting information sharing mechanism, and can simultaneously acquire the required dotting information by avoiding dotting processing of a plurality of transcoding processes related to the same source file after acquiring the dotting information of the slicing start time and the slicing duration of the sliced file during multi-process transcoding.

3. The embodiment of the invention can quickly acquire the primary coding information and share the primary coding information. The method mainly aims at multi-resolution output, the primary coding information is quickly acquired through the coding parameters output by low resolution, and then the primary coding information with low resolution is used for secondary coding with high resolution through the coefficient relation between the primary coding parameters with high resolution and the primary coding parameters with low resolution.

Of course, it is not necessary for any product in which the invention is practiced to achieve all of the above-described advantages at the same time.

Drawings

In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts. In the drawings:

fig. 1 is a schematic structural diagram of a distributed file transcoding apparatus for multi-resolution output according to an embodiment of the present invention;

FIG. 2 is a flowchart illustrating a distributed file transcoding method with multi-resolution output according to an embodiment of the present invention;

fig. 3 is a schematic diagram of a distributed file transcoding process with multi-resolution output according to an embodiment of the present invention.

Detailed Description

The following will describe in detail a multi-resolution output distributed file transcoding method and apparatus provided by the present invention with reference to the accompanying drawings, where this embodiment is implemented on the premise of the technical solution of the present invention, and a detailed implementation manner and a specific operation process are given, but the scope of protection of the present invention is not limited to the following embodiments, and those skilled in the art can modify and render the same without changing the spirit and content of the present invention.

Referring to fig. 1, the present invention provides a multi-resolution output distributed file transcoding apparatus, including a video slicing module 100, a plurality of first encoding modules 200, a plurality of second encoding modules 300, and a plurality of slice merging modules 400, wherein,

the video slice module 100 slices a video file into a plurality of first video slices, and sends all the first video slices to a plurality of the first encoding modules 200;

the first encoding module 200 performs primary encoding on the received first video slices respectively to generate second video slices, and sends all the second video slices to the plurality of second encoding modules 300;

the second encoding module 300 transcodes each of the second video slices into a plurality of third video slices with different resolutions, and sends all the third video slices to the plurality of slice merging modules 400, wherein all the third video slices with the same resolution are sent to the same slice merging module 400;

all the slice merging modules 400 merge and output all the third video slices with the same resolution.

As a preferred embodiment, the REDIS data cache 500 is further included, and is used to replace the slice position dotting information, where the slice position dotting information includes start time and duration information of slicing of the video file.

As a preferred embodiment, when the first encoding module encodes the first video slice received by the first encoding module once, slice position dotting information is obtained from the REDIS data cache.

As a preferred embodiment, the video slicing module 100, the first encoding module 200, the second encoding module 300 and/or the slicing and merging module 400 are POD node servers generated for kubernets system control.

It should be understood that the number of the first coding module 200, the second coding module 300, and the slice merging module 400 and the connection relationship thereof are only given as a specific embodiment, the present invention does not limit the number of the first coding module 200, the second coding module 300, and the slice merging module 400, and there is no correlation between the number of the first coding module 200, the second coding module 300, and the slice merging module 400, and there is no one-to-one restriction on the connection relationship (data transmission) between the first coding module 200 and the second coding module 300, and between the second coding module 300 and the slice merging module 400, and each first coding module 200 may be connected to any one or more second coding modules 300, and the second coding module 300 may be connected to any one or more slice merging modules 400 according to the needs of the practical application.

Referring to fig. 2 and fig. 3, the present invention provides a method for transcoding a multi-resolution output distributed file, including the following steps:

s1: the video slicing module divides a video file into a plurality of first video slices and sends all the first video slices to a plurality of first coding modules;

in this embodiment, after the video slicing module slices the video file into a plurality of first video slices, the slice position dotting information is stored in the REDIS data cache, where the slice position dotting information includes start time and duration information of the slicing of the video file.

Specifically, the video slicing module performs video slicing position dotting, and stores slicing position dotting information including start time and duration information of video file slicing into the REDIS data cache, so as to realize sharing of the slicing position dotting information.

S2: all the first coding modules respectively carry out primary coding on the received first video slices to generate second video slices, and all the second video slices are sent to a plurality of second coding modules;

and the second video slice produced after the primary coding is finished is the video slice with the first resolution, and the second video slice is put into the node server for storage and standby.

S3: the second coding module respectively transcodes each second video slice into a plurality of third video slices with different resolutions and sends all the third video slices to a plurality of slice merging modules, wherein all the third video slices with the same resolution are sent to the same slice merging module;

when multi-resolution output is performed, the second encoding module rapidly acquires primary encoding information through the encoding parameters of the low-resolution output (second video slice), and uses the primary encoding information of the low resolution for secondary encoding of high resolution through the coefficient relation between the primary encoding parameters of the high resolution and the primary encoding parameters of the low resolution to generate a third video slice.

S4: and all the slice merging modules merge and output all the third video slices with the same resolution.

As a preferred embodiment, in step S2, when all the first encoding modules encode the first video slices received by them once, slice position dotting information is obtained from the REDIS data cache.

As a preferred embodiment, the second encoding module transcodes each of the second video slices into 3 third video slices with different resolutions, respectively.

The disclosure above is only one specific embodiment of the present application, but the present application is not limited thereto, and any variations that can be made by those skilled in the art are intended to fall within the scope of the present application.

8页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种视频帧预测方法、装置及终端设备

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类