WO2017097126A1 - 一种转码方法及装置 - Google Patents

一种转码方法及装置 Download PDF

Info

Publication number
WO2017097126A1
WO2017097126A1 PCT/CN2016/107411 CN2016107411W WO2017097126A1 WO 2017097126 A1 WO2017097126 A1 WO 2017097126A1 CN 2016107411 W CN2016107411 W CN 2016107411W WO 2017097126 A1 WO2017097126 A1 WO 2017097126A1
Authority
WO
WIPO (PCT)
Prior art keywords
resolution
code rate
preset
definition
media file
Prior art date
Application number
PCT/CN2016/107411
Other languages
English (en)
French (fr)
Inventor
江文斐
孟辰
裴银祥
Original Assignee
阿里巴巴集团控股有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 阿里巴巴集团控股有限公司 filed Critical 阿里巴巴集团控股有限公司
Priority to EP16872318.7A priority Critical patent/EP3389269A4/en
Publication of WO2017097126A1 publication Critical patent/WO2017097126A1/zh
Priority to US16/004,006 priority patent/US10567779B2/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/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/115Selection of the code volume for a coding unit prior to coding
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/146Data rate or code amount at the encoder output
    • H04N19/147Data rate or code amount at the encoder output according to rate distortion criteria
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/146Data rate or code amount at the encoder output
    • H04N19/15Data rate or code amount at the encoder output by monitoring actual compressed data size at the memory before deciding storage at the transmission buffer
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/46Embedding additional information in the video signal during the compression process
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
    • H04N19/59Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving spatial sub-sampling or interpolation, e.g. alteration of picture size or resolution
    • 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/234363Processing 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 altering the spatial resolution, e.g. for clients with a lower screen resolution
    • 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/234381Processing 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 altering the temporal resolution, e.g. decreasing the frame rate by frame skipping
    • 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/23439Processing 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 for generating different versions

