Page 1 of 1
[REQ] MP3 Encoding
Posted: 27 Mar 2023 22:24
by 3QQPcr
There exists a Directory Opus script that allows encoding of MP3 files, as shown in the attachment of this post.
Would it be possible to import this idea into XYplorer?
Additionally, is it possible for XYplorer to use text as a toolbar button (also illustrated in attachment)?
Thanks in advance.
Re: [REQ] MP3 Encoding
Posted: 27 Mar 2023 22:31
by highend
Write a simple script? A minimal bit of popupmenu() for the selection of what to do + calling ffmpeg to do the conversions...
Toolbars just with text but no visible button? Afaik not...
Re: [REQ] MP3 Encoding
Posted: 27 Mar 2023 22:36
by jupe
You can have text as toolbar button, just use text:REQUIREDTEXT as icon definition in CTB Icon field.
Re: [REQ] MP3 Encoding
Posted: 27 Mar 2023 22:54
by highend

Cool, never used that one (or... ever will but nonetheless)
Regarding a simple script, e.g.:
Adapt the path and fill in the ffmpeg options for v0 / v4 (too lazy to search them myself)...
Code: Select all
$ffmpeg = "D:\Tools\@Command Line Tools\ffmpeg\ffmpeg.exe";
end (exists($ffmpeg) != 1), "FFMPEG not found, aborted!";
$menu = <<<>>>
CBR 320 kbps (best)|-ar 44100 -ac 2 -b:a 320k
CBR 160 kbps (medium)|-ar 44100 -ac 2 -b:a 160k
CBR 128 kbps (web/mail)|-ar 44100 -ac 2 -b:a 128k
VBR v0|
VBR v4|
>>>;
$options = popupmenu($menu, 6:=<crlf>, 7:="|");
if ($options) {
$baseOptions = " -loglevel error -stats -y -vn ";
foreach($item, <get SelectedItemsPathNames>, <crlf>, "e") {
$dst = gpc($item, "path") . "\" . gpc($item, "base") . ".mp3";
run lax("$ffmpeg" -i "$item" $baseOptions $options "$dst");
}
}
Re: [REQ] MP3 Encoding
Posted: 27 Mar 2023 23:45
by 3QQPcr
jupe wrote: ↑27 Mar 2023 22:36
You can have text as toolbar button, just use
text:REQUIREDTEXT as icon definition in CTB Icon field.
Perfect, thanks!
highend wrote: ↑27 Mar 2023 22:54
Regarding a simple script, e.g.:
Thanks to you too for the quick response, your effort is appreciated as usual.
Re: [REQ] MP3 Encoding
Posted: 26 May 2023 20:25
by 3QQPcr
In case anyone is interested in this script using LAME encoder instead of FFMPEG:
Code: Select all
$lame = "C:...\LAME\lame.exe";
end (exists($lame) != 1), "LAME not found, aborted!";
$menu = <<<>>>
[WEB] CBR 320 kbps |-b 320
[CDDA] VBR V0|-V 0
>>>;
$options = popupmenu($menu, 6:=<crlf>, 7:="|");
if ($options) {
$baseOptions = " -loglevel error -stats -y -vn ";
foreach($item, <get SelectedItemsPathNames>, <crlf>, "e") {
$dst = gpc($item, "path") . "\" . gpc($item, "base") . ".mp3";
run lax("$lame" "$item" $options "$dst");
}
}
Thanks again to @highend!