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
Register FAQ Calendar Today's Posts Search

Reply
 
Thread Tools Search this Thread Display Modes
Old 8th November 2022, 08:41   #1  |  Link
SamKook
Registered User
 
Join Date: Mar 2011
Posts: 216
Long audio fails only when piping to libopus

I was working with a 6h29m audio track for a video and my usual workflow uses avs2pipemod to pipe the audio to the encoder but this time, it failed after 4% which is a first for me.

After a bunch of testing, I realized 32 or 64bit didn't matter, it only happened to libopus(nero aac worked fine) and only when piping(feeding ffmpeg the avs script directly worked fine too).

I was wondering if it's a known limitation, me messing up or an actual bug.

An easy way to recreate the issue is with a blankclip like this:
Code:
BlankClip(length=1342178, audio_rate=48000, channels=2, fps=60, width=720, height=576, color=$000000)
And something like this for the piping:
Code:
"C:\Progs\avs2pipemod\avs2pipemod64.exe" -wav "test.avs" | "C:\Progs\opus-tools-0.2-opus-1.3.1\opusenc.exe" --quiet --vbr --bitrate 64 - "test.opus"
This is what I get:
Code:
avs2pipemod[info]: writing 22369.633 seconds of 48000 Hz, 665719930882 channel audio.
avs2pipemod[info]: total elapsed time is 0.001 sec.
avs2pipemod[error]: only wrote 1012 of 1073742400 samples.
If you set the blank clip to 1 less length(1342177), it'll work fine, I made sure to find the edge of it for the test.


Edit: After chatting with a very helpful person on opus IRC channel, the issue seems to be that I was using the wav option(also tried extwav) and opus doesn't support wav files bigger than 4GB which is almost certainly what the blankclip would produce since my original file was 4.27GB.
If I use rawaudio instead when piping and use the raw switch for opusenc it does work perfectly fine.
__________________
AMD Ryzen 9 5950X and EVGA RTX 3080 with G.skill 64Gb 3600 (2 16x2 kit) on Asrock X570 Taichi with Samsung 980 Pro 500Gb NVMe SSD running Win10 x64 on LG 34GN850-B 34.0" 3440 x 1440 160 Hz

Last edited by SamKook; 8th November 2022 at 10:02.
SamKook is offline   Reply With Quote
Old 8th November 2022, 13:23   #2  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 6,915
Quote:
Originally Posted by SamKook View Post
... opus doesn't support wav files bigger than 4GB...
Opusenc support them but you need add the parameter --ignorelength to force ignore the data length in wav header, a 32 bit field than have a wrong data (the overflow over 4 GB when the wav is biger).

Checked without problem your test.avs

"avs2pipemod64.exe" -wav "test.avs" | "opusenc.exe" --ignorelength --quiet --vbr --bitrate 64 - "test.opus"

Code:
Audio
Format                                   : Opus
Duration                                 : 6 h 12 min
The same or equivalent parameter is needed for many encoders: OggEnc2, NeroAacEnc, qaac, fhgaacenc, ffdcaenc, flac, ...
__________________
BeHappy, AviSynth audio transcoder.

Last edited by tebasuna51; 8th November 2022 at 13:58. Reason: add info
tebasuna51 is online now   Reply With Quote
Old 8th November 2022, 20:38   #3  |  Link
SamKook
Registered User
 
Join Date: Mar 2011
Posts: 216
You're right, I should have paid more attention to the neroaac command when I tested with it and it worked. I just reused my old command but it does have ignorelength specified in it.

I wonder what's the difference between that and just using raw instead, there's doesn't seem to be a need to specify anything either way other than tell the encoder it's raw.
__________________
AMD Ryzen 9 5950X and EVGA RTX 3080 with G.skill 64Gb 3600 (2 16x2 kit) on Asrock X570 Taichi with Samsung 980 Pro 500Gb NVMe SSD running Win10 x64 on LG 34GN850-B 34.0" 3440 x 1440 160 Hz

Last edited by SamKook; 8th November 2022 at 20:40.
SamKook is offline   Reply With Quote
Old 8th November 2022, 21:53   #4  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 6,915
The wav header say: Samplerate, Numchannels, Bitdepth (and ChannelMask with WAVEFORMATEXTENSIBLE header)

That data must be send when using raw
__________________
BeHappy, AviSynth audio transcoder.
tebasuna51 is online now   Reply With Quote
Old 9th November 2022, 10:29   #5  |  Link
SamKook
Registered User
 
Join Date: Mar 2011
Posts: 216
I see. The defaults just happen to be the same as my source in this case so just using --raw worked without specifying anything else.
__________________
AMD Ryzen 9 5950X and EVGA RTX 3080 with G.skill 64Gb 3600 (2 16x2 kit) on Asrock X570 Taichi with Samsung 980 Pro 500Gb NVMe SSD running Win10 x64 on LG 34GN850-B 34.0" 3440 x 1440 160 Hz
SamKook is offline   Reply With Quote
Reply


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 21:17.


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