Cmd.exe and Internal Commands: some help with pipe

English support forum

Moderators: white, Hacker, petermad, Stefan2

Post Reply
Axis
Junior Member
Junior Member
Posts: 88
Joined: 2015-07-14, 18:53 UTC

Cmd.exe and Internal Commands: some help with pipe

Post by *Axis »

Hi to all.

This is working fine with command line (cmd.exe):
ffmpeg.exe -i "y:\videos\video.mkv" -map 0:a:0 -f wav -acodec pcm_f32le -ac 2 - | qaac64.exe --cvbr 192 --quality 2 --ignorelength - -o "y:\audio\track.m4a"


It doesn't work with TC's internal command (using Start Menu), e.g.:


Command:
cmd.exe /C ""%commander_path%\(Tools\ffmpeg\ffmpeg.exe""

Parameters:
?-i %n -map 0:a:0 -f wav -acodec pcm_f32le -ac 2 - | "%%commander_path%%\(Tools\qaac64.exe"--cvbr 192 --quality 2 --ignorelength - -o "y:\audio\track.m4a"


The console window says:
'"C:\(TCM)\(Tools\ffmpeg\ffmpeg.exe"" -i Video.mkv -map 0:a:0 -f wav -acodec pcm_f32le -ac 2 - | "C:\' is not recognized as an internal or external command, operable program or batch file.


What's the problem here? I tried other variants but nothing seems to help.


Many thanks.
User avatar
petermad
Power Member
Power Member
Posts: 14808
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Post by *petermad »

2Axis

Try and replace %n with %P%N
Put a space between between "%%commander_path%%\(Tools\qaac64.exe" and --cvbr
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Axis
Junior Member
Junior Member
Posts: 88
Joined: 2015-07-14, 18:53 UTC

Post by *Axis »

Try that:

Command:
cmd.exe /C ""%commander_path%\(Tools\ffmpeg\ffmpeg.exe""

Parameters:
?-i %P%N -map 0:a:0 -f wav -acodec pcm_f32le -ac 2 - | "%%commander_path%%\(Tools\qaac64.exe" --cvbr 192 --quality 2 --ignorelength - -o "y:\audio\track.m4a"


Same error message (in console window):

'"C:\(TCM)\(Tools\ffmpeg\ffmpeg.exe"" -i y:\videos\Video.mkv -map 0:a:0 -f wav -acodec pcm_f32le -ac 2 - | "C:\' is not recognized as an internal or external command, operable program or batch file.


Thanks
User avatar
Dalai
Power Member
Power Member
Posts: 9388
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Post by *Dalai »

CMD expects the whole command to be enclosed in quotes when /C (or /K) is used. You can do that by passing all parameters via the parameters field, but I think it's better to launch ffmpeg.exe directly instead.

Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
Axis
Junior Member
Junior Member
Posts: 88
Joined: 2015-07-14, 18:53 UTC

Post by *Axis »

Dalai wrote:CMD expects the whole command to be enclosed in quotes when /C (or /K) is used.
It's strange because the following internal command works fine:

Command:
cmd.exe /k ""%commander_path%\(Tools\ffmpeg\ffmpeg.exe""


Parameters:
?-f concat -i %F -c copy file 'output.%E'


Thanks
User avatar
nsp
Power Member
Power Member
Posts: 1805
Joined: 2005-12-04, 08:39 UTC
Location: Lyon (FRANCE)
Contact:

Re: Cmd.exe and Internal Commands: some help with pipe

Post by *nsp »

Axis wrote:Hi to all.

This is working fine with command line (cmd.exe):
ffmpeg.exe -i "y:\videos\video.mkv" -map 0:a:0 -f wav -acodec pcm_f32le -ac 2 - | qaac64.exe --cvbr 192 --quality 2 --ignorelength - -o "y:\audio\track.m4a"


It doesn't work with TC's internal command (using Start Menu), e.g.:


Command:
cmd.exe /C ""%commander_path%\(Tools\ffmpeg\ffmpeg.exe""

Parameters:
?-i %n -map 0:a:0 -f wav -acodec pcm_f32le -ac 2 - | "%%commander_path%%\(Tools\qaac64.exe"--cvbr 192 --quality 2 --ignorelength - -o "y:\audio\track.m4a"


The console window says:
'"C:\(TCM)\(Tools\ffmpeg\ffmpeg.exe"" -i Video.mkv -map 0:a:0 -f wav -acodec pcm_f32le -ac 2 - | "C:\' is not recognized as an internal or external command, operable program or batch file.


What's the problem here? I tried other variants but nothing seems to help.


Many thanks.
The problem is that the Pipe is not enclosed in the quotes.
Even if it not a solution using TC only, you can use TCBL to build an intermediate bat file.
You can use an ini section

Code: Select all

[Convert2m4a]
cmd="%commander_path%\(Tools\ffmpeg\ffmpeg.exe" -i "$f" -map 0:a:0 -f wav -acodec pcm_f32le -ac 2 - | "%commander_path%\(Tools\qaac64.exe" --cvbr 192 --quality 2 --ignorelength - -o "y:\audio\$z.m4a"
and use a command like this

Code: Select all

command: %commander_path%\(Tools\TCBL\tcbl.exe
parameters: -qei %L Convert2m4a
This also work if you select many files at once..
Post Reply