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 14th October 2018, 19:50   #181  |  Link
LoRd_MuldeR
Software Developer
 
LoRd_MuldeR's Avatar
 
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,248
opus v1.3-rc2+2
opus-tools v0.2+2 | libopusenc v0.2.1 | libopusfile v0.11+4
opus-tools.2018-10-14.zip (mirror)

(Includes a custom patch to show progress in 'opusdec' tool!)
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊
LoRd_MuldeR is offline   Reply With Quote
Old 18th October 2018, 22:55   #182  |  Link
hajj_3
Registered User
 
Join Date: Mar 2004
Posts: 1,120
Opus 1.3 final is out now, please update title.

Changes since 1.2.x include:

Improvements to the VAD and speech/music classification using an RNN
Support for ambisonics coding using channel mapping families 2 and 3
Improvements to stereo speech coding at low bitrate
Using wideband encoding down to 9 kb/s
Making it possible to use SILK down to bitrates around 5 kb/s
Minor quality improvement on tones
Enabling the spec fixes in RFC 8251 by default
Security/hardening improvements
Notable bug fixes include:

Fixes to the CELT PLC
Bandwidth detection fixes

Last edited by hajj_3; 20th October 2018 at 14:02.
hajj_3 is offline   Reply With Quote
Old 22nd October 2018, 23:32   #183  |  Link
IgorC
Registered User
 
Join Date: Apr 2004
Posts: 1,315
OP updated.
IgorC is offline   Reply With Quote
Old 23rd October 2018, 08:42   #184  |  Link
Gravitator
Registered User
 
Join Date: May 2014
Posts: 292
Quote:
Originally Posted by IgorC View Post
Gravitator,

As I can see the issue was corrected. You can try this build https://hydrogenaud.io/index.php/top...html#msg950387

The issue was present when native built-in resampler was used.
The old version is still better...
Is it possible to control the built-in resampler?
OPUS v1.3-beta1 encoder > opus-tools 0.1.10-2-gcc5a249-dirty
OPUS v1.3-final encoder > opus-tools 0.2-3-gf5f571b
Test sample > OPUS 1.3-final vs 1.3-beta1

Last edited by Gravitator; 23rd October 2018 at 08:47.
Gravitator is offline   Reply With Quote
Old 24th October 2018, 21:23   #185  |  Link
LoRd_MuldeR
Software Developer
 
LoRd_MuldeR's Avatar
 
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,248
opus v1.3
opus-tools v0.2+3 | libopusenc v0.2.1 | libopusfile v0.11+4
2018-10-24.zip (mirror)

(Includes a custom patch to show progress in 'opusdec' tool!)
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊

Last edited by LoRd_MuldeR; 24th October 2018 at 21:26.
LoRd_MuldeR is offline   Reply With Quote
Old 24th October 2018, 23:09   #186  |  Link
jmvalin
Registered User
 
Join Date: Nov 2014
Posts: 9
Quote:
Originally Posted by Gravitator View Post
The old version is still better...
Is it possible to control the built-in resampler?
OPUS v1.3-beta1 encoder > opus-tools 0.1.10-2-gcc5a249-dirty
OPUS v1.3-final encoder > opus-tools 0.2-3-gf5f571b
Test sample > OPUS 1.3-final vs 1.3-beta1
So it appears that the issue has nothing to do with the resampler, but with the signal itself and (especially) the fact that it's 8-bit. When you give an 8-bit file to the encoder, it assumes that it's very noisy and that it can discard a lot of that noise. What probably happened in the "good" file is that the information about the bit depth just never made it to the encoder. As for the reason an external resampler "fixes" the problem, it's probably just because the resampler's output was a 16-bit file.

So there may still be something to do to improve the situation, but to be honest I'm not actually sure what would be the correct behaviour for 8-bit input.
jmvalin is offline   Reply With Quote
Old 13th April 2019, 14:01   #187  |  Link
hajj_3
Registered User
 
Join Date: Mar 2004
Posts: 1,120
Opus v1.3.1 is out:

libopus 1.3.1
Apr 12, 2019
This Opus 1.3.1 minor release fixes an issue with the analysis on files with digital silence (all zeros), especially on x87 builds (mostly affects 32-bit builds). It also includes two new features:

A new OPUS_GET_IN_DTX query to know if the encoder is in DTX mode (last frame was either a comfort noise frame or not encoded at all)
A new (and still experimental) CMake-based build system that is eventually meant to replace the VS2015 build system (the autotools one will stay).
hajj_3 is offline   Reply With Quote
Old 21st April 2019, 16:10   #188  |  Link
LoRd_MuldeR
Software Developer
 
