[REQ] MP3 Encoding

Features wanted...
Post Reply
3QQPcr
Posts: 50
Joined: 01 Feb 2022 04:52

[REQ] MP3 Encoding

Post 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.
Attachments
flactomp3.png
flactomp3.png (374.29 KiB) Viewed 385 times

highend
Posts: 13274
Joined: 06 Feb 2011 00:33

Re: [REQ] MP3 Encoding

Post 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...
One of my scripts helped you out? Please donate via Paypal

jupe
Posts: 2757
Joined: 20 Oct 2017 21:14
Location: Win10 22H2 120dpi

Re: [REQ] MP3 Encoding

Post by jupe »

You can have text as toolbar button, just use text:REQUIREDTEXT as icon definition in CTB Icon field.

highend
Posts: 13274
Joined: 06 Feb 2011 00:33

Re: [REQ] MP3 Encoding

Post by highend »

:tup: 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");
        }
    }
One of my scripts helped you out? Please donate via Paypal

3QQPcr
Posts: 50
Joined: 01 Feb 2022 04:52

Re: [REQ] MP3 Encoding

Post 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.

3QQPcr
Posts: 50
Joined: 01 Feb 2022 04:52

Re: [REQ] MP3 Encoding

Post 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!

Post Reply