Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > General > Audio encoding

Reply
 
Thread Tools Search this Thread Display Modes
Old 8th November 2019, 00:51   #201  |  Link
qyot27
...?
 
qyot27's Avatar
 
Join Date: Nov 2005
Location: Florida
Posts: 1,419
Ah, here it is in opusenc's manpage:
Code:
--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.
qyot27 is offline   Reply With Quote
Old 8th November 2019, 01:04   #202  |  Link
redbtn
Registered User
 
redbtn's Avatar
 
Join Date: Jan 2019
Location: Russia
Posts: 105
Quote:
Originally Posted by qyot27 View Post
Ah, here it is in opusenc's manpage:

Code:
--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?
redbtn is offline   Reply With Quote
Old 8th November 2019, 01:08   #203  |  Link
qyot27
...?
 
qyot27's Avatar
 
Join Date: Nov 2005
Location: Florida
Posts: 1,419
If you look at opusinfo's output, serial numbers appear to be CRC32-style hashes:
Code:
E:\Documents>opusinfo test.opus | grep serial
New logical stream (#1, serial: dc7ac5e3): type opus
qyot27 is offline   Reply With Quote
Old 23rd February 2021, 19:37   #204  |  Link
Boulder
Pig on the wing
 
Boulder's Avatar
 
Join Date: Mar 2002
Location: Finland
Posts: 5,718
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.
__________________
And if the band you're in starts playing different tunes
I'll see you on the dark side of the Moon...
Boulder is offline   Reply With Quote
Old 23rd February 2021, 20:47   #205  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 6,890
Seems opus only support these channels mapping:

Quote:
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).
__________________
BeHappy, AviSynth audio transcoder.
tebasuna51 is offline   Reply With Quote
Old 24th February 2021, 01:22   #206  |  Link
filler56789
SuperVirus
 
filler56789's Avatar
 
Join Date: Jun 2012
Location: Antarctic Japan
Posts: 1,351
Quote:
Originally Posted by Boulder View Post
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.
filler56789 is offline   Reply With Quote
Old 24th February 2021, 02:55   #207  |  Link
Richard1485
Guest
 
Posts: n/a
Another option is to double the back channel and encode as 5.0.
  Reply With Quote
Old 24th February 2021, 06:06   #208  |  Link
Boulder
Pig on the wing
 
Boulder's Avatar
 
Join Date: Mar 2002
Location: Finland
Posts: 5,718
Quote:
Originally Posted by Richard1485 View Post
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
__________________
And if the band you're in starts playing different tunes
I'll see you on the dark side of the Moon...
Boulder is offline   Reply With Quote
Old 24th February 2021, 11:57   #209  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 6,890
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
__________________
BeHappy, AviSynth audio transcoder.
tebasuna51 is offline   Reply With Quote
Old 24th February 2021, 13:19   #210  |  Link
Boulder
Pig on the wing
 
Boulder's Avatar
 
Join Date: Mar 2002
Location: Finland
Posts: 5,718
Quote:
Originally Posted by tebasuna51 View Post
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
__________________
And if the band you're in starts playing different tunes
I'll see you on the dark side of the Moon...
Boulder is offline   Reply With Quote
Old 24th February 2021, 16:15   #211  |  Link
Richard1485
Guest
 
Posts: n/a
Tebasuna has already provided an easy solution with ffmpeg, but if anyone wants to go from 4.0 to 5.0 with AviSynth:
Code:
#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)

Last edited by Richard1485; 19th March 2021 at 13:35. Reason: added Amplify(0.707)
  Reply With Quote
Old 25th February 2021, 10:34   #212  |  Link
Boulder
Pig on the wing
 
Boulder's Avatar
 
Join Date: Mar 2002
Location: Finland
Posts: 5,718
I think you also need to use Amplify(0.707) on those new rear channels.
__________________
And if the band you're in starts playing different tunes
I'll see you on the dark side of the Moon...
Boulder is offline   Reply With Quote
Old 25th February 2021, 11:19   #213  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 6,890
In order to obtain a correct channel mapping from AviSynth I recommend use BeHappy with this .avs:

Quote:
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
There are also rewavi 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

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.
Attached Files
File Type: zip wavi106m_x86_x64.zip (50.1 KB, 61 views)
__________________
BeHappy, AviSynth audio transcoder.

Last edited by tebasuna51; 25th February 2021 at 14:18. Reason: Add info
tebasuna51 is offline   Reply With Quote
Old 25th February 2021, 14:01   #214  |  Link
Richard1485
Guest
 
Posts: n/a
Quote:
Originally Posted by Boulder View Post
I think you also need to use Amplify(0.707) on those new rear channels.
Oh, yes! Good point.
  Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 19:50.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.