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. |
8th November 2022, 08:41 | #1 | Link |
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) 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" 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. 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. |
8th November 2022, 13:23 | #2 | Link |
Moderator
Join Date: Feb 2005
Location: Spain
Posts: 6,915
|
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
__________________
BeHappy, AviSynth audio transcoder. Last edited by tebasuna51; 8th November 2022 at 13:58. Reason: add info |
8th November 2022, 20:38 | #3 | Link |
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. |
9th November 2022, 10:29 | #5 | Link |
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 |
|
|