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, replaced the old Nero AAC encoder with ffmpeg's native AAC encoder, and removed unused libsndfile/lame32 files.
Updated by Onj on 2026/06/01 so gaud.bat and gaudn.bat download to the user's SendTo\iPlayer folder and automatically run the iPlayer fixer afterwards. YouTube helper scripts now download to the user's SendTo\YouTube folder, with path.txt added so iPlayer and YouTube helper output folders can be changed in one place.
Updated by Onj on 2026/06/03 so the installer preserves an existing path.txt during updates, removed the old FFMPeg to M4A option because AAC encode now creates m4a files correctly, made file2mp4.bat and file2mov.bat try stream-copy remux before GPU/CPU H.264 transcoding, updated file+image2video.bat to use GPU/CPU H.264 fallback while preserving image aspect ratio, added update-sendto.cmd with SHA-256-verified updates via https://3.onj.me/programs/.sendto.json, removed placeholder sha256/size values from installed package metadata, documented urlgrab.bat and vgmstr.bat, renamed the bundled downloader from youtube-dl.exe to yt-dlp.exe, and verified the bundled yt-dlp.exe binary was current at release time.
Updated by Onj on 2026/06/04 so the installer removes stale files from older installs, including qtaacenc.exe, neroAacEnc.exe, libsndfile-1.dll, the old libsndfile directory, and old flcnm/flcrnm/flcwavnm helper bat files. Added Check-BundledEncoderUpdates.ps1 as a release-time update check for bundled encoders, updated vgmstream to r2117 using vgmstream-cli.exe, and made gvid.bat/gvidn.bat use the IPLAYER_DIR value from path.txt. yt-dlp.exe was checked for updates before release.

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 %userprofile%\encoders\path.txt already exists, the installer leaves it alone so your download folder choices are not overwritten by updates.

To update later, run update-sendto.cmd from this folder or from %userprofile%\encoders. The updater checks the current server manifest, tells you if a newer SendTo package is available, and asks before downloading or installing anything. It requires 7-Zip to extract the .7z package.

Before publishing a new package, run Check-BundledEncoderUpdates.ps1 from this folder. It checks the bundled encoder versions, updates yt-dlp.exe, and writes a report for the release.

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

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.

Shared download paths:
path.txt: Sets shared output folders for helper scripts that download files. By default, YouTube helpers use %userprofile%\SendTo\YouTube and iPlayer audio helpers use %userprofile%\SendTo\iPlayer. Edit path.txt once if you want those downloads somewhere else. The bat files create the folders automatically if they do not already exist.
_loadpaths.cmd: Internal helper used by the bat files to read path.txt.
.sendto.json: Internal installed version information used by update-sendto.cmd. The server manifest at https://3.onj.me/programs/.sendto.json contains the current archive URL, size and SHA-256.
update-sendto.cmd/update-sendto.ps1: Checks for a newer SendTo package, verifies it and installs it if you agree.

Files in general:
file2mov.bat: Converts one or more highlighted files to .mov if possible, including .webm files. It first tries a stream-copy remux, which is fast and does not re-encode. If the original audio/video streams cannot be copied into a mov container, it tries GPU H.264 encoders, then falls back to CPU H.264/AAC.
file2mp4.bat: Converts one or more highlighted files to .mp4 if possible, including .webm files. It first tries a stream-copy remux, which is fast and does not re-encode. If the original audio/video streams cannot be copied into an mp4 container, it tries GPU H.264 encoders, then falls back to CPU H.264/AAC.
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. It tries GPU H.264 encoders first, falls back to CPU H.264 if needed, writes AAC audio, and pads the image to 1280x720 without stretching it.
urlgrab.bat: Uses ffmpeg to copy an online media URL or stream into output.mp4 where possible. This is a quick capture/remux helper, not a downloader for every website.
_video2container.cmd: Internal helper used by file2mp4.bat and file2mov.bat for remux, GPU encode and CPU fallback behavior.

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 the IPLAYER_DIR value from path.txt as .m4a, then runs the iPlayer fixer to normalise names and arrange Show\Series N folders.
gaudn.bat: Uses getiplayer (installed separately) to download from BBC iPlayer, specifically used for grabbing non-audio-described content and no video. Outputs to the IPLAYER_DIR value from path.txt as .m4a, then runs the iPlayer fixer to normalise names and arrange Show\Series N folders.
gvid.bat: Uses getiplayer (installed separately) to download from BBC iPlayer, specifically used for grabbing audio-described content with video. Outputs to the IPLAYER_DIR value from path.txt.
gvidn.bat: Uses getiplayer (installed separately) to download non-audio-described content with video. Outputs to the IPLAYER_DIR value from path.txt.
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.

vgmstream:
vgmstreamer.bat: Uses vgmstream-cli.exe to decode one selected supported game-audio file to wav.
vgmstr.bat: Uses vgmstream-cli.exe to decode supported game-audio files in the current folder tree to wav.

yt-dlp:
The bundled downloader executable is yt-dlp.exe.
ydl.bat: Uses yt-dlp.exe to download from a variety of sites. Simply give this a url in quotes for best performance. It extracts audio and keeps the original downloaded media where yt-dlp produces one.
ydldr.bat: Uses yt-dlp.exe to download audio while keeping the original downloaded media files.
ydln.bat: Uses yt-dlp.exe to download from a variety of sites. Simply give this a url in quotes for best performance. It extracts audio-only and removes leftover video container files.
ydlndr.bat: Uses yt-dlp.exe to download audio-only and remove leftover video container files.
ydlup.bat: Updates yt-dlp.exe to latest version.

The YouTube helper scripts save downloads to the YOUTUBE_DIR value in path.txt. The iPlayer audio helper scripts save downloads to the IPLAYER_DIR value in path.txt. Edit path.txt if you want a different location.

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.

