Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Opus 1.1 (Read 42131 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Opus 1.1

Reply #50
Found a way to fix this problem: in function seek_forward (in audio_in.c) comment out fseek():

Code: [Select]
static int seek_forward(FILE *in, unsigned int length)
{
    //if(fseek(in, length, SEEK_CUR))
    {
        /* Failed. Do it the hard way. */
        unsigned char buf[1024];
        unsigned int seek_needed = length;


added: currently opusenc uses fseek() to skip over "LIST"  chunk, and this somehow prevents further reading/seeking

Doesn't it look familiar? IIRC, I saw similar code in flac frontend in the past.
fseek() on a non-seekable file is guaranteed to fail on Posix, but not on Windows. Therefore, "try to seek first and read when fail" doesn't work...

Opus 1.1

Reply #51
So another solution is to use #ifdef?

Code: [Select]
static int seek_forward(FILE *in, unsigned int length)
{
#if !defined _WIN32
    if(fseek(in, length, SEEK_CUR))
#endif
    {
        /* Failed. Do it the hard way. */
        unsigned char buf[1024];

Opus 1.1

Reply #52
So another solution is to use #ifdef?

Code: [Select]
static int seek_forward(FILE *in, unsigned int length)
{
#if !defined _WIN32
    if(fseek(in, length, SEEK_CUR))
#endif
    {
        /* Failed. Do it the hard way. */
        unsigned char buf[1024];

I have uploaded a build of opustools with this mod in place. If someone would kindly confirm this works OK, I'll complete other relevant recompiles and upload.

It's available here: http://www.rarewares.org/files/opus/opus-t...win32_SSE-1.zip

TIA.

Opus 1.1

Reply #53
This one works, john33.
Code: [Select]
ffmpeg.exe -hide_banner -i input.avs -c:a copy -f wav - | qaac.exe --silent -D - -o - | opusenc.exe --bitrate 64 - output.opus
ffmpeg.exe -hide_banner -i input.avs -c:a copy -f wav - | opusenc.exe --bitrate 64 - output.opus
Now both produce the same output. Thank you, lvqcl and john33!
Upon having loaded the AviSynth audiostream ffmpeg does still notify me though with: "[wav @ 02f8d700] Using AVStream.codec.time_base as a timebase hint to the muxer is deprecated. Set AVStream.time_base instead." Does anyone know by chance if this is important/bad?
Btw john33, I see you grabbed opus-tools 0.1.8 for this fix, but 0.1.9 is out already.

Opus 1.1

Reply #54
This one works, john33.
........
Btw john33, I see you grabbed opus-tools 0.1.8 for this fix, but 0.1.9 is out already.

Thanks for the feedback, and the 'heads up'. I'll sort new compiles out tomorrow.

Opus 1.1

Reply #55
This one works, john33.
........
Btw john33, I see you grabbed opus-tools 0.1.8 for this fix, but 0.1.9 is out already.

Thanks for the feedback, and the 'heads up'. I'll sort new compiles out tomorrow.

Opus-tools updated on Rarewares to 0.1.9, including the bug fix. I'll get to the oggenc2 compiles later.

Opus 1.1

Reply #56
Opus-tools updated on Rarewares to 0.1.9, including the bug fix.

Thanks.

Quote
I'll get to the oggenc2 compiles later.

What's new on this one? Same fix?

Opus 1.1

Reply #57
Code: [Select]
opusenc.exe -V
opusenc opus-tools  (using libopus 1.1.x-git)
Copyright (C) 2008-2013 Xiph.Org Foundation
Could you please recompile and enter the opus-tools version, because opusinfo.exe, but especially MediaInfo reads those entries.
"libopus 1.1.x-git" means compiled from latest git at that moment I guess?

P.s. http://www.rarewares.org/opus.php --> you seem to forgot a "<" in front of "/span>".


Opus 1.1

Reply #59
Code: [Select]
opusenc.exe -V
opusenc opus-tools  (using libopus 1.1.x-git)
Copyright (C) 2008-2013 Xiph.Org Foundation
Could you please recompile and enter the opus-tools version, because opusinfo.exe, but especially MediaInfo reads those entries.
"libopus 1.1.x-git" means compiled from latest git at that moment I guess?

P.s. http://www.rarewares.org/opus.php --> you seem to forgot a "<" in front of "/span>".

Recompiled, as requested. Sorry, I thought I'd taken care of that! Yes, latest git.

opus.php fixed as well, thanks again!



Opus 1.1

Reply #62
You can steel fskip_ahead() from FLAC frontend:
https://git.xiph.org/?p=flac.git;a=commitdi...6a8645e83be9768
LAME has similar function named fskip() in get_audio.c, in which only S_ISFIFO is treated as a non-seekable candidate.

Completely killing fseek() on win32 is usually fine since what is skipped is usually tiny.
However, AIFF can have COMM(=header) after ssnd(=PCM data), in which case HUGE amount of block has to be skipped by fread() before reading COMM.

Opus 1.1

Reply #63
You can steel fskip_ahead() from FLAC frontend:
https://git.xiph.org/?p=flac.git;a=commitdi...6a8645e83be9768
LAME has similar function named fskip() in get_audio.c, in which only S_ISFIFO is treated as a non-seekable candidate.

Completely killing fseek() on win32 is usually fine since what is skipped is usually tiny.
However, AIFF can have COMM(=header) after ssnd(=PCM data), in which case HUGE amount of block has to be skipped by fread() before reading COMM.

Code 'stolen' from FLAC fronted!  Could someone kindly check that I've amended this in a way that it performs correctly? TIA.

It's here: http://www.rarewares.org/files/opus/opus-t...win32_SSE-1.zip


Opus 1.1

Reply #65
Piping 32bit float AviSynth audio from ffmpeg to opusenc works for me. Thanks.

Excellent.  Thanks for letting me know. I'll proliferate new compiles that use this code.

Opus 1.1

Reply #66
john33, thanks for the new builds again.

Is SSE2 optimised instead of SSE on Opus 64bit a typo?

Opus 1.1

Reply #67
john33, thanks for the new builds again.

Is SSE2 optimised instead of SSE on Opus 64bit a typo?

No, it's not a typo, I just selected the SSE2 compiler option on all the Opus x64 component builds.


Opus 1.1

Reply #69
eahm, all x64 CPUs must support SSE2, so there's no harm....

True.
Even the very first 64-bit Athlons (ClawHammer and Newcastle from september 2003) already had SSE2 support. So there's no 64-bit desktop CPU from Intel or AMD without SSE2.

2 john33: thanks for releasing new opus builds. Btw do you still plan to create opusdropXP one day ?

Opus 1.1

Reply #70
ffmpeg does still notify me though with: "[wav @ 02f8d700] Using AVStream.codec.time_base as a timebase hint to the muxer is deprecated. Set AVStream.time_base instead." Does anyone know by chance if this is important/bad?

Hi
It's been fixed ---> fixed


Opus 1.1

Reply #72
Why file converted 2 times with same encoder options (--bitrate 128) with last official codec opus-tools 0.1.9 they have different structure/checksum?


Opus 1.1

Reply #73
Why file converted 2 times with same encoder options (--bitrate 128) with last official codec opus-tools 0.1.9 they have different structure/checksum?

Timestamp? Unique conversion id?

Opus 1.1

Reply #74
Code: [Select]
Diagnostic options:
--serial n         Forces a specific stream serial number