SamKook
8th November 2022, 08:41
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:
BlankClip(length=1342178, audio_rate=48000, channels=2, fps=60, width=720, height=576, color=$000000)
And something like this for the piping:
"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:
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.
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:
BlankClip(length=1342178, audio_rate=48000, channels=2, fps=60, width=720, height=576, color=$000000)
And something like this for the piping:
"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:
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.