Hello.
I am trying to utilize an option --output-prefix= and i get confused in how it is described and how it actually works.
I thought this option added a prefix to a filename so it could be useful for testing purposes.
Option's description:
--output-prefix=STRING Prefix each output file name with the given
STRING. This can be useful for encoding or
decoding files to a different directory. Make
sure if your STRING is a path name that it ends
with a '/' slash.
I need to re-encode some FLAC files in a folder but not to overwrite or move them anywhere.
So after re-encoding all of the files are in one folder and may be easily treated further, because they are sorted by name (prefix).
I have a folder with
Song1.flac,
Song2.flac,
Song3.flac. I run CLI
flac.exe -1 -j16 --output-prefix=TEST_V1_ "C:\Test\Song1.flac" "C:\Test\Song2.flac" "C:\Test\Song3.flac"
and i get files
TEST_V1_Song1.flac,
TEST_V1_Song2.flac,
TEST_V1_Song3.flac but they are located in flac.exe's folder (not in C:\Test\)
Would anyone please explain if i do something wrong or it works as it should? And maybe there is a way to reach my goal?
I thought this option added a prefix to a filename
Yes, it takes the "filename" part from the input "path", adds the prefix to it and that becomes the output "path".
flac.exe -1 -j16 --output-prefix=TEST_V1_ "C:\Test\Song1.flac" "C:\Test\Song2.flac" "C:\Test\Song3.flac"
and i get files TEST_V1_Song1.flac, TEST_V1_Song2.flac, TEST_V1_Song3.flac but they are located in flac.exe's
I would expect them to be located in your current directory. At least that's what happens on linux. You could try to "cd" to "C:\Test" first and see if it helps. If it doesn't, you could use the full path in the prefix:
flac.exe -1 -j16 --output-prefix="C:\Test\TEST_V1_" "C:\Test\Song1.flac" "C:\Test\Song2.flac" "C:\Test\Song3.flac"
use the full path in the prefix
Thank you, that worked. But i am still confused, it this really proper way to type a full path when you just need to rename a file for example.
What about
--output-prefix=".\TEST_V1_"
?
You didn't read the help text you quoted. It mentioned including the target directory in the output prefix.
Just use
flac -1 -j16 --output-prefix="C:\Test\TEST_V1_" "C:\Test\Song1.flac" "C:\Test\Song2.flac" "C:\Test\Song3.flac"
Dunno who you are replying to.
Anyway, isn't the following what was intended?
PS C:\tmp\output-dir-test> dir
Directory: C:\tmp\output-dir-test
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a---- 2023-12-20 09:18 13303886 wavefile1.wav
-a---- 2023-12-20 09:18 13303886 wavefile2.wav
-a---- 2023-12-20 09:18 13303886 wavefile3.wav
PS C:\tmp\output-dir-test> flac --output-prefix=".\prepre" .\wavef*.wav
flac 1.4.3
Copyright (C) 2000-2009 Josh Coalson, 2011-2023 Xiph.Org Foundation
flac comes with ABSOLUTELY NO WARRANTY. This is free software, and you are
welcome to redistribute it under certain conditions. Type `flac' for details.
wavefile1.wav: WARNING: skipping unknown chunk 'LIST' (use --keep-foreign-metadata to keep)
wavefile1.wav: wrote 6621322 bytes, ratio=0,498
wavefile2.wav: WARNING: skipping unknown chunk 'LIST' (use --keep-foreign-metadata to keep)
wavefile2.wav: wrote 6621322 bytes, ratio=0,498
wavefile3.wav: WARNING: skipping unknown chunk 'LIST' (use --keep-foreign-metadata to keep)
wavefile3.wav: wrote 6621322 bytes, ratio=0,498
PS C:\tmp\output-dir-test> dir
Directory: C:\tmp\output-dir-test
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a---- 2023-12-20 09:18 6621322 preprewavefile1.flac
-a---- 2023-12-20 09:18 6621322 preprewavefile2.flac
-a---- 2023-12-20 09:18 6621322 preprewavefile3.flac
-a---- 2023-12-20 09:18 13303886 wavefile1.wav
-a---- 2023-12-20 09:18 13303886 wavefile2.wav
-a---- 2023-12-20 09:18 13303886 wavefile3.wav
PS C:\tmp\output-dir-test>
I replied to the topic starter who said the description doesn't match reality. IMO it works logically and as described. If each path is prefixed with a custom string without specifying any directory, current directory will be used. Logical and expected.
Solutions are to either change the working directory or specifying the wanted target directory in the option.
What about
--output-prefix=".\TEST_V1_"
?
In this case files (TEST_V1_Song1.flac etc.) are created in a folder flac.exe exists.
You didn't read the help text you quoted. It mentioned including the target directory in the output prefix.
I read it but as i said before i might not understood it properly.
I thought that the logic of PREFIX was to be any of:
1) PATH\
2) PATH\PREFIX
3) PREFIX
Depending on what you type in the PREFIX field it does:
1) Creates converted files in a folder you wrote in the PATH and filenames are original.flac
2) Creates converted files in a folder you wrote in the PATH and filenames are PREFIXoriginal.flac
3) Creates converted files in a original folder and filenames are PREFIXoriginal.flac
In this case files (TEST_V1_Song1.flac etc.) are created in a folder flac.exe exists.
Not here. Are you calling the command from that folder?
In this case files (TEST_V1_Song1.flac etc.) are created in a folder flac.exe exists.
Not here. Are you calling the command from that folder?
C:\Flac>flac.exe -1 -j16 --output-prefix=".\TEST_V1_" "C:\Test\Song1.wav" "C:\Test\Song2.wav" "C:\Test\Song3.wav"
After that 3 files flac are created in c;\TEST