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: FLAC Command Line "until" (Read 4185 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

FLAC Command Line "until"

I installed one of the plug-ins to playback Playstation PSF files. I don't know which one of them, exactly, is playing them. I installed several "game" plug-ins.
They play. I can hear them.

But when I try to convert to flac (I updated the converter pack to the newest to include FLAC 1.3.0; also have other binaries found here) The conversion process runs forever since the tracks are looped.

Playback only allows 3 minutes of play but conversion is infinite.
I went through all the plugin options for every "game" plugin to see if there were separate options for encoding.
Nothing.

The command line for FLAC shows there's a general option for "--unil=mm:ss.ss" but when I include that in a custom profile and encode, I get an error back.

Syntax:
Encoding: flac [<general-options>] [<format-options>] [<encoding options>] [inputfile [...]]

My command:
--until=3:00.00 -s --ignore-chunk-sizes -8 - -o %d

Everything is the default settings for Foobar2000.
I have only added "--until=3:00.00"

This is the error I get:
Conversion failed: The encoder has terminated prematurely with code 1 (0x00000001); please re-check parameters

Anyone know what code 1 means or if I put in something wrong?
Is the command line input for foobar completely different than it would be as a standalone encoder?

I couldn't find any documentation on Foobar's FLAC command line help.
I like to use "HD audio" in PaulStretch. "HD audio", lol.

FLAC Command Line "until"

Reply #1
According to the documentation that should work, but when I open a command-prompt and manually enter the command-line I get this:
Code: [Select]
flac.exe -8 --until=0:10.00 sample.wav -o sample.flac

ERROR: invalid value for --until
and I don't know why. --until=441000 on the other hand does work, so in your case would be --until=7938000 (180*<sample-rate>).


FLAC Command Line "until"

Reply #3
That worked. Seems the documentation is wrong. Even in the exe itself: --until={#|[+|-]mm:ss.ss} should be --until={#|[+|-]mm:ss,ss}.

FLAC Command Line "until"

Reply #4
I think that it's locale-specific and probably a bug.

FLAC Command Line "until"

Reply #5
See the flac-dev ML. From what I understand this is specific to Windows.
It's only audiophile if it's inconvenient.

FLAC Command Line "until"

Reply #6
Nothing's working.
I tried every suggestion and still get errors.

I'll uninstall everything and install just the basics.
I have no idea what's going on.

I tried removing "ignore chuck size" and it started to encode to flac but completely ignored the "until" command and looped the encoding process.

I added "%s" for the temporary file and it did the same thing.

I removed "%s" and it didn't even start, it just went straight to encode.

I even tried on a different music source that's from a CD rip in FLAC.
From FLAC to FLAC using any of the "until" command gives errors.

I found a solution using WinAmp though.
But now I'm curious why "until" won't work at all for me.

I'll do some extensive troubleshooting with my installation and the various builds I've found here.
I like to use "HD audio" in PaulStretch. "HD audio", lol.

FLAC Command Line "until"

Reply #7
It might seem like a silly question, but then you have not acknowledged any of the discussion around it, so: Did you try replacing the period in the time supplied to FLAC with a comma?

FLAC Command Line "until"

Reply #8
Yeah, I did try with the comma and it still produced errors.
I tried with the binary from RareWares and I even tried v1.2.1.

using frame numbers didn't work either.

If it's working for you guys and not me, then I must have done something with my installations or other things.
I like to use "HD audio" in PaulStretch. "HD audio", lol.

FLAC Command Line "until"

Reply #9
See the flac-dev ML. From what I understand this is specific to Windows.

No, decimal point character depends on locale not only on Windows.
That mail says that make fullcheck failure is specific to Windows (because setting locale related environment variables doesn't work).

FLAC Command Line "until"

Reply #10
@ Sparktank: Perhaps you can upload a sample psf-file so we can have a look ourselves.

[edit]
Nevermind Sparktank. I just tried to flac some gbs-files I still had around (which I assume are simular to psf-files), and eventually decoded a gbs-file to wav first and then tried to flac it, but no matter what I do, I'm getting an error message everytime.
Encoding an ordinary wav-file (3 minutes long) to flac directly works just fine:
Code: [Select]
flac.exe --until=1:00,00 -8 sample.wav -o sample.flac

But the following always fails in Foobar:
Code: [Select]
-s --until=1:00,00 --ignore-chunk-sizes -8 - -o %d

The following in Foobar does produce a flac-file, but still an error-window comes up when the progress-bar has reached 33% (1minute of 3):
Code: [Select]
-s --until=1:00,00 -8 - -o %d

Bit-comparing this one with the flac.exe-output results in: Length mismatch : 0:59.907483 vs 1:00.000000, 2641920 vs 2646000 samples
[/edit]

FLAC Command Line "until"

Reply #11
The PSF file decoder you use should be foo_psf, at least I don't know of other components for that task. When used with Converter it asks looping to be disabled no matter what playback settings you have enabled. I don't know if Converter had a bug in some version where this didn't work but it definitely works correctly in foobar2000 v1.2.8.

FLAC.exe will helpfully tell you "--ignore-chunk-sizes not allowed with --until" if you check it in command prompt.

The --until option doesn't require defining hundreds of a second to work so you can ignore the silly localization dependant format. It can be used with simpler form --until=3:00.

You could use the --until option if you used temporary files (encoder parameters --until=3:00 -s -8 %s -o %d), but that of course is not an option for your situation (the wav file writing would never stop and the encoder would never be able to start its task).

The reason --until causes error with Converter when you use pipes is that the flac process ends itself when it reaches the length you asked. That is an unexpected problem in foobar's eyes and it reports it. I don't know why the file gets cut short in this case.

In conclusion: make sure you have latest version of foobar2000 and foo_psf.

 

FLAC Command Line "until"

Reply #12
(encoder parameters --until=3:00 -s -8 %s -o %d)
...
The reason --until causes error with Converter when you use pipes is that the flac process ends itself when it reaches the length you asked. That is an unexpected problem in foobar's eyes and it reports it. I don't know why the file gets cut short in this case.
Makes a lot of sense and it works! Thanks.