LoRd_MuldeR's Avatar
 
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,248
opus v1.3.1+1
libopusenc v0.2.1+2 | libopusfile v0.11+5 | opus-tools v0.2+3
opus-tools.2019-04-21.zip (mirror)

(Includes a custom patch to show progress in 'opusdec' tool!)
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊

Last edited by LoRd_MuldeR; 21st April 2019 at 16:13.
LoRd_MuldeR is offline   Reply With Quote
Old 6th November 2019, 12:55   #189  |  Link
redbtn
Registered User
 
redbtn's Avatar
 
Join Date: Jan 2019
Location: Russia
Posts: 105
I will be grateful for the explanation how to correctly convert 5.1 or 7.1 to opus?
For example i have 7.1 flac file. I tried to convert through foobar2000 and ffmpeg, and i get Channel layout : L in both cases. What i'm doing wrong?

My bat file
Quote:
ffmpeg.exe -i input.flac -c:a libopus -vbr on -b:a 512k -ac 8 -y -hide_banner output.opus
Quote:
Audio
ID : 3035015489 (0xB4E6A941)
Format : Opus
Duration : 1 h 52 min
Channel(s) : 8 channels
Channel layout : L
Sampling rate : 48.0 kHz
Detected bit depth : 24 bits
Compression mode : Lossy
Writing library : Lavf58.29.100

Quote:
Audio
Format : FLAC
Format/Info : Free Lossless Audio Codec
Duration : 1 h 52 min
Bit rate mode : Variable
Bit rate : 3 066 kb/s
Channel(s) : 8 channels
Channel layout : L R C LFE Lb Rb Ls Rs
Sampling rate : 48.0 kHz
Bit depth : 24 bits
Compression mode : Lossless
Stream size : 2.41 GiB (100%)
Writing library : libFLAC 1.3.2 (UTC 2017-01-01)
redbtn is offline   Reply With Quote
Old 6th November 2019, 12:58   #190  |  Link
Anakunda
Registered User
 
Join Date: Jan 2010
Posts: 330
Quote:
Originally Posted by redbtn View Post
I will be grateful for the explanation how to correctly convert 5.1 or 7.1 to opus?

For example i have 7.1 flac file. I tried to convert through foobar2000 and ffmpeg, and i get Channel layout : L in both cases. What i'm doing wrong?



My bat file
Can you upload the source somewhere, or excerpt from it.

________________________
Sent from my phone using Tapatalk
Anakunda is offline   Reply With Quote
Old 6th November 2019, 13:45   #191  |  Link
redbtn
Registered User
 
redbtn's Avatar
 
Join Date: Jan 2019
Location: Russia
Posts: 105
Quote:
Originally Posted by Anakunda View Post
Can you upload the source somewhere, or excerpt from it.
I cut it by mkvtoolnix, but when i extract *.flac, for some reason it has the duration of the whole movie. But it doesn't matter, you can still reproduce it
https://drive.google.com/open?id=1Ys...3VCGOTLGz0TaEu

I can upload source, but it 2.4Gb.

Last edited by redbtn; 6th November 2019 at 14:04.
redbtn is offline   Reply With Quote
Old 6th November 2019, 14:48   #192  |  Link
Anakunda
Registered User
 
Join Date: Jan 2010
Posts: 330
I was able to convert all channels

General
Duration : 58 s 801 ms
Overall bit rate : 146 kb/s
Writing application : opusenc from opus-tools 0.2-3-gf5f571b
ENCODER_OPTIONS : --bitrate 128 --vbr --comp 10

Channel(s)_Original : 8 channels
Channel layout : L R C LFE Lb Rb Ls Rs
ChannelLayout_Original : FL
Sampling rate : 48.0 kHz
Detected bit depth : 24 bits
Compression mode : Lossy
Writing library : libopus 1.3, libopusenc 0.2.1

Probably Opus requires at least 16kbit per channel while defaulting to VBR@96k leaves only 12k for each channel, hence downmixing comes into effect. What are your encoder settings? Try to increase overall bitrate to 128k or more.
Anakunda is offline   Reply With Quote
Old 6th November 2019, 14:56   #193  |  Link
redbtn
Registered User
 
redbtn's Avatar
 
Join Date: Jan 2019
Location: Russia
Posts: 105
Quote:
Originally Posted by Anakunda View Post
I was able to convert all channels



General

Duration : 58 s 801 ms

Overall bit rate : 146 kb/s

Writing application : opusenc from opus-tools 0.2-3-gf5f571b

