WO2020119515A1 - Video transcoding method and device - Google Patents

Video transcoding method and device Download PDF

Info

Publication number
WO2020119515A1
WO2020119515A1 PCT/CN2019/122642 CN2019122642W WO2020119515A1 WO 2020119515 A1 WO2020119515 A1 WO 2020119515A1 CN 2019122642 W CN2019122642 W CN 2019122642W WO 2020119515 A1 WO2020119515 A1 WO 2020119515A1
Authority
WO
WIPO (PCT)
Prior art keywords
transcoding
video
target
source video
determined
Prior art date
Application number
PCT/CN2019/122642
Other languages
French (fr)
Chinese (zh)
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 WO2020119515A1 publication Critical patent/WO2020119515A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/234Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs
    • H04N21/2343Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream 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 or manipulating encoded video stream 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/40Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using video transcoding, i.e. partial or full decoding of a coded input stream followed by re-encoding of the decoded output stream
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/42Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by implementation details or hardware specially adapted for video compression or decompression, e.g. dedicated software implementation
    • H04N19/436Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by implementation details or hardware specially adapted for video compression or decompression, e.g. dedicated software implementation using parallelised computational arrangements
    • 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 or manipulating encoded video stream scene graphs
    • H04N21/2343Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs involving reformatting operations of video signals for distribution or compliance with end-user requests or end-user device requirements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs
    • H04N21/4402Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs
    • H04N21/4402Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display
    • H04N21/440218Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display by transcoding between formats or standards, e.g. from MPEG-2 to MPEG-4

