View Full Version : [Updated 2019] Opus 1.3. New WebM audio codec (Opus+VP9/AV1)
qyot27
8th November 2019, 00:51
Ah, here it is in opusenc's manpage:
--serial n
Force use of a specific stream serial number, rather than one that is randomly generated. This is used to make the encoder deterministic for testing and is not generally recommended.
You could try forcing the serial number and see if that results in what you're wanting.
redbtn
8th November 2019, 01:04
Ah, here it is in opusenc's manpage:
--serial n
Force use of a specific stream serial number, rather than one that is randomly generated. This is used to make the encoder deterministic for testing and is not generally recommended.
You could try forcing the serial number and see if that results in what you're wanting.I don't know what number I should use. It seems to me like it just stream "ID", isn't it?
qyot27
8th November 2019, 01:08
If you look at opusinfo's output, serial numbers appear to be CRC32-style hashes:
E:\Documents>opusinfo test.opus | grep serial
New logical stream (#1, serial: dc7ac5e3): type opus
Boulder
23rd February 2021, 19:37
What is the proper way to re-encode a 3/1-channel track with Opus? At least Mediainfo thinks Opus maps two channels to the rear while the proper order is L R C Cb.
tebasuna51
23rd February 2021, 20:47
Seems opus only support these channels mapping:
5.1.1.2. Channel Mapping Family 1
Allowed numbers of channels: 1...8. Vorbis channel order.
Each channel is assigned to a speaker location in a conventional
surround arrangement. Specific locations depend on the number of
channels, and are given below in order of the corresponding channel
indices.
o 1 channel: monophonic (mono).
o 2 channels: stereo (left, right).
o 3 channels: linear surround (left, center, right).
o 4 channels: quadraphonic (front left, front right, rear left,
rear right).
o 5 channels: 5.0 surround (front left, front center, front right,
rear left, rear right).
o 6 channels: 5.1 surround (front left, front center, front right,
rear left, rear right, LFE).
o 7 channels: 6.1 surround (front left, front center, front right,
side left, side right, rear center, LFE).
o 8 channels: 7.1 surround (front left, front center, front right,
side left, side right, rear left, rear right, LFE).
filler56789
24th February 2021, 01:22
What is the proper way to re-encode a 3/1-channel track with Opus? At least Mediainfo thinks Opus maps two channels to the rear while the proper order is L R C Cb.
Vorbis, Opus, AAC, FLAC, are good only as replacements for the old Layer 3,
if you want PROPER multichannel encoding just go with AC3, DTS, MLP /TrueHD and DTS-HD.
Richard1485
24th February 2021, 02:55
Another option is to double the back channel and encode as 5.0.
Boulder
24th February 2021, 06:06
Another option is to double the back channel and encode as 5.0.
Yes, that's what I thought I'd have to do if Opus couldn't work with the original order. I recall that the eac3to thread had at least one case like this, just have to dig the magic Avisynth script from there :)
tebasuna51
24th February 2021, 11:57
You can use:
ffmpeg -i input310 -af "pan=5.0|FL=FL|FR=FR|FC=FC|BL=0.707BC|BR=0.707BC" -ab 192k output50.opus
But warning, MediaInfo v20.09 have a bug and inform output50.opus like:
Channel layout : L R Lb Rb LFE
a inexistent opus channel layout
But after decoded output50.opus by ffmpeg or opusdec have the correct channel mapping:
Channel layout : L R C Lb Rb
Boulder
24th February 2021, 13:19
You can use:
ffmpeg -i input310 -af "pan=5.0|FL=FL|FR=FR|FC=FC|BL=0.707BC|BR=0.707BC" -ab 192k output50.opus
But warning, MediaInfo v20.09 have a bug and inform output50.opus like:
Channel layout : L R Lb Rb LFE
a inexistent opus channel layout
But after decoded output50.opus by ffmpeg or opusdec have the correct channel mapping:
Channel layout : L R C Lb Rb
Cheers, I was already wondering the channel layout and figured that I may have to add an empty LFE track there but it seems to be working then :)
Richard1485
24th February 2021, 16:15
Tebasuna has already provided an easy solution with ffmpeg, but if anyone wants to go from 4.0 to 5.0 with AviSynth:
#double back channel
fl=WavSource("l.wav")
fr=WavSource("r.wav")
c=WavSource("c.wav")
bc=WavSource("bc.wav").Amplify(0.707)# preserve global volume
MergeChannels(fl,fr,c,bc,bc)
Boulder
25th February 2021, 10:34
I think you also need to use Amplify(0.707) on those new rear channels.
tebasuna51
25th February 2021, 11:19
In order to obtain a correct channel mapping from AviSynth I recommend use BeHappy with this .avs:
a=LWLibavAudioSource("INPUT310")
fronts = GetChannel(a, 1, 2, 3)
back = GetChannel(a, 4).Amplify(0.707)
Mergechannels(fronts, back, back)
And check the ChMask option with a value of 55.
Now the AviSynth output is a WAVE_FORMAT_EXTENSIBLE with the correct channelmask and must be encoded correctly by any encoder compatible (ffmpeg,qaac,opus,flac,...)
[EDIT] If you don't want install BeHappy you can try this command line:
wavi INPUT310.avs - /M 55 | opusenc --ignorelength --bitrate 192 - output50.opus
I attach the last Chikuzen wavi encode (https://forum.doom9.org/showthread.php?p=1527102#post1527102)
There are also rewavi (https://forum.doom9.org/showthread.php?p=1829561#post1829561) with similar sintax:
rewavi INPUT310.avs - -x 55 | opusenc --ignorelength --bitrate 192 - output50.opus
Out of BeHappy the default AviSynth output is 16 bits, if you want more precission you can add to .avs the line:
global OPT_AllowFloatAudio=True
And also Avs2pipemod (http://avisynth.nl/index.php/Avs2pipemod)
Avs2pipemod INPUT310.avs -extwav=float | opusenc --ignorelength --bitrate 192 - output50.opus
It can work here because the default channel mask for 5 channels is 55 but Avs2pipemod can't supply the desired channel mask like wavi/rewavi
For big files maybe the wavi-AviSynth 32 bits can crash.
Richard1485
25th February 2021, 14:01
I think you also need to use Amplify(0.707) on those new rear channels.
Oh, yes! Good point.:D
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.