ENCODER_OPTIONS : --bitrate 128 --vbr --comp 10



Channel(s)_Original : 8 channels

Channel layout : L R C LFE Lb Rb Ls Rs

ChannelLayout_Original : FL

Sampling rate : 48.0 kHz

Detected bit depth : 24 bits

Compression mode : Lossy

Writing library : libopus 1.3, libopusenc 0.2.1



Probably Opus requires at least 16kbit per channel while defaulting to VBR@96k leaves only 12k for each channel, hence downmixing comes into effect. What are your encoder settings? Try to increase overall bitrate to 128k or more.
Like I said my settings are
ffmpeg.exe -i input.flac -c:a libopus -vbr on -b:a 512k -ac 8 -y -hide_banner output.opus
So, 512kb should be enough. Can you share your script?
redbtn is offline   Reply With Quote
Old 6th November 2019, 15:04   #194  |  Link
Anakunda
Registered User
 
Join Date: Jan 2010
Posts: 330
Then problem lies in you frontend. Use opusenc instead

Code:
opusenc --bitrate 512 --vbr sample.flac sample.opus
Can you play this on all channels?
Anakunda is offline   Reply With Quote
Old 6th November 2019, 16:38   #195  |  Link
redbtn
Registered User
 
redbtn's Avatar
 
Join Date: Jan 2019
Location: Russia
Posts: 105
Quote:
Originally Posted by Anakunda View Post
Then problem lies in you frontend. Use opusenc instead



Code:
opusenc --bitrate 512 --vbr sample.flac sample.opus


Can you play this on all channels?
Thank you very much! I used opus tools with your script and now it works good! Can I ask where you got latest opus tools? It looks like mine is older than yours.
First I downloaded from the official website, now I use LoRd_Mulder's build.

Last edited by redbtn; 6th November 2019 at 16:44.
redbtn is offline   Reply With Quote
Old 6th November 2019, 18:29   #196  |  Link
Anakunda
Registered User
 
Join Date: Jan 2010
Posts: 330
It's at HydrigenAudio, Opus subforum.

________________________
Sent from my phone using Tapatalk
Anakunda is offline   Reply With Quote
Old 6th November 2019, 21:01   #197  |  Link
qyot27
...?
 
qyot27's Avatar
 
Join Date: Nov 2005
Location: Florida
Posts: 1,419
Quote:
Originally Posted by redbtn View Post
I will be grateful for the explanation how to correctly convert 5.1 or 7.1 to opus?
For example i have 7.1 flac file. I tried to convert through foobar2000 and ffmpeg, and i get Channel layout : L in both cases. What i'm doing wrong?

My bat file
The problem is mediainfo. The output from FFmpeg is correct and matches the output of opusenc, as shown by opusinfo. The only difference is the metadata written to the container.

The issue at hand is that opusenc seems to always write the WAVEFORMATEXTENSIBLE_CHANNEL_MASK= value to the file's metadata, whereas FFmpeg only does it if the channel layout does not match the default (apparently; that's what some of the kinda-related issues on FFmpeg's trac go with).

The Opus file sourced from sample.flac after encoding by opusenc has a value of WAVEFORMATEXTENSIBLE_CHANNEL_MASK=0X63F. If you demux the metadata from the FFmpeg-encoded opus file, paste that value into the metadata, then take the FFmpeg-encoded file and adjusted metadata file and remux them together with FFmpeg, mediainfo will 'see' the channel layout in the new file.

Code:
ffmpeg -i sample.flac -acodec libopus -vbr on -ab 512k ffmpeg.opus
Check ffmpeg.opus in mediainfo to show it's not seeing the layout.

Then check ffmpeg.opus in opusinfo and using ffmpeg -i to show that both of them still see the file as having all its channels.

Play it back in mpv to verify whether the layout is correct despite mediainfo not reporting it.
Code:
ffmpeg -i ffmpeg.opus -f ffmetadata metadata.txt
Add WAVEFORMATEXTENSIBLE_CHANNEL_MASK=0X63F to metadata.txt because that's what opusenc would output.
Code:
ffmpeg -i ffmpeg.opus -i metadata.txt -map_metadata 1 -c copy ffmpeg-new.opus
Check ffmpeg-new.opus with mediainfo to see that it is reporting the layout.

Now, if you do this and then the channel layout when being played back is wrong, then there's a bug that needs to be traced.

Last edited by qyot27; 6th November 2019 at 21:05.
qyot27 is offline   Reply With Quote
Old 7th November 2019, 12:18   #198  |  Link
redbtn
Registered User
 
