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: Question about option --output-prefix= (Read 1435 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Question about option --output-prefix=

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:
Spoiler (click to show/hide)

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
Code: [Select]
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?

Re: Question about option --output-prefix=

Reply #1
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".

Code: [Select]
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:
Code: [Select]
flac.exe -1 -j16 --output-prefix="C:\Test\TEST_V1_" "C:\Test\Song1.flac" "C:\Test\Song2.flac" "C:\Test\Song3.flac"

Re: Question about option --output-prefix=

Reply #2
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.


Re: Question about option --output-prefix=

Reply #4
You didn't read the help text you quoted. It mentioned including the target directory in the output prefix.

Just use
Code: [Select]
flac -1 -j16 --output-prefix="C:\Test\TEST_V1_" "C:\Test\Song1.flac" "C:\Test\Song2.flac" "C:\Test\Song3.flac"

Re: Question about option --output-prefix=

Reply #5
Dunno who you are replying to.


Anyway, isn't the following what was intended?

Code: [Select]
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>


Re: Question about option --output-prefix=

Reply #6
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.

Re: Question about option --output-prefix=

Reply #7
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


Re: Question about option --output-prefix=

Reply #9
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?

Code: [Select]
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