Definitions

  • This application relates to the field of Internet technology, in particular to a video transcoding method and device.
  • the video playback platform In order to provide users with videos with different picture quality, the video playback platform usually needs to transcode the source video to generate multiple videos with different resolutions and different bit rates.
  • the source video needs to be downloaded from an external storage platform first, and then the source video is transcoded. Then, in order to generate these videos, the source video needs to be downloaded multiple times, which results in consuming more bandwidth. Because external storage platforms usually set concurrency limits for bandwidth and traffic, this will inevitably hinder the growth of the video playback platform's business scale. Therefore, there is an urgent need to provide a more reliable video transcoding method to reduce the bandwidth occupied when the source video is transcoded into multiple different videos.
  • the purpose of the embodiments of the present application is to provide a video transcoding method and device, which can reduce the bandwidth occupied when the source video is transcoded into multiple different videos, so as to support more traffic under the same bandwidth.
  • an embodiment of the present application provides a video transcoding method, the method includes: obtaining a source video; for a variety of target videos to be output, determining a transcoding from the source video to a conversion of the target video Coding mode; based on the determined transcoding mode, transcoding the source video.
  • the embodiments of the present application also provide a video transcoding device, which includes: a video acquisition unit for acquiring source video; a transcoding mode determination unit for multiple target videos to be output, Determining a transcoding method from the source video to the target video; a transcoding unit, configured to transcode the source video based on the determined transcoding method.
  • the embodiments of the present application also provide a video transcoding device.
  • the device includes a memory and a processor.
  • the memory is used to store a computer program.
  • the computer program is executed by the processor, the foregoing Video transcoding method.
  • various transcoding methods for transcoding from the source video to each of the target videos can be separately determined.
  • the source video is sequentially transcoded to obtain each of the target videos, or according to the determined In each of the transcoding modes, the source video is transcoded in parallel to obtain each of the target videos.
  • the transcoding process from the source video to multiple different target videos can be completed in one transcoding machine.
  • the entire transcoding process only requires one source video download from an external storage platform, reducing the number of source video downloads , So as to reduce the bandwidth occupied when the source video is transcoded into multiple different videos, and then it can support more business volume under the same bandwidth.
  • FIG. 1 is a schematic diagram of a video transcoding method in an embodiment of this application
  • FIG. 2 is a schematic diagram of a directed acyclic transcoding architecture in the implementation of this application.
  • FIG. 3 is a schematic structural diagram of a video transcoding device according to an embodiment of the present application.
  • FIG. 4 is a schematic structural diagram of another video transcoding device in an embodiment of the present application.
  • the present application provides a video transcoding method, which can be applied to a terminal device having an image processing function.
  • the terminal device may be, for example, a desktop computer, a notebook computer, a tablet computer, a workstation, or the like.
  • the method can also be applied to a business server of a video playing website.
  • the business server may be an independent server or a server cluster composed of multiple servers.
  • the video transcoding method provided in this application includes the following steps.
  • the method of acquiring the source video may include reading the source video from the storage path according to a storage path provided by an external storage platform.
  • S13 Determine the transcoding method from the source video to the target video for various target videos to be output.
  • the source videos after acquiring the source video, for the various target videos or target audios to be output, the source videos need to be transcoded separately to obtain these target videos or target audios. Since the output of these target videos depends on the source video, a directed acyclic graph with the source video as the root node and the target video as the child node can be constructed according to the dependency relationship between the source video and these target videos (Directed Acyclic Graph, DAG) transcoding structure, so that multiple transcoding tasks from source video to multiple target videos can be completed in the terminal device according to the constructed transcoding structure. In order to achieve these transcoding tasks, the source video may be transcoded into the target video transcoding method. In this way, based on the determined transcoding method, the transcoding process of the source video can be implemented in a terminal device to obtain various target videos.
  • a directed acyclic graph with the source video as the root node and the target video as the child node can be constructed according to the dependency relationship between the source video and these target videos (Directed Acyclic
  • the transcoding process from the source video to the target video may be a transcoding process that already exists in actual applications. Then, the transcoding process can be directly obtained from the existing transcoding process.
  • the source video transcoding is a transcoding method of the target video.
  • the transcoding method corresponds to the video transcoding parameters required for transcoding one video to another video, and the parameter values of the video transcoding parameters may be based on the video parameters and audio parameters of the two videos The parameter value is determined.
  • the transcoding parameters may include, for example, fidelity, resolution, transmission code rate, and so on. After these transcoding parameters are set, the video can be transcoded, so that the transcoded video conforming to these transcoding parameters can be obtained.
  • a support vector machine support vector machine, SVM
  • SVM support vector machine
  • the source video and the target video may be used as a transcoding start node and a transcoding end node in the transcoding mode identification model, respectively.
  • a training sample set may be obtained in advance, and the training sample set may be used to train the transcoding mode recognition model so that the transcoding mode recognition model can recognize The transcoding method corresponding to the input video group.
  • the training sample set may include a sample video group whose corresponding transcoding method is the specified transcoding method and a corresponding sample video group whose corresponding transcoding method is not the specified transcoding method.
  • the sample video group may include sample videos corresponding to the transcoding start node and the transcoding end node, respectively. In this way, during the training process, the sample video groups in the training sample set can be sequentially input into the transcoding mode recognition model.
  • An initial neural network can be constructed in the transcoding method recognition model, and initial prediction parameters can be preset in the neural network. After processing the input sample video group through the initial prediction parameters, a prediction result of the sample video group can be obtained, and the prediction result can be used to characterize whether the transcoding mode corresponding to the sample video group is Specify the transcoding method. Specifically, when the transcoding method recognition model processes the sample video group, it can first extract the first feature vector corresponding to the parameter information of the source video and the second feature vector corresponding to the parameter information of the target video . Elements in the first feature vector may be parameter values of various parameters of the source video, for example, parameter values of video parameters or audio parameters, and video parameters may include video resolution, video bit rate, video frame rate, and video Format and so on.
  • the elements in the first feature vector may be parameter values of various parameters of the target video.
  • the transcoding mode recognition model can read the parameter value of each parameter in the source video corresponding to the transcoding start node in the sample video group, and the parameter value of each parameter in the target video corresponding to the transcoding end node , And in accordance with the order of reading, the parameter values constitute the first feature vector and the second feature vector.
  • a convolutional neural network Convolutional Neural Network, CNN
  • CNN convolutional Neural Network
  • a probability value vector of the sample video group can be obtained.
  • the probability value vector may include a probability value for a specified transcoding method.
  • the probability value vector may include two probability values, and these two probability values respectively represent the probability that the transcoding method is the specified transcoding method and the probability that the transcoding method is not the specified transcoding method.
  • a probability value vector of (0.4, 0.8) can be obtained through the transcoding method recognition model, where 0.4 means transcoding
  • the coding method is the probability of the specified transcoding method
  • 0.8 means the probability that the transcoding method is not the specified transcoding method.
  • the probability results predicted by the transcoding method identification model may not match the actual situation.
  • the above input is a sample video group whose transcoding method is the specified transcoding method, but in the obtained probability vector, the probability that the transcoding method is the specified transcoding method is only 0.4, which indicates the transcoding method The probability of not specifying the transcoding method is 0.8. In this case, it indicates that the prediction result is incorrect.
  • the initial prediction parameter in the transcoding mode identification model can be adjusted according to the difference between the prediction result and the correct result.
  • the sample video group may have a theoretical probability value result.
  • the theoretical probability value result of the transcoding method being the designated transcoding method may be (1, 0), where 1 indicates that the transcoding method is the probability value of the designated transcoding method.
  • the predicted probability value result can be subtracted from the theoretical probability value result to obtain the difference between the two, and then the obtained difference can be used to adjust the initial prediction parameters of the neural network. After the prediction parameters are processed again for the sample video group, the obtained prediction result is consistent with the correct result. In this way, after training a large number of training samples, the transcoding method recognition model can distinguish whether the transcoding method corresponding to the sample video group is the specified transcoding method, thereby identifying the actual transcoding corresponding to the sample video group the way.
  • the source video after determining the transcoding method from the source video to the target video, the source video can be implemented in a terminal device based on the determined transcoding method Transcoding process to get the various target videos. Specifically, since the output of these target videos depends on the source video, then according to the dependency relationship between the source video and these target videos, a directed direction with the source video as the root node and the target video as the child node can be constructed Directed Acyclic Graph (DAG) transcoding structure, so that based on the determined various transcoding methods for various target videos, the conversion from the source video can be completed in the terminal device according to the constructed transcoding structure
  • DAG Directed Acyclic Graph
  • the code is multiple transcoding tasks for multiple target videos.
  • the source video may be transcoded into each of the target videos according to the determined transcoding method, and the source video may be transcoded in sequence to obtain each of the target videos.
  • the source video may be transcoded in order according to the sequence of the processor usage corresponding to the transcoding method from small to large and the above-mentioned transcoding structure, so as to obtain corresponding various target videos.
  • the transcoding process from the source video to multiple different target videos can be completed in one transcoding machine.
  • the entire transcoding process only requires one source video download from an external storage platform, reducing the number of source video downloads , So as to reduce the bandwidth occupied when the source video is transcoded into multiple different videos, and then it can support more business volume under the same bandwidth.
  • the actual transcoding device The source video transcoding is the corresponding processor usage rate when specifying the video, and the transcoding task on the transcoding device is reasonably scheduled. Then, before obtaining the source video, the transcoding scheduling information can be obtained.
  • the transcoding scheduling information may be used to characterize multiple transcoding task information allocated on the designated transcoding device; the transcoding task information corresponds to the source video and the target video to be output.
  • the target video to be output corresponding to the transcoding task information can be subsequently determined to be a transcoding method from the source video to the target video.
  • the manner of acquiring the transcoding scheduling information may specifically include reading the transcoding scheduling information from the storage path according to the provided storage path.
  • determining the transcoding scheduling information may specifically include that, first, the processor usage rate corresponding to the transcoding from the source video to the designated video on the designated transcoding device may be determined.
  • the designated transcoding device may include a transcoder that subsequently performs the transcoding task. For example, from actual application, the corresponding processor usage rate can be recorded when a corresponding single transcoding task is completed on each transcoder. Then, the target video to be output on the specified transcoding device may be determined from the specified video according to the determined processor usage rate.
  • the specified video when the sum of the processor usage rates corresponding to the determined multiple types of specified videos reaches a specified threshold, the specified video may be used as the target video to be output.
  • the value range of the specified threshold can be set according to the actual application, for example, it can include 90 percent (%) to 100%.
  • transcoding scheduling information for the designated transcoding device may be generated.
  • the transcoding task on the transcoding device is reasonably scheduled.
  • the transcoding tasks of transcoding the source video into audio and video with resolutions of 1080P and 270P are assigned to a transcoding device, and the source video is transcoded separately
  • corresponding transcoding scheduling information can be generated.
  • the two transcoding devices only need to download the source video once from the external storage platform, and can complete multiple transcoding tasks respectively.
  • the number of source video downloads can be significantly reduced, thereby reducing the bandwidth occupied when the source video is transcoded into multiple different videos, and thus can support more business volume under the same bandwidth.
  • the functions implemented in the above method steps may be implemented by a computer program, and the computer program may be stored in a computer storage medium.
  • the computer storage medium may be coupled with the processor, so that the processor can read the computer program in the computer storage medium.
  • S13 Determine the transcoding method from the source video to the target video for multiple target videos to be output;
  • the source video is transcoded in parallel to obtain each of the target videos.
  • transcoding scheduling information is used to characterize multiple transcoding task information allocated on a designated transcoding device; the transcoding task information corresponds to the source video and the target video to be output;
  • the transcoding method from the source video to the target video is determined.
  • transcoding scheduling information for the designated transcoding device is generated.
  • the specified video is used as the target video to be output.
  • the transcoding method characterized by the predicted value is used as the transcoding method from the source video to the target video.
  • the training sample set includes a sample video group whose corresponding transcoding method is the specified transcoding method and a corresponding sample video group whose corresponding transcoding method is not the specified transcoding method;
  • this application also provides a video transcoding device, which may include:
  • the video obtaining unit 100 is used to obtain the source video
  • the transcoding mode determining unit 200 is configured to determine a transcoding mode for transcoding from the source video to the target video for various target videos to be output;
  • the transcoding unit 300 is configured to transcode the source video based on the determined transcoding method.
  • the transcoding unit is further configured to sequentially transcode the source video according to the determined respective transcoding methods of transcoding from the source video into each of the target videos, to Obtaining each of the target videos, or, according to each of the determined transcoding modes, parallel transcoding the source video to obtain each of the target videos.
  • the device further includes:
  • Scheduling information acquisition unit used to acquire transcoding scheduling information; the transcoding scheduling information is used to characterize multiple transcoding task information allocated on the designated transcoding device; the transcoding task information and the source video Corresponding to the output target video;
  • the transcoding mode determining unit is used to determine the transcoding mode from the source video to the target video for the target video to be output corresponding to the transcoding task information.
  • the scheduling information acquisition unit includes:
  • a utilization rate determining module used to determine the corresponding processor utilization rate when transcoding from the source video to the designated video on the designated transcoding device
  • a video determining module configured to determine the target video to be output on the designated transcoding device from the designated video according to the determined utilization rate of the processor
  • the information generating module is configured to generate transcoding scheduling information for the designated transcoding device based on the determined target video to be output.
  • the video determination module is further configured to use the specified video as the target video to be output when the sum of the processor usage rates corresponding to the determined multiple types of the specified videos reaches a specified threshold.
  • the present application also provides a video transcoding device.
  • the device includes a memory and a processor.
  • the memory is used to store a computer program.
  • the computer program is executed by the processor, the following steps are implemented:
  • S13 Determine the transcoding method from the source video to the target video for multiple target videos to be output;
  • the memory may include a physical device for storing information, usually the information is digitized and then stored on a medium using electrical, magnetic, or optical methods.
  • the memory described in this embodiment may further include: devices that use electrical energy to store information, such as RAM, ROM, etc.; devices that use magnetic energy to store information, such as hard disks, floppy disks, magnetic tapes, magnetic core memories, bubble memories, and U disks ; Devices that use optical methods to store information, such as CDs or DVDs.
  • devices that use electrical energy to store information such as RAM, ROM, etc.
  • devices that use magnetic energy to store information such as hard disks, floppy disks, magnetic tapes, magnetic core memories, bubble memories, and U disks
  • Devices that use optical methods to store information such as CDs or DVDs.
  • quantum memory graphene memory, and so on.
  • the processor may be implemented in any suitable manner.
  • the processor may employ, for example, a microprocessor or processor and a computer-readable medium storing computer-readable program code (such as software or firmware) executable by the (micro)processor, logic gate, switch, dedicated integration Circuit (Application Specific Integrated Circuit, ASIC), programmable logic controller and embedded microcontroller form, etc.
  • computer-readable program code such as software or firmware
  • the source video is transcoded in parallel to obtain each of the target videos.
  • transcoding scheduling information is used to characterize multiple transcoding task information allocated on a designated transcoding device; the transcoding task information corresponds to the source video and the target video to be output;
  • the transcoding method from the source video to the target video is determined.
  • transcoding scheduling information for the designated transcoding device is generated.
  • the specified video is used as the target video to be output.
  • the transcoding method characterized by the predicted value is used as the transcoding method from the source video to the target video.
  • the training sample set includes a sample video group whose corresponding transcoding method is the specified transcoding method and a corresponding sample video group whose corresponding transcoding method is not the specified transcoding method;
  • various transcoding methods for transcoding from the source video to each of the target videos can be separately determined.
  • the source video is sequentially transcoded to obtain each of the target videos, or according to the determined For each of the transcoding methods, parallel transcoding the source video to obtain each of the target videos.
  • the transcoding process from the source video to multiple different target videos can be completed in one transcoding machine.
  • the entire transcoding process only requires one source video download from an external storage platform, reducing the number of source video downloads , So as to reduce the bandwidth occupied when the source video is transcoded into multiple different videos, and then it can support more business volume under the same bandwidth.
  • the improvement of a technology can be clearly distinguished from the improvement in hardware (for example, the improvement of circuit structures such as diodes, transistors, and switches) or the improvement in software (the improvement of the process flow).
  • the improvement of many methods and processes can be regarded as a direct improvement of the hardware circuit structure.
  • Designers almost get the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that the improvement of a method flow cannot be realized by hardware physical modules.
  • a programmable logic device Programmable Logic Device, PLD
  • PLD Programmable Logic Device
  • FPGA Field Programmable Gate Array
  • HDL Hardware Description Language
  • ABEL Advanced Boolean Expression
  • AHDL AlteraHardwareDescriptionLanguage
  • Confluence a specific programming language
  • CUPL CornellUniversityProgrammingLanguage
  • HDCal JHDL (JavaHardwareDescriptionLanguage)
  • Lava Lola
  • MyHDL PALASM
  • RHDL RubyHardwareDescription
  • video image transcoding device in addition to implementing the video image transcoding device in a pure computer-readable program code manner, it is entirely possible to make the video image transcoding device into logic gates, switches, application specific integrated circuits, Program the logic controller and embedded microcontroller to achieve the same function. Therefore, such a video image transcoding device can be regarded as a hardware component, and the device for implementing various functions included therein can also be regarded as a structure within the hardware component. Or even, the means for realizing various functions can be regarded as both a software module of an implementation method and a structure within a hardware component.
  • the present application can be implemented by means of software plus a necessary general hardware platform. Based on this understanding, the technical solution of the present application can be embodied in the form of a software product in essence or part that contributes to the existing technology, and the computer software product can be stored in a storage medium, such as ROM/RAM, magnetic disk , Optical discs, etc., including several instructions to enable a computer device (which may be a personal computer, server, or network device, etc.) to perform the methods described in various embodiments of the present application or some parts of the embodiments.
  • ROM/RAM read-only memory
  • magnetic disk magnetic disk
  • Optical discs etc.
  • the present application may be described in the general context of computer-executable instructions executed by a computer, such as program modules.
  • program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types.
  • the present application may also be practiced in distributed computing environments in which tasks are performed by remote processing devices connected through a communication network.
  • program modules may be located in local and remote computer storage media including storage devices.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Computing Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

The embodiment of the present application disclose a video transcoding method and device. The method comprises the following steps: obtaining a source video; determining the mode of transcoding the source video into multiple target videos to be output; and transcoding the source video on the basis of the determined transcoding mode. The technical solution according to the present application can reduce the bandwidth occupied when transcoding a source video into multiple different videos, thereby supporting bigger business volume under a same bandwidth.

Description

一种视频转码方法及装置Video transcoding method and device
本申请要求2018年12月11日递交的申请号为201811510051.3、发明名称为“一种视频转码方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application requires the priority of the Chinese patent application with the application number 201811510051.3 and the invention titled "a video transcoding method and device" filed on December 11, 2018, the entire content of which is incorporated by reference in this application.
技术领域Technical field
本申请涉及互联网技术领域,特别涉及一种视频转码方法及装置。This application relates to the field of Internet technology, in particular to a video transcoding method and device.
背景技术Background technique
随着互联网技术的不断发展,涌现出越来越多的视频播放平台。为了向用户提供不同画质的视频,视频播放平台通常需要对源视频进行转码,从而生成具备不同分辨率和不同码率的多份视频。With the continuous development of Internet technology, more and more video playback platforms have emerged. In order to provide users with videos with different picture quality, the video playback platform usually needs to transcode the source video to generate multiple videos with different resolutions and different bit rates.
当前,针对生成的每一份视频,都需要先从外部存储平台下载源视频,然后对源视频进行转码。那么,为了生成这些视频,需要多次下载源视频,导致占用较多带宽。由于外部存储平台通常会针对带宽和流量设置并发上限,这样,势必会阻碍视频播放平台的业务规模的增长。因此,亟需提供一种更加可靠的视频转码方法,以降低源视频转码为多份不同的视频时所占带宽。Currently, for each generated video, the source video needs to be downloaded from an external storage platform first, and then the source video is transcoded. Then, in order to generate these videos, the source video needs to be downloaded multiple times, which results in consuming more bandwidth. Because external storage platforms usually set concurrency limits for bandwidth and traffic, this will inevitably hinder the growth of the video playback platform's business scale. Therefore, there is an urgent need to provide a more reliable video transcoding method to reduce the bandwidth occupied when the source video is transcoded into multiple different videos.
发明内容Summary of the invention
本申请实施方式的目的是提供一种视频转码方法及装置,能够降低源视频转码为多份不同的视频时所占带宽,从而可以在同样带宽下支撑更多的业务量。The purpose of the embodiments of the present application is to provide a video transcoding method and device, which can reduce the bandwidth occupied when the source video is transcoded into multiple different videos, so as to support more traffic under the same bandwidth.
为实现上述目的,本申请实施方式提供一种视频转码方法,所述方法包括:获取源视频;针对待输出的多种目标视频,确定从所述源视频转码为所述目标视频的转码方式;基于确定的所述转码方式,对所述源视频进行转码。In order to achieve the above purpose, an embodiment of the present application provides a video transcoding method, the method includes: obtaining a source video; for a variety of target videos to be output, determining a transcoding from the source video to a conversion of the target video Coding mode; based on the determined transcoding mode, transcoding the source video.
为实现上述目的,本申请实施方式还提供一种视频转码装置,所述装置包括:视频获取单元,用于获取源视频;转码方式确定单元,用于针对待输出的多种目标视频,确定从所述源视频转码为所述目标视频的转码方式;转码单元,用于基于确定的所述转码方式,对所述源视频进行转码。To achieve the above purpose, the embodiments of the present application also provide a video transcoding device, which includes: a video acquisition unit for acquiring source video; a transcoding mode determination unit for multiple target videos to be output, Determining a transcoding method from the source video to the target video; a transcoding unit, configured to transcode the source video based on the determined transcoding method.
为实现上述目的,本申请实施方式还提供一种视频转码装置,所述装置包括存储器和处理器,所述存储器用于存储计算机程序,所述计算机程序被所述处理器执行时,实现上述的视频转码方法。In order to achieve the above object, the embodiments of the present application also provide a video transcoding device. The device includes a memory and a processor. The memory is used to store a computer program. When the computer program is executed by the processor, the foregoing Video transcoding method.
由上可见,本申请提供的技术方案,在获取源视频之后,针对待输出的多种目标视频,可以分别确定从所述源视频转码为各个所述目标视频的各种转码方式。这样,根据确定的从所述源视频转码分别转码为各个所述目标视频的各个转码方式,依次对所述源视频进行转码,以得到各个所述目标视频,也可以根据确定的各个所述转码方式,对所述源视频进行并行转码,以得到各个所述目标视频。如此,从源视频转码为多份不同的目标视频的转码过程可以在一台转码机器完成,整个转码过程只需从外部存储平台进行一次源视频下载,减少了源视频下载的次数,从而降低源视频转码为多份不同的视频时所占带宽,进而可以在同样带宽下支撑更多的业务量。It can be seen from the above that, after obtaining the source video, after acquiring the source video, for various target videos to be output, various transcoding methods for transcoding from the source video to each of the target videos can be separately determined. In this way, according to the determined transcoding methods from the source video to the target video, the source video is sequentially transcoded to obtain each of the target videos, or according to the determined In each of the transcoding modes, the source video is transcoded in parallel to obtain each of the target videos. In this way, the transcoding process from the source video to multiple different target videos can be completed in one transcoding machine. The entire transcoding process only requires one source video download from an external storage platform, reducing the number of source video downloads , So as to reduce the bandwidth occupied when the source video is transcoded into multiple different videos, and then it can support more business volume under the same bandwidth.
附图说明BRIEF DESCRIPTION
为了更清楚地说明本申请实施方式或现有技术中的技术方案,下面将对实施方式或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请中记载的一些实施方式,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to more clearly explain the embodiments of the present application or the technical solutions in the prior art, the following will briefly introduce the drawings used in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only These are some of the embodiments described in this application. For those of ordinary skill in the art, without paying any creative labor, other drawings can be obtained based on these drawings.
图1为本申请实施方式中视频转码方法示意图;FIG. 1 is a schematic diagram of a video transcoding method in an embodiment of this application;
图2为本申请实施方式中有向无环转码架构的示意图;2 is a schematic diagram of a directed acyclic transcoding architecture in the implementation of this application;
图3为本申请实施方式中一种视频转码装置的结构示意图;3 is a schematic structural diagram of a video transcoding device according to an embodiment of the present application;
图4为本申请实施方式中另一种视频转码装置的结构示意图。4 is a schematic structural diagram of another video transcoding device in an embodiment of the present application.
具体实施方式detailed description
为了使本技术领域的人员更好地理解本申请中的技术方案,下面将结合本申请实施方式中的附图,对本申请实施方式中的技术方案进行清楚、完整地描述,显然,所描述的实施方式仅仅是本申请一部分实施方式,而不是全部的实施方式。基于本申请中的实施方式,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施方式,都应当属于本申请保护的范围。In order to enable those skilled in the art to better understand the technical solutions in the present application, the technical solutions in the embodiments of the present application will be described clearly and completely in conjunction with the drawings in the embodiments of the present application. Obviously, the described The embodiments are only a part of the embodiments of the present application, but not all the embodiments. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art without creative work shall fall within the scope of protection of this application.
本申请提供一种视频转码方法,所述方法可以应用于具备图像处理功能的终端设备中。所述终端设备例如可以是台式电脑、笔记本电脑、平板电脑、工作站等。此外,所述方法还可以应用于视频播放网站的业务服务器中,所述业务服务器可以是独立的服务器,也可以是由多个服务器构成的服务器集群。The present application provides a video transcoding method, which can be applied to a terminal device having an image processing function. The terminal device may be, for example, a desktop computer, a notebook computer, a tablet computer, a workstation, or the like. In addition, the method can also be applied to a business server of a video playing website. The business server may be an independent server or a server cluster composed of multiple servers.
请参阅图1,本申请提供的视频转码方法包括以下步骤。Please refer to FIG. 1, the video transcoding method provided in this application includes the following steps.
S11:获取源视频。S11: Obtain the source video.
在本实施方式中,通过对源视频进行转码,可以生成具备不同分辨率和不同码率的多份视频。In this embodiment, by transcoding the source video, multiple videos with different resolutions and different code rates can be generated.
在本实施方式中,获取所述源视频的方式可以包括根据外部存储平台提供的存储路径,从所述存储路径下读取所述源视频。In this embodiment, the method of acquiring the source video may include reading the source video from the storage path according to a storage path provided by an external storage platform.
S13:针对待输出的多种目标视频,确定从所述源视频转码为所述目标视频的转码方式。S13: Determine the transcoding method from the source video to the target video for various target videos to be output.
在本实施方式中,在获取源视频之后,针对待输出的多种目标视频或者目标音频,需要分别对所述源视频进行转码,从而得到这些目标视频或目标音频。由于这些目标视频的输出都依赖于所述源视频,那么可以根据源视频与这些目标视频之间的依赖关系,构建以源视频为根节点、所述目标视频为子节点的有向无环图(Directed Acyclic Graph,DAG)的转码结构,从而可以按照构建的转码结构在所述终端设备中完成从源视频转码为多种目标视频的多个转码任务。为了实现这些转码任务,可以先确定所述源视频转码为所述目标视频的转码方式。这样,后续便可以基于确定的所述转码方式,在一台终端设备中实现对所述源视频的转码过程,以得到各种目标视频。In this embodiment, after acquiring the source video, for the various target videos or target audios to be output, the source videos need to be transcoded separately to obtain these target videos or target audios. Since the output of these target videos depends on the source video, a directed acyclic graph with the source video as the root node and the target video as the child node can be constructed according to the dependency relationship between the source video and these target videos (Directed Acyclic Graph, DAG) transcoding structure, so that multiple transcoding tasks from source video to multiple target videos can be completed in the terminal device according to the constructed transcoding structure. In order to achieve these transcoding tasks, the source video may be transcoded into the target video transcoding method. In this way, based on the determined transcoding method, the transcoding process of the source video can be implemented in a terminal device to obtain various target videos.
在一个实施方式中,从所述源视频转码为所述目标视频的转码过程可能是实际应用中已经存在的转码过程,那么,便可以从已经存在的转码过程中直接获取从所述源视频转码为所述目标视频的转码方式。在本实施方式中,所述转码方式与一个视频转码至另一个视频所需的视频转码参数相对应,该视频转码参数的参数值可以根据这两个视频的视频参数和音频参数的参数值确定。所述转码参数例如可以包括保真度、分辨率、传输码率等。在设置了这些转码参数后,便可以对视频进行转码,从而得到符合这些转码参数的转码后的视频。In one embodiment, the transcoding process from the source video to the target video may be a transcoding process that already exists in actual applications. Then, the transcoding process can be directly obtained from the existing transcoding process. The source video transcoding is a transcoding method of the target video. In this embodiment, the transcoding method corresponds to the video transcoding parameters required for transcoding one video to another video, and the parameter values of the video transcoding parameters may be based on the video parameters and audio parameters of the two videos The parameter value is determined. The transcoding parameters may include, for example, fidelity, resolution, transmission code rate, and so on. After these transcoding parameters are set, the video can be transcoded, so that the transcoded video conforming to these transcoding parameters can be obtained.
在一个实施方式中,考虑到从所述源视频转码为多种目标视频的转码方式可能无法从已存在的转码过程中找到,为此,在实际应用过程中,可以采用深度学习的方法,构建用于识别转码方式的转码方式识别模型。例如,可以通过支持向量机(support vector machine,SVM)对由所述源视频和所述目标视频构成的视频组对应的转码方式进行识别。其中,可以将所述源视频和所述目标视频分别作为所述转码方式识别模型中的转码起始节点和转码结束节点。具体地,在构建所述路径识别模型时,可以预先获取训练样本集,所述训练样本集可以用于对所述转码方式识别模型进行训练,以使得所述转码方式识别模型能够识别出输入的视频组对应的转码方式。所述训练样本集中可以包括对应的转码 方式为指定转码方式的样本视频组以及对应的转码方式不为所述指定转码方式的样本视频组。所述样本视频组中可以包括所述转码起始节点和所述转码结束节点分别对应的样本视频。这样,在训练过程中,可以依次将所述训练样本集中的样本视频组输入转码方式识别模型。该转码方式识别模型中可以构建初始的神经网络,神经网络中可以预先设置初始预测参数。通过所述初始预测参数对输入的所述样本视频组进行处理后,可以得到所述样本视频组的预测结果,所述预测结果可以用于表征所述样本视频组对应的转码方式是否为所述指定转码方式。具体地,所述转码方式识别模型在对样本视频组进行处理时,首先可以分别提取所述源视频的参数信息对应的第一特征向量和所述目标视频的参数信息对应的第二特征向量。所述第一特征向量中的元素可以是所述源视频的各个参数的参数值,例如,视频参数或音频参数的参数值,视频参数可以包括视频分辨率、视频码率、视频帧率和视频格式等等。类似地,所述第一特征向量中的元素可以是所述目标视频的各个参数的参数值。这样,所述转码方式识别模型可以读取所述样本视频组中转码起始节点对应的源视频中每个参数的参数值,以及转码结束节点对应的目标视频中每个参数的参数值,并按照读取的顺序,将参数值构成所述第一特征向量和所述第二特征向量。在实际应用中,由于参数的个数通常较多,会导致提取的特征向量的维数也较大,这样,会耗费较多的资源来对特征向量进行处理。鉴于此,在本实施方式中还可以采用卷积神经网络(Convolutional Neural Network,CNN)对样本视频组进行处理,从而得到维数较小的特征向量,以便后续的识别处理。In one embodiment, considering that transcoding from the source video to multiple target videos may not be found in the existing transcoding process, for this reason, in the actual application process, deep learning can be used Method, construct a transcoding method recognition model for identifying transcoding methods. For example, a support vector machine (support vector machine, SVM) may be used to identify the transcoding method corresponding to the video group composed of the source video and the target video. Wherein, the source video and the target video may be used as a transcoding start node and a transcoding end node in the transcoding mode identification model, respectively. Specifically, when constructing the path recognition model, a training sample set may be obtained in advance, and the training sample set may be used to train the transcoding mode recognition model so that the transcoding mode recognition model can recognize The transcoding method corresponding to the input video group. The training sample set may include a sample video group whose corresponding transcoding method is the specified transcoding method and a corresponding sample video group whose corresponding transcoding method is not the specified transcoding method. The sample video group may include sample videos corresponding to the transcoding start node and the transcoding end node, respectively. In this way, during the training process, the sample video groups in the training sample set can be sequentially input into the transcoding mode recognition model. An initial neural network can be constructed in the transcoding method recognition model, and initial prediction parameters can be preset in the neural network. After processing the input sample video group through the initial prediction parameters, a prediction result of the sample video group can be obtained, and the prediction result can be used to characterize whether the transcoding mode corresponding to the sample video group is Specify the transcoding method. Specifically, when the transcoding method recognition model processes the sample video group, it can first extract the first feature vector corresponding to the parameter information of the source video and the second feature vector corresponding to the parameter information of the target video . Elements in the first feature vector may be parameter values of various parameters of the source video, for example, parameter values of video parameters or audio parameters, and video parameters may include video resolution, video bit rate, video frame rate, and video Format and so on. Similarly, the elements in the first feature vector may be parameter values of various parameters of the target video. In this way, the transcoding mode recognition model can read the parameter value of each parameter in the source video corresponding to the transcoding start node in the sample video group, and the parameter value of each parameter in the target video corresponding to the transcoding end node , And in accordance with the order of reading, the parameter values constitute the first feature vector and the second feature vector. In practical applications, since the number of parameters is usually large, the dimension of the extracted feature vector is also large, which will consume more resources to process the feature vector. In view of this, in this embodiment, a convolutional neural network (Convolutional Neural Network, CNN) can also be used to process the sample video group, so as to obtain feature vectors with smaller dimensions for subsequent identification processing.
在本实施方式中,经过所述神经网络对输入的样本视频组的数据进行处理之后,可以得到该样本视频组的概率值向量。在所述概率值向量中可以包括针对指定转码方式的概率值。所述概率值向量中可以包括两个概率值,这两个概率值分别表示转码方式为所述指定转码方式的概率以及不为所述指定转码方式的概率。例如,在输入一组对应的转码方式为所述指定转码方式的样本视频组之后,经过所述转码方式识别模型可以得到(0.4,0.8)这样的概率值向量,其中,0.4表示转码方式为所述指定转码方式息的概率,0.8表示转码方式不为所述指定转码方式的概率。由于转码方式识别模型中的初始预测参数可能设置得不够准确,因此经过转码方式识别模型预测得到的概率结果可能与实际情况不符。例如,上述输入的是转码方式为所述指定转码方式的样本视频组,但是得到的概率向量中,表示转码方式为所述指定转码方式的概率仅为0.4,而表示转码方式不为所述指定转码方式的概率为0.8。在这种情况下,表明预测结果不正确。此时,可以根据所述预测结果与正确结果之间的差异值,对所述转码方式识别模型中的初始预测参数进行 调整。具体地,所述样本视频组可以具备理论的概率值结果。例如,转码方式为所述指定转码方式的理论的概率值结果可以为(1,0),其中1表示转码方式为所述指定转码方式的概率值。此时,可以将预测得到的概率值结果与理论的概率值结果进行相减,从而得到两者的差值,然后可以利用得到的差值对神经网络的初始预测参数进行调整,最终使得通过调整后的预测参数再次对所述样本视频组进行处理后,得到的预测结果与正确结果相符。这样,通过对大量的训练样本进行训练之后,该转码方式识别模型便可以区分样本视频组对应的转码方式是否为所述指定转码方式,从而可以识别出样本视频组对应的实际转码方式。In this embodiment, after processing the data of the input sample video group through the neural network, a probability value vector of the sample video group can be obtained. The probability value vector may include a probability value for a specified transcoding method. The probability value vector may include two probability values, and these two probability values respectively represent the probability that the transcoding method is the specified transcoding method and the probability that the transcoding method is not the specified transcoding method. For example, after inputting a corresponding set of sample video groups whose transcoding method is the specified transcoding method, a probability value vector of (0.4, 0.8) can be obtained through the transcoding method recognition model, where 0.4 means transcoding The coding method is the probability of the specified transcoding method, and 0.8 means the probability that the transcoding method is not the specified transcoding method. Since the initial prediction parameters in the transcoding method identification model may not be set accurately enough, the probability results predicted by the transcoding method identification model may not match the actual situation. For example, the above input is a sample video group whose transcoding method is the specified transcoding method, but in the obtained probability vector, the probability that the transcoding method is the specified transcoding method is only 0.4, which indicates the transcoding method The probability of not specifying the transcoding method is 0.8. In this case, it indicates that the prediction result is incorrect. At this time, the initial prediction parameter in the transcoding mode identification model can be adjusted according to the difference between the prediction result and the correct result. Specifically, the sample video group may have a theoretical probability value result. For example, the theoretical probability value result of the transcoding method being the designated transcoding method may be (1, 0), where 1 indicates that the transcoding method is the probability value of the designated transcoding method. At this time, the predicted probability value result can be subtracted from the theoretical probability value result to obtain the difference between the two, and then the obtained difference can be used to adjust the initial prediction parameters of the neural network. After the prediction parameters are processed again for the sample video group, the obtained prediction result is consistent with the correct result. In this way, after training a large number of training samples, the transcoding method recognition model can distinguish whether the transcoding method corresponding to the sample video group is the specified transcoding method, thereby identifying the actual transcoding corresponding to the sample video group the way.
S15:基于获取的所述路径信息,对所述源视频进行转码。S15: Transcode the source video based on the obtained path information.
在本实施方式中,在确定从所述源视频转码为所述目标视频的转码方式之后,便可以基于确定的所述转码方式,在一台终端设备中实现对所述源视频的转码过程,以得到各种所述目标视频。具体地,由于这些目标视频的输出都依赖于所述源视频,那么可以根据源视频与这些目标视频之间的依赖关系,构建以源视频为根节点、所述目标视频为子节点的有向无环图(Directed Acyclic Graph,DAG)的转码结构,从而可以基于确定的分别针对各种目标视频的各种转码方式,按照构建的转码结构在所述终端设备中完成从源视频转码为多种目标视频的多个转码任务。在实际应用中,可以据确定的从所述源视频转码分别转码为各个所述目标视频的各个转码方式,依次对所述源视频进行转码,以得到各个所述目标视频。例如,可以按照转码方式对应的处理器使用率由小到大的顺序和上述的转码结构,依次对所述源视频进行转码,从而得到对应的各种目标视频。不仅如此,还可以根据确定的各个所述转码方式,按照上述的转码结构,对所述源视频进行并行转码,也就是并发进行上述多个转码任务,从而可以得到各个所述目标视频。如此,从源视频转码为多份不同的目标视频的转码过程可以在一台转码机器完成,整个转码过程只需从外部存储平台进行一次源视频下载,减少了源视频下载的次数,从而降低源视频转码为多份不同的视频时所占带宽,进而可以在同样带宽下支撑更多的业务量。In this embodiment, after determining the transcoding method from the source video to the target video, the source video can be implemented in a terminal device based on the determined transcoding method Transcoding process to get the various target videos. Specifically, since the output of these target videos depends on the source video, then according to the dependency relationship between the source video and these target videos, a directed direction with the source video as the root node and the target video as the child node can be constructed Directed Acyclic Graph (DAG) transcoding structure, so that based on the determined various transcoding methods for various target videos, the conversion from the source video can be completed in the terminal device according to the constructed transcoding structure The code is multiple transcoding tasks for multiple target videos. In practical applications, the source video may be transcoded into each of the target videos according to the determined transcoding method, and the source video may be transcoded in sequence to obtain each of the target videos. For example, the source video may be transcoded in order according to the sequence of the processor usage corresponding to the transcoding method from small to large and the above-mentioned transcoding structure, so as to obtain corresponding various target videos. Not only that, it is also possible to perform parallel transcoding on the source video according to each of the determined transcoding methods and the above transcoding structure, that is, to concurrently perform the above multiple transcoding tasks, so that each of the targets can be obtained video. In this way, the transcoding process from the source video to multiple different target videos can be completed in one transcoding machine. The entire transcoding process only requires one source video download from an external storage platform, reducing the number of source video downloads , So as to reduce the bandwidth occupied when the source video is transcoded into multiple different videos, and then it can support more business volume under the same bandwidth.
在本申请一个实施方式中,考虑到在转码过程中充分利用实际转码设备的处理器使用率以及避免实际转码设备负载过量的情况出现,可以预先根据在实际转码设备上从所述源视频转码为指定视频时对应的处理器使用率,合理调度转码设备上的转码任务。那么,在获取源视频之前,可以获取转码调度信息。其中,所述转码调度信息可以用于表征分配在指定转码设备上的多个转码任务信息;所述转码任务信息与所述源视频、待输出的目标视频相对应。相应地,后续便可以针对所述转码任务信息对应的待输出的目标 视频,确定从所述源视频转码为所述目标视频的转码方式。In an embodiment of the present application, considering that the processor utilization rate of the actual transcoding device is fully utilized during the transcoding process and the situation that the actual transcoding device is overloaded is avoided, the actual transcoding device The source video transcoding is the corresponding processor usage rate when specifying the video, and the transcoding task on the transcoding device is reasonably scheduled. Then, before obtaining the source video, the transcoding scheduling information can be obtained. Wherein, the transcoding scheduling information may be used to characterize multiple transcoding task information allocated on the designated transcoding device; the transcoding task information corresponds to the source video and the target video to be output. Correspondingly, the target video to be output corresponding to the transcoding task information can be subsequently determined to be a transcoding method from the source video to the target video.
在本实施方式中,获取所述转码调度信息的方式具体可以包括根据提供的存储路径,从所述存储路径下读取所述转码调度信息。在实际应用中,确定所述转码调度信息具体可以包括,可以先确定在指定转码设备上从所述源视频转码为指定视频时对应的处理器使用率。其中,所述指定转码设备可以包括后续进行转码任务的转码器。例如,从实际应用中,可以在各个转码器上完成对应的单个转码任务时记录对应的处理器使用率。接着可以根据确定的所述处理器使用率,从所述指定视频中确定待在所述指定转码设备上输出的目标视频。例如,当确定的多种所述指定视频分别对应的处理器使用率之和达到指定阈值时,可以将所述指定视频作为待输出的目标视频。其中,所述指定阈值的取值范围可以根据实际应用情况来设定,例如,可以包括90百分比(%)~100%。最后,可以基于确定的待输出的目标视频,生成针对所述指定转码设备的转码调度信息。In this embodiment, the manner of acquiring the transcoding scheduling information may specifically include reading the transcoding scheduling information from the storage path according to the provided storage path. In practical applications, determining the transcoding scheduling information may specifically include that, first, the processor usage rate corresponding to the transcoding from the source video to the designated video on the designated transcoding device may be determined. Wherein, the designated transcoding device may include a transcoder that subsequently performs the transcoding task. For example, from actual application, the corresponding processor usage rate can be recorded when a corresponding single transcoding task is completed on each transcoder. Then, the target video to be output on the specified transcoding device may be determined from the specified video according to the determined processor usage rate. For example, when the sum of the processor usage rates corresponding to the determined multiple types of specified videos reaches a specified threshold, the specified video may be used as the target video to be output. Wherein, the value range of the specified threshold can be set according to the actual application, for example, it can include 90 percent (%) to 100%. Finally, based on the determined target video to be output, transcoding scheduling information for the designated transcoding device may be generated.
例如,如图2所示,为了向用户提供多种视频或纯音频,例如,分辨率分别为1080P、720P、540P、360P、270P和音频,可以先根据在实际转码设备上从所述源视频分别转码为这些视频或纯音频时对应的处理器使用率,合理调度转码设备上的转码任务。经过转码任务的组合,例如,将从所述源视频分别转码为音频、分辨率分为1080P和270P的视频的转码任务分配至一个转码设备,将从所述源视频分别转码为分辨率为720P、540P、360P的视频的转码任务,便可以生成对应的转码调度信息。后续在获取所述转码调度信息之后,这两个转码设备分别仅需从外部存储平台进行一次源视频下载,便可以分别完成多个转码任务。如此,便可以明显减少了源视频下载的次数,从而降低源视频转码为多份不同的视频时所占带宽,进而可以在同样带宽下支撑更多的业务量。For example, as shown in FIG. 2, in order to provide users with a variety of video or pure audio, for example, resolutions of 1080P, 720P, 540P, 360P, 270P and audio, you can first select the source from the source on the actual transcoding device. When the video is transcoded to the corresponding processor utilization rate of these videos or pure audio, the transcoding task on the transcoding device is reasonably scheduled. After the combination of transcoding tasks, for example, the transcoding tasks of transcoding the source video into audio and video with resolutions of 1080P and 270P are assigned to a transcoding device, and the source video is transcoded separately For video transcoding tasks with resolutions of 720P, 540P, and 360P, corresponding transcoding scheduling information can be generated. Subsequently, after acquiring the transcoding scheduling information, the two transcoding devices only need to download the source video once from the external storage platform, and can complete multiple transcoding tasks respectively. In this way, the number of source video downloads can be significantly reduced, thereby reducing the bandwidth occupied when the source video is transcoded into multiple different videos, and thus can support more business volume under the same bandwidth.
在本实施方式中,上述方法步骤中实现的功能,可以由计算机程序实现,所述计算机程序可以被存储于计算机存储介质中。具体的,所述计算机存储介质可以与处理器进行耦合,处理器从而可以读取计算机存储介质中的计算机程序。所述计算机程序被处理器执行时,可以实现以下功能:In this embodiment, the functions implemented in the above method steps may be implemented by a computer program, and the computer program may be stored in a computer storage medium. Specifically, the computer storage medium may be coupled with the processor, so that the processor can read the computer program in the computer storage medium. When the computer program is executed by the processor, the following functions can be realized:
S11:获取源视频;S11: Obtain the source video;
S13:针对待输出的多种目标视频,确定从所述源视频转码为所述目标视频的转码方式;S13: Determine the transcoding method from the source video to the target video for multiple target videos to be output;
S15:基于确定的所述转码方式,对所述源视频进行转码。S15: Transcode the source video based on the determined transcoding method.
在一个实施方式中,所述计算机程序被所述处理器执行时,还实现以下步骤:In one embodiment, when the computer program is executed by the processor, the following steps are further implemented:
根据确定的从所述源视频转码分别转码为各个所述目标视频的各个转码方式,依次 对所述源视频进行转码,以得到各个所述目标视频;According to the determined respective transcoding methods of transcoding from the source video into each of the target videos, sequentially transcoding the source video to obtain each of the target videos;
或者,or,
根据确定的各个所述转码方式,对所述源视频进行并行转码,以得到各个所述目标视频。According to each of the determined transcoding methods, the source video is transcoded in parallel to obtain each of the target videos.
在一个实施方式中,所述计算机程序被所述处理器执行时,还实现以下步骤:In one embodiment, when the computer program is executed by the processor, the following steps are further implemented:
获取转码调度信息;所述转码调度信息用于表征分配在指定转码设备上的多个转码任务信息;所述转码任务信息与所述源视频、待输出的目标视频相对应;Obtain transcoding scheduling information; the transcoding scheduling information is used to characterize multiple transcoding task information allocated on a designated transcoding device; the transcoding task information corresponds to the source video and the target video to be output;
相应地,针对所述转码任务信息对应的待输出的目标视频,确定从所述源视频转码为所述目标视频的转码方式。Correspondingly, for the target video to be output corresponding to the transcoding task information, the transcoding method from the source video to the target video is determined.
在一个实施方式中,所述计算机程序被所述处理器执行时,还实现以下步骤:In one embodiment, when the computer program is executed by the processor, the following steps are further implemented:
确定在指定转码设备上从所述源视频转码为指定视频时对应的处理器使用率;Determine the corresponding processor usage rate when transcoding from the source video to the designated video on the designated transcoding device;
根据确定的所述处理器使用率,从所述指定视频中确定待在所述指定转码设备上输出的目标视频;Determine the target video to be output on the designated transcoding device from the designated video according to the determined utilization rate of the processor;
基于确定的待输出的目标视频,生成针对所述指定转码设备的转码调度信息。Based on the determined target video to be output, transcoding scheduling information for the designated transcoding device is generated.
在一个实施方式中,所述计算机程序被所述处理器执行时,还实现以下步骤:In one embodiment, when the computer program is executed by the processor, the following steps are further implemented:
当确定的多种所述指定视频分别对应的处理器使用率之和达到指定阈值时,将所述指定视频作为待输出的目标视频。When the sum of the respective processor utilization rates of the determined multiple types of the specified videos reaches a specified threshold, the specified video is used as the target video to be output.
在一个实施方式中,所述计算机程序被所述处理器执行时,还实现以下步骤:In one embodiment, when the computer program is executed by the processor, the following steps are further implemented:
将所述源视频和所述目标视频构成的视频组输入转码方式识别模型中,以通过所述转码方式识别模型分别提取所述源视频的参数信息对应的第一特征向量和所述目标视频的参数信息对应的第二特征向量,并通过所述转码方式识别模型确定所述第一特征向量和所述第二特征向量构成的向量组对应的预测值;Inputting a video group composed of the source video and the target video into a transcoding method identification model, to separately extract the first feature vector corresponding to the parameter information of the source video and the target through the transcoding method identification model The second feature vector corresponding to the parameter information of the video, and determining the prediction value corresponding to the vector group formed by the first feature vector and the second feature vector through the transcoding method recognition model;
将所述预测值表征的转码方式作为从所述源视频转码为所述目标视频的转码方式。The transcoding method characterized by the predicted value is used as the transcoding method from the source video to the target video.
在一个实施方式中,所述计算机程序被所述处理器执行时,还实现以下步骤:In one embodiment, when the computer program is executed by the processor, the following steps are further implemented:
获取训练样本集,所述训练样本集中包括对应的转码方式为指定转码方式的样本视频组以及对应的转码方式不为所述指定转码方式的样本视频组;Obtain a training sample set, where the training sample set includes a sample video group whose corresponding transcoding method is the specified transcoding method and a corresponding sample video group whose corresponding transcoding method is not the specified transcoding method;
将所述训练样本集中的样本视频组输入转码方式识别模型,所述转码方式识别模型中包括初始预测参数;Input the sample video group in the training sample set into a transcoding mode identification model, where the transcoding mode identification model includes initial prediction parameters;
通过所述初始预测参数对输入的所述样本视频组进行处理,得到所述样本视频组的预测结果,所述预测结果用于表征所述样本视频组对应的转码方式是否为所述指定转码 方式;Processing the input sample video group through the initial prediction parameter to obtain a prediction result of the sample video group, where the prediction result is used to characterize whether the transcoding mode corresponding to the sample video group is the specified conversion Code method
若所述预测结果不正确,根据所述预测结果与正确结果之间的差异值,对所述转码方式识别模型中的初始预测参数进行调整,以使得通过调整后的预测参数再次对所述样本视频组进行处理后,得到的预测结果与正确结果相符。If the prediction result is incorrect, adjust the initial prediction parameters in the transcoding method identification model according to the difference between the prediction result and the correct result, so that the adjusted prediction parameters After the sample video group is processed, the prediction results obtained are consistent with the correct results.
请参阅图3,本申请还提供一种视频转码装置,所述装置可以包括:Referring to FIG. 3, this application also provides a video transcoding device, which may include:
视频获取单元100,用于获取源视频;The video obtaining unit 100 is used to obtain the source video;
转码方式确定单元200,用于针对待输出的多种目标视频,确定从所述源视频转码为所述目标视频的转码方式;The transcoding mode determining unit 200 is configured to determine a transcoding mode for transcoding from the source video to the target video for various target videos to be output;
转码单元300,用于基于确定的所述转码方式,对所述源视频进行转码。The transcoding unit 300 is configured to transcode the source video based on the determined transcoding method.
在一个实施方式中,所述转码单元还用于根据确定的从所述源视频转码分别转码为各个所述目标视频的各个转码方式,依次对所述源视频进行转码,以得到各个所述目标视频,或者,根据确定的各个所述转码方式,对所述源视频进行并行转码,以得到各个所述目标视频。In one embodiment, the transcoding unit is further configured to sequentially transcode the source video according to the determined respective transcoding methods of transcoding from the source video into each of the target videos, to Obtaining each of the target videos, or, according to each of the determined transcoding modes, parallel transcoding the source video to obtain each of the target videos.
在一个实施方式中,所述装置还包括:In one embodiment, the device further includes:
调度信息获取单元,用于获取转码调度信息;所述转码调度信息用于表征分配在指定转码设备上的多个转码任务信息;所述转码任务信息与所述源视频、待输出的目标视频相对应;Scheduling information acquisition unit, used to acquire transcoding scheduling information; the transcoding scheduling information is used to characterize multiple transcoding task information allocated on the designated transcoding device; the transcoding task information and the source video Corresponding to the output target video;
相应的,所述转码方式确定单元用于针对所述转码任务信息对应的待输出的目标视频,确定从所述源视频转码为所述目标视频的转码方式。Correspondingly, the transcoding mode determining unit is used to determine the transcoding mode from the source video to the target video for the target video to be output corresponding to the transcoding task information.
在一个实施方式中,所述调度信息获取单元包括:In one embodiment, the scheduling information acquisition unit includes:
使用率确定模块,用于确定在指定转码设备上从所述源视频转码为指定视频时对应的处理器使用率;A utilization rate determining module, used to determine the corresponding processor utilization rate when transcoding from the source video to the designated video on the designated transcoding device;
视频确定模块,用于根据确定的所述处理器使用率,从所述指定视频中确定待在所述指定转码设备上输出的目标视频;A video determining module, configured to determine the target video to be output on the designated transcoding device from the designated video according to the determined utilization rate of the processor;
信息生成模块,用于基于确定的待输出的目标视频,生成针对所述指定转码设备的转码调度信息。The information generating module is configured to generate transcoding scheduling information for the designated transcoding device based on the determined target video to be output.
在一个实施方式中,所述视频确定模块还用于当确定的多种所述指定视频分别对应的处理器使用率之和达到指定阈值时,将所述指定视频作为待输出的目标视频。In one embodiment, the video determination module is further configured to use the specified video as the target video to be output when the sum of the processor usage rates corresponding to the determined multiple types of the specified videos reaches a specified threshold.
本说明书实施方式提供的视频转码装置,其中各个单元模块的具体功能,可以与本说明书中的前述方法实施方式相对照解释,并能够达到前述方法实施方式的技术效果, 这里便不再赘述。The video transcoding device provided in the embodiments of the present specification, wherein the specific functions of each unit module can be explained in comparison with the aforementioned method embodiments in the present specification, and can achieve the technical effects of the aforementioned method embodiments, which will not be repeated here.
请参阅图4,本申请还提供一种视频转码装置,所述装置包括存储器和处理器,所述存储器用于存储计算机程序,所述计算机程序被所述处理器执行时,实现以下步骤:Referring to FIG. 4, the present application also provides a video transcoding device. The device includes a memory and a processor. The memory is used to store a computer program. When the computer program is executed by the processor, the following steps are implemented:
S11:获取源视频;S11: Obtain the source video;
S13:针对待输出的多种目标视频,确定从所述源视频转码为所述目标视频的转码方式;S13: Determine the transcoding method from the source video to the target video for multiple target videos to be output;
S15:基于确定的所述转码方式,对所述源视频进行转码。S15: Transcode the source video based on the determined transcoding method.
在本实施方式中,所述存储器可以包括用于存储信息的物理装置,通常是将信息数字化后再以利用电、磁或者光学等方法的媒体加以存储。本实施方式所述的存储器又可以包括:利用电能方式存储信息的装置,如RAM、ROM等;利用磁能方式存储信息的装置,如硬盘、软盘、磁带、磁芯存储器、磁泡存储器、U盘;利用光学方式存储信息的装置,如CD或DVD。当然,还有其他方式的存储器,例如量子存储器、石墨烯存储器等等。In this embodiment, the memory may include a physical device for storing information, usually the information is digitized and then stored on a medium using electrical, magnetic, or optical methods. The memory described in this embodiment may further include: devices that use electrical energy to store information, such as RAM, ROM, etc.; devices that use magnetic energy to store information, such as hard disks, floppy disks, magnetic tapes, magnetic core memories, bubble memories, and U disks ; Devices that use optical methods to store information, such as CDs or DVDs. Of course, there are other types of memory, such as quantum memory, graphene memory, and so on.
在本实施方式中,所述处理器可以按任何适当的方式实现。例如,所述处理器可以采取例如微处理器或处理器以及存储可由该(微)处理器执行的计算机可读程序代码(例如软件或固件)的计算机可读介质、逻辑门、开关、专用集成电路(Application Specific Integrated Circuit,ASIC)、可编程逻辑控制器和嵌入微控制器的形式等等。In this embodiment, the processor may be implemented in any suitable manner. For example, the processor may employ, for example, a microprocessor or processor and a computer-readable medium storing computer-readable program code (such as software or firmware) executable by the (micro)processor, logic gate, switch, dedicated integration Circuit (Application Specific Integrated Circuit, ASIC), programmable logic controller and embedded microcontroller form, etc.
在一个实施方式中,所述计算机程序被所述处理器执行时,还实现以下步骤:In one embodiment, when the computer program is executed by the processor, the following steps are further implemented:
根据确定的从所述源视频转码分别转码为各个所述目标视频的各个转码方式,依次对所述源视频进行转码,以得到各个所述目标视频;According to the determined respective transcoding methods from the source video transcoding to each of the target videos, sequentially transcoding the source video to obtain each of the target videos;
或者,or,
根据确定的各个所述转码方式,对所述源视频进行并行转码,以得到各个所述目标视频。According to each of the determined transcoding methods, the source video is transcoded in parallel to obtain each of the target videos.
在一个实施方式中,所述计算机程序被所述处理器执行时,还实现以下步骤:In one embodiment, when the computer program is executed by the processor, the following steps are further implemented:
获取转码调度信息;所述转码调度信息用于表征分配在指定转码设备上的多个转码任务信息;所述转码任务信息与所述源视频、待输出的目标视频相对应;Obtain transcoding scheduling information; the transcoding scheduling information is used to characterize multiple transcoding task information allocated on a designated transcoding device; the transcoding task information corresponds to the source video and the target video to be output;
相应地,针对所述转码任务信息对应的待输出的目标视频,确定从所述源视频转码为所述目标视频的转码方式。Correspondingly, for the target video to be output corresponding to the transcoding task information, the transcoding method from the source video to the target video is determined.
在一个实施方式中,所述计算机程序被所述处理器执行时,还实现以下步骤:In one embodiment, when the computer program is executed by the processor, the following steps are further implemented:
确定在指定转码设备上从所述源视频转码为指定视频时对应的处理器使用率;Determine the corresponding processor usage rate when transcoding from the source video to the designated video on the designated transcoding device;
根据确定的所述处理器使用率,从所述指定视频中确定待在所述指定转码设备上输出的目标视频;Determine the target video to be output on the designated transcoding device from the designated video according to the determined utilization rate of the processor;
基于确定的待输出的目标视频,生成针对所述指定转码设备的转码调度信息。Based on the determined target video to be output, transcoding scheduling information for the designated transcoding device is generated.
在一个实施方式中,所述计算机程序被所述处理器执行时,还实现以下步骤:In one embodiment, when the computer program is executed by the processor, the following steps are further implemented:
当确定的多种所述指定视频分别对应的处理器使用率之和达到指定阈值时,将所述指定视频作为待输出的目标视频。When the sum of the respective processor utilization rates of the determined multiple types of the specified videos reaches a specified threshold, the specified video is used as the target video to be output.
在一个实施方式中,所述计算机程序被所述处理器执行时,还实现以下步骤:In one embodiment, when the computer program is executed by the processor, the following steps are further implemented:
将所述源视频和所述目标视频构成的视频组输入转码方式识别模型中,以通过所述转码方式识别模型分别提取所述源视频的参数信息对应的第一特征向量和所述目标视频的参数信息对应的第二特征向量,并通过所述转码方式识别模型确定所述第一特征向量和所述第二特征向量构成的向量组对应的预测值;Inputting a video group composed of the source video and the target video into a transcoding method identification model, to separately extract the first feature vector corresponding to the parameter information of the source video and the target through the transcoding method identification model The second feature vector corresponding to the parameter information of the video, and determining the prediction value corresponding to the vector group formed by the first feature vector and the second feature vector through the transcoding method recognition model;
将所述预测值表征的转码方式作为从所述源视频转码为所述目标视频的转码方式。The transcoding method characterized by the predicted value is used as the transcoding method from the source video to the target video.
在一个实施方式中,所述计算机程序被所述处理器执行时,还实现以下步骤:In one embodiment, when the computer program is executed by the processor, the following steps are further implemented:
获取训练样本集,所述训练样本集中包括对应的转码方式为指定转码方式的样本视频组以及对应的转码方式不为所述指定转码方式的样本视频组;Obtain a training sample set, where the training sample set includes a sample video group whose corresponding transcoding method is the specified transcoding method and a corresponding sample video group whose corresponding transcoding method is not the specified transcoding method;
将所述训练样本集中的样本视频组输入转码方式识别模型,所述转码方式识别模型中包括初始预测参数;Input the sample video group in the training sample set into a transcoding mode identification model, where the transcoding mode identification model includes initial prediction parameters;
通过所述初始预测参数对输入的所述样本视频组进行处理,得到所述样本视频组的预测结果,所述预测结果用于表征所述样本视频组对应的转码方式是否为所述指定转码方式;Processing the input sample video group through the initial prediction parameter to obtain a prediction result of the sample video group, where the prediction result is used to characterize whether the transcoding mode corresponding to the sample video group is the specified conversion Code method
若所述预测结果不正确,根据所述预测结果与正确结果之间的差异值,对所述转码方式识别模型中的初始预测参数进行调整,以使得通过调整后的预测参数再次对所述样本视频组进行处理后,得到的预测结果与正确结果相符。If the prediction result is incorrect, adjust the initial prediction parameters in the transcoding method identification model according to the difference between the prediction result and the correct result, so that the adjusted prediction parameters After the sample video group is processed, the prediction results obtained are consistent with the correct results.
由上可见,本申请提供的技术方案,在获取源视频之后,针对待输出的多种目标视频,可以分别确定从所述源视频转码为各个所述目标视频的各种转码方式。这样,根据确定的从所述源视频转码分别转码为各个所述目标视频的各个转码方式,依次对所述源视频进行转码,以得到各个所述目标视频,也可以根据确定的各个所述转码方式,对所述源视频进行并行转码,以得到各个所述目标视频。如此,从源视频转码为多份不同的目标视频的转码过程可以在一台转码机器完成,整个转码过程只需从外部存储平台进行一次源视频下载,减少了源视频下载的次数,从而降低源视频转码为多份不同的视频时 所占带宽,进而可以在同样带宽下支撑更多的业务量。It can be seen from the above that, after obtaining the source video, after acquiring the source video, for various target videos to be output, various transcoding methods for transcoding from the source video to each of the target videos can be separately determined. In this way, according to the determined transcoding methods from the source video to the target video, the source video is sequentially transcoded to obtain each of the target videos, or according to the determined For each of the transcoding methods, parallel transcoding the source video to obtain each of the target videos. In this way, the transcoding process from the source video to multiple different target videos can be completed in one transcoding machine. The entire transcoding process only requires one source video download from an external storage platform, reducing the number of source video downloads , So as to reduce the bandwidth occupied when the source video is transcoded into multiple different videos, and then it can support more business volume under the same bandwidth.
在20世纪90年代,对于一个技术的改进可以很明显地区分是硬件上的改进(例如,对二极管、晶体管、开关等电路结构的改进)还是软件上的改进(对于方法流程的改进)。然而,随着技术的发展,当今的很多方法流程的改进已经可以视为硬件电路结构的直接改进。设计人员几乎都通过将改进的方法流程编程到硬件电路中来得到相应的硬件电路结构。因此,不能说一个方法流程的改进就不能用硬件实体模块来实现。例如,可编程逻辑器件(Programmable Logic Device,PLD)(例如现场可编程门阵列(Field Programmable Gate Array,FPGA))就是这样一种集成电路,其逻辑功能由用户对器件编程来确定。由设计人员自行编程来把一个数字***“集成”在一片PLD上,而不需要请芯片制造厂商来设计和制作专用的集成电路芯片。而且,如今,取代手工地制作集成电路芯片,这种编程也多半改用“逻辑编译器(logic compiler)”软件来实现,它与程序开发撰写时所用的软件编译器相类似,而要编译之前的原始代码也得用特定的编程语言来撰写,此称之为硬件描述语言(Hardware Description Language,HDL),而HDL也并非仅有一种,而是有许多种,如ABEL(Advanced Boolean Expression Language)、AHDL(Altera Hardware Description Language)、Confluence、CUPL(Cornell University Programming Language)、HDCal、JHDL(Java Hardware Description Language)、Lava、Lola、MyHDL、PALASM、RHDL(Ruby Hardware Description Language)等,目前最普遍使用的是VHDL(Very-High-Speed Integrated Circuit Hardware Description Language)与Verilog2。本领域技术人员也应该清楚,只需要将方法流程用上述几种硬件描述语言稍作逻辑编程并编程到集成电路中,就可以很容易得到实现该逻辑方法流程的硬件电路。In the 1990s, the improvement of a technology can be clearly distinguished from the improvement in hardware (for example, the improvement of circuit structures such as diodes, transistors, and switches) or the improvement in software (the improvement of the process flow). However, with the development of technology, the improvement of many methods and processes can be regarded as a direct improvement of the hardware circuit structure. Designers almost get the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that the improvement of a method flow cannot be realized by hardware physical modules. For example, a programmable logic device (Programmable Logic Device, PLD) (such as a field programmable gate array (Field Programmable Gate Array, FPGA)) is such an integrated circuit, and its logic function is determined by the user programming the device. Designers can program themselves to "integrate" a digital system on a PLD without having to ask chip manufacturers to design and make dedicated integrated circuit chips. Moreover, nowadays, instead of manually making integrated circuit chips, this kind of programming is also mostly implemented with "logic compiler" software, which is similar to the software compiler used in program development and writing, but before compilation The original code must also be written in a specific programming language, which is called hardware description language (Hardware Description Language, HDL), and HDL is not only one kind, but there are many kinds, such as ABEL (Advanced Boolean Expression) Language , AHDL (AlteraHardwareDescriptionLanguage), Confluence, CUPL (CornellUniversityProgrammingLanguage), HDCal, JHDL (JavaHardwareDescriptionLanguage), Lava, Lola, MyHDL, PALASM, RHDL (RubyHardwareDescription) It is VHDL (Very-High-Speed Integrated Circuit Hardware Description) and Verilog2. Those skilled in the art should also be clear that by simply programming the method flow in the above hardware description languages and programming into the integrated circuit, the hardware circuit that implements the logic method flow can be easily obtained.
本领域技术人员也知道,除了以纯计算机可读程序代码方式实现视频图像转码装置以外,完全可以通过将方法步骤进行逻辑编程来使得视频图像转码装置以逻辑门、开关、专用集成电路、可编程逻辑控制器和嵌入微控制器等的形式来实现相同功能。因此这种视频图像转码装置可以被认为是一种硬件部件,而对其内包括的用于实现各种功能的装置也可以视为硬件部件内的结构。或者甚至,可以将用于实现各种功能的装置视为既可以是实现方法的软件模块又可以是硬件部件内的结构。Those skilled in the art also know that, in addition to implementing the video image transcoding device in a pure computer-readable program code manner, it is entirely possible to make the video image transcoding device into logic gates, switches, application specific integrated circuits, Program the logic controller and embedded microcontroller to achieve the same function. Therefore, such a video image transcoding device can be regarded as a hardware component, and the device for implementing various functions included therein can also be regarded as a structure within the hardware component. Or even, the means for realizing various functions can be regarded as both a software module of an implementation method and a structure within a hardware component.
通过以上的实施方式的描述可知,本领域的技术人员可以清楚地了解到本申请可借助软件加必需的通用硬件平台的方式来实现。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品可以存储在存储介质中,如ROM/RAM、磁碟、光盘等,包括若干指令用以使得一台 计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施方式或者实施方式的某些部分所述的方法。It can be known from the description of the above embodiments that those skilled in the art can clearly understand that the present application can be implemented by means of software plus a necessary general hardware platform. Based on this understanding, the technical solution of the present application can be embodied in the form of a software product in essence or part that contributes to the existing technology, and the computer software product can be stored in a storage medium, such as ROM/RAM, magnetic disk , Optical discs, etc., including several instructions to enable a computer device (which may be a personal computer, server, or network device, etc.) to perform the methods described in various embodiments of the present application or some parts of the embodiments.
本说明书中的各个实施方式均采用递进的方式描述,各个实施方式之间相同相似的部分互相参见即可,每个实施方式重点说明的都是与其他实施方式的不同之处。尤其,针对视频图像转码装置的实施方式来说,均可以参照前述方法的实施方式的介绍对照解释。The various embodiments in this specification are described in a progressive manner. The same or similar parts between the various embodiments can be referred to each other. Each embodiment focuses on the differences from other embodiments. In particular, for the embodiments of the video image transcoding device, reference may be made to the introduction of the foregoing method embodiments for comparison and explanation.
本申请可以在由计算机执行的计算机可执行指令的一般上下文中描述,例如程序模块。一般地,程序模块包括执行特定任务或实现特定抽象数据类型的例程、程序、对象、组件、数据结构等等。也可以在分布式计算环境中实践本申请,在这些分布式计算环境中,由通过通信网络而被连接的远程处理设备来执行任务。在分布式计算环境中,程序模块可以位于包括存储设备在内的本地和远程计算机存储介质中。The present application may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application may also be practiced in distributed computing environments in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media including storage devices.
虽然通过实施方式描绘了本申请,本领域普通技术人员知道,本申请有许多变形和变化而不脱离本申请的精神,希望所附的权利要求包括这些变形和变化而不脱离本申请的精神。Although the present application has been described through the embodiments, those of ordinary skill in the art know that there are many variations and changes in the present application without departing from the spirit of the application, and it is hoped that the appended claims include these variations and changes without departing from the spirit of the application.

Claims (13)

  1. 一种视频转码方法,其特征在于,所述方法包括:A video transcoding method, characterized in that the method includes:
    获取源视频;Get the source video;
    针对待输出的多种目标视频,确定从所述源视频转码为所述目标视频的转码方式;For multiple target videos to be output, determine a transcoding method from the source video to the target video;
    基于确定的所述转码方式,对所述源视频进行转码。Transcode the source video based on the determined transcoding method.
  2. 根据权利要求1所述的方法,其特征在于,基于确定的所述转码方式对所述源视频进行转码,包括:The method according to claim 1, wherein transcoding the source video based on the determined transcoding method includes:
    根据确定的从所述源视频转码分别转码为各个所述目标视频的各个转码方式,依次对所述源视频进行转码,以得到各个所述目标视频;According to the determined respective transcoding methods from the source video transcoding to each of the target videos, sequentially transcoding the source video to obtain each of the target videos;
    或者,or,
    根据确定的各个所述转码方式,对所述源视频进行并行转码,以得到各个所述目标视频。According to each of the determined transcoding methods, the source video is transcoded in parallel to obtain each of the target videos.
  3. 根据权利要求1所述的方法,其特征在于,在获取源视频之前,所述方法还包括:The method according to claim 1, wherein before acquiring the source video, the method further comprises:
    获取转码调度信息;所述转码调度信息用于表征分配在指定转码设备上的多个转码任务信息;所述转码任务信息与所述源视频、待输出的目标视频相对应;Obtain transcoding scheduling information; the transcoding scheduling information is used to characterize multiple transcoding task information allocated on a designated transcoding device; the transcoding task information corresponds to the source video and the target video to be output;
    相应地,针对所述转码任务信息对应的待输出的目标视频,确定从所述源视频转码为所述目标视频的转码方式。Correspondingly, for the target video to be output corresponding to the transcoding task information, the transcoding method from the source video to the target video is determined.
  4. 根据权利要求2所述的方法,其特征在于,所述转码调度信息按照下述方式确定:The method according to claim 2, wherein the transcoding scheduling information is determined in the following manner:
    确定在指定转码设备上从所述源视频转码为指定视频时对应的处理器使用率;Determine the corresponding processor usage rate when transcoding from the source video to the designated video on the designated transcoding device;
    根据确定的所述处理器使用率,从所述指定视频中确定待在所述指定转码设备上输出的目标视频;Determine the target video to be output on the designated transcoding device from the designated video according to the determined utilization rate of the processor;
    基于确定的待输出的目标视频,生成针对所述指定转码设备的转码调度信息。Based on the determined target video to be output, transcoding scheduling information for the designated transcoding device is generated.
  5. 根据权利要求3所述的方法,其特征在于,确定待在所述指定转码设备上输出的目标视频,包括:The method according to claim 3, wherein determining the target video to be output on the designated transcoding device includes:
    当确定的多种所述指定视频分别对应的处理器使用率之和达到指定阈值时,将所述指定视频作为待输出的目标视频。When the sum of the respective processor utilization rates of the determined multiple types of the specified videos reaches a specified threshold, the specified video is used as the target video to be output.
  6. 根据权利要求1所述的方法,其特征在于,确定从所述源视频转码为所述目标视频的转码方式,包括:The method according to claim 1, wherein determining the transcoding method from the source video to the target video includes:
    将所述源视频和所述目标视频构成的视频组输入转码方式识别模型中,以通过所述转码方式识别模型分别提取所述源视频的参数信息对应的第一特征向量和所述目标视 频的参数信息对应的第二特征向量,并通过所述转码方式识别模型确定所述第一特征向量和所述第二特征向量构成的向量组对应的预测值;Inputting a video group composed of the source video and the target video into a transcoding method identification model, to separately extract the first feature vector corresponding to the parameter information of the source video and the target through the transcoding method identification model The second feature vector corresponding to the parameter information of the video, and determining the prediction value corresponding to the vector group formed by the first feature vector and the second feature vector through the transcoding method recognition model;
    将所述预测值表征的转码方式作为从所述源视频转码为所述目标视频的转码方式。The transcoding method characterized by the predicted value is used as the transcoding method from the source video to the target video.
  7. 根据权利要求6所述的方法,其特征在于,所述转码方式识别模型按照下述方式确定:The method according to claim 6, wherein the transcoding mode identification model is determined in the following manner:
    获取训练样本集,所述训练样本集中包括对应的转码方式为指定转码方式的样本视频组以及对应的转码方式不为所述指定转码方式的样本视频组;Obtain a training sample set, where the training sample set includes a sample video group whose corresponding transcoding method is the specified transcoding method and a corresponding sample video group whose corresponding transcoding method is not the specified transcoding method;
    将所述训练样本集中的样本视频组输入转码方式识别模型,所述转码方式识别模型中包括初始预测参数;Input the sample video group in the training sample set into a transcoding mode identification model, where the transcoding mode identification model includes initial prediction parameters;
    通过所述初始预测参数对输入的所述样本视频组进行处理,得到所述样本视频组的预测结果,所述预测结果用于表征所述样本视频组对应的转码方式是否为所述指定转码方式;Processing the input sample video group through the initial prediction parameter to obtain a prediction result of the sample video group, where the prediction result is used to characterize whether the transcoding mode corresponding to the sample video group is the specified conversion Code method
    若所述预测结果不正确,根据所述预测结果与正确结果之间的差异值,对所述转码方式识别模型中的初始预测参数进行调整,以使得通过调整后的预测参数再次对所述样本视频组进行处理后,得到的预测结果与正确结果相符。If the prediction result is incorrect, adjust the initial prediction parameters in the transcoding method identification model according to the difference between the prediction result and the correct result, so that the adjusted prediction parameters After the sample video group is processed, the prediction results obtained are consistent with the correct results.
  8. 一种视频转码装置,其特征在于,所述装置包括:A video transcoding device, characterized in that the device includes:
    视频获取单元,用于获取源视频;Video acquisition unit for acquiring source video;
    转码方式确定单元,用于针对待输出的多种目标视频,确定从所述源视频转码为所述目标视频的转码方式;A transcoding method determining unit, used to determine the transcoding method for transcoding from the source video to the target video for various target videos to be output;
    转码单元,用于基于确定的所述转码方式,对所述源视频进行转码。The transcoding unit is configured to transcode the source video based on the determined transcoding method.
  9. 根据权利要求8所述的装置,其特征在于,所述转码单元还用于根据确定的从所述源视频转码分别转码为各个所述目标视频的各个转码方式,依次对所述源视频进行转码,以得到各个所述目标视频,或者,根据确定的各个所述转码方式,对所述源视频进行并行转码,以得到各个所述目标视频。The apparatus according to claim 8, wherein the transcoding unit is further configured to separately transcode each of the target videos according to the determined transcoding from the source video to each of the target videos, and to sequentially convert the The source video is transcoded to obtain each of the target videos, or, according to each determined transcoding method, the source video is transcoded in parallel to obtain each of the target videos.
  10. 根据权利要求8所述的装置,其特征在于,所述装置还包括:The device according to claim 8, wherein the device further comprises:
    调度信息获取单元,用于获取转码调度信息;所述转码调度信息用于表征分配在指定转码设备上的多个转码任务信息;所述转码任务信息与所述源视频、待输出的目标视频相对应;Scheduling information acquisition unit, used to acquire transcoding scheduling information; the transcoding scheduling information is used to characterize multiple transcoding task information allocated on the designated transcoding device; the transcoding task information and the source video Corresponding to the output target video;
    相应的,所述转码方式确定单元用于针对所述转码任务信息对应的待输出的目标视频,确定从所述源视频转码为所述目标视频的转码方式。Correspondingly, the transcoding mode determining unit is used to determine the transcoding mode from the source video to the target video for the target video to be output corresponding to the transcoding task information.
  11. 根据权利要求10所述的装置,其特征在于,所述调度信息获取单元包括:The apparatus according to claim 10, wherein the scheduling information acquisition unit comprises:
    使用率确定模块,用于确定在指定转码设备上从所述源视频转码为指定视频时对应的处理器使用率;A utilization rate determining module, used to determine the corresponding processor utilization rate when transcoding from the source video to the designated video on the designated transcoding device;
    视频确定模块,用于根据确定的所述处理器使用率,从所述指定视频中确定待在所述指定转码设备上输出的目标视频;A video determining module, configured to determine the target video to be output on the designated transcoding device from the designated video according to the determined utilization rate of the processor;
    信息生成模块,用于基于确定的待输出的目标视频,生成针对所述指定转码设备的转码调度信息。The information generating module is configured to generate transcoding scheduling information for the designated transcoding device based on the determined target video to be output.
  12. 根据权利要求11所述的装置,其特征在于,所述视频确定模块还用于当确定的多种所述指定视频分别对应的处理器使用率之和达到指定阈值时,将所述指定视频作为待输出的目标视频。The apparatus according to claim 11, wherein the video determination module is further configured to use the specified video as the specified video when the sum of the processor usage rates corresponding to the determined plurality of specified videos reaches a specified threshold The target video to be output.
  13. 一种视频转码装置,其特征在于,所述装置包括存储器和处理器,所述存储器用于存储计算机程序,所述计算机程序被所述处理器执行时,实现如权利要求1至7中任一所述的方法。A video transcoding device, characterized in that the device includes a memory and a processor, and the memory is used to store a computer program, and when the computer program is executed by the processor, any of claims 1 to 7 is implemented One of the methods.
PCT/CN2019/122642 2018-12-11 2019-12-03 Video transcoding method and device WO2020119515A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201811510051.3A CN111314737B (en) 2018-12-11 2018-12-11 Video transcoding method and device
CN201811510051.3 2018-12-11

Publications (1)

Publication Number Publication Date
WO2020119515A1 true WO2020119515A1 (en) 2020-06-18

Family

ID=71077102

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/122642 WO2020119515A1 (en) 2018-12-11 2019-12-03 Video transcoding method and device

Country Status (2)

Country Link
CN (1) CN111314737B (en)
WO (1) WO2020119515A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111901631A (en) * 2020-07-30 2020-11-06 有半岛(北京)信息科技有限公司 Transcoding method, device, server and storage medium for live video

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112565775B (en) * 2020-11-26 2023-09-05 北京达佳互联信息技术有限公司 Method, device and storage medium for audio and video transcoding
CN115396683B (en) * 2022-08-22 2024-04-09 广州博冠信息科技有限公司 Video optimization processing method and device, electronic equipment and computer readable medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103269431A (en) * 2013-04-15 2013-08-28 浙江宇视科技有限公司 Method and device for realizing cloud transcoding
CN103686207A (en) * 2013-12-04 2014-03-26 乐视网信息技术(北京)股份有限公司 Transcoding task scheduling method and system
CN104168488A (en) * 2014-08-29 2014-11-26 北京奇艺世纪科技有限公司 Video transcoding method and device
EP3073738A1 (en) * 2015-03-26 2016-09-28 Alcatel Lucent Methods and devices for video encoding
EP3322189A1 (en) * 2016-11-10 2018-05-16 Alcatel Lucent Method and system for controlling video transcoding
CN108174290A (en) * 2018-01-25 2018-06-15 北京百度网讯科技有限公司 For handling the method and apparatus of video

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108512817B (en) * 2017-02-28 2020-09-04 北京大学 Multi-video transcoding scheduling method and device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103269431A (en) * 2013-04-15 2013-08-28 浙江宇视科技有限公司 Method and device for realizing cloud transcoding
CN103686207A (en) * 2013-12-04 2014-03-26 乐视网信息技术(北京)股份有限公司 Transcoding task scheduling method and system
CN104168488A (en) * 2014-08-29 2014-11-26 北京奇艺世纪科技有限公司 Video transcoding method and device
EP3073738A1 (en) * 2015-03-26 2016-09-28 Alcatel Lucent Methods and devices for video encoding
EP3322189A1 (en) * 2016-11-10 2018-05-16 Alcatel Lucent Method and system for controlling video transcoding
CN108174290A (en) * 2018-01-25 2018-06-15 北京百度网讯科技有限公司 For handling the method and apparatus of video

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111901631A (en) * 2020-07-30 2020-11-06 有半岛(北京)信息科技有限公司 Transcoding method, device, server and storage medium for live video

Also Published As

Publication number Publication date
CN111314737A (en) 2020-06-19
CN111314737B (en) 2022-12-06

Similar Documents

Publication Publication Date Title
WO2020119515A1 (en) Video transcoding method and device
US11159790B2 (en) Methods, apparatuses, and systems for transcoding a video
EP3901785A1 (en) Content filtering in media playing devices
US12008038B2 (en) Summarization of video artificial intelligence method, system, and apparatus
WO2023125361A1 (en) Character generation method and apparatus, electronic device, and storage medium
TW202028997A (en) Embedded rendering engine for media data
US20190045269A1 (en) Communication apparatus, communication control method, and computer program
US11997314B2 (en) Video stream processing method and apparatus, and electronic device and computer-readable medium
US10645406B2 (en) Transcoding method and apparatus
US20080291209A1 (en) Encoding Multi-media Signals
US10819951B2 (en) Recording video from a bitstream
WO2023005386A1 (en) Model training method and apparatus
EP3899928A1 (en) Conditional forward error correction for network data
WO2020118503A1 (en) Method and apparatus for determining image focusing region
WO2020119670A1 (en) Video transcoding method and device
US10679070B1 (en) Systems and methods for a video understanding platform
Zhao et al. Hvpi: Extending hadoop to support video analytic applications
US7830284B2 (en) Entropy encoding apparatus, entropy encoding method, and computer program
US20120023148A1 (en) Applying Transcodings In A Determined Order To Produce Output Files From A Source File
US20200382826A1 (en) Background enhancement in discriminatively encoded video
WO2022179424A1 (en) Data processing method and apparatus
CN107005731B (en) Image cloud end streaming media service method, server and system using application codes
CN114157895A (en) Video processing method and device, electronic equipment and storage medium
CN107277650B (en) Video file cutting method and device
CN111083416A (en) Data processing method and device, electronic equipment and readable storage medium

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: 19896976

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19896976

Country of ref document: EP

Kind code of ref document: A1