SendTo encoders.

Started by onj and updated by arfy on 2012/01/19.
Updated by Onj on 2013/05/04.
Updated yet again by Onj on 2013/05/24
Updated again again by Onj on 2017/07/31.
Yet another update by arfy on 2017/08/04, attempt to make the project self-contained, no need to pollute the windows/windows\system32 folders. Now user specific. Also include notes on the extra bat files provided, such as flc.bat
Further update by Onj on 2018-01-06, updating Lame and Flac encoders to latest.
Updated by Onj on 2024-07-18 after many years of not doing so.
Updated by Onj on 2025/08/02 with lots more info on bat files and a slimming down of the flac shortcuts and bat files.
Updated by Onj on 2026/05/24 with an installer, newer encoder binaries, the iPlayer fixer script and a few extra utility bat files.
Updated by Onj on 2026/05/31 so mp3 encoding supports flac input via ffmpeg when lame cannot read it directly.
Updated again by Onj on 2026/05/31 to replace the old Nero AAC encoder with ffmpeg's native AAC encoder, and remove unused libsndfile/lame32 files.

How to set up sendTo menu items for various encoding/decoding jobs.
Follow these instructions, substituting the command line for your encoder of choice, see below.
The easy way is to run install-sendto.cmd or install-sendto.ps1 from this folder. It copies the encoders folder to your user home directory, creates the SendTo shortcuts and adds %userprofile%\encoders to your user path.

If you'd rather do it manually, copy the encoders folder to your user home directory. %userprofile% on any windows should get you there. This method keeps things tidy, and doesn't need any modifications to the path environment variable, unless you'd like to make use of the extra utility bat files provided, see below.
Copy all the shortcuts in the shortcuts folder to your sendTo folder. This is found under :
%appdata%\Microsoft\Windows\SendTo

If for whatever reason these shortcuts don't work out of the box, follow these instructions to set things up manually.


For each exe file, right click and select create shortcut. this will give you a shortcut to <exe name> in your current directory. rename this to the name given for each exe file below, Then go into the properties for each shortcut, filling out the target field as given in the instructions. 
Finally, copy these shortcuts to your sendTo folder.
now, for the encoders.

flac: flac.exe (flac32.exe for windows 32-bit systems)

&Flac 2 Wav and delete:
%userprofile%\encoders\flac.exe -d --delete-input-file --keep-foreign-metadata-if-present -j 4

&Wav 2 Flac & delete:
%userprofile%\encoders\flac.exe -8 --delete-input-file -V -f --keep-foreign-metadata-if-present -j 4

Mp3: mp3.bat

note: only an mp3 encode option is given, as it's assumed most sound editors, etc, can read mp3 natively. The mp3 wrapper encodes normal wav input with lame directly, and uses ffmpeg to feed flac input to lame when lame cannot read the flac file itself.

mp&3 encode:
%userprofile%\encoders\mp3.bat

ogg encode: oggenc2.exe
note: again, only an ogg encode option is given, as it's assumed most sound editors, etc, can read ogg natively. Also, like lame, oggenc can take flac input directly and give you an ogg file.

&ogg encode:
%userprofile%\encoders\oggenc2.exe -q4

AAC encode: aac.bat

Shortcut property: %userprofile%\encoders\aac.bat

The bat file uses ffmpeg's native AAC encoder and writes an m4a file beside the source file.

Opus encode/decode

opusdec.exe opusenc.exe
Required bat files: OpDec.bat OpEnc.bat
shortcut for Opus decode: %userprofile%\encoders\opdec.bat
Shortcut for Opus encode: %userprofile%\encoders\OpEnc.bat

ffmpeg: ffmpeg.exe
FFMP&eg to M4A:
%userprofile%\encoders\fpg.bat

Note II: Sometimes you may get an unusual file that says it's m4a or mp4, but be unable to play it. Try using the above command on the file and it *may* fix it.

Notes on the utility bat files.

The following bat files are included as conveniences, particularly useful when working from cmd. To use these, add %userprofile%\encoders to your path. Here's what each file does.

Files in general:
file2mov.bat: Encodes the highlighted file to .mov if possible.
file2mp4.bat: Encodes the highlighted file to .mp4 if possible.
file2wav.bat: Encodes the highlighted file to wav. This works on all sorts of weird and wonderful things with no extension, random extensions and so on.
file+image2video.bat: Takes one image and one audio file, in either order, and makes a simple MP4 video.

flac:
flc.bat: encodes a single flac file at maximum compression.
flcr.bat: encode all wav or aiff files in the current directory, including subdirectories. 
flcwav.bat: Decodes all flac files in the current directory and subdirectories.

getiplayer:
gaud.bat: Uses getiplayer (installed separately) to download from BBC iPlayer, specifically used for grabbing audio-described content and no video. Outputs to .m4a.
gaudn.bat: Uses getiplayer (installed separately) to download from BBC iPlayer, specifically used for grabbing non-audio-described content and no video. Outputs to .m4a.
gvid.bat: Uses getiplayer (installed separately) to download from BBC iPlayer, specifically used for grabbing audio-described content with video. Outputs to .mp4.
gvidn.bat: Uses getiplayer (installed separately) to download non-audio-described content with video.
iplayerfixer.cmd: Tidies get_iplayer downloads into Show\Series N folders. Run iplayerfixer preview to see what it would do, iplayerfixer copy to copy files, or iplayerfixer with no option to move matching files.

MP3:
_mp3encode.cmd: helper used by the mp3 bat files. It sends flac input through ffmpeg, then pipes decoded wav audio to lame.
mp3.bat: encodes one or more files to mp3 with the same settings as the SendTo menu item.
mp3d.bat: encodes all wav and flac files in the current directory and subdirectories to mp3.
mp3del.bat: same as above, but deletes each input file only after that file encodes successfully... careful with this one!
mp3low.bat: encodes one or more files to mp3, at lower quality (64kbps)

AAC:
aac.bat: encodes one or more files to AAC in an m4a container using ffmpeg.

OGG:
ogg.bat: encodes a single file to ogg using the same settings as the SendTo menu item. 

Opus:
OpDec.bat: Decodes an Opus file to Wav.
opEnc.bat: Encodes a Wav file to Opus.

yt-dlp:
ydl.bat: Uses yt-dlp to download from a variety of sites. Simply give this a url in quotes for best performance. Will save video if possible.
ydldr.bat: Uses yt-dlp/youtube-dl to download audio while keeping the original downloaded media files.
ydln.bat: Uses yt-dlp to download from a variety of sites. Simply give this a url in quotes for best performance. Will save audio-only.
ydlndr.bat: Uses yt-dlp/youtube-dl to download audio-only and remove leftover video container files.
ydlup.bat: Updates yt-dlp to latest version.

Well, that's it, for now. feel free to tell us about any other encoders/decoders you'd like in here, and we'll see what can be done.

