通過(guò)B站杜比全景聲上傳5.1聲道環(huán)繞聲(將5.1聲道環(huán)繞聲轉(zhuǎn)換為杜比全景聲)
聲明:如此得到的并非真正的杜比全景聲,只是應(yīng)對(duì)B站二壓的一種妥協(xié)策略,本人認(rèn)為經(jīng)過(guò)此種簡(jiǎn)單處理所得音頻并不能稱為杜比全景聲,也不建議讀者發(fā)布視頻時(shí)強(qiáng)行將雙聲道音頻升混至更多聲道來(lái)點(diǎn)亮所謂“杜比全景聲”的標(biāo)識(shí)。另?yè)?jù)UP主?@傘都被賣了?的有關(guān)研究,22.2ch視頻在轉(zhuǎn)換為杜比全景聲后播放效果優(yōu)于直接降混為雙聲道。故而環(huán)繞聲轉(zhuǎn)全景聲或許具備一定實(shí)用價(jià)值,能讓觀眾得到更好體驗(yàn)。

# 項(xiàng)目初衷
環(huán)繞聲很早就應(yīng)用于市場(chǎng),像`Dobly`和`DTS`這樣的5.1聲道環(huán)繞聲在20余年前的DVD中都相當(dāng)常見(jiàn)。然而由于互聯(lián)網(wǎng)視頻傳輸長(zhǎng)期以來(lái)的雙聲道限制以及環(huán)繞聲終端設(shè)備的普及率低下,環(huán)繞聲一直沒(méi)能在國(guó)內(nèi)視頻網(wǎng)站受到很好的支持。現(xiàn)如今B站引入杜比全景聲,給了我們一種通過(guò)杜比全景聲塞下環(huán)繞聲的手段,也能讓我們借由此項(xiàng)技術(shù)讓環(huán)繞聲在不同配置的音響系統(tǒng)下以最合適的方式播放,營(yíng)造出環(huán)繞的氛圍。
當(dāng)然,環(huán)繞聲推出比全景聲晚很多,這種轉(zhuǎn)換顯然是浪費(fèi)了全景聲其他更多的性質(zhì)(比如其單獨(dú)的聲音對(duì)象),所以說(shuō)這樣的轉(zhuǎn)換也只能說(shuō)是UP主們?yōu)榱擞^眾能更好的享受視頻做出的一種妥協(xié),類似于強(qiáng)行擴(kuò)大視頻分辨率避免B站二壓。
# 環(huán)繞聲的規(guī)格
為了讓各位能有一個(gè)對(duì)環(huán)繞聲的初步印象,我們以最常見(jiàn)的5.1環(huán)繞聲舉例,看看它包含了哪些成分。
## 組成
> The first digit in "5.1" is the number of full range channels. The ".1" reflects the limited frequency range of the LFE channel.
5.1環(huán)繞聲音頻由5+1個(gè)獨(dú)立的通道組成。其中五個(gè)分別是左前、右前、中間、左環(huán)繞和右環(huán)繞,另外多出來(lái)的一個(gè)是低音通道。
> All 5.1 systems use the same speaker channels and configuration, having a Front Left (**FL**) and Front Right (**FR**), a [Center Channel](https://en.wikipedia.org/wiki/Center_channel "Center channel") (**CNT**), two [surround channels](https://en.wikipedia.org/wiki/Surround_channels "Surround channels") (Surround Left - **SL** and Surround Right - **SR**) and the [low-frequency effects](https://en.wikipedia.org/wiki/Low-frequency_effects "Low-frequency effects") (**SW**) channel designed for a [subwoofer](https://en.wikipedia.org/wiki/Subwoofer "Subwoofer").[[4]](https://en.wikipedia.org/wiki/5.1_surround_sound#cite_note-4)[[5]](https://en.wikipedia.org/wiki/5.1_surround_sound#cite_note-:0-5)
## 空間位置
> ![[Pasted image 20230819164644.png]]
> Most common [loudspeaker](https://en.wikipedia.org/wiki/Loudspeaker "Loudspeaker") configuration for 5.1; used by [Dolby Digital](https://en.wikipedia.org/wiki/Dolby_Digital "Dolby Digital"), [SDDS](https://en.wikipedia.org/wiki/Sony_dynamic_digital_sound "Sony dynamic digital sound"), [DTS](https://en.wikipedia.org/wiki/DTS_(sound_system) "DTS (sound system)"), [THX](https://en.wikipedia.org/wiki/THX "THX"), and [Dolby Pro Logic II](https://en.wikipedia.org/wiki/Dolby_Pro_Logic#Dolby_Pro_Logic_II "Dolby Pro Logic"). The white square in the center of the diagram depicts the low-frequency speaker. Each black square depicts a loudspeaker. The center speaker in the top line of the diagram is used for dialogue. The left and right speakers on either side of the center speaker are used to create stereo sound for music and other sound effects in the film. The left and right surround speakers in the bottom line create the surround sound effect.
上圖是5.1聲道環(huán)繞聲音頻各個(gè)聲道對(duì)應(yīng)揚(yáng)聲器位置的示意圖。五個(gè)黑色填充的方框很好理解,就是前面所說(shuō)的五個(gè)聲道對(duì)應(yīng)的揚(yáng)聲器的位置,播放時(shí)每個(gè)聲道的音頻在對(duì)應(yīng)的揚(yáng)聲器播放;中間的無(wú)填充黑框表示低音音響。
在設(shè)計(jì)之初,低音通道用來(lái)單獨(dú)存放電影中的低音特效,方便影院根據(jù)實(shí)際情況調(diào)節(jié)低音的音量大小,而并沒(méi)有規(guī)定這些音效應(yīng)該在空間中處于什么位置。事實(shí)上,由于現(xiàn)在大部分音響都能夠播放這種程度的低音,一個(gè)專門的低音炮是否有必要也存在爭(zhēng)議,因?yàn)槲覀兺耆梢栽谄渌?個(gè)音響中播放這個(gè)低音音頻??傊梢源譁\的認(rèn)為,在5.1全景聲中,只要求低音通道的聲音存在并且播放出來(lái),而并不要求這個(gè)通道的聲音從某個(gè)特定的方向傳來(lái)。
> ![[Pasted image 20230819170240.png]]
> 一種針對(duì)5.1環(huán)繞聲的音響擺放方式
## 文件格式
我們以一段包含杜比5.1環(huán)繞聲的DVD中的視頻為例,用`MediaInfo`查看一下其中的音頻信息
```
音頻 #1
ID? ? ? ? ? ? ? ? ? ? ? ? ? ? ?: 189 (0xBD)-128 (0x80)
格式? ? ? ? ? ? ? ? ? ? ? ? ? ? ?: AC-3
格式/信息? ? ? ? ? ? ? ? ? ? ? ? ? : Audio Coding 3
傳播名? ? ? ? ? ? ? ? ? ? ? ? ? ? : Dolby Digital
混流模式? ? ? ? ? ? ? ? ? ? ? ? ? ?: DVD-Video
時(shí)長(zhǎng)? ? ? ? ? ? ? ? ? ? ? ? ? ? ?: 52 秒 800 毫秒
碼率模式? ? ? ? ? ? ? ? ? ? ? ? ? ?: 恒定碼率 (CBR)
碼率? ? ? ? ? ? ? ? ? ? ? ? ? ? ?: 448 kb/s
聲道數(shù)? ? ? ? ? ? ? ? ? ? ? ? ? ? : 6 聲道
聲道布局? ? ? ? ? ? ? ? ? ? ? ? ? ?: L R C LFE Ls Rs
采樣率? ? ? ? ? ? ? ? ? ? ? ? ? ? : 48.0 kHz
幀率? ? ? ? ? ? ? ? ? ? ? ? ? ? ?: 31.250 FPS (1536 SPF)
壓縮模式? ? ? ? ? ? ? ? ? ? ? ? ? ?: 有損
流大小? ? ? ? ? ? ? ? ? ? ? ? ? ? : 2.82 MiB (0%)
服務(wù)類別? ? ? ? ? ? ? ? ? ? ? ? ? ?: Complete Main
```
可以看到,音頻文件格式為AC3,包含六個(gè)聲道
1. L 左
2. R 右
3. C 中間
4. LFE 低音
5. Ls 左環(huán)繞
6. Rs 右環(huán)繞
它們的英文標(biāo)識(shí)名稱與前文提到的有所不同,但意思一致。
## 環(huán)繞聲音頻的播放
如果我們采用`PotPlayer`來(lái)播放這段含有環(huán)繞聲音頻的視頻,打開(kāi)選項(xiàng)觀察音頻輸出,我們發(fā)現(xiàn)源文件的5.1聲道在輸出時(shí)已經(jīng)變?yōu)榱?聲道。
這個(gè)過(guò)程被稱為**降混**(downmix),也就是把聲道數(shù)多的音頻向聲道數(shù)少的音頻轉(zhuǎn)換。當(dāng)多聲道音頻在數(shù)量不足的音響上播放時(shí),特別的,當(dāng)環(huán)繞聲音頻在立體聲音響上播放時(shí),這種轉(zhuǎn)換不可避免。
>>The mixdown process converts a program with a multiple-channel configuration into a program with fewer channels. Common examples include downmixing from [5.1 surround sound](https://en.wikipedia.org/wiki/5.1_surround_sound "5.1 surround sound") to stereo, and stereo to mono. Because these are common scenarios, it is common practice to verify the sound of such downmixes during the production process to ensure stereo and mono compatibility.
>
>摘自[Audio mixing (recorded music) - Wikipedia](https://en.wikipedia.org/wiki/Audio_mixing_(recorded_music)#Downmixing)
然而,如果這種轉(zhuǎn)換得當(dāng),我們?nèi)匀荒軌蛟诹Ⅲw聲音響或者耳機(jī)下感受到環(huán)繞聲帶來(lái)的寬廣的聲音效果。特別的,通過(guò)`Dolby Access`等軟件提供的虛擬環(huán)繞聲(virtual surround sound)技術(shù),聽(tīng)眾得以在有限的揚(yáng)聲器數(shù)量下體驗(yàn)到環(huán)繞聲效果。
> **Lo/Ro - default**:? Downmixes from 5.1 to Stereo using the coefficients:
>>Lo = L + (–3 dB × C) + (–3 dB × Ls)
>>Ro = R + (–3 dB × C) + (–3 dB × Rs)
>
>杜比5.1的降混參數(shù)
>摘自[How do the 5.1 and Stereo downmix settings work? (dolby.com)](https://professionalsupport.dolby.com/s/article/How-do-the-5-1-and-Stereo-downmix-settings-work?language=en_US)
## 環(huán)繞聲音頻的拆分
如果你想把5.1聲道音頻的六個(gè)音軌全部拆分出來(lái)以得到6個(gè)單聲道的音頻文件,這里有[一篇俄語(yǔ)文章](https://rutracker.net/forum/viewtopic.php?p=31326521#31326521)詳細(xì)講述了你可能需要用到的工具。
> 對(duì)于杜比AC3格式,文章推薦使用BeHappy
# 杜比全景聲規(guī)格
## 組成
> Dolby Atmos is an immersive, object-based sound format that allows you to place your music in three-dimensional space. With a much wider palette than stereo, you can now place and move sounds in three dimensions to fully capture the artist’s vision. Dolby Atmos can be easily added to your existing workflow and is supported by major music streaming services including Apple Music, Amazon Music and Tidal.
杜比全景聲包含的內(nèi)容比環(huán)繞聲多的多,這里我們不妨粗淺的把它理解成**環(huán)繞聲**+**對(duì)象**,并從制作流程的原料和成品探討。
### 原料
想要制作杜比全景聲音頻,首先要準(zhǔn)備兩方面的材料:
+ 音床(bed):杜比全景聲中的環(huán)繞聲部分,邏輯上表示為在空間中固定位置的揚(yáng)聲器。
+ 對(duì)象(objects):杜比全景聲中的獨(dú)立發(fā)聲體,邏輯上表示為在空間中自由放置的聲源。
通過(guò)在DAW中分配不同音頻,使它們成為音床的一部分或者對(duì)象的一部分。
### 成品
通過(guò)原料,我們渲染得到包含所有音頻及其位置信息的`ADM BWF`文件,然后通過(guò)特定格式(`Dolby Digital Plus JOC`)編碼得到可供B站上傳的音頻文件。
> Dolby Digital Plus JOC (Joint Object Coding) refers to the underlying technology used to deliver Dolby Atmos via the Dolby Digital Plus format. In product UI and documentation it is commonly referred to as Dolby Digital Plus with Dolby Atmos.
>?
>> Joint Object Coding is a coding technique that allows up to 15 full range channels or objects, plus LFE channel, to be carried within a Dolby Digital Plus bitstream in a backward-compatible manner.
>
>> A Dolby Digital Plus JOC decoder uses the Joint Object Coding data to decode the channels or objects to up to 15.1 channels of PCM. The decoder also output object audio metadata (OAMD) which instructs the Dolby Atmos renderer how to position each of these objects and/or channels based on the configured playback environment.?
>
>> Existing Dolby Digital Plus decoders ignore the JOC data and decode the Dolby Digital Plus bitstream which consists of a multichannel render of the Dolby Atmos audio.
>
>摘自[What is Dolby Digital Plus JOC? (Joint Object Coding)](https://professionalsupport.dolby.com/s/article/What-is-Dolby-Digital-Plus-JOC-Joint-Object-Coding?language=en_US)
杜比全景聲最多能夠包含118個(gè)對(duì)象,這顯然遠(yuǎn)遠(yuǎn)超出用于監(jiān)聽(tīng)的揚(yáng)聲器數(shù)量,更不用說(shuō)這些對(duì)象還能夠在空間中自由移動(dòng)。顯然,這些對(duì)象發(fā)出的聲音必須通過(guò)支持杜比全景聲的渲染器降混到現(xiàn)有的環(huán)繞聲音響或者耳機(jī)上。
由于渲染后的音頻包括了所有音頻軌道和它們的空間位置,支持杜比全景聲的設(shè)備在播放時(shí)能夠自動(dòng)根據(jù)設(shè)備自身情況決定如何降混原音頻,這樣便可得到跨設(shè)備的全景聲體驗(yàn)。
# 轉(zhuǎn)換流程
## 思路
我們的目的是將環(huán)繞聲轉(zhuǎn)換為全景聲,因而只需要用到杜比全景聲的音床部分,具體步驟如下:
0. 提取杜比環(huán)繞聲音頻
1. 通過(guò)DAW將環(huán)繞聲軌道映射到杜比全景聲音床
2. 渲染得到ADM BWF文件
3. 編碼得到DD+ JOC文件
4. 將音頻與視頻封裝為MP4
5. 上傳B站
## 處理工具
0. PgcDemux:用于DVD音視頻的提取
1. Davinci Resolve Studio 17+(以18.5為例):用于軌道映射以及ADM文件渲染
2. Dolby Media Encoder:用于編碼DD+ JOC文件
3. mp4demuxer:用于視頻拆解
4. mp4muxer:用于音視頻封裝
5. ffmpeg:用于對(duì)DVD視頻轉(zhuǎn)碼
# 具體步驟
略