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: Command-Line Decoder Wrapper (Read 28478 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Command-Line Decoder Wrapper

Summary
This component allows you to comfortably play or convert any audio format with a standalone command-line decoder available, including various exotic formats that do not have native foobar2000 decoder components.
Check the documentation link below for more details.

Links
Home page
Documentation

Have fun.
Microsoft Windows: We can't script here, this is bat country.

Command-Line Decoder Wrapper

Reply #1
Attached: configuration file (work-in-progress), thanks to Case
Currently supported formats:
* LA
* LPAC

You can import this thru the preferences page.
Microsoft Windows: We can't script here, this is bat country.

Command-Line Decoder Wrapper

Reply #2
Thanks a lot. No problems playing LA-files.
BUT, I have this habit of putting the version number in the file name like this: la (Lossless Audio Compressor 0.4b).exe.
Where as la.exe -cout %s (with the binary renamed accordingly of course) works just fine, "la (Lossless Audio Compressor 0.4b).exe" -cout %s does not. Entering the full path of the binary, "D:\Storage\Media\Binaries\la (Lossless Audio Compressor 0.4b).exe" -cout %s seems to be the only way to get it working.

Command-Line Decoder Wrapper

Reply #3
New version out, misbehavior on space in exe file name fixed. Thanks for reporting.
Microsoft Windows: We can't script here, this is bat country.

Command-Line Decoder Wrapper

Reply #4
Hi!

Thank you for versatile decoder. Curious if this could be somehow helpful in direct playing of DTS-HD and TrueHD audio files?
The command line for piped decoding is eac3to input.dtshd stdout.wav
The command line for non-piped decoding is eac3to %s %d this i'm afraid however generates a HUGE temp file in the source folder (expectingly 10-20gb in size) which also takes quite a long time before playbak start depending on the drive throughput. I want to avoid this and rather play via pipe ie. no temp wav files creating ....any thoughts..............

 

Command-Line Decoder Wrapper

Reply #5
Thanks for this component! 
Is it possible to add option to write mp4 tags?

The command line for non-piped decoding is eac3to %s %d this i'm afraid however generates a HUGE temp file in the source folder (expectingly 10-20gb in size) which also takes quite a long time before playbak start depending on the drive throughput. I want to avoid this and rather play via pipe ie. no temp wav files creating ....any thoughts..............

I have no problems using eac3to.exe %s stdout.wav for dtshd 24/96 playback.

Command-Line Decoder Wrapper

Reply #6
Is it possible to add option to write mp4 tags?

If there's a scenario where that makes sense (MP4 files that are not decoded by the native MP4 handler - what file type exactly?), sure why not.
Microsoft Windows: We can't script here, this is bat country.

Command-Line Decoder Wrapper

Reply #7
MP4 files that are not decoded by the native MP4 handler - what file type exactly?

MPEG-4 ALS in MP4 container.

Command-Line Decoder Wrapper

Reply #8
Split.
Microsoft Windows: We can't script here, this is bat country.

Command-Line Decoder Wrapper

Reply #9
I wanted to provide example for decoding two files simultaneously, hopefully as some sort of temporal solution to a thread asking for lossywav correction playback. Then noticed that this component, same as converter, doesn't allow using title formatting functions for input line. Because of that I created batch file (soxdec.cmd):

Code: [Select]
@echo off
set input=%~1
sox -m %1 "%input:lossy.flac=lwcdf.flac%" -t .wav -

and instruct decoder to: "soxdec.cmd %s"

It works fine but sox process isn't terminated on playback stop.

If I use sox directly in decoder input line: "sox %s -t .wav -" then decoder closes sox process as expected.

Command-Line Decoder Wrapper

Reply #10
I'm not sure weather this issue is caused by foo_input_exe or foo_dsp_effect so I post it in both threads, maybe authors will find what can be wrong.
My DSP chain looks like this: Skip Silence - > convert 5.1 to stereo -> convert mono to stereo -> playback rate shift. Playback Rate Shift requires 2ch signal. So used DSP effects provide such signal.
When I play 6ch FLAC encoded from DVD-A everything works OK. Signal is downmixed and I can use PRS actively or just unused, but present in chain. But when I play audio from video files and I use foo_input_exe to wrap signal decompressed by FFMPEG.exe from that files, then 6ch audio decoded from .VOB file generates error: "Unrecoverable playback error: Illegal number of channels". It means that Playback Rate Shift gets 6ch audio instead of 2ch - like "convert 5.1 to stereo" wasn't working or something like this... Why? What can I do to avoid this error in such playback configuration?

Command-Line Decoder Wrapper

Reply #11
The reason is ffmpeg. Not foo_input_exe, not foo_dsp_effect and not "convert 5.1 to stereo dsp".
You can downmix with ffmpeg itself using -ac 2 or -channel_layout downmix
E.g.: ffmpeg.exe -i %s -vn -ac 2 -f wav -
        ffmpeg.exe -i %s -vn -channel_layout downmix -f wav -

Command-Line Decoder Wrapper

Reply #12
Hm... I thought that it goes like this:
1. foobar sends command to ffmpeg to simply create PCM wav on my HDD
2. ffmpeg decodes audio, creates wav and lets foobar open it (sends output file name and path to foobar)
3. foobar simply plays wav from my HDD - like every other file - eg 6ch FLAC from DVD-A.
4. this implies that file (to be exact - decoded bitstream with audio) goes through consecutive chain of DSPs - like every other file - eg 6ch FLAC from DVD-A.
5. this implies that before Playback Rate Shift DSP is used, decoded audio should be 2ch bistream (downmixed from 5.1)...

Then why I have to downmix to 2ch before wav is opened in foobar? Or maybe I am wrong and something works differently when ffmpeg or foo_input_exe is used?

Command-Line Decoder Wrapper

Reply #13
Looks like "Convert 5.1 to stereo" plugin doesn't recognize the audio as 5.1.

I created a file with "6: FL FR FC LFE SL SR" channel mask and indeed it wasn't downmixed. A file with "6: FL FR FC LFE BL BR" channel mask was recognized as 5.1.

So, "Convert 5.1 to stereo" plugin doesn't like 5.1 with side channels.

Command-Line Decoder Wrapper

Reply #14
Hm... Maybe ffmpeg uses that "wrong" channel masks in output wav file... Then I have to choose between loading PRS to chain each time I want to use it or remove multichannel functionality in audio from video files by "hardcoding" it with appropiate command line switch in ffmpeg... Or - maybe I should post another "Request post" on foobar forum  . "Convert 5.1 to stereo" is part of standard DSP array, isn't it ?

As foobar reads:
"Standard DSPs for foobar2000
© 2002-2012 Peter Pawlowski
Advanced limiter by MTRH
5.1 Downmix by Garf".

Command-Line Decoder Wrapper

Reply #15
EpicForever: Although Rollin's suggestion works just fine for ffmpeg, you could give foo_channel_mixer a try as a permanent solution for Playback Rate Shift. Works in all cases; 6ch FLACs decoded by foobar itself and 6ch movie-clips by ffmpeg. I've been happily using foo_channel_mixer and Pitch Shift (foo_dsp_effect) for some time now myself.

Command-Line Decoder Wrapper

Reply #16
Channel order handling in downmix DSP changed in foobar2000 1.2.3.
Microsoft Windows: We can't script here, this is bat country.

Command-Line Decoder Wrapper

Reply #17
Peter - thank you for permanent (I hope  )workaround, CoRoNe - thank you for suggestion.

Command-Line Decoder Wrapper

Reply #18
Good morning:

I have problems with packMP3 files (*.PMP): I can't seem to configure well the Command-Line Decoder Wraper, for I can't hear  nothing when I open a .PMP. Here is my configuration:





(packMP3.exe is on the main folder of foobar)
A zero-bytes file is created when I try to play the archive. Also, I get this error within a pop-up window:

Unable to open item for playback (Unexpected decoding failure, no output file was created)

Can anybody help me? Excuse me if this is no place for this kind of questions!

Command-Line Decoder Wrapper

Reply #19
Try decode command:
Code: [Select]
packMP3.exe -

Command-Line Decoder Wrapper

Reply #20
mariner, you need to create a simple wrapper batch file to be able to use packMP3. Put this command in the batch file (you can call it for example packmp3.cmd): @if not ."%~2" == ."" packmp3.exe -np - < "%~1" > "%~2"
and use this as Decode command: packmp3.cmd %s %d

Command-Line Decoder Wrapper

Reply #21
mariner, you need to create a simple wrapper batch file to be able to use packMP3. Put this command in the batch file (you can call it for example packmp3.cmd): @if not ."%~2" == ."" packmp3.exe -np - < "%~1" > "%~2"
and use this as Decode command: packmp3.cmd %s %d


Thanks for your responses, lvqcl & Case. And yes, that's how it finally works ok! I feel that it's very slow when processing songs (a big buffer timing helps a lot, but i refer to the whole process of decoding and the first song to play). But I suppose this is the fastest it can be, so there's nothing to worry about. I think I'm gonna compress most of my discography with packMP3, in order to save space.

Thank you very much, I was going mad with the syntax thing!

Command-Line Decoder Wrapper

Reply #22
How can I use folder foobar2000/encoders for decoders (for portable mode without full path)?

Command-Line Decoder Wrapper

Reply #23
I put ffmpeg.exe next to foobar2000.exe and it's solved the problem.

Re: Command-Line Decoder Wrapper

Reply #24
With mpv
Code: [Select]
mpv.exe %s -of=wav -o -