Definitions

  • the present application relates to the field of information processing technologies, and in particular, to a transcoding method and apparatus.
  • Mobile streaming media is a combination of mobile communication and streaming media transmission.
  • the mobile network uses streaming media technology for data transmission on the mobile terminal, providing users with services including video on demand, mobile video chat, mobile video surveillance and the like.
  • Transcoding is to compress high-definition large media files (such as video files) into suitable network scenarios (such as fiber-optic network, WIFI network, 3G network, etc.) and some terminals (such as TV, PC, mobile phone, PAD, etc.).
  • suitable network scenarios such as fiber-optic network, WIFI network, 3G network, etc.
  • some terminals such as TV, PC, mobile phone, PAD, etc.
  • the process of playing a file/stream Generally, the smaller the media file is compressed, the more suitable it is to transmit in a bandwidth-constrained environment, but the display quality of the media file may be worse.
  • the existing transcoding method generally includes: setting transcoding parameters corresponding to different definitions in advance, for example, the definition may include: flow, standard definition, high definition, and super clear, and the resolutions corresponding to the four definitions may be separately set.
  • Rate and upper limit code rate Calculating the instantaneous code rate of the media file in real time according to the preset resolution and the content of the media file. When the instantaneous code rate is greater than the upper limit code rate corresponding to the resolution, in order to prevent the media file from being stuck, The upper instantaneous code rate is replaced by the upper limit code rate to ensure that the media file can be played smoothly.
  • the instantaneous code rate in the existing transcoding method is calculated according to the preset resolution and the content of the media file, in the foregoing Under the two parameters of the set resolution and the instantaneous bit rate, the current content of the media file can be clearly played.
  • the instantaneous code rate is greater than the upper limit code rate corresponding to the resolution, the upper limit code rate is used for transcoding.
  • the clarity of the current content playback of the media file may not be guaranteed if the media file is played smoothly.
  • the purpose of the embodiment of the present application is to provide a transcoding method and device to ensure that the media file is smoothly and clearly Line play.
  • the embodiment of the present application provides a transcoding method and device, which are implemented as follows:
  • a transcoding method comprising:
  • precoding the media file by using the first preset rule according to the first resolution and the second resolution, to obtain a first precoding code rate and a second definition gear position corresponding to the first definition gear position.
  • first precoding code rate and a second definition gear position corresponding to the first definition gear position.
  • the first precoding code rate is greater than a preset code rate threshold corresponding to the first definition bit position, adjusting the first resolution bit position according to the first precoding code rate and the preset code rate threshold a first resolution and a second resolution corresponding to the second definition gear;
  • a transcoding device includes: a media file acquisition module, a resolution gear position determination module, a resolution determination module, a precoding code rate determination module, a resolution adjustment module, and a transcoding module;
  • the media file obtaining module is configured to obtain attribute information of the media file, where the attribute information includes an initial resolution
  • the definition gear position determining module is configured to determine, according to an initial resolution of the media file, a preset plurality of resolution gear positions, and a resolution range corresponding to each resolution gear position, determining a corresponding number of the media file a sharpness gear position, the lowest sharpness gear position of the preset plurality of sharpness gear positions is used as a second sharpness gear position corresponding to the media file;
  • the resolution determining module is configured to determine, according to an initial resolution of the media file, a first resolution, according to a ranking of the first resolution in a resolution range corresponding to the first definition gear position, a second resolution having the same rank in a resolution range corresponding to the second sharpness scale;
  • the precoding code rate determining module is configured to precode the media file by using a first preset rule according to the first resolution and the second resolution, to obtain a first corresponding to the first resolution gear Precoding code rate and second clear a second precoding code rate corresponding to the sharpness gear;
  • the resolution adjustment module is configured to adjust, according to the first precoding code rate and the preset code rate threshold, when the first precoding code rate is greater than a preset code rate threshold corresponding to the first definition bit position Determining a first resolution corresponding to the first resolution gear and a second resolution corresponding to the second definition gear;
  • the transcoding module is configured to transcode the media file by using a first preset rule based on the adjusted first resolution and the adjusted second resolution of the resolution adjustment module.
  • the method and device for transcoding according to the embodiments of the present application may determine the resolution of different resolution gears according to the initial resolution of the media file, based on the determined Resolution, precoding the media file, when the precoding code rate is greater than a preset code rate threshold, the media file may not be played smoothly, and according to the precoding code rate and preset
  • the code rate threshold is used to adjust the resolution corresponding to each definition, and then the media file is transcoded according to the adjusted resolution, so that the media file can be played smoothly and clearly.
  • FIG. 1 is a flow chart of an embodiment of a transcoding method of the present application
  • FIG. 2 is a block diagram of one embodiment of a transcoding device of the present application.
  • the embodiment of the present application provides a transcoding method and device.
  • the transcoding method may include:
  • S101 Acquire attribute information of a media file, where the attribute information includes an initial resolution.
  • the media file can be a video file.
  • the attribute information may include: an initial resolution.
  • the attribute information may further include: an initial code rate of the media file.
  • S102 Determine, according to an initial resolution of the media file, a preset plurality of resolution gear positions, and a resolution range corresponding to each resolution gear position, determining a first definition gear position corresponding to the media file, where The lowest definition gear position among the plurality of preset sharpness gear positions is used as the second sharpness gear position corresponding to the media file.
  • the preset plurality of definition gear positions may include: 4 definition gear positions.
  • the four sharpness positions from the highest definition to the lowest definition may be: ultra clear, high definition, standard definition, smooth.
  • the resolution range and resolution ranking corresponding to each of the above resolution positions can be as shown in Table 1. In the resolution range corresponding to each resolution gear in Table 1, at least three resolutions may be included, which may be sequentially arranged in descending order of resolution.
  • the first definition gear position corresponding to the media file can be determined according to each resolution gear position and its corresponding resolution range and resolution ranking according to Table 1.
  • the first definition gear position can be used to indicate the highest resolution achievable by the media file.
  • the second definition gear position corresponding to the media file may be the lowest definition gear position among the preset plurality of definition gear positions.
  • the preset plurality of sharpness positions from the highest definition to the lowest definition may be: ultra clear, high definition, standard definition, smooth, then the second definition position may be “fluent” Gear position.
  • the first definition gear position may be determined according to a resolution range corresponding to each preset resolution gear position and an initial resolution of the media file, where the resolution range corresponding to the initial resolution corresponds to
  • the sharpness gear can be the first sharpness gear. For example, if the initial resolution of the media file is 1920 ⁇ 1080, the first definition gear position may be “super clear” gear position; if the initial resolution of the media file is 848 ⁇ 480, then The first definition gear position may be a "standard definition" gear position.
  • S103 using the initial resolution of the media file as the first resolution, determining the second definition gear position according to the ranking of the first resolution in the resolution range corresponding to the first resolution gear position. A second resolution having the same rank in the corresponding resolution range.
  • the initial resolution of the media file can be used as the first resolution.
  • the second resolution corresponding to the second definition gear position may be determined according to the ranking of the first resolution in the resolution range corresponding to the first definition gear position. Specifically, the ranking of the second resolution in the resolution range corresponding to the second definition gear is the same as the ranking of the first resolution in the resolution range corresponding to the first definition gear.
  • the first resolution gear position is a “high definition” gear position
  • the second resolution gear position is a “fluent” gear position
  • the first resolution is 1392 ⁇ 784, which is in a resolution corresponding to the “high definition” gear position.
  • the first position of the range, then the second resolution corresponding to the second resolution gear may be 624 ⁇ 352, which is located at the first position of the resolution range corresponding to the “smooth” gear position.
  • S104 Precoding the media file by using a first preset rule according to the first resolution and the second resolution, to obtain a first precoding code rate and a second resolution corresponding to the first definition gear position.
  • the second precoding code rate corresponding to the gear position.
  • the media file may be pre-coded by using a first preset rule, and the first pre-coding code rate and the second resolution corresponding to the first definition gear position may be obtained.
  • the second precoding code rate corresponding to the gear position may be obtained.
  • the first preset rule may include performing precoding according to a CRF (constant rate factor) value or a fixed QP (quantization parameter) value.
  • a CRF value of 18 indicates that the quality of the media file is basically lossless, and the value of the CRF is 19-21.5. Indicates that the quality of the media file is of high quality.
  • the value of CRF is 22-26, indicating that the media file quality is medium quality.
  • the value range of QP is generally 0 to 51. The larger the value, the worse the quality of the media file. For general Internet video files, if QP>35, the quality of the media file is very poor. Therefore, in a preferred embodiment, the CRF may range from 19 to 26. In a preferred embodiment, the QP may range from 0 to 35.
  • the pre-coding the media file by using the first preset rule may further include: extracting a plurality of segments of the media file for precoding, and precoding the plurality of segments separately.
  • the code rate values are averaged, and the obtained average value is taken as a precoding code rate.
  • S105 If the first precoding code rate is greater than a preset code rate threshold corresponding to the first definition bit position, adjusting the first resolution file according to the first precoding code rate and the preset code rate threshold.
  • the bit corresponds to the first resolution and the second resolution corresponding to the second resolution gear.
  • the preset code rate threshold may be a maximum code rate value that the media file can clearly play at the first resolution. If the first precoding code rate is greater than the preset code rate threshold, it may be indicated that when the media file is transcoded according to the first resolution, the content of the media file cannot be played smoothly.
  • the first resolution bit rate and the preset code rate threshold may be adjusted according to the first resolution bit rate.
  • the second resolution corresponding to the first resolution and the second definition gear. Specifically, the method may include: determining a reduced amplitude of the first resolution and the second resolution based on the preset code rate threshold and a preset coefficient, and determining the adjusted first resolution and the first according to the reduced amplitude Two resolutions.
  • the determining the reduced amplitude of the first resolution and the second resolution based on the preset code rate threshold and the preset coefficient may specifically include: determining whether the first precoding code rate is greater than or equal to a pre- Set the product of the second power of the coefficient and the preset code rate threshold. If yes, the first resolution and the second resolution are respectively adjusted to be reduced by two ranks in the corresponding sharpness position. Rate value.
  • the value of the preset coefficient may be greater than 1.
  • the preset coefficient may have a value of 1.1 to 1.5.
  • the first resolution is 1392 ⁇ 784, which is in the first position of the resolution range corresponding to the “HD” gear position
  • the second resolution is 624 ⁇ 352, which is located in the resolution range corresponding to the “smooth” gear position.
  • the first precoding code rate obtained by using the first resolution precoding is BitRates
  • the preset code rate threshold is MaxRate. It is judged that BitRates>MaxRate*scale*scale, where scale is the preset coefficient.
  • the adjusted first resolution and second resolution may be: 1356 ⁇ 864 and 480 ⁇ 272, respectively.
  • the first precoding code rate is less than a product of the second power of the preset coefficient and the preset code rate threshold, it may be further determined whether the first code rate is greater than or equal to the preset code.
  • the product of the rate threshold and the preset coefficient if yes, the first resolution and the second resolution are respectively adjusted to decrease the resolution value after one rank in the corresponding sharpness scale.
  • the first resolution and the second resolution may not be adjusted.
  • Adjusting the resolution within the same sharpness position ensures that the resolution of the media file playback is unchanged.
  • the code rate value after transcoding can be made smaller than the preset code rate threshold, so that the media file can be played smoothly.
  • S106 Transcode the media file by using a first preset rule based on the adjusted first resolution and the adjusted second resolution.
  • the media file may be transcoded using a first preset rule. Transcoding the media file according to the adjusted first resolution and the adjusted second resolution ensures that the media file is played smoothly and clearly.
  • the transcoding according to the first resolution and the second resolution may be smooth and The media file is played clearly, so the media file can be transcoded based on the first resolution and the second resolution.
  • the method may further include: determining an intermediate resolution corresponding to the at least one intermediate definition gear position between the first definition gear position and the second definition gear position, based on the first resolution, the second resolution And the intermediate resolution, using a second preset algorithm, calculating an intermediate precoding code rate corresponding to the intermediate definition gear position.
  • the intermediate resolution corresponding to the intermediate definition gear can be adjusted.
  • the media file may be transcoded by using the first preset rule based on the adjusted first resolution, the adjusted second resolution, and the adjusted intermediate resolution.
  • the method for adjusting the intermediate resolution may be the same as the method for adjusting the first resolution, which is not described herein again.
  • determining an intermediate resolution of the at least one intermediate definition gear position between the first definition gear position and the second definition gear position may adopt a method of determining a second resolution corresponding to the second definition gear position .
  • the intermediate resolution corresponding to the intermediate definition gear position may be determined according to the ranking of the first resolution in the resolution range corresponding to the first definition gear position.
  • the ranking of the intermediate resolution in the resolution range corresponding to the intermediate definition gear position is the same as the ranking of the first resolution in the resolution range corresponding to the first definition gear position.
  • the first definition gear position is a “high definition” gear position
  • the second definition gear position is a “fluent” gear position, then there may be a between the first definition gear position and the second definition gear position.
  • Intermediate definition gear "standard definition" gear.
  • the first resolution corresponding to the first sharpness gear is 1392 ⁇ 784, which is in the first position of the resolution range corresponding to the “high definition” gear position
  • the intermediate resolution corresponding to the intermediate sharpness gear position may be 944 ⁇ 528, which is the first place in the resolution range corresponding to the “standard definition” gear.
  • the second preset algorithm may include: an interpolation algorithm. Specifically, a linear relationship between the resolution and the precoding code rate can be calculated according to the first resolution, the second resolution, the first precoding code rate, and the second precoding code rate, and can be calculated according to the linear relationship. An intermediate precoding code rate corresponding to the intermediate resolution. The intermediate precoding rate corresponding to the intermediate resolution of the intermediate definition gear is calculated by the interpolation algorithm, and the calculated precoding rate can be matched with the resolution, thereby ensuring the media at the resolution of the intermediate definition gear. Files can be played smoothly and clearly.
  • an interpolation algorithm Specifically, a linear relationship between the resolution and the precoding code rate can be calculated according to the first resolution, the second resolution, the first precoding code rate, and the second precoding code rate, and can be calculated according to the linear relationship.
  • An intermediate precoding code rate corresponding to the intermediate resolution is calculated by the interpolation algorithm, and the calculated precoding rate can be matched with the resolution, thereby ensuring the media at the resolution of the intermediate
  • the transcoding method provided by the foregoing embodiment may determine the resolution of different resolution gear positions according to the initial resolution of the media file, and based on the determined resolution, the media file may be pre-coded first.
  • the precoding code rate is greater than the preset code rate threshold, the media file may not be played smoothly, and the resolution corresponding to each resolution of the media file may be adjusted according to the precoding code rate and the preset code rate threshold. And transcoding the media file according to the adjusted resolution, so that the media file can be played smoothly and clearly.
  • the transcoding device may include: a media file obtaining module 201, a resolution gear position determining module 202, a resolution determining module 203, and a precoding code.
  • the media file obtaining module 201 can be configured to obtain attribute information of the media file.
  • the attribute information may include: an initial resolution.
  • the attribute information may also include an initial code rate of the media file.
  • the definition gear position determining module 202 may be configured to determine, according to an initial resolution of the media file, a preset plurality of resolution gear positions, and a resolution range corresponding to each resolution gear position, determining that the media file corresponds to The first definition gear position, the lowest definition gear position of the preset plurality of definition gear positions is used as the second definition gear position corresponding to the media file.
  • the resolution determining module 203 may be configured to use the initial resolution of the media file as the first resolution, according to the ranking of the first resolution in the resolution range corresponding to the first definition gear position, A second resolution having the same rank in the resolution range corresponding to the second definition gear is determined.
  • the precoding code rate determining module 204 may be configured to perform precoding on the media file by using a first preset rule according to the first resolution and the second resolution, to obtain a first resolution file corresponding to the first resolution file. a first precoding code rate corresponding to the second precoding code rate and the second resolution bit rate.
  • the resolution adjustment module 205 may be configured to: when the first precoding code rate is greater than a preset code rate threshold corresponding to the first definition bit position, according to the first precoding code rate and the preset code rate And a second value corresponding to the first resolution corresponding to the first definition gear position and the second resolution gear position.
  • the transcoding module 206 can be configured to transcode the media file by using a first preset rule based on the adjusted first resolution and the adjusted second resolution.
  • the transcoding module 206 may be further configured to be based on the first resolution when the first precoding code rate is less than or equal to a preset rate threshold of the first definition bit position. And a second resolution, transcoding the media file by using a first preset rule.
  • the bit position determination module 202 is further configured to determine at least one intermediate definition gear position between the first definition gear position and the second definition gear position.
  • the resolution determining module 203 is further configured to determine an intermediate resolution corresponding to the at least one intermediate definition gear.
  • the precoding code rate determining module 204 is further configured to calculate, according to the first resolution, the second resolution, and the intermediate resolution, a second preset algorithm, corresponding to the intermediate definition gear Intermediate precoding code rate.
  • the resolution adjustment module 205 is further configured to adjust an intermediate resolution corresponding to the intermediate definition gear position.
  • the transcoding module 206 can also be configured to adjust the second resolution and the adjusted second score. The resolution and the adjusted intermediate resolution are used to transcode the media file using a first preset rule.
  • the transcoding device provided in the foregoing embodiment corresponds to the embodiment of the transcoding method of the present application, and the method embodiment of the present application can be implemented to obtain the technical effects of the method embodiment of the present application.
  • PLD Programmable Logic Device
  • FPGA Field Programmable Gate Array
  • HDL Hardware Description Language
  • the controller can be implemented in any suitable manner, for example, the controller can take the form of, for example, a microprocessor or processor and a computer readable medium storing computer readable program code (eg, software or firmware) executable by the (micro)processor.
  • computer readable program code eg, software or firmware
  • examples of controllers include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, The Microchip PIC18F26K20 and the Silicone Labs C8051F320, the memory controller can also be implemented as part of the memory's control logic.
  • the controller can be implemented by logic programming the method steps in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, and embedded microcontrollers.
  • Such a controller can therefore be considered a hardware component, and the means for implementing various functions included therein can also be considered as a structure within the hardware component.
  • a device for implementing various functions can be considered as a software module that can be both a method of implementation and a structure within a hardware component.
  • the system, device, module or unit illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product having a certain function.
  • the present application can be implemented by means of software plus a necessary general hardware platform. Based on such understanding, portions of the technical solution of the present application that contribute substantially or to the prior art may be embodied in the form of a software product.
  • the computing device includes one or more processors (CPU ), input / output interface, network interface and memory.
  • the computer software product can include instructions for causing a computer device (which can be a personal computer, server, or network device, etc.) to perform the methods described in various embodiments of the present application or portions of the embodiments.
  • the computer software product can be stored in a memory, which may include non-persistent memory, random access memory (RAM), and/or nonvolatile memory in a computer readable medium, such as read only memory (ROM) or Flash memory.
  • RAM random access memory
  • ROM read only memory
  • Memory is an example of a computer readable medium.
  • Computer readable media includes both permanent and non-persistent, removable and non-removable media.
  • Information storage can be implemented by any method or technology.
  • the information can be computer readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read only memory.
  • PRAM phase change memory
  • SRAM static random access memory
  • DRAM dynamic random access memory
  • RAM random access memory
  • ROM read only memory
  • EEPROM electrically erasable programmable read only memory
  • flash memory or other memory technology
  • compact disk read only memory CD-ROM
  • DVD digital versatile disk
  • Magnetic tape cartridges magnetic tape storage or other magnetic storage devices or any other non-transportable media can be used to store information that can be accessed by a computing device.
  • computer readable media does not include transitory computer readable media, such as modulated data signals and carrier waves.
  • This application can be used in a variety of general purpose or special purpose computer system environments or configurations.
  • the application can be described in the general context of computer-executable instructions executed by a computer, such as a program module.
  • program modules include routines, programs, objects, components, data structures, and the like that perform particular tasks or implement particular abstract data types.
  • the present application can also be practiced in distributed computing environments where tasks are performed by remote processing devices that are connected through a communication network.
  • program modules can be located in both local and remote computer storage media including storage devices.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)
  • Telephonic Communication Services (AREA)

Abstract

本申请实施例公开了一种转码方法及装置,所述方法包括:获取媒体文件的初始分辨率;确定媒体文件对应的第一清晰度档位和第二清晰度档位,确定第一清晰度档位对应的第一分辨率和第二清晰度档位对应的第二分辨率;根据第一分辨率、第二分辨率,利用第一预设规则进行预编码,得到第一清晰度档位对应的第一预编码码率和第二清晰度档位对应的第二预编码码率;若第一预编码码率大于预设码率阈值,调整第一分辨率和第二分辨率;基于调整后的第一分辨率和调整后的第二分辨率,利用第一预设规则对所述媒体文件进行转码。上述实施例提供的转码方法及装置,可以保证媒体文件流畅且清晰地进行播放。

Description

一种转码方法及装置
本申请要求2015年12月08日递交的申请号为201510894540.3、发明名称为“一种转码方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及信息处理技术领域,特别涉及一种转码方法及装置。
背景技术
随着移动通信技术的不断发展,网络接入速度的飞速提升,移动终端的越趋智能化,以及数字压缩技术的日益优化,移动终端已从简单的通信、联络工具,发展成为一个多媒体智能平台。移动流媒体是移动通信和流媒体传输的结合,通过移动网络在移动终端上采用流媒体技术进行数据传输,为用户提供包括视频点播、移动视频聊天、移动视频监控等服务。
转码是将高清的超大媒体文件(例如视频文件)压缩成适合在某些网络场景下(如光纤网络、WIFI网络、3G网络等)、某些终端上(如电视、PC、手机、PAD等)播放的文件/流的过程。通常媒体文件压缩得越小,就越适合在带宽受限的环境下传输,但是媒体文件的显示画质也可能越差。
现有的转码方法通常包括:预先设置好不同清晰度对应的转码参数,例如清晰度可以包括:流程、标清、高清和超清四种,可以分别设置所述四种清晰度对应的分辨率和上限码率。根据预先设置的分辨率和媒体文件的内容,实时计算所述媒体文件的瞬时码率,当瞬时码率大于所述分辨率对应的上限码率时,为了防止媒体文件出现卡顿的现象,可以利用所述上限码率代替当前的瞬时码率,以保证媒体文件可以流畅地播放。
在实现本申请过程中,发明人发现现有技术中至少存在如下问题:现有的转码方法中的瞬时码率是根据预先设置的分辨率和媒体文件的内容计算得到的,在所述预先设置的分辨率和瞬时码率两个参数下,媒体文件的当前内容可以清晰地播放,当瞬时码率大于所述分辨率对应的上限码率时,采用所述上限码率来进行转码,保证媒体文件播放流畅的情况下可能无法保证媒体文件的当前内容播放的清晰度。
发明内容
本申请实施例的目的是提供一种转码方法及装置,以保证媒体文件流畅且清晰地进 行播放。
为解决上述技术问题,本申请实施例提供一种转码方法及装置是这样实现的:
一种转码方法,包括:
获取媒体文件的属性信息,所述属性信息包括初始分辨率;
根据所述媒体文件的初始分辨率、预设的多个清晰度档位和各清晰度档位对应的分辨率范围,确定所述媒体文件对应的第一清晰度档位,将所述预设的多个清晰度档位中的最低清晰度档位的作为所述媒体文件对应的第二清晰度档位;
以所述媒体文件的初始分辨率作为第一分辨率,根据所述第一分辨率在第一清晰度档位对应的分辨率范围中的排位,来确定在第二清晰度档位对应的分辨率范围中具有相同排位的第二分辨率;
根据所述第一分辨率和第二分辨率,利用第一预设规则对所述媒体文件进行预编码,得到第一清晰度档位对应的第一预编码码率和第二清晰度档位对应的第二预编码码率;
若所述第一预编码码率大于第一清晰度档位对应的预设码率阈值,根据所述第一预编码码率和预设码率阈值,调整所述第一清晰度档位对应的第一分辨率和第二清晰度档位对应的第二分辨率;
基于所述调整后的第一分辨率和调整后的第二分辨率,利用第一预设规则对所述媒体文件进行转码。
一种转码装置,包括:媒体文件获取模块、清晰度档位确定模块、分辨率确定模块、预编码码率确定模块、分辨率调整模块和转码模块;其中,
所述媒体文件获取模块,用于获取媒体文件的属性信息,所述属性信息包括初始分辨率;
所述清晰度档位确定模块,用于根据所述媒体文件的初始分辨率、预设的多个清晰度档位及各清晰度档位对应的分辨率范围,确定所述媒体文件对应的第一清晰度档位,将所述预设的多个清晰度档位中的最低清晰度档位作为所述媒体文件对应的第二清晰度档位;
所述分辨率确定模块,用于以所述媒体文件的初始分辨率作为第一分辨率,根据所述第一分辨率在第一清晰度档位对应的分辨率范围中的排位,来确定在第二清晰度档位对应的分辨率范围中具有相同排位的第二分辨率;
所述预编码码率确定模块,用于根据所述第一分辨率和第二分辨率,利用第一预设规则对所述媒体文件进行预编码,得到第一清晰度档位对应的第一预编码码率和第二清 晰度档位对应的第二预编码码率;
所述分辨率调整模块,用于当第一预编码码率大于第一清晰度档位对应的预设码率阈值时,根据所述第一预编码码率和预设码率阈值,调整所述第一清晰度档位对应的第一分辨率和第二清晰度档位对应的第二分辨率;
所述转码模块,用于基于所述分辨率调整模块调整后的第一分辨率和调整后的第二分辨率,利用第一预设规则对所述媒体文件进行转码。
由以上本申请实施例提供的技术方案可见,本申请实施例提供的一种转码方法及装置,可以根据媒体文件的初始分辨率来确定不同清晰度档位的分辨率,基于所述确定的分辨率,对所述媒体文件进行预编码,当所述预编码码率大于预设的码率阈值时,可能导致所述媒体文件不能流畅播放,此时根据所述预编码码率和预设码率阈值来调整各清晰度对应的分辨率,再根据调整后的分辨率来对所述媒体文件进行转码,可以保证所述媒体文件流畅且清晰地播放。
附图说明
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请中记载的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。
图1是本申请转码方法一个实施例的流程图;
图2是本申请转码装置的一个实施例的模块图。
具体实施方式
本申请实施例提供一种转码方法及装置。
为了使本技术领域的人员更好地理解本申请中的技术方案,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都应当属于本申请保护的范围。
图1是本申请转码方法一个实施例的流程图。如图1所示,所述转码方法可以包括:
S101:获取媒体文件的属性信息,所述属性信息包括初始分辨率。
可以获取媒体文件的属性信息。所述媒体文件可以是视频文件。
所述属性信息可以包括:初始分辨率。所述属性信息还可以包括:所述媒体文件的初始码率。
S102:根据所述媒体文件的初始分辨率、预设的多个清晰度档位及各清晰度档位对应的分辨率范围,确定所述媒体文件对应的第一清晰度档位,将所述预设的多个清晰度档位中的最低清晰度档位作为所述媒体文件对应的第二清晰度档位。
所述预设的多个清晰度档位可以包括:4个清晰度档位。所述4个清晰度档位从最高清晰度到最低清晰度依次可以是:超清、高清、标清、流畅。上述各清晰度档位对应的分辨率范围及分辨率排位可以如表1所示。表1中每个清晰度档位对应的分辨率范围中,可以包括至少3个分辨率,其可以按分辨率从大到小的顺序依次进行排列。
表1 各清晰度档位和其对应的分辨率范围及分辨率排位
Figure PCTCN2016107411-appb-000001
根据表1所述的各清晰度档位和其对应的分辨率范围及分辨率排位可以确定所述媒体文件对应的第一清晰度档位。所述第一清晰度档位可以用于表示所述媒体文件可以达到的最高清晰度。
所述媒体文件对应的第二清晰度档位可以是所述预设的多个清晰度档位中最低清晰度档位。例如,若所述预设的多个清晰度档位从最高清晰度到最低清晰度依次可以是:超清、高清、标清、流畅,那么,所述第二清晰度档位可以是“流畅”档位。
所述第一清晰度档位可以根据所述预设的各清晰度档位对应的分辨率范围和所述媒体文件的初始分辨率来确定,所述初始分辨率所在的分辨率范围所对应的清晰度档位可以为第一清晰度档位。例如,若所述媒体文件的初始分辨率为1920×1080,那么所述第一清晰度档位可以为“超清”档位;若所述媒体文件的初始分辨率为848×480,那么所述第一清晰度档位可以为“标清”档位。
S103:以所述媒体文件的初始分辨率作为第一分辨率,根据所述第一分辨率在第一清晰度档位对应的分辨率范围中的排位,来确定在第二清晰度档位对应的分辨率范围中具有相同排位的第二分辨率。
可以以所述媒体文件的初始分辨率作为第一分辨率。
所述第二清晰度档位对应的第二分辨率可以根据所述第一分辨率在第一清晰度档位对应的分辨率范围中的排位来确定。具体地,所述第二分辨率在第二清晰度档位对应的分辨率范围中的排位与第一分辨率在第一清晰度档位对应的分辨率范围中的排位相同。例如,所述第一清晰度档位为“高清”档位,第二清晰度档位为“流畅”档位;第一分辨率为1392×784,其处于“高清”档位对应的分辨率范围的第一位,那么,所述第二清晰度档位对应的第二分辨率可以为624×352,其位于“流畅”档位对应的分辨率范围的第一位。
S104:根据所述第一分辨率和第二分辨率,利用第一预设规则对所述媒体文件进行预编码,得到第一清晰度档位对应的第一预编码码率和第二清晰度档位对应的第二预编码码率。
根据所述第一分辨率和第二分辨率,利用第一预设规则可以对所述媒体文件进行预编码,可以得到第一清晰度档位对应的第一预编码码率和第二清晰度档位对应的第二预编码码率。
所述第一预设规则可以包括:根据CRF(constant ratefactor,固定码率系数)值或者固定QP(量化参数)值进行预编码。例如,可以根据CRF=26或QP=29来对视频进行编码。通常情况下,CRF的值为18表示媒体文件质量基本为无损,CRF的值为19-21.5 表示媒体文件质量为高质量,CRF的值为22-26表示媒体文件质量为中等质量。QP的取值范围一般为0~51,值越大,表示媒体文件的质量越差,对于一般互联网视频文件,若QP>35,媒体文件的质量就很差了。因此,在优选的实施方式中,所述CRF的取值范围可以为19~26。在优选的实施方式中,所述QP的取值范围可以为0~35。
在另一个实施方式中,所述利用第一预设规则对所述媒体文件进行预编码还可以包括:抽取所述媒体文件的多个片段进行预编码,对所述多个片段预编码分别得到的码率值求平均,将所述求得的平均值作为预编码码率。通过对其中的多个片段进行预编码,可以节约预编码的时间,从而提高转码效率。
S105:若所述第一预编码码率大于第一清晰度档位对应的预设码率阈值,根据所述第一预编码码率和预设码率阈值,调整所述第一清晰度档位对应的第一分辨率和第二清晰度档位对应的第二分辨率。
可以判断所述第一预编码码率是否大于第一清晰度档位对应的预设码率阈值。所述预设码率阈值可以是所述媒体文件在第一分辨率下能够清晰播放的最大码率值。若所述第一预编码码率大于所述预设码率阈值,可以表示所述媒体文件在根据第一分辨率进行转码时,媒体文件的内容不能流畅播放。
若第一预编码码率大于第一清晰度档位对应的预设码率阈值,可以根据所述第一预编码码率和预设码率阈值,调整所述第一清晰度档位对应的第一分辨率和第二清晰度档位对应的第二分辨率。具体可以包括:基于所述预设码率阈值和预设系数,确定所述第一分辨率和第二分辨率的降低的幅度,根据所述降低的幅度确定调整后的第一分辨率和第二分辨率。
其中,基于所述预设码率阈值和预设系数,确定所述第一分辨率和第二分辨率的降低的幅度,具体可以包括:判断所述第一预编码码率是否大于或等于预设系数的2次方和所述预设码率阈值的乘积,若是,所述第一分辨率和第二分辨率分别调整为在其对应的清晰度档位中降低2个排位后的分辨率值。所述预设系数的取值可以为大于1。优选地,所述预设系数的取值可以为1.1~1.5。
例如,假设第一分辨率为1392×784,其处于“高清”档位对应的分辨率范围的第一位,第二分辨率为624×352,其位于“流畅”档位对应的分辨率范围的第一位。所述利用该第一分辨率预编码得到的第一预编码码率为BitRates,所述预设码率阈值为 MaxRate。经判断,BitRates>MaxRate*scale*scale,其中scale为预设系数。那么,可以确定所述第一分辨率和第二分辨率分别需要调整为在其对应的清晰度档位中降低2个排位后的分辨率值。那么调整后的第一分辨率和第二分辨率分别可以是:1356×864和480×272。
进一步地,若所述第一预编码码率小于预设系数的2次方和所述预设码率阈值的乘积,可以进一步判断所述第一编码码率是否大于或等于所述预设码率阈值和预设系数的乘积,若是,所述第一分辨率和第二分辨率分别调整为在其对应的清晰度档位中降低1个排位后的分辨率值。
进一步地,若所述第一编码码率小于所述预设码率阈值和预设系数的乘积,所述第一分辨率和第二分辨率可以不进行调整。
在同一个清晰度档位内调整分辨率,可以保证媒体文件播放的清晰度不变。同时,通过降低分辨率,可以使得转码后的码率值小于预设的码率阈值,保证媒体文件能够流畅播放。
S106:基于所述调整后的第一分辨率和调整后的第二分辨率,利用第一预设规则对所述媒体文件进行转码。
基于所述调整后的第一分辨率和调整后的第二分辨率,可以利用第一预设规则对所述媒体文件进行转码。根据调整后的第一分辨率和调整后的第二分辨率来对媒体文件进行转码,可以保证所述媒体文件流畅且清晰地播放。
在另一个实施方式中,若所述第一预编码码率小于或等于第一清晰度档位的预设码率阈值,可以表示根据第一分辨率、第二分辨率进行转码可以流畅且清晰地播放所述媒体文件,因此,可以基于所述第一分辨率、第二分辨率对所述媒体文件进行转码。
在另一个实施方式中,当所述多个清晰度档位为至少3个清晰度档位且所述第一清晰度档位为预设的多个清晰度档位中清晰度最高的档位时,所述方法还可以包括:确定所述第一清晰度档位和第二清晰度档位之间的至少一个中间清晰度档位对应的中间分辨率,基于第一分辨率、第二分辨率和所述中间分辨率,利用第二预设算法,计算与所述中间清晰度档位对应的中间预编码码率。
进一步地,当根据所述第一预编码码率和预设码率阈值调整所述第一清晰度档位对 应的第一分辨率和第二清晰度档位对应的第二分辨率时,可以调整所述中间清晰度档位对应的中间分辨率。相应地,可以基于所述调整后的第一分辨率、调整后的第二分辨率和调整后的中间分辨率,利用第一预设规则对所述媒体文件进行转码。所述中间分辨率的调整方法可以与第一分辨率的调整方法相同,本申请在此不再赘述
其中,确定所述第一清晰度档位和第二清晰度档位之间的至少一个中间清晰度档位的中间分辨率,可以采用确定第二清晰度档位对应的第二分辨率的方法。具体地,所述中间清晰度档位对应的中间分辨率可以根据所述第一分辨率在第一清晰度档位对应的分辨率范围中的排位来确定。所述中间分辨率在所述中间清晰度档位对应的分辨率范围中的排位与第一分辨率在第一清晰度档位对应的分辨率范围中的排位相同。例如,所述第一清晰度档位为“高清”档位,第二清晰度档位为“流畅”档位,那么所述第一清晰度档位和第二清晰度档位之间可以有一中间清晰度档位“标清”档位。第一清晰度档位对应的第一分辨率为1392×784,其处于“高清”档位对应的分辨率范围的第一位,那么,所述中间清晰度档位对应的中间分辨率可以为944×528,其位于“标清”档位对应的分辨率范围的第一位。
所述第二预设算法可以包括:插值算法。具体地,根据第一分辨率、第二分辨率和第一预编码码率、第二预编码码率可以计算得到分辨率和预编码码率的线性关系,根据所述线性关系,可以计算得到与所述中间分辨率对应的中间预编码码率。通过插值算法计算中间清晰度档位的中间分辨率所对应的中间预编码码率,计算得到的预编码码率与分辨率能够匹配,从而可以保证在中间清晰度档位的分辨率下,媒体文件可以流畅且清晰地播放。
上述实施例提供的转码方法,可以根据媒体文件的初始分辨率来确定不同清晰度档位的分辨率,基于所述确定的分辨率,可以先对所述媒体文件进行预编码,当所述预编码码率大于预设码率阈值时,可能导致所述媒体文件不能流畅播放,可以根据所述预编码码率和预设码率阈值来调整所述媒体文件的各清晰度对应的分辨率,再根据调整后的分辨率来对媒体文件进行转码,可以保证所述媒体文件流畅且清晰地播放。
下面介绍本申请转码装置一个实施例。
图2是本申请转码装置的一个实施例的模块图。如图2所示,所述转码装置可以包括:媒体文件获取模块201、清晰度档位确定模块202、分辨率确定模块203、预编码码 率确定模块204、分辨率调整模块205和转码模块206。其中,
所述媒体文件获取模块201,可以用于获取媒体文件的属性信息。所述属性信息可以包括:初始分辨率。所述属性信息还可以包括所述媒体文件的初始码率。
所述清晰度档位确定模块202,可以用于根据所述媒体文件的初始分辨率、预设的多个清晰度档位及各清晰度档位对应的分辨率范围,确定所述媒体文件对应的第一清晰度档位,将所述预设的多个清晰度档位中的最低清晰度档位作为所述媒体文件对应的第二清晰度档位。
所述分辨率确定模块203,可以用于以所述媒体文件的初始分辨率作为第一分辨率,根据所述第一分辨率在第一清晰度档位对应的分辨率范围中的排位,来确定在第二清晰度档位对应的分辨率范围中具有相同排位的第二分辨率。
所述预编码码率确定模块204,可以用于根据所述第一分辨率和第二分辨率,利用第一预设规则对所述媒体文件进行预编码,得到第一清晰度档位对应的第一预编码码率和第二清晰度档位对应的第二预编码码率。
所述分辨率调整模块205,可以用于当所述第一预编码码率大于第一清晰度档位对应的预设码率阈值时,根据所述第一预编码码率和预设码率阈值,调整所述第一清晰度档位对应的第一分辨率和第二清晰度档位对应的第二分辨率。
所述转码模块206,可以用于基于所述调整后的第一分辨率和调整后的第二分辨率,利用第一预设规则对所述媒体文件进行转码。
在另一个实施方式中,当所述第一预编码码率小于或等于第一清晰度档位的预设码率阈值时,所述转码模块206还可以用于基于所述第一分辨率、第二分辨率,利用第一预设规则对所述媒体文件进行转码。
在另一个实施方式中,当所述多个清晰度档位大于为至少3个清晰度档位且所述第一清晰度档位为预设的多个清晰度档位中清晰度最高的档位时,所述清晰度档位确定模块202,还可以用于确定所述第一清晰度档位和第二清晰度档位之间的至少一个中间清晰度档位。相应地,所述分辨率确定模块203还可以用于确定所述至少一个中间清晰度档位对应的中间分辨率。所述预编码码率确定模块204还可以用于基于所述第一分辨率、第二分辨率和所述中间分辨率,利用第二预设算法,计算与所述中间清晰度档位对应的中间预编码码率。
进一步地,所述分辨率调整模块205还可以用于调整所述中间清晰度档位对应的中间分辨率。所述转码模块206,还可以用于基于调整后的第一分辨率、调整后的第二分 辨率和调整后的中间分辨率,利用第一预设规则对所述媒体文件进行转码。
上述实施例提供的转码装置与本申请转码方法实施例相对应,可以实现本申请方法实施例,取得本申请方法实施例的技术效果。
在20世纪90年代,对于一个技术的改进可以很明显地区分是硬件上的改进(例如,对二极管、晶体管、开关等电路结构的改进)还是软件上的改进(对于方法流程的改进)。然而,随着技术的发展,当今的很多方法流程的改进已经可以视为硬件电路结构的直接改进。设计人员几乎都通过将改进的方法流程编程到硬件电路中来得到相应的硬件电路结构。因此,不能说一个方法流程的改进就不能用硬件实体模块来实现。例如,可编程逻辑器件(Programmable Logic Device,PLD)(例如现场可编程门阵列(Field Programmable Gate Array,FPGA))就是这样一种集成电路,其逻辑功能由用户对器件编程来确定。由设计人员自行编程来把一个数字系统“集成”在一片PLD上,而不需要请芯片制造厂商来设计和制作专用的集成电路芯片2。而且,如今,取代手工地制作集成电路芯片,这种编程也多半改用“逻辑编译器(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。本领域技术人员也应该清楚,只需要将方法流程用上述几种硬件描述语言稍作逻辑编程并编程到集成电路中,就可以很容易得到实现该逻辑方法流程的硬件电路。
控制器可以按任何适当的方式实现,例如,控制器可以采取例如微处理器或处理器以及存储可由该(微)处理器执行的计算机可读程序代码(例如软件或固件)的计算机可读介质、逻辑门、开关、专用集成电路(Application Specific Integrated Circuit,ASIC)、可编程逻辑控制器和嵌入微控制器的形式,控制器的例子包括但不限于以下微控制器:ARC 625D、Atmel AT91SAM、Microchip PIC18F26K20以及Silicone Labs C8051F320,存储器控制器还可以被实现为存储器的控制逻辑的一部分。
本领域技术人员也知道,除了以纯计算机可读程序代码方式实现控制器以外,完全 可以通过将方法步骤进行逻辑编程来使得控制器以逻辑门、开关、专用集成电路、可编程逻辑控制器和嵌入微控制器等的形式来实现相同功能。因此这种控制器可以被认为是一种硬件部件,而对其内包括的用于实现各种功能的装置也可以视为硬件部件内的结构。或者甚至,可以将用于实现各种功能的装置视为既可以是实现方法的软件模块又可以是硬件部件内的结构。
上述实施例阐明的系统、装置、模块或单元,具体可以由计算机芯片或实体实现,或者由具有某种功能的产品来实现。
为了描述的方便,描述以上装置时以功能分为各种单元分别描述。当然,在实施本申请时可以把各单元的功能在同一个或多个软件和/或硬件中实现。
通过以上的实施方式的描述可知,本领域的技术人员可以清楚地了解到本申请可借助软件加必需的通用硬件平台的方式来实现。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,在一个典型的配置中,计算设备包括一个或多个处理器(CPU)、输入/输出接口、网络接口和内存。该计算机软件产品可以包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例或者实施例的某些部分所述的方法。该计算机软件产品可以存储在内存中,内存可能包括计算机可读介质中的非永久性存储器,随机存取存储器(RAM)和/或非易失性内存等形式,如只读存储器(ROM)或闪存(flash RAM)。内存是计算机可读介质的示例。计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带,磁带磁磁盘存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。按照本文中的界定,计算机可读介质不包括短暂电脑可读媒体(transitory media),如调制的数据信号和载波。
本说明书中的各个实施例均采用递进的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于系统实施例而言,由于其基本相似于方法实施例,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。
本申请可用于众多通用或专用的计算机系统环境或配置中。例如:个人计算机、服务器计算机、手持设备或便携式设备、平板型设备、多处理器系统、基于微处理器的系统、置顶盒、可编程的消费电子设备、网络PC、小型计算机、大型计算机、包括以上任何系统或设备的分布式计算环境等等。
本申请可以在由计算机执行的计算机可执行指令的一般上下文中描述,例如程序模块。一般地,程序模块包括执行特定任务或实现特定抽象数据类型的例程、程序、对象、组件、数据结构等等。也可以在分布式计算环境中实践本申请,在这些分布式计算环境中,由通过通信网络而被连接的远程处理设备来执行任务。在分布式计算环境中,程序模块可以位于包括存储设备在内的本地和远程计算机存储介质中。
虽然通过实施例描绘了本申请,本领域普通技术人员知道,本申请有许多变形和变化而不脱离本申请的精神,希望所附的权利要求包括这些变形和变化而不脱离本申请的精神。

Claims (17)

  1. 一种转码方法,其特征在于,包括:
    获取媒体文件的属性信息,所述属性信息包括初始分辨率;
    根据所述媒体文件的初始分辨率、预设的多个清晰度档位和各清晰度档位对应的分辨率范围,确定所述媒体文件对应的第一清晰度档位,将所述预设的多个清晰度档位中的最低清晰度档位的作为所述媒体文件对应的第二清晰度档位;
    以所述媒体文件的初始分辨率作为第一分辨率,根据所述第一分辨率在第一清晰度档位对应的分辨率范围中的排位,来确定在第二清晰度档位对应的分辨率范围中具有相同排位的第二分辨率;
    根据所述第一分辨率和第二分辨率,利用第一预设规则对所述媒体文件进行预编码,得到第一清晰度档位对应的第一预编码码率和第二清晰度档位对应的第二预编码码率;
    若所述第一预编码码率大于第一清晰度档位对应的预设码率阈值,根据所述第一预编码码率和预设码率阈值,调整所述第一清晰度档位对应的第一分辨率和第二清晰度档位对应的第二分辨率;
    基于所述调整后的第一分辨率和调整后的第二分辨率,利用第一预设规则对所述媒体文件进行转码。
  2. 如权利要求1所述的一种转码方法,其特征在于,所述根据媒体文件的初始分辨率、预设的多个清晰度档位及各清晰度档位对应的分辨率范围,确定所述媒体文件对应的第一清晰度档位,具体包括:所述初始分辨率所在的分辨率范围所对应的清晰度档位为第一清晰度档位。
  3. 如权利要求1所述的一种转码方法,其特征在于,所述利用第一预设规则对所述媒体文件进行预编码包括:根据固定码率系数值或者固定量化参数值进行预编码。
  4. 如权利要求3所述的一种转码方法,其特征在于,所述利用第一预设规则对所述媒体文件进行预编码包括:抽取所述媒体文件的多个片段进行预编码,对所述多个片段预编码分别得到的码率值求平均,将所述求得的平均值作为预编码码率。
  5. 如权利要求1所述的一种转码方法,其特征在于,所述预设码率阈值包括:所述媒体文件在第一分辨率下清晰播放的最大码率值。
  6. 如权利要求1所述的一种转码方法,其特征在于,所述根据第一预编码码率和预设码率阈值,调整所述第一清晰度档位对应的第一分辨率和第二清晰度档位对应的第二分辨率,包括:基于所述预设码率阈值和预设系数,确定所述第一分辨率和第二分辨率的降低的幅度,根据所述降低的幅度确定调整后的第一分辨率和第二分辨率。
  7. 如权利要求6所述的一种转码方法,其特征在于,所述基于预设码率阈值和预设系数,确定所述第一分辨率和第二分辨率的降低的幅度,具体包括:
    判断所述第一预编码码率是否大于或等于预设系数的2次方和所述预设码率阈值的乘积;
    若是,所述第一分辨率和第二分辨率分别调整为在其对应的清晰度档位中降低2个排位后的分辨率值。
  8. 如权利要求7所述的一种转码方法,其特征在于,若所述第一预编码码率小于预设系数的2次方和所述预设码率阈值的乘积,所述方法还包括:
    判断所述第一编码码率是否大于或等于所述预设码率阈值和预设系数的乘积;
    若是,所述第一分辨率和第二分辨率分别调整为在其对应的清晰度档位中降低1个排位后的分辨率值。
  9. 如权利要求6-8中任意一项所述的一种转码方法,其特征在于,所述预设系数的取值范围包括:大于1。
  10. 如权利要求1所述的一种转码方法,其特征在于,所述方法还包括:若所述第一预编码码率小于或等于第一清晰度档位对应的预设码率阈值,基于所述第一分辨率和第二分辨率对所述媒体文件进行转码。
  11. 如权利要求1所述的一种转码方法,其特征在于,当所述多个清晰度档位为至少3个清晰度档位且所述第一清晰度档位为预设的多个清晰度档位中清晰度最高的档位时,所述方法还包括:
    确定所述第一清晰度档位和第二清晰度档位之间的至少一个中间清晰度档位对应的中间分辨率;
    基于第一分辨率、第二分辨率和所述中间分辨率,利用第二预设算法,计算与所述中间清晰度档位对应的中间预编码码率。
  12. 如权利要求11所述的一种转码方法,其特征在于,所述中间档位对应的中间分辨率根据所述第一分辨率在第一清晰度档位对应的分辨率范围中的排位来确定,具体地,所述中间分辨率在所述中间清晰度档位对应的分辨率范围中的排位与第一分辨率在第一清晰度档位对应的分辨率范围中的排位相同。
  13. 如权利要求11或12所述的一种转码方法,其特征在于,所述第二预设算法包括:插值算法。
  14. 一种转码装置,其特征在于,包括:媒体文件获取模块、清晰度档位确定模块、分辨率确定模块、预编码码率确定模块、分辨率调整模块和转码模块;其中,
    所述媒体文件获取模块,用于获取媒体文件的属性信息,所述属性信息包括初始分辨率;
    所述清晰度档位确定模块,用于根据所述媒体文件的初始分辨率、预设的多个清晰度档位及各清晰度档位对应的分辨率范围,确定所述媒体文件对应的第一清晰度档位,将所述预设的多个清晰度档位中的最低清晰度档位作为所述媒体文件对应的第二清晰度档位;
    所述分辨率确定模块,用于以所述媒体文件的初始分辨率作为第一分辨率,根据所述第一分辨率在第一清晰度档位对应的分辨率范围中的排位,来确定在第二清晰度档位对应的分辨率范围中具有相同排位的第二分辨率;
    所述预编码码率确定模块,用于根据所述第一分辨率和第二分辨率,利用第一预设规则对所述媒体文件进行预编码,得到第一清晰度档位对应的第一预编码码率和第二清晰度档位对应的第二预编码码率;
    所述分辨率调整模块,用于当第一预编码码率大于第一清晰度档位对应的预设码率阈值时,根据所述第一预编码码率和预设码率阈值,调整所述第一清晰度档位对应的第一分辨率和第二清晰度档位对应的第二分辨率;
    所述转码模块,用于基于所述分辨率调整模块调整后的第一分辨率和调整后的第二分辨率,利用第一预设规则对所述媒体文件进行转码。
  15. 如权利要求14所述的一种转码装置,其特征在于,当所述第一预编码码率小于或等于第一清晰度档位的预设码率阈值时,所述转码模块还用于基于所述第一分辨率、第二分辨率,利用第一预设规则对所述媒体文件进行转码。
  16. 如权利要求14所述的一种转码装置,其特征在于,当所述多个清晰度档位大于为至少3个清晰度档位且所述第一清晰度档位为预设的多个清晰度档位中清晰度最高的档位时,所述清晰度档位确定模块,还用于确定所述第一清晰度档位和第二清晰度档位之间的至少一个中间清晰度档位;
    所述分辨率确定模块,还用于确定所述至少一个中间清晰度档位对应的中间分辨率;
    所述预编码码率确定模块,还用于基于所述第一分辨率、第二分辨率和所述中间分辨率,利用第二预设算法,计算与所述中间清晰度档位对应的中间预编码码率。
  17. 如权利要求16所述的一种转码装置,其特征在于,所述分辨率调整模块还用于调整所述中间清晰度档位对应的中间分辨率;相应地,所述转码模块,还用于基于调整后的第一分辨率、调整后的第二分辨率和调整后的中间分辨率,利用第一预设规则对所述媒体文件进行转码。
PCT/CN2016/107411 2015-12-08 2016-11-28 一种转码方法及装置 WO2017097126A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
EP16872318.7A EP3389269A4 (en) 2015-12-08 2016-11-28 METHOD AND DEVICE FOR TRANSCODING
US16/004,006 US10567779B2 (en) 2015-12-08 2018-06-08 Method and apparatus for transcoding

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510894540.3A CN106856570B (zh) 2015-12-08 2015-12-08 一种转码方法及装置
CN201510894540.3 2015-12-08

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US16/004,006 Continuation US10567779B2 (en) 2015-12-08 2018-06-08 Method and apparatus for transcoding

Publications (1)

Publication Number Publication Date
WO2017097126A1 true WO2017097126A1 (zh) 2017-06-15

Family

ID=59012677

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/107411 WO2017097126A1 (zh) 2015-12-08 2016-11-28 一种转码方法及装置

Country Status (4)

Country Link
US (1) US10567779B2 (zh)
EP (1) EP3389269A4 (zh)
CN (1) CN106856570B (zh)
WO (1) WO2017097126A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111866533A (zh) * 2020-07-13 2020-10-30 网宿科技股份有限公司 一种直播转码方法及装置

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110366006A (zh) * 2019-07-24 2019-10-22 北京奇艺世纪科技有限公司 视频播放方法、装置、终端设备及计算机可读存储介质
CN111277826B (zh) * 2020-01-22 2022-03-11 腾讯科技(深圳)有限公司 一种视频数据处理方法、装置及存储介质
CN114025190B (zh) * 2021-11-03 2023-06-20 北京达佳互联信息技术有限公司 多码率调度方法和多码率调度装置
CN114697299B (zh) * 2022-04-21 2024-05-10 湖南快乐阳光互动娱乐传媒有限公司 一种音视频转码优先级确定方法、系统、装置及存储介质
CN115134339B (zh) * 2022-06-28 2024-07-02 京东方科技集团股份有限公司 媒体文件处理方法、装置及电子设备
CN116781951B (zh) * 2023-08-24 2023-12-05 湖南快乐阳光互动娱乐传媒有限公司 一种清晰度调节方法、装置和服务器

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103220550A (zh) * 2012-01-19 2013-07-24 华为技术有限公司 视频转换的方法及装置
CN103702138A (zh) * 2013-11-29 2014-04-02 乐视网信息技术(北京)股份有限公司 自适应指定转码的方法和系统
CN104581169A (zh) * 2014-12-31 2015-04-29 乐视网信息技术(北京)股份有限公司 分级转码方法及装置
CN105100800A (zh) * 2015-09-11 2015-11-25 Tcl集团股份有限公司 视频编码器编码码率调节方法及装置
WO2015183910A1 (en) * 2014-05-30 2015-12-03 Alibaba Group Holding Limited Method and apparatus of content-based self-adaptive video transcoding

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9171577B1 (en) * 2003-04-25 2015-10-27 Gopro, Inc. Encoding and decoding selectively retrievable representations of video content
US8456986B2 (en) * 2006-12-13 2013-06-04 Viasat, Inc. Video and data network load balancing
US8290038B1 (en) * 2009-11-30 2012-10-16 Google Inc. Video coding complexity estimation
FR3013933A1 (fr) * 2013-11-22 2015-05-29 Orange Diffusion adaptative de contenus multimedia
US9516358B2 (en) * 2013-11-26 2016-12-06 At&T Intellectual Property I, L.P. Method and apparatus for providing media content
CN105657520A (zh) * 2014-11-18 2016-06-08 乐视网信息技术(北京)股份有限公司 一种视频清晰度切换方法和视频播放器
US10225301B2 (en) * 2015-08-26 2019-03-05 Zhan Ma Method and apparatus for use of input messages in media transport to support interactive communications

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103220550A (zh) * 2012-01-19 2013-07-24 华为技术有限公司 视频转换的方法及装置
CN103702138A (zh) * 2013-11-29 2014-04-02 乐视网信息技术(北京)股份有限公司 自适应指定转码的方法和系统
WO2015183910A1 (en) * 2014-05-30 2015-12-03 Alibaba Group Holding Limited Method and apparatus of content-based self-adaptive video transcoding
CN104581169A (zh) * 2014-12-31 2015-04-29 乐视网信息技术(北京)股份有限公司 分级转码方法及装置
CN105100800A (zh) * 2015-09-11 2015-11-25 Tcl集团股份有限公司 视频编码器编码码率调节方法及装置

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP3389269A4 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111866533A (zh) * 2020-07-13 2020-10-30 网宿科技股份有限公司 一种直播转码方法及装置
CN111866533B (zh) * 2020-07-13 2022-03-08 网宿科技股份有限公司 一种直播转码方法及装置

Also Published As

Publication number Publication date
US20180295372A1 (en) 2018-10-11
CN106856570A (zh) 2017-06-16
EP3389269A4 (en) 2019-07-17
EP3389269A1 (en) 2018-10-17
CN106856570B (zh) 2018-08-24
US10567779B2 (en) 2020-02-18

Similar Documents

Publication Publication Date Title
WO2017097126A1 (zh) 一种转码方法及装置
US11589088B2 (en) System and method for automatically selecting encoding/decoding for streaming media
JP7429676B2 (ja) ビデオ符号化及び復号のための適応的伝達関数
JP6469788B2 (ja) メディアコンテンツの適応型ストリーミングのための品質情報の使用
KR102086995B1 (ko) 멀티미디어 콘텐트의 심리스 해상도 전환을 위한 해상도들의 선택
US9699464B2 (en) Adaptive bitrate streaming for wireless video
US10645406B2 (en) Transcoding method and apparatus
US20150156096A1 (en) Virtualization service apparatus and method of providing virtualization service
TW201541987A (zh) 基於網速傳輸文件的方法及系統
US9525641B1 (en) Facilitating buffer wait time determination based on device- or entity-related conditions
US20170374432A1 (en) System and method for adaptive video streaming with quality equivalent segmentation and delivery
TW201828696A (zh) 轉碼方法及裝置
TWI721089B (zh) 轉碼方法及裝置
JP6005292B2 (ja) ビデオ符号化及び復号のためのヒストグラム分割ベースのローカル適応フィルタ
US20240259574A1 (en) Faster Hybrid Three Pass Encoding for Video Streaming
Lin et al. Geo-popularity assisted optimized transcoding for large scale adaptive streaming
JP6379408B2 (ja) ビデオ符号化及び復号のためのヒストグラム分割ベースのローカル適応フィルタ
Nguyen et al. How to prepare videos for streaming on GCM
JP2017028714A (ja) ビデオ符号化及び復号のためのヒストグラム分割ベースのローカル適応フィルタ

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

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

WWE Wipo information: entry into national phase

Ref document number: 2016872318

Country of ref document: EP