redbtn's Avatar
 
Join Date: Jan 2019
Location: Russia
Posts: 105
Quote:
Originally Posted by qyot27 View Post
The problem is mediainfo. The output from FFmpeg is correct and matches the output of opusenc, as shown by opusinfo. The only difference is the metadata written to the container.



The issue at hand is that opusenc seems to always write the WAVEFORMATEXTENSIBLE_CHANNEL_MASK= value to the file's metadata, whereas FFmpeg only does it if the channel layout does not match the default (apparently; that's what some of the kinda-related issues on FFmpeg's trac go with).



The Opus file sourced from sample.flac after encoding by opusenc has a value of WAVEFORMATEXTENSIBLE_CHANNEL_MASK=0X63F. If you demux the metadata from the FFmpeg-encoded opus file, paste that value into the metadata, then take the FFmpeg-encoded file and adjusted metadata file and remux them together with FFmpeg, mediainfo will 'see' the channel layout in the new file.



Code:
ffmpeg -i sample.flac -acodec libopus -vbr on -ab 512k ffmpeg.opus
Check ffmpeg.opus in mediainfo to show it's not seeing the layout.



Then check ffmpeg.opus in opusinfo and using ffmpeg -i to show that both of them still see the file as having all its channels.



Play it back in mpv to verify whether the layout is correct despite mediainfo not reporting it.

Code:
ffmpeg -i ffmpeg.opus -f ffmetadata metadata.txt
Add WAVEFORMATEXTENSIBLE_CHANNEL_MASK=0X63F to metadata.txt because that's what opusenc would output.

Code:
ffmpeg -i ffmpeg.opus -i metadata.txt -map_metadata 1 -c copy ffmpeg-new.opus
Check ffmpeg-new.opus with mediainfo to see that it is reporting the layout.



Now, if you do this and then the channel layout when being played back is wrong, then there's a bug that needs to be traced.
I'll check it later. But, when I use foobar2000 (it uses opusenc for converting), I get the same result with only L channel. How to explain that?
And I have another question. If I convert the same file multiple times, I get files with identical size but different MD5. I thought maybe only metadata changes, and looked on files into hex editor. They are different. Opus makes different decisions every time and encodes differently?
(for example x265 or flac gives identical files)

PS: I found another weird thing, if I convert to flac via ffmpeg (instead of eac3to), and then convert to opus via opus-tools, the same thing happens (mediainfo shows only L channel)
I checked in hex editor and flac file produced by ffmpeg also doesn't have WAVEFORMATEXTENSIBLE_CHANNEL_MASK=0X63F

The same situation with
Quote:
eac3to INPUT stdout.wav | opusenc --ignorelength --bitrate 512 - OUTPUT.opus
I'm sure I'm not the first who noticed it, but it seems I'm only one who's worried about it.

Last edited by redbtn; 7th November 2019 at 17:25.
redbtn is offline   Reply With Quote
Old 8th November 2019, 00:15   #199  |  Link
qyot27
...?
 
qyot27's Avatar
 
Join Date: Nov 2005
Location: Florida
Posts: 1,419
foobar2000 is probably not giving the FLAC file directly to opusenc, but decoding it to PCM and either piping it into opusenc or using a temp Wave file.

This really does sound like something that needs to be reported to MediaInfo, though.

I don't know anything about libopus' determinism (or lack thereof) with its output from the same file.
qyot27 is offline   Reply With Quote
Old 8th November 2019, 00:48   #200  |  Link
redbtn
Registered User
 
redbtn's Avatar
 
Join Date: Jan 2019
Location: Russia
Posts: 105
Quote:
Originally Posted by qyot27 View Post
foobar2000 is probably not giving the FLAC file directly to opusenc, but decoding it to PCM and either piping it into opusenc or using a temp Wave file
Yes, I think so. Like eac3to does this with command line I've posted above.
It doesn't matter, I found that mkvtoolnix erases metadata from opus file. When I mux it into MKV, mediainfo shows "Channel L". And if I demux opus from MKV, files are not the same. It doesn't have Channel layout and information about encoder (and maybe something else). I tried to compare them into hex editor, but files are much different. I don't have enough knowledge in this area, and I don't know is it impact to playback or not. But I definitely don't like that I can't mux file into MKV and then demux and get the same file as it was.
It seems to me that I have to choose another encoder for converting my files (Unless someone can clarify this situation)
Anyway, thank you qyot27 for help.

Last edited by redbtn; 8th November 2019 at 00:54.
redbtn is offline   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 08:05.


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