CN107659819B - A kind of method and apparatus of video code conversion - Google Patents
A kind of method and apparatus of video code conversion Download PDFInfo
- Publication number
- CN107659819B CN107659819B CN201711038561.0A CN201711038561A CN107659819B CN 107659819 B CN107659819 B CN 107659819B CN 201711038561 A CN201711038561 A CN 201711038561A CN 107659819 B CN107659819 B CN 107659819B
- Authority
- CN
- China
- Prior art keywords
- code rate
- rate
- bit rate
- video
- target video
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 38
- 238000006243 chemical reaction Methods 0.000 title claims 3
- 230000000694 effects Effects 0.000 abstract description 5
- 230000008569 process Effects 0.000 description 11
- 238000004364 calculation method Methods 0.000 description 5
- 238000010586 diagram Methods 0.000 description 5
- 238000001514 detection method Methods 0.000 description 3
- 238000005538 encapsulation Methods 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 238000001914 filtration Methods 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000000737 periodic effect Effects 0.000 description 1
- 230000002085 persistent effect Effects 0.000 description 1
- 239000002699 waste material Substances 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/40—Methods 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
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/20—Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
- H04N21/25—Management operations performed by the server for facilitating the content distribution or administrating data related to end-users or client devices, e.g. end-user or client device authentication, learning user preferences for recommending movies
- H04N21/266—Channel or content management, e.g. generation and management of keys and entitlement messages in a conditional access system, merging a VOD unicast channel into a multicast channel
- H04N21/2662—Controlling the complexity of the video stream, e.g. by scaling the resolution or bitrate of the video stream based on the client capabilities
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/40—Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
- H04N21/43—Processing 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/44—Processing 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/4402—Processing 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
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Databases & Information Systems (AREA)
- Compression Or Coding Systems Of Tv Signals (AREA)
- Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)
Abstract
本发明公开了一种视频转码的方法和装置,属于计算机技术领域。所述方法包括:获取解封装后的目标视频的视频数据包;周期性计算所述目标视频的全局平均码率和预设周期内的局部平均码率;根据所述全局平均码率和所述局部平均码率,对编码码率进行调整;基于调整后的编码码率,对所述目标视频进行转码处理。采用本发明,可以最大限度地保证输出视频的码率与输入视频的码率基本一致,从而可以提高视频转码的效果。
The invention discloses a video transcoding method and device, belonging to the technical field of computers. The method includes: obtaining the video data packet of the decapsulated target video; periodically calculating the global average bit rate of the target video and the local average bit rate in a preset period; according to the global average bit rate and the The local average bit rate is used to adjust the encoding bit rate; based on the adjusted encoding bit rate, the target video is transcoded. By adopting the present invention, the code rate of the output video is basically consistent with that of the input video to the greatest extent, thereby improving the effect of video transcoding.
Description
技术领域technical field
本发明涉及计算机技术领域,特别涉及一种视频转码的方法和装置。The present invention relates to the field of computer technology, in particular to a video transcoding method and device.
背景技术Background technique
伴随着互联网技术的发展以及现代带宽的不断提速,互联网与人们的生活联系的日益密切,越来越多的人们热衷于在互联网中获取视频来丰富生活,当下,高品质高质量的视频已成为人们日常需求的首选。With the development of Internet technology and the continuous increase of modern bandwidth, the connection between the Internet and people's lives is becoming closer and closer. More and more people are keen to obtain videos on the Internet to enrich their lives. At present, high-quality and high-quality videos have become The first choice for people's daily needs.
基于宣传或者版权保护的需要,视频的发布方经常在发布的视频数据中添加专属的水印,以避免视频数据被他人盗用。具体的,发布方可以先获取封装好的初始视频(可称为输入视频),然后对初始视频的视频数据进行解封装、解码,再在视频中的每一帧图像中添加水印,之后,发布方可以再对添加完水印的视频数据进行编码、封装,从而将最终视频(可以称为输出视频)提供给接收方(如转播方或者观众等)。上述对视频数据处理的过程也可以称为对视频数据的转码处理。Based on the needs of publicity or copyright protection, video publishers often add exclusive watermarks to the published video data to prevent the video data from being stolen by others. Specifically, the publisher can first obtain the packaged initial video (which can be called the input video), then decapsulate and decode the video data of the initial video, and then add a watermark to each frame of the video, and then publish The party can encode and encapsulate the watermarked video data, so as to provide the final video (which may be called the output video) to the receiver (such as the relay party or the audience, etc.). The above process of processing video data may also be referred to as transcoding processing of video data.
在实现本发明的过程中,发明人发现现有技术至少存在以下问题:In the process of realizing the present invention, the inventor finds that there are at least the following problems in the prior art:
如果转码后视频的码率过小,则视频的画面质量将会很差,甚至出现画面失真或马赛克现象,而如果转码后视频的码率过大,则会导致传输视频时带宽资源的浪费,这样,则需要输出视频的码率尽可能接近输入视频的码率。然而,受不同编码模式的影响,转码时很难准确获知输入视频的码率,故而,视频转码的效果较差。If the code rate of the transcoded video is too small, the image quality of the video will be poor, and even picture distortion or mosaic phenomenon will appear, and if the code rate of the video after transcoding is too high, it will lead to the loss of bandwidth resources when transmitting the video. Waste, in this way, the bit rate of the output video needs to be as close as possible to the bit rate of the input video. However, due to the influence of different encoding modes, it is difficult to accurately know the bit rate of the input video during transcoding, so the effect of video transcoding is poor.
发明内容Contents of the invention
为了解决现有技术的问题,本发明实施例提供了一种视频转码的方法和装置。所述技术方案如下:In order to solve the problems in the prior art, embodiments of the present invention provide a video transcoding method and device. Described technical scheme is as follows:
第一方面,提供了一种视频转码的方法,所述方法包括:In a first aspect, a video transcoding method is provided, the method comprising:
获取解封装后的目标视频的视频数据包;Obtain the video data packet of the target video after decapsulation;
周期性计算所述目标视频的全局平均码率和预设周期内的局部平均码率;Periodically calculate the global average bit rate of the target video and the local average bit rate within a preset period;
根据所述全局平均码率和所述局部平均码率,对编码码率进行调整;adjusting the coding rate according to the global average rate and the local average rate;
基于调整后的编码码率,对所述目标视频进行转码处理。Based on the adjusted coding rate, the target video is transcoded.
可选的,所述周期性计算所述目标视频的全局平均码率和预设周期内的局部平均码率,包括:Optionally, the periodic calculation of the global average bit rate of the target video and the local average bit rate within a preset period includes:
将所述视频数据包的数据量累积至已获取到的所述目标视频的全局数据量和预设周期内已获取到的所述目标视频的局部数据量中;accumulating the data volume of the video data packet into the acquired global data volume of the target video and the local data volume of the target video acquired within a preset period;
根据所述视频数据包对应的解码时间戳,确定所述目标视频的已解码时长和预设周期时长;Determine the decoded duration and preset period duration of the target video according to the decoding timestamp corresponding to the video data packet;
将所述全局数据量和所述已解码时长之商作为全局平均码率,并将所述局部数据量和所述预设周期时长之商作为局部平均码率。The quotient of the global data amount and the decoded duration is taken as the global average code rate, and the quotient of the local data amount and the preset cycle duration is taken as the local average code rate.
可选的,所述根据所述全局平均码率和所述局部平均码率,对编码码率进行调整,包括:Optionally, adjusting the encoding bit rate according to the global average bit rate and the local average bit rate includes:
如果所述局部平均码率与当前编码码率的绝对差值大于预设阈值,则判断所述局部平均码率是否大于预设的最小码率参考值;If the absolute difference between the local average bit rate and the current encoding bit rate is greater than a preset threshold, then determine whether the local average bit rate is greater than a preset minimum bit rate reference value;
如果是,则将所述编码码率设置为所述局部平均码率,如果不是,则将所述全局平均码率和所述最小码率参考值中的最大值作为所述编码码率。If yes, set the encoding bit rate as the local average bit rate; if not, set the maximum value of the global average bit rate and the minimum bit rate reference value as the encoding bit rate.
可选的,所述如果所述局部平均码率与当前编码码率的绝对差值大于预设阈值,则判断所述局部平均码率是否大于预设的最小码率参考值,包括:Optionally, if the absolute difference between the local average code rate and the current encoding code rate is greater than a preset threshold, then judging whether the local average code rate is greater than a preset minimum code rate reference value includes:
如果所述局部平均码率与当前编码码率的绝对差值大于预设阈值,且已解码时长大于预设时长,则判断所述局部平均码率是否大于预设的最小码率参考值。If the absolute difference between the local average bit rate and the current encoding bit rate is greater than a preset threshold, and the decoded duration is longer than a preset time length, it is judged whether the local average bit rate is greater than a preset minimum bit rate reference value.
可选的,所述方法还包括:Optionally, the method also includes:
如果所述局部平均码率与当前编码码率的绝对差值大于预设阈值,且已解码时长小于预设时长,则将所述局部平均码率和预设的最大码率参考值中的最大值作为所述编码码率。If the absolute difference between the local average code rate and the current encoding code rate is greater than the preset threshold, and the decoded duration is less than the preset duration, then the maximum of the local average code rate and the preset maximum code rate reference value value as the code rate.
可选的,所述方法还包括:Optionally, the method also includes:
获取所述目标视频的属性信息,所述属性信息中至少包括所述目标视频的目标分辨率和目标帧率。The attribute information of the target video is acquired, and the attribute information includes at least a target resolution and a target frame rate of the target video.
可选的,所述方法还包括:Optionally, the method also includes:
确定所述目标视频的属性信息和预设的标准属性信息的数学关系;determining the mathematical relationship between the attribute information of the target video and the preset standard attribute information;
根据所述数学关系和所述标准属性信息对应的标准码率,确定所述目标视频的最小码率参考值和最大码率参考值。Determine a minimum code rate reference value and a maximum code rate reference value of the target video according to the mathematical relationship and the standard code rate corresponding to the standard attribute information.
第二方面,提供了一种视频转码的装置,所述装置包括:In a second aspect, a device for video transcoding is provided, the device comprising:
第一获取模块,用于获取解封装后的目标视频的视频数据包;The first obtaining module is used to obtain the video data packet of the decapsulated target video;
计算模块,用于周期性计算所述目标视频的全局平均码率和预设周期内的局部平均码率;A calculation module, configured to periodically calculate the global average bit rate of the target video and the local average bit rate within a preset period;
调整模块,用于根据所述全局平均码率和所述局部平均码率,对编码码率进行调整;An adjustment module, configured to adjust the encoding bit rate according to the global average bit rate and the local average bit rate;
转码模块,用于基于调整后的编码码率,对所述目标视频进行转码处理。The transcoding module is configured to perform transcoding processing on the target video based on the adjusted coding rate.
可选的,所述计算模块,具体用于:Optionally, the calculation module is specifically used for:
将所述视频数据包的数据量累积至已获取到的所述目标视频的全局数据量和预设周期内已获取到的所述目标视频的局部数据量中;accumulating the data volume of the video data packet into the acquired global data volume of the target video and the local data volume of the target video acquired within a preset period;
根据所述视频数据包对应的解码时间戳,确定所述目标视频的已解码时长和预设周期时长;Determine the decoded duration and preset period duration of the target video according to the decoding timestamp corresponding to the video data packet;
将所述全局数据量和所述已解码时长之商作为全局平均码率,并将所述局部数据量和所述预设周期时长之商作为局部平均码率。The quotient of the global data amount and the decoded duration is taken as the global average code rate, and the quotient of the local data amount and the preset cycle duration is taken as the local average code rate.
可选的,所述调整模块,具体用于:Optionally, the adjustment module is specifically used for:
如果所述局部平均码率与当前编码码率的绝对差值大于预设阈值,则判断所述局部平均码率是否大于预设的最小码率参考值;If the absolute difference between the local average bit rate and the current encoding bit rate is greater than a preset threshold, then determine whether the local average bit rate is greater than a preset minimum bit rate reference value;
如果是,则将所述编码码率设置为所述局部平均码率,如果不是,则将所述全局平均码率和所述最小码率参考值中的最大值作为所述编码码率。If yes, set the encoding bit rate as the local average bit rate; if not, set the maximum value of the global average bit rate and the minimum bit rate reference value as the encoding bit rate.
可选的,所述调整模块,具体用于:Optionally, the adjustment module is specifically used for:
如果所述局部平均码率与当前编码码率的绝对差值大于预设阈值,且已解码时长大于预设时长,则判断所述局部平均码率是否大于预设的最小码率参考值。If the absolute difference between the local average bit rate and the current encoding bit rate is greater than a preset threshold, and the decoded duration is longer than a preset time length, it is judged whether the local average bit rate is greater than a preset minimum bit rate reference value.
可选的,所述调整模块,还用于:Optionally, the adjustment module is also used for:
如果所述局部平均码率与当前编码码率的绝对差值大于预设阈值,且已解码时长小于预设时长,则将所述局部平均码率和预设的最大码率参考值中的最大值作为所述编码码率。If the absolute difference between the local average code rate and the current encoding code rate is greater than the preset threshold, and the decoded duration is less than the preset duration, then the maximum of the local average code rate and the preset maximum code rate reference value value as the code rate.
可选的,所述装置还包括:Optionally, the device also includes:
第二获取模块,用于获取所述目标视频的属性信息,所述属性信息中至少包括所述目标视频的目标分辨率和目标帧率。The second obtaining module is configured to obtain attribute information of the target video, where the attribute information at least includes a target resolution and a target frame rate of the target video.
可选的,所述装置还包括:Optionally, the device also includes:
第一确定模块,用于确定所述目标视频的属性信息和预设的标准属性信息的数学关系。The first determining module is configured to determine the mathematical relationship between the attribute information of the target video and preset standard attribute information.
可选的,所述装置还包括:Optionally, the device also includes:
第二确定模块,用于根据所述数学关系和所述标准属性信息对应的标准码率,确定所述目标视频的最小码率参考值和最大码率参考值。The second determination module is configured to determine a minimum code rate reference value and a maximum code rate reference value of the target video according to the mathematical relationship and the standard code rate corresponding to the standard attribute information.
本发明实施例提供的技术方案带来的有益效果是:The beneficial effects brought by the technical solution provided by the embodiments of the present invention are:
本发明实施例中,服务器获取解封装后的目标视频的视频数据包,周期性计算目标视频的全局平均码率和预设周期内的局部平均码率,根据全局平均码率和局部平均码率,对编码码率进行调整,基于调整后的编码码率,对目标视频进行转码处理。这样,在对目标视频进行转码的过程中,服务器可以对编码码率进行实时探测,并根据探测结果及时调整编码码率,可以最大限度地保证输出视频的码率与输入视频的码率基本一致,从而可以提高视频转码的效果。In the embodiment of the present invention, the server obtains the video data packet of the target video after decapsulation, periodically calculates the global average bit rate of the target video and the local average bit rate in the preset period, according to the global average bit rate and the local average bit rate , adjust the encoding bit rate, and perform transcoding processing on the target video based on the adjusted encoding bit rate. In this way, during the process of transcoding the target video, the server can detect the encoding bit rate in real time, and adjust the encoding bit rate in time according to the detection results, so as to ensure that the bit rate of the output video is basically the same as the bit rate of the input video. Consistent, so that the effect of video transcoding can be improved.
附图说明Description of drawings
为了更清楚地说明本发明实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings that need to be used in the description of the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present invention. For those skilled in the art, other drawings can also be obtained based on these drawings without creative effort.
图1是本发明实施例提供的一种视频转码的方法流程图;FIG. 1 is a flowchart of a video transcoding method provided by an embodiment of the present invention;
图2是本发明实施例提供的一种调整编码码率的流程示意图;Fig. 2 is a schematic flow chart of adjusting the coding rate provided by an embodiment of the present invention;
图3是本发明实施例提供的一种视频转码的步骤示意图;FIG. 3 is a schematic diagram of video transcoding steps provided by an embodiment of the present invention;
图4是本发明实施例提供的一种视频转码的装置结构示意图;FIG. 4 is a schematic structural diagram of a video transcoding device provided by an embodiment of the present invention;
图5是本发明实施例提供的一种视频转码的装置结构示意图;FIG. 5 is a schematic structural diagram of a video transcoding device provided by an embodiment of the present invention;
图6是本发明实施例提供的一种服务器的结构示意图。Fig. 6 is a schematic structural diagram of a server provided by an embodiment of the present invention.
具体实施方式Detailed ways
为使本发明的目的、技术方案和优点更加清楚,下面将结合附图对本发明实施方式作进一步地详细描述。In order to make the object, technical solution and advantages of the present invention clearer, the implementation manner of the present invention will be further described in detail below in conjunction with the accompanying drawings.
本发明实施例提供了一种视频转码的方法,该方法的执行主体可以是服务器。其中,服务器可以是具备视频转码功能的服务器,如视频发布方的服务器,服务器在接收到视频数据后,可以对视频进行转码处理,然后将转码后的视频提供给外界。上述服务器可以包括处理器、存储器、收发器,处理器可以用于进行下述流程中视频转码的处理,存储器可以用于存储下述处理过程中需要的数据以及产生的数据,收发器可以用于接收和发送下述处理过程中的相关数据,如用于接收输入视频和发送输出视频。本实施例中以服务器为直播平台的管理服务器为例进行说明,其它情况与之相似,不再一一介绍。An embodiment of the present invention provides a method for video transcoding, and the execution subject of the method may be a server. Wherein, the server may be a server with a video transcoding function, such as a server of a video publisher. After receiving video data, the server may perform transcoding processing on the video, and then provide the transcoded video to the outside world. The above-mentioned server may include a processor, a memory, and a transceiver. The processor may be used to perform video transcoding processing in the following process, and the memory may be used to store data required and generated during the following processing. The transceiver may use Used to receive and send relevant data in the following processes, such as for receiving input video and sending output video. In this embodiment, the server is the management server of the live broadcast platform as an example for illustration, other situations are similar and will not be introduced one by one.
下面将结合具体实施方式,对图1所示的处理流程进行详细的说明,内容可以如下:The processing flow shown in FIG. 1 will be described in detail below in conjunction with specific implementation methods, and the content may be as follows:
步骤101,获取解封装后的目标视频的视频数据包。Step 101, acquire the video data packet of the decapsulated target video.
在实施中,主播在直播间开始直播后,主播侧的数据采集设备可以实时采集用于生成直播视频的画面、声音等,再由视频制作设备生成相应的直播视频,并由视频传输设备将该直播视频实时发送至直播平台的服务器。这样,服务器可以接收到主播侧发送的直播视频的视频数据。服务器将该直播视频转发给直播间的观众前,可以对直播视频进行视频转码,以在视频画面中添加水印。具体的,服务器可以先获取直播视频(即目标视频)的封装格式、音视频参数以及编解码参数等信息,然后根据封装格式对上述目标视频进行相应的解封装,从而可以获取解封装后的目标视频的视频数据。此处,目标视频的视频数据将以视频数据包的形式来获取,每个视频数据包对应视频中的一个图像帧。当然,本实施例公开的是一种视频转码的方法,不仅仅适用于在视频画面中添加水印,还可以用于其他合理可行的处理。In the implementation, after the anchor starts live broadcasting in the live broadcast room, the data acquisition equipment on the anchor side can collect in real time the pictures and sounds used to generate the live video, and then the video production equipment will generate the corresponding live video, and the video transmission equipment will The live video is sent to the server of the live broadcast platform in real time. In this way, the server can receive the video data of the live video sent by the host side. Before the server forwards the live video to the viewers in the live room, the server may perform video transcoding on the live video to add a watermark to the video screen. Specifically, the server can first obtain information such as the encapsulation format, audio and video parameters, and codec parameters of the live video (that is, the target video), and then decapsulate the above target video according to the encapsulation format, so that the decapsulated target video can be obtained. The video data of the video. Here, the video data of the target video will be acquired in the form of video data packets, and each video data packet corresponds to an image frame in the video. Certainly, what is disclosed in this embodiment is a video transcoding method, which is not only suitable for adding watermarks to video images, but also can be used for other reasonable and feasible processes.
步骤102,周期性计算目标视频的全局平均码率和预设周期内的局部平均码率。Step 102, periodically calculate the global average bit rate of the target video and the local average bit rate within a preset period.
在实施中,服务器在获取目标视频的视频数据包时,可以周期性地计算目标视频的全局平均码率Rg和预设周期内的局部平均码率Rt。具体的,可以在每个周期末尾,统计已获取到的目标视频的所有数据量(可称为全局数据量),以及从解码开始到现在所经历的时长(可称为已解码时长),进而可以将全局数据量和已解码时长之商作为全局平均码率Rg。同时,还可以统计预设周期内已获取到的目标视频的所有数据量(可称为局部数据量),然后将局部数据量和预设周期时长之商作为预设周期内的局部平均码率Rt。In implementation, when the server obtains the video data packets of the target video, it may periodically calculate the global average bit rate Rg of the target video and the local average bit rate Rt within a preset period. Specifically, at the end of each cycle, it is possible to count all the data volumes of the acquired target video (may be called the global data volume), and the time elapsed from the beginning of decoding to the present (may be called the decoded time length), and then The quotient of the global data amount and the decoded duration can be taken as the global average code rate Rg. At the same time, it is also possible to count all the data volume of the target video that has been acquired within the preset period (which can be called the local data volume), and then use the quotient of the local data volume and the duration of the preset period as the local average bit rate within the preset period Rt.
可选的,在计算全局平均码率和局部平均码率时,可以同时考虑当前获取视频数据包,相应的,步骤102的处理可以如下:将视频数据包的数据量累积至已获取到的目标视频的全局数据量和预设周期内已获取到的目标视频的局部数据量中;根据视频数据包对应的解码时间戳,确定目标视频的已解码时长和预设周期时长;将全局数据量和已解码时长之商作为全局平均码率,并将局部数据量和预设周期时长之商作为局部平均码率。Optionally, when calculating the global average code rate and the local average code rate, the currently acquired video data packet can be considered at the same time. Correspondingly, the processing of step 102 can be as follows: accumulate the data volume of the video data packet to the acquired target The global data volume of the video and the local data volume of the target video acquired within the preset period; according to the decoding timestamp corresponding to the video data packet, determine the decoded duration of the target video and the preset period duration; combine the global data volume and The quotient of the decoded time length is used as the global average code rate, and the quotient of the local data volume and the preset cycle time is used as the local average code rate.
在实施中,服务器在获取目标视频的某一个视频数据包后,可以将该视频数据包的数据量累积至已获取到的目标视频的全局数据量和预设周期内已获取到的目标视频的局部数据量中。同时,服务器还可以获取该视频数据包对应的解码时间戳,然后基于该解码时间戳确定目标视频的已解码时长和预设周期时长,例如,该视频数据包对应的解码时间戳转换为本地时间为t1,上一视频数据包对应的解码时间戳转换成本地时间为t2,已知解码开始到现在经历时长为T1,预设周期时长为T2,t1-t2小于T2时,则不进行处理,等待下一次视频数据包的接收,当t1-t2大于T2时,就计算当前周期内的平均码率。之后,服务器可以将上述计算出的全局数据量和已解码时长之商作为全局平均码率Rg,并将局部数据量和预设周期时长之商作为局部平均码率Rt。本实施例中的预设周期时长,不一定是固定值,可以根据实际使用情况和需求而定。In implementation, after the server obtains a certain video data packet of the target video, the data amount of the video data packet can be accumulated to the global data amount of the obtained target video and the total data amount of the target video obtained within a preset period. in the local data volume. At the same time, the server can also obtain the decoding timestamp corresponding to the video data packet, and then determine the decoded duration and preset cycle duration of the target video based on the decoding timestamp, for example, convert the decoding timestamp corresponding to the video data packet to local time is t1, the decoding timestamp corresponding to the last video data packet is converted to the local time as t2, it is known that the time elapsed from the beginning of decoding to the present is T1, and the preset cycle time is T2. When t1-t2 is less than T2, no processing is performed. Waiting for the reception of the next video data packet, when t1-t2 is greater than T2, calculate the average code rate in the current cycle. Afterwards, the server may use the quotient of the calculated global data amount and the decoded duration as the global average code rate Rg, and use the quotient of the local data amount and the preset cycle time as the local average code rate Rt. The preset cycle duration in this embodiment is not necessarily a fixed value, and may be determined according to actual usage conditions and requirements.
步骤103,根据全局平均码率和局部平均码率,对编码码率进行调整。Step 103, adjusting the encoding bit rate according to the global average bit rate and the local average bit rate.
在实施中,服务器在计算出目标视频的全局平均码率Rg和预设周期内的局部平均码率Rt后,可以根据全局平均码率Rg和局部平均码率Rt,对当前使用的编码码率R进行调整。例如,可以将该局部平均码率Rt和当前使用的编码码率作比较,如果两者的绝对差值超过预设阈值,则可以将编码码率调整为上述全局平均码率Rg的值。如果两者的绝对差值未超过预设阈值,则保持当前的编码码率不变。当然,具体调整编码码率的方案多种多样,此处仅是示例性地给出了一种简单可行的方案。值得一提的是,对于ABR(available bit-rate,可用比特率)和VBR(Variable Bit Rate,动态比特率)两种不同的编码模式,设置的编码码率可以为VBR编码模式下的最大码率,或者为ABR编码模式下的平均码率。In implementation, after the server calculates the global average bit rate Rg of the target video and the local average bit rate Rt within the preset period, the currently used encoding bit rate can be calculated according to the global average bit rate Rg and the local average bit rate Rt. R to adjust. For example, the local average bit rate Rt can be compared with the currently used encoding bit rate, and if the absolute difference between the two exceeds a preset threshold, the encoding bit rate can be adjusted to the value of the above-mentioned global average bit rate Rg. If the absolute difference between the two does not exceed the preset threshold, the current encoding rate remains unchanged. Certainly, there are various schemes for adjusting the coding bit rate, and a simple and feasible scheme is only given here as an example. It is worth mentioning that, for the two different encoding modes of ABR (available bit-rate, available bit rate) and VBR (Variable Bit Rate, dynamic bit rate), the set encoding bit rate can be the maximum code in VBR encoding mode rate, or the average bit rate in ABR encoding mode.
可选的,为了避免VBR编码模式下,由于视频画面静止或场景简单而导致某段时间段内的码率过小,可以设置相应的码率参考值,相应的,步骤103的处理可以如下:如果局部平均码率与当前编码码率的绝对差值大于预设阈值,则判断局部平均码率是否大于预设的最小码率参考值;如果是,则将编码码率设置为局部平均码率,如果不是,则将全局平均码率和最小码率参考值中的最大值作为编码码率。Optionally, in order to avoid that in the VBR encoding mode, the code rate in a certain period of time is too small due to the stillness of the video picture or the simple scene, a corresponding code rate reference value can be set. Correspondingly, the processing of step 103 can be as follows: If the absolute difference between the local average bit rate and the current encoding bit rate is greater than the preset threshold, then judge whether the local average bit rate is greater than the preset minimum bit rate reference value; if so, set the encoding bit rate as the local average bit rate , if not, use the maximum value among the global average bit rate and the minimum bit rate reference value as the encoding bit rate.
其中,预设阈值可以是技术人员用于判断视频转码过程中,码率波动是否过大,是否需要更新编码码率,而预先设定的一个标准值。Wherein, the preset threshold may be a standard value preset by technicians for judging whether the bit rate fluctuates too much during the video transcoding process and whether the encoding bit rate needs to be updated.
在实施中,对于目标视频,服务器处可以预先设置有该视频的最小码率参考值,即在任何情况下,目标视频的编码码率均不小于该最小码率参考值。这样,服务器在计算出目标视频的全局平均码率Rg和预设周期内的局部平均码率Rt后,可以将局部平均码率Rt和当前编码码率进行比较,如果两者的绝对差值大于预设阈值,则可以判断局部平均码率Rt和预设的最小码率参考值两者的大小。如果局部平均码率Rt大于上述最小码率参考值,则可以直接将编码码率设置为该局部平均码率Rt;而如果局部平均码率Rt不大于上述最小码率参考值,则可以选取全局平均码率Rg和最小码率参考值两者中的最大值作为编码码率。当然,如果局部平均码率Rt和当前编码码率的绝对差值未超过预设阈值,则保持当前的编码码率不变。In implementation, for the target video, a minimum bit rate reference value of the video may be preset at the server, that is, in any case, the encoding bit rate of the target video is not less than the minimum bit rate reference value. In this way, after the server calculates the global average bit rate Rg of the target video and the local average bit rate Rt within the preset period, it can compare the local average bit rate Rt with the current encoding bit rate, if the absolute difference between the two is greater than If the threshold is preset, the local average bit rate Rt and the preset minimum bit rate reference value can be judged. If the local average code rate Rt is greater than the above minimum code rate reference value, you can directly set the encoding code rate as the local average code rate Rt; and if the local average code rate Rt is not greater than the above minimum code rate reference value, you can choose the global The maximum value of the average bit rate Rg and the minimum bit rate reference value is used as the encoding bit rate. Of course, if the absolute difference between the local average code rate Rt and the current code rate does not exceed the preset threshold, the current code rate remains unchanged.
可选的,由于平均值的特性,数据越多平均值越接近于真实值,在转码的开始阶段由于数据量太小而导致计算出的输入视频流的全局平均码率没有参考价值,为避免该情况,可以有如下处理:如果局部平均码率与当前编码码率的绝对差值大于预设阈值,且已解码时长大于预设时长,则判断局部平均码率是否大于预设的最小码率参考值;如果局部平均码率与当前编码码率的绝对差值大于预设阈值,且已解码时长小于预设时长,则将局部平均码率和预设的最大码率参考值中的最大值作为编码码率。Optionally, due to the characteristics of the average value, the more data there is, the closer the average value is to the real value. In the initial stage of transcoding, the calculated global average bit rate of the input video stream has no reference value due to the small amount of data. To avoid this situation, the following processing can be done: If the absolute difference between the local average code rate and the current encoding code rate is greater than the preset threshold, and the decoded time is longer than the preset time, then judge whether the local average code rate is greater than the preset minimum code rate reference value; if the absolute difference between the local average bit rate and the current encoding bit rate is greater than the preset threshold, and the decoded duration is less than the preset duration, the maximum of the local average bit rate and the preset maximum bit rate reference value will be The value is used as the encoding bit rate.
在实施中,与最小码率参考值类似,对于目标视频,服务器处也可以预先设置有该视频的最大码率参考值,即在任何情况下,目标视频的编码码率均不大于该最小码率参考值。这样,服务器在计算出目标视频的全局平均码率Rg和预设周期内的局部平均码率Rt后,可以将局部平均码率Rt和当前编码码率进行比较,如果两者的绝对差值大于预设阈值,且已解码时长大于预设时长,则可以进行局部平均码率Rt和预设的最小码率参考值两者的大小判断处理,以及根据判断结果调整编码码率的处理,具体可以参照步骤103。而如果局部平均码率Rt与当前编码码率的绝对差值大于预设阈值,但已解码时长小于预设时长,则可以将局部平均码率Rt和预设的最大码率参考值中的最大值作为编码码率。值得一提的是,为了避免转码后视频画面质量较差,可以在转码初始阶段,将编码码率值初始化为上述最大码率参考值。In implementation, similar to the minimum bit rate reference value, for the target video, the server can also preset the maximum bit rate reference value of the video, that is, in any case, the encoding bit rate of the target video is not greater than the minimum bit rate Rate reference value. In this way, after the server calculates the global average bit rate Rg of the target video and the local average bit rate Rt within the preset period, it can compare the local average bit rate Rt with the current encoding bit rate, if the absolute difference between the two is greater than If the threshold is preset, and the decoded duration is longer than the preset duration, the local average code rate Rt and the preset minimum code rate reference value can be judged, and the coded code rate can be adjusted according to the judgment result. Specifically, it can be Refer to step 103. And if the absolute difference between the local average bit rate Rt and the current encoding bit rate is greater than the preset threshold, but the decoded duration is less than the preset duration, then the maximum of the local average bit rate Rt and the preset maximum bit rate reference value can be The value is used as the encoding bit rate. It is worth mentioning that, in order to avoid poor video quality after transcoding, you can initialize the encoding bit rate value to the above-mentioned maximum bit rate reference value at the initial stage of transcoding.
可选的,最小码率参考值和最大码率参考值的计算标准多种多样,可以根据目标视频的属性信息来进行具体计算,相应的处理可以如下:获取目标视频的属性信息;确定目标视频的属性信息和预设的标准属性信息的数学关系;根据数学关系和标准属性信息对应的标准码率,确定目标视频的最小码率参考值和最大码率参考值。Optionally, the calculation standards for the minimum bit rate reference value and the maximum bit rate reference value are various, and can be specifically calculated according to the attribute information of the target video, and the corresponding processing can be as follows: obtain the attribute information of the target video; determine the target video The mathematical relationship between the attribute information and the preset standard attribute information; according to the mathematical relationship and the standard bit rate corresponding to the standard attribute information, determine the minimum bit rate reference value and the maximum bit rate reference value of the target video.
其中,属性信息中至少包括目标视频的目标分辨率和目标帧率。Wherein, the attribute information includes at least a target resolution and a target frame rate of the target video.
在实施中,服务器可以设定有视频的标准属性信息和标准码率的对应关系,该对应关系可以是根据历史数据或者经验统计得来的。这样,在计算目标视频的最小码率参考值和最大码率参考值时,可以先获取目标视频的属性信息,该属性信息中至少包括目标视频的目标分辨率和目标帧率,然后按照预设算法确定目标视频的属性信息和预设的标准属性信息的数学关系。此处预设算法可以多种多样,可以由技术人员根据数据的合理性进行选择,本实施例并不限定具体的算法。例如,目标分辨率为weight1*height1,目标帧率为fps1,标准属性信息中的标准分辨率为weight0*height0,标准帧率为fps0,数学关系则可以是:f(s)=(weight1*height1*fps1)/(weight0*height0*fps0),或者数学关系还可以是:g(s)=log(weight1*height1*fps1)/log(weight0*height0*fps0)。之后,可以根据上述数学关系和标准属性信息对应的标准码率,确定目标视频的最小码率参考值和最大码率参考值。具体的,当标准码率为R0时,则可以存在R1=R0*f(s),R2=R0*g(s),进而,最大码率参考值为Rmax=MAX(R1,R2);最小码率参考值为Rmin=MIN(R1,R2)。In an implementation, the server may set a corresponding relationship between standard attribute information of the video and a standard bit rate, and the corresponding relationship may be obtained based on historical data or empirical statistics. In this way, when calculating the minimum bit rate reference value and the maximum bit rate reference value of the target video, the attribute information of the target video can be obtained first, which at least includes the target resolution and target frame rate of the target video, and then according to the preset The algorithm determines the mathematical relationship between the attribute information of the target video and the preset standard attribute information. The preset algorithms here can be various, and can be selected by technicians according to the rationality of the data, and this embodiment does not limit the specific algorithms. For example, the target resolution is weight1*height1, the target frame rate is fps1, the standard resolution in the standard attribute information is weight0*height0, the standard frame rate is fps0, the mathematical relationship can be: f(s)=(weight1*height1 *fps1)/(weight0*height0*fps0), or the mathematical relationship can also be: g(s)=log(weight1*height1*fps1)/log(weight0*height0*fps0). Afterwards, the minimum bit rate reference value and the maximum bit rate reference value of the target video may be determined according to the above mathematical relationship and the standard bit rate corresponding to the standard attribute information. Specifically, when the standard code rate is R0, there may be R1=R0*f(s), R2=R0*g(s), and then the maximum code rate reference value is Rmax=MAX(R1, R2); the minimum The code rate reference value is Rmin=MIN(R1, R2).
上述调整编码码率的全部处理可以参考图2所示。For the entire process of adjusting the coding rate described above, reference may be made to FIG. 2 .
步骤104,基于调整后的编码码率,对目标视频进行转码处理。Step 104, based on the adjusted coding rate, perform transcoding processing on the target video.
在实施中,服务器在基于上述全局平均码率Rg和局部平均码率Rt,对编码码率进行调整之后,可以基于调整后的编码码率,对目标视频进行转码处理,即进行解码、滤镜处理(包括添加水印的处理)、重新编码和输出等步骤,直至下一次调整编码码率。In implementation, after the server adjusts the encoding bit rate based on the above-mentioned global average bit rate Rg and local average bit rate Rt, the target video can be transcoded based on the adjusted encoding bit rate, that is, decoding, filtering Steps such as mirror processing (including the processing of adding watermark), re-encoding and output, until the next time the encoding rate is adjusted.
为了便于理解,图3示出了视频转码的整体流程,具体内容可以如下:1、服务器读取目标视频;2、获取目标视频封装格式、视频参数以及编解码参数等信息;3、对目标视频解封装,分离其音视频数据;4.1、对于视频数据,调整编码码率,并将编码码率设置到编码器的参数中;4.2、解码目标视频的视频数据;4.3、对视频数据的图像帧进行滤镜处理;4.4、编码滤镜处理后的视频数据;5.1、对于音频数据,解码音频数据;5.2、对目标视频的音频数据进行滤镜处理;5.3、编码滤镜处理后的音频数据;6、按照输出文件类型封装目标视频;7、输出目标视频。For ease of understanding, Figure 3 shows the overall process of video transcoding, and the specific content can be as follows: 1. The server reads the target video; 2. Obtains information such as the target video package format, video parameters, and codec parameters; 3. Transcodes the target video Video decapsulation, separate its audio and video data; 4.1, for video data, adjust the encoding bit rate, and set the encoding bit rate to the parameters of the encoder; 4.2, decode the video data of the target video; 4.3, the image of the video data Frame filter processing; 4.4, encoding the video data processed by the filter; 5.1, for audio data, decoding the audio data; 5.2, performing filter processing on the audio data of the target video; 5.3, encoding the audio data processed by the filter ; 6. Encapsulate the target video according to the output file type; 7. Output the target video.
本发明实施例中,服务器获取解封装后的目标视频的视频数据包,周期性计算目标视频的全局平均码率和预设周期内的局部平均码率,根据全局平均码率和局部平均码率,对编码码率进行调整,基于调整后的编码码率,对目标视频进行转码处理。这样,在对目标视频进行转码的过程中,服务器可以对编码码率进行实时探测,并根据探测结果及时调整编码码率,可以最大限度地保证输出视频的码率与输入视频的码率基本一致,从而可以提高视频转码的效果。In the embodiment of the present invention, the server obtains the video data packet of the target video after decapsulation, periodically calculates the global average bit rate of the target video and the local average bit rate in the preset period, according to the global average bit rate and the local average bit rate , adjust the encoding bit rate, and perform transcoding processing on the target video based on the adjusted encoding bit rate. In this way, during the process of transcoding the target video, the server can detect the encoding bit rate in real time, and adjust the encoding bit rate in time according to the detection results, so as to ensure that the bit rate of the output video is basically the same as the bit rate of the input video. Consistent, so that the effect of video transcoding can be improved.
基于相同的技术构思,本发明实施例还提供了一种视频转码的装置,如图4所示,所述装置包括:Based on the same technical concept, the embodiment of the present invention also provides a video transcoding device, as shown in Figure 4, the device includes:
第一获取模块401,用于获取解封装后的目标视频的视频数据包;The first obtaining module 401 is used to obtain the video data packet of the target video after decapsulation;
计算模块402,用于周期性计算所述目标视频的全局平均码率和预设周期内的局部平均码率;Calculation module 402, for periodically calculating the global average code rate of the target video and the local average code rate within a preset period;
调整模块403,用于根据所述全局平均码率和所述局部平均码率,对编码码率进行调整;An adjustment module 403, configured to adjust the encoding bit rate according to the global average bit rate and the local average bit rate;
转码模块404,用于基于调整后的编码码率,对所述目标视频进行转码处理。The transcoding module 404 is configured to perform transcoding processing on the target video based on the adjusted coding rate.
可选的,所述计算模块402,具体用于:Optionally, the calculating module 402 is specifically used for:
将所述视频数据包的数据量累积至已获取到的所述目标视频的全局数据量和预设周期内已获取到的所述目标视频的局部数据量中;accumulating the data volume of the video data packet into the acquired global data volume of the target video and the local data volume of the target video acquired within a preset period;
根据所述视频数据包对应的解码时间戳,确定所述目标视频的已解码时长和预设周期时长;Determine the decoded duration and preset period duration of the target video according to the decoding timestamp corresponding to the video data packet;
将所述全局数据量和所述已解码时长之商作为全局平均码率,并将所述局部数据量和所述预设周期时长之商作为局部平均码率。The quotient of the global data amount and the decoded duration is taken as the global average code rate, and the quotient of the local data amount and the preset cycle duration is taken as the local average code rate.
可选的,所述调整模块403,具体用于:Optionally, the adjustment module 403 is specifically used for:
如果所述局部平均码率与当前编码码率的绝对差值大于预设阈值,则判断所述局部平均码率是否大于预设的最小码率参考值;If the absolute difference between the local average bit rate and the current encoding bit rate is greater than a preset threshold, then determine whether the local average bit rate is greater than a preset minimum bit rate reference value;
如果是,则将所述编码码率设置为所述局部平均码率,如果不是,则将所述全局平均码率和所述最小码率参考值中的最大值作为所述编码码率。If yes, set the encoding bit rate as the local average bit rate; if not, set the maximum value of the global average bit rate and the minimum bit rate reference value as the encoding bit rate.
可选的,所述调整模块403,具体用于:Optionally, the adjustment module 403 is specifically used for:
如果所述局部平均码率与当前编码码率的绝对差值大于预设阈值,且已解码时长大于预设时长,则判断所述局部平均码率是否大于预设的最小码率参考值。If the absolute difference between the local average bit rate and the current encoding bit rate is greater than a preset threshold, and the decoded duration is longer than a preset time length, it is judged whether the local average bit rate is greater than a preset minimum bit rate reference value.
可选的,所述调整模块,还用于:Optionally, the adjustment module is also used for:
如果所述局部平均码率与当前编码码率的绝对差值大于预设阈值,且已解码时长小于预设时长,则将所述局部平均码率和预设的最大码率参考值中的最大值作为所述编码码率。If the absolute difference between the local average code rate and the current encoding code rate is greater than the preset threshold, and the decoded duration is less than the preset duration, then the maximum of the local average code rate and the preset maximum code rate reference value value as the code rate.
可选的,如图5所示,所述装置还包括:Optionally, as shown in Figure 5, the device further includes:
第二获取模块405,用于获取所述目标视频的属性信息,所述属性信息中至少包括所述目标视频的目标分辨率和目标帧率;The second acquiring module 405 is configured to acquire attribute information of the target video, wherein the attribute information includes at least a target resolution and a target frame rate of the target video;
第一确定模块406,用于确定所述目标视频的属性信息和预设的标准属性信息的数学关系;The first determination module 406 is used to determine the mathematical relationship between the attribute information of the target video and the preset standard attribute information;
第二确定模块407,用于根据所述数学关系和所述标准属性信息对应的标准码率,确定所述目标视频的最小码率参考值和最大码率参考值。The second determining module 407 is configured to determine a minimum code rate reference value and a maximum code rate reference value of the target video according to the mathematical relationship and the standard code rate corresponding to the standard attribute information.
本发明实施例中,服务器获取解封装后的目标视频的视频数据包,周期性计算目标视频的全局平均码率和预设周期内的局部平均码率,根据全局平均码率和局部平均码率,对编码码率进行调整,基于调整后的编码码率,对目标视频进行转码处理。这样,在对目标视频进行转码的过程中,服务器可以对编码码率进行实时探测,并根据探测结果及时调整编码码率,可以最大限度地保证输出视频的码率与输入视频的码率基本一致,从而可以提高视频转码的效果。In the embodiment of the present invention, the server obtains the video data packet of the target video after decapsulation, periodically calculates the global average bit rate of the target video and the local average bit rate in the preset period, according to the global average bit rate and the local average bit rate , adjust the encoding bit rate, and perform transcoding processing on the target video based on the adjusted encoding bit rate. In this way, during the process of transcoding the target video, the server can detect the encoding bit rate in real time, and adjust the encoding bit rate in time according to the detection results, so as to ensure that the bit rate of the output video is basically the same as the bit rate of the input video. Consistent, so that the effect of video transcoding can be improved.
图6是本发明实施例提供的服务器的结构示意图。该服务器600可因配置或性能不同而产生比较大的差异,可以包括一个或一个以上中央处理器622(例如,一个或一个以上处理器)和存储器632,一个或一个以上存储应用程序642或数据644的存储介质630(例如一个或一个以上海量存储设备)。其中,存储器632和存储介质630可以是短暂存储或持久存储。存储在存储介质630的程序可以包括一个或一个以上模块(图示没标出),每个模块可以包括对服务器中的一系列指令操作。更进一步地,中央处理器622可以设置为与存储介质630通信,在服务器600上执行存储介质630中的一系列指令操作。Fig. 6 is a schematic structural diagram of a server provided by an embodiment of the present invention. The server 600 can have relatively large differences due to different configurations or performances, and can include one or more central processing units 622 (for example, one or more processors) and memory 632, and one or more storage applications 642 or data 644 storage medium 630 (for example, one or more mass storage devices). Wherein, the memory 632 and the storage medium 630 may be temporary storage or persistent storage. The program stored in the storage medium 630 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations for the server. Furthermore, the central processing unit 622 may be configured to communicate with the storage medium 630 , and execute a series of instruction operations in the storage medium 630 on the server 600 .
服务器600还可以包括一个或一个以上电源629,一个或一个以上有线或无线网络接口650,一个或一个以上输入输出接口658,一个或一个以上键盘656,和/或,一个或一个以上操作系统641,例如Windows Server TM,Mac OS XTM,Unix TM,Linux TM,FreeBSD TM等等。The server 600 may also include one or more power supplies 629, one or more wired or wireless network interfaces 650, one or more input and output interfaces 658, one or more keyboards 656, and/or, one or more operating systems 641 , such as Windows Server TM, Mac OS XTM, Unix TM, Linux TM, FreeBSD TM, etc.
服务器600可以包括有存储器,以及一个或者一个以上的程序,其中一个或者一个以上程序存储于存储器中,且经配置以由一个或者一个以上处理器执行所述一个或者一个以上程序包含用于进行上述视频转码的指令。The server 600 may include a memory, and one or more programs, wherein one or more programs are stored in the memory, and configured to be executed by one or more processors, including for performing the above-mentioned Instructions for video transcoding.
本领域普通技术人员可以理解实现上述实施例的全部或部分步骤可以通过硬件来完成,也可以通过程序来指令相关的硬件完成,所述的程序可以存储于一种计算机可读存储介质中,上述提到的存储介质可以是只读存储器,磁盘或光盘等。Those of ordinary skill in the art can understand that all or part of the steps for implementing the above embodiments can be completed by hardware, and can also be completed by instructing related hardware through a program. The program can be stored in a computer-readable storage medium. The above-mentioned The storage medium mentioned may be a read-only memory, a magnetic disk or an optical disk, and the like.
以上所述仅为本发明的较佳实施例,并不用以限制本发明,凡在本发明的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。The above descriptions are only preferred embodiments of the present invention, and are not intended to limit the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present invention shall be included in the protection of the present invention. within range.
Claims (15)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711038561.0A CN107659819B (en) | 2017-10-30 | 2017-10-30 | A kind of method and apparatus of video code conversion |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711038561.0A CN107659819B (en) | 2017-10-30 | 2017-10-30 | A kind of method and apparatus of video code conversion |
Publications (2)
Publication Number | Publication Date |
---|---|
CN107659819A CN107659819A (en) | 2018-02-02 |
CN107659819B true CN107659819B (en) | 2019-10-25 |
Family
ID=61096563
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201711038561.0A Active CN107659819B (en) | 2017-10-30 | 2017-10-30 | A kind of method and apparatus of video code conversion |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107659819B (en) |
Families Citing this family (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109379630B (en) * | 2018-11-27 | 2021-03-12 | Oppo广东移动通信有限公司 | Video processing method, device, electronic device and storage medium |
CN109862442B (en) * | 2019-02-22 | 2022-05-17 | 伟乐视讯科技股份有限公司 | Input stream processing method and processing device based on IP transmission |
CN109788316B (en) * | 2019-02-27 | 2020-08-14 | 腾讯科技(深圳)有限公司 | Code rate control method and device, video transcoding method and device, computer equipment and storage medium |
CN110913245A (en) * | 2019-11-08 | 2020-03-24 | 网宿科技股份有限公司 | A method and device for controlling video transcoding rate |
CN111193924B (en) | 2019-12-26 | 2022-01-25 | 腾讯科技(深圳)有限公司 | Method and device for determining video code rate, computer equipment and storage medium |
CN117478958B (en) * | 2023-09-19 | 2024-05-31 | 广州开得联软件技术有限公司 | Video playing method, device, electronic equipment and storage medium |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104159109A (en) * | 2014-05-28 | 2014-11-19 | 百视通网络电视技术发展有限责任公司 | Bit rate control method and system based on VBR video encoding |
CN105451099A (en) * | 2014-08-19 | 2016-03-30 | 北京大学 | Method and device for adjusting video code rate |
CN105847805A (en) * | 2016-03-30 | 2016-08-10 | 乐视控股(北京)有限公司 | Sliding window-based code rate control method and apparatus |
US9769231B1 (en) * | 2011-04-01 | 2017-09-19 | Arris Enterprises Llc | QoS for adaptable HTTP video |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6895050B2 (en) * | 2001-04-19 | 2005-05-17 | Jungwoo Lee | Apparatus and method for allocating bits temporaly between frames in a coding system |
JP4251650B2 (en) * | 2005-03-28 | 2009-04-08 | 株式会社カシオ日立モバイルコミュニケーションズ | Image processing apparatus and program |
US9113194B2 (en) * | 2007-12-19 | 2015-08-18 | Arris Technology, Inc. | Method and system for interleaving video and data for transmission over a network at a selected bit rate |
CN104717507A (en) * | 2015-03-31 | 2015-06-17 | 北京奇艺世纪科技有限公司 | Video transcoding method and device |
CN106331704B (en) * | 2015-07-07 | 2019-10-22 | 杭州海康威视数字技术股份有限公司 | A kind of video code rate control method and video coding apparatus |
-
2017
- 2017-10-30 CN CN201711038561.0A patent/CN107659819B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9769231B1 (en) * | 2011-04-01 | 2017-09-19 | Arris Enterprises Llc | QoS for adaptable HTTP video |
CN104159109A (en) * | 2014-05-28 | 2014-11-19 | 百视通网络电视技术发展有限责任公司 | Bit rate control method and system based on VBR video encoding |
CN105451099A (en) * | 2014-08-19 | 2016-03-30 | 北京大学 | Method and device for adjusting video code rate |
CN105847805A (en) * | 2016-03-30 | 2016-08-10 | 乐视控股(北京)有限公司 | Sliding window-based code rate control method and apparatus |
Also Published As
Publication number | Publication date |
---|---|
CN107659819A (en) | 2018-02-02 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107659819B (en) | A kind of method and apparatus of video code conversion | |
CN108965883B (en) | System and method for encoding video content using virtual intra frames | |
CN102959976B (en) | The method and apparatus of assessment video flow quality | |
CN112073737B (en) | Re-encoding predicted image frames in live video streaming applications | |
CN113766317A (en) | Video transmission method, video transmission device, electronic equipment and storage medium | |
AU2008202703B2 (en) | Apparatus and method for providing multimedia content | |
KR101942270B1 (en) | Media playback apparatus and method including delay prevention system | |
US10609440B1 (en) | Timing data anomaly detection and correction | |
KR20180010392A (en) | Method and apparatus for streaming media data using java script | |
CN110505522A (en) | Processing method, device and the electronic equipment of video data | |
CN110662100A (en) | Information processing method, device and system and computer readable storage medium | |
CN107801049B (en) | Real-time video transmission and playing method and device | |
CN115398481A (en) | Device and method for performing artificial intelligence encoding and artificial intelligence decoding on images | |
CN106817588A (en) | Transcoding control method and device, net cast method and system | |
TW202143740A (en) | Adaptive video streaming systems and methods | |
RU2651241C2 (en) | Transmission device, transmission method, reception device and reception method | |
US20130007206A1 (en) | Transmission apparatus, control method for transmission apparatus, and storage medium | |
US20040105030A1 (en) | Information processing system, information processing apparatus, information processing method, program storage medium, and program | |
US11917327B2 (en) | Dynamic resolution switching in live streams based on video quality assessment | |
JP2004193990A (en) | Information processing system, information processor, information processing method, recording medium and program | |
CN108184053B (en) | Embedded image processing method and device | |
US11334979B2 (en) | System and method to detect macroblocking in images | |
JP2020022106A (en) | Information processing apparatus, information processing method, and program | |
US10270832B1 (en) | Method and system for modifying a media stream having a variable data rate | |
US20220200909A1 (en) | Managing data flow between source node and recipient node |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |