Qiniu cloud audio and video new features: audio support AAC_HE

Like MP3 as everyone knows, AAC is also a common audio format. There are three common AAC specifications today: LC-AAC (the most basic), HE-AAC (AACPlus v1), and HE-AAC v2.

HE : "High Efficiency". HE-AAC (also known as AACPlus v1, SBR) implements AAC (LC) and SBR (Band Replication) technology by means of a container. SBR cuts the frequency spectrum, the low frequency is separately encoded to save the main components, the high frequency is separately amplified and encoded to save the sound quality, and the sound quality is also saved in the case of reducing the file size.

HEv2: Contains HE-AAC and PS (parametric stereo) techniques using a container approach. PS technology stores all the information of one channel, and then spends few bytes to describe the other channel and its difference with parameters.

In the case of low bit rate, the sound quality of HE-AAC and HE-AAC v2 encoding is significantly better than LC-AAC.

HE-AAC is widely used in TV broadcasting system, smart TV. Now many mainstream streaming media platforms have begun to support HE-AAC, such as Apple HLS and Microsoft Smooth Streaming. In the process of operating Qiniu Cloud, we found that many customers of audio live broadcast and on-demand need to store high-fidelity sound quality, and at the same time reduce the data size to a reasonable range. In order to meet the needs of such customers and help them output high-quality sound, Qiniuyun has added audio support for HE-AAC based on the original audio and video processing.

By calling the Qiniuyun avthumb interface and setting the /audioProfile parameter to enable the AAC_HE compression algorithm, MP3 or AAC audio files can be converted into audio files with a higher compression ratio.

Now, you can test it as follows:

Upload original audio

Open  https://portal.qiniu.com/signin , log in to the Qiniu account;
create a space, and upload resources:
1. Add object storage resources

2. Create a public space and pay attention to the space access domain name

3. Enter the content management page to manage files

4. Select upload file to upload the original audio file

Return to the content management page, confirm that the resource is uploaded successfully, and the resource external link can be successfully obtained and accessed successfully:
search for the file name prefix, find the specific file name, and obtain the audio external link address

Transcode AAC_HE

Transcoding the original audio requires triggering the audio and video service interface of Qiniu. The SDK of each server language of Qiniu directly encapsulates the transcoding interface. Refer to the corresponding [SDK documentation] to trigger the corresponding transcoding. operate;

Here's how to use Qiniu's [qrsctl command line tool] and [Qiniuslab graphical interface tool] to directly transcode AAC_HE, so that before the official access to Qiniu's various language SDKs, it can also be converted without development workload. code test.

The qrsctl tool performs transcoding

Find the key pair information of the account in the user management interface
1. Enter account management

2. Get the key pair (AccessKey/SecretKey)

Check the corresponding version of the local system  , download the qrsctl tool compression package of the corresponding system version from http://developer.qiniu.com/docs/v6/tools/qrsctl.html#download  , and decompress it locally;
open the command line, switch Go to the decompression directory of the tool and perform transcoding.
Use the account key pair to perform the login operation:

Generate the expected processing resource and save it as a result parameter for the saveas operation in the transcoding parameter:

Get the result string YWFjLWhlLXRlc3Q6SnVwaXRlci5hYWNfaGUuYWFj of command line processing. (among them, aac-he-test is the audio target space name of the transcoding result, and Jupiter.aac_he.aac is the target file name of the transcoding result.

Execute the transcoding operation command:

其中 aac-he-test 为原始音频所在空间名,Jupiter.mp3 为原始音频完整文件名( key );avthumb/aac/acodec/libfdk_aac/audioProfile/aac_he|saveas/YWNjLWhlLXRlc3Q6SnVwaXRlci5hYWNfaGUuYWFj 为将原始音频转换为 AAC_HE 编码的必选转码参数;saveas/YWFjLWhlLXRlc3Q6SnVwaXRlci5hYWNfaGUuYWFj 为处理结果文件另存为的空间名和文件名参数(EncodedEntry) 。

执行转码操作命令后,得到一个形如 https://api.qiniu.com/status/get/prefop?id=z0.56ca10937823de318868f33b 的 URL ,在浏览器中打开这个链接,打开链接获取一个 json 串,当 json 串中 code 字段为 0 时,获取 key 字段的值,即为处理结果的文件名:

再次进入空间的内容管理界面,搜索处理结果的文件名,即可获取处理结果的外链地址,在播放器中直接播放:

QiniuLab 工具执行转码

QiniuLab 做为 Windows 下的图形化测试工具,可以给不熟悉命令行操作的 Windows 用户提供另一种界面友好的选择。

下载 http://qdisk.qiniudn.com/QiniuLab_alpha.zip 并解压;
打开 QiniuLab ,进行密钥对设置,密钥对获取方式可参考 qrsctl 工具:

生成预期处理资源另存为结果参数,用于转码参数中的 saveas 操作:

选择工具选项卡中的 Url 安全的 Base64 选项,输入aac-he-test Jupiter.aac_he.aac,获取字符串YWFjLWhlLXRlc3Q6SnVwaXRlci5hYWNfaGUuYWFj。(其中,aac-he-test 为转码结果音频目标空间名,Jupiter.aac_he.aac 为转码结果目标文件名。

选择持久化选项卡,进行转码:
填写转码参数,其中 Bucket 填写原始音频所在空间(例子中是 aac-he-test ),key 为原始音频完整文件名(例子中为 Jupiter.mp3 ),Fops 为将原始音频转换为 AAC_HE 编码的必选转码参数(其中saveas/YWFjLWhlLXRlc3Q6SnVwaXRlci5hYWNfaGUuYWFj 为处理结果文件另存为的空间名和文件名参数)。

查询转码处理结果:

当 code 字段为 0 时,key 字段的值即为处理结果的文件名;

再次进入空间的内容管理界面,搜索处理结果的文件名,即可获取处理结果的外链地址,在播放器中直接播放:

AAC_HE 转码效果实测报告

我们挑选了一首音域较广、声音元素较为复杂的曲子《行星组曲之木星》,通过测试后发现:

以 MP3 为基准, AAC 相对于 MP3 减小了 21.91% 的大小,而 AAC_HE 相对于 MP3 减小了近 50%,而实际声音效果几乎完全一致。

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325448582&siteId=291194637