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: Using pipe in custom converter problem (Read 2037 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Using pipe in custom converter problem

Hi, If I use a pipe in custom encoder
Code: [Select]
sox.exe -t wav --ignore-length - -G -b 16 -t wav - rate -v -L 48000 dither | flac.exe - -o %d --best
it causes errors. I have compared to raw command from prompt with emulated stdin (flac -d -c input.flac | sox -t wav --ignore-length - -G -b 16 -t wav - rate -v -L 48000 dither | flac - -o output.flac --best), where the output is made
What's the problem with foobar?


Re: Using pipe in custom converter problem

Reply #2
Got what you mean, thx. Now the converter binary is cmd and all encoders are in param. However I still get error:

Source: "C:\Users\Anakunda\AppData\Local\Temp\Gordon Lightfoot - Sundown (1974) [FLAC 24-192]\01. Somewhere U.S.A..flac"
  An error occurred while writing to file (The encoder has terminated prematurely with code 0 (0x00000000); please re-check parameters) : "C:\Users\Anakunda\AppData\Local\Temp\Gordon Lightfoot - Sundown (1974) [FLAC]\01 - Somewhere U.S.A..flac"
  Additional information:
  Encoder stream format: 192000Hz / 2ch / 24bps
  Command line: "C:\Windows\System32\cmd.exe" sox.exe -t wav --ignore-length - -G -b 16 -t wav - rate -v -L 48000 dither | flac.exe - -o "01 - Somewhere U.S.A..flac" --best --replay-gain
  Working folder: C:\Users\Anakunda\AppData\Local\Temp\Gordon Lightfoot - Sundown (1974) [FLAC]\

Re: Using pipe in custom converter problem

Reply #3
Try -o %d instead of the predefined filename.

Re: Using pipe in custom converter problem

Reply #4
Try -o %d instead of the predefined filename.
That'ss what I already have. Exact parameters field is
sox.exe -t wav --ignore-length - -G -b 16 -t wav - rate -v -L 48000 dither | flac.exe - -o %d --best --replay-gain
sox and flac are within converter's lookup paths

Re: Using pipe in custom converter problem

Reply #5
No ideas why the chain isn't working? I need it piped. Thanx

Re: Using pipe in custom converter problem

Reply #6
Check "Do not convert in multiple threads" in encoding settings.

Re: Using pipe in custom converter problem

Reply #7
Check "Do not convert in multiple threads" in encoding settings.
This apparently doesn't help. Plz. try to replicate the converter profile


Re: Using pipe in custom converter problem

Reply #8
LossyWAV settings have /d /c switches, and you didn't add them.
Try this:
Code: [Select]
/d /c sox.exe -t wav --ignore-length - -G -b 16 -t wav - rate -v -L 48000 dither | flac.exe - -o %d --best --replay-gain

Re: Using pipe in custom converter problem

Reply #9
Thanks, you're right, I forgot the switches. Now the conversion goes fine.
I have one additional problem, if I try to make the command more flexible, I use this formatting string
Code: [Select]
/d /c sox.exe -t wav --ignore-length - -G -b 16 -t wav - rate -v -L $ifequal($mod(%samplerate%,48000),0,48000,44100) dither | flac.exe - -o %d --best
in the error console I see that the functions are not interpolated. Is there some possibility to use foobar's macros in tool's arglist?
I see that tags alone are expanded.


Re: Using pipe in custom converter problem

Reply #11
Maybe Peter could consider adding another checkbox to converter dialog for evaluating param string as title formatting?

 

Re: Using pipe in custom converter problem

Reply #12
I have one more foobar command problem however: If I try to chain these 3 commands in Run Services profile, they're not executed. What is wrong with the command line?
Code: [Select]
C:\Windows\System32\cmd.exe /k /d mediainfo "$directory_path(%path%)\*.flac" | pcregrep "MQA" && for %i in ("$directory_path(%path%)\*.flac") do is_mqa.py "%~fi" && metasize.pl "$directory_path(%path%)\*.flac"