• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

cfexecute question

Contributor ,
Dec 22, 2020 Dec 22, 2020

Copy link to clipboard

Copied

I am trying to get cfexecute to work. From a command line within drive d\lame on a Windows server if I run:

lame -b 128 "Abba - Dancing Queen.mp3" "Abba - Dancing Queen 128.mpe"

The file converts as expected.

From CF2016 if I run:

<cfexecute name="d:\lame\lame.exe"
arguments="-b 128 ""Abba - Dancing Queen.mp3"" ""Abba - Dancing Queen 128.mp3"""
outputFile = "D:\lame\output.txt"
>

Nothing happens. Output.txt is blank and the file doesn't convert. Doesn't even seem like lame.exe even executes.

 

Suggestions?  (insert lame song jokes here)

 

Thanks, Gary

Views

487

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Dec 23, 2020 Dec 23, 2020

Hi ghanna1

I followed these steps:

  1. downloaded the 64-bit Lame library from https://www.rarewares.org/mp3-lame-bundle.php and unpacked it to my D drive.
  2. downloaded a test MP3 at https://file-examples.com/index.php/sample-audio-files/sample-mp3-download/, and renamed the file to Abba - Dancing Queen.mp3
  3. ran the following code

 

<cfexecute name="d:\lame\lame.exe" arguments='-b 128 "d:\lame\Abba - Dancing Queen.mp3" "d:\lame\Abba - Dancing Queen 128.mp3"'></cfexecute>

 

It works as expected.

 

 

 

...

Votes

Translate

Translate
Community Expert ,
Dec 22, 2020 Dec 22, 2020

Copy link to clipboard

Copied

Well, take it one step at a time.
  1. You have left off a timeout. I think you'll find that's needed, even just timeout=1
  2. What if you leave off the arguments? Do you then get any output?
  3. In your args you have escaped double-quotes. That MAY work, but try also just single quotes for them, or double quotes for them and single quotes for the entire arguments value
  4. Finally, if all else fails, 
Try:
<cfexecute name="c:\windows\system32\cmd.exe" arguments="/c d:\lame\lame.exe -b 128 'Abba - Dancing Queen.mp3' 'Abba - Dancing Queen 128.mp3'" outputFile = "D:\lame\output.txt" timeout="10"/>
 
Let us know how any go, or if none.


/Charlie (troubleshooter, carehart.org)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 22, 2020 Dec 22, 2020

Copy link to clipboard

Copied

<cfexecute name="d:\lame\lame.exe"
           arguments='-b 128 "d:\lame\Abba - Dancing Queen.mp3" 
                      "d:\lame\Abba - Dancing Queen 128.mp3"'>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Dec 22, 2020 Dec 22, 2020

Copy link to clipboard

Copied

As @BKBK is showing, use fully qualified paths for all files in your arguments.

One small correction, the destination filename should have an "mpe" extension. I think @ghanna1 made a typo in the CF version of what they're trying to do. The "mpe" was the typo.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Dec 22, 2020 Dec 22, 2020

Copy link to clipboard

Copied

Actually, it supposed to be .mp3 on both. 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Dec 22, 2020 Dec 22, 2020

Copy link to clipboard

Copied

Thanks for the suggestions. I tried BKBK's:

<cfexecute name="d:\lame\lame.exe"
 arguments='-b 128 "d:\lame\Abba - Dancing Queen.mp3" 
"d:\lame\Abba - Dancing Queen 128.mp3"'

I also tried adding timeout as Charlie suggested.

<cfexecute name="d:\lame\lame.exe"
arguments='-b 128 "d:\lame\Abba - Dancing Queen.mp3" 
"d:\lame\Abba - Dancing Queen 128.mp3"'
timeout = "20"
outputFile = "D:\lame\output.txt"> 

I also tried Charlie's suggestion of running CMD:

<cfexecute name="c:\windows\system32\cmd.exe" arguments='/c d:\lame\lame.exe -b 128 "Abba - Dancing Queen.mp3" "Abba - Dancing Queen 128.mp3" ' 
timeout = "20"
outputFile = "D:\lame\output.txt">

Still no luck. Even if the arguments are wrong Lame.exe returns something. If CF is launching the exe shouldn't I see something besides an empty output.txt file created? I thought it would capture whatever lame.exe outputted. 

 

Gary

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Dec 22, 2020 Dec 22, 2020

Copy link to clipboard

Copied

Lame.exe only requires quotation marks if there are spaces in the input or output file. For a test, I renamed the input file to queen.mp3 and the output file to queen128.mp3. I ran the command line as:

lame -b 128 queen.mp3 queen128.mp3

which worked as expected.

Screen Shot 2020-12-22 at 7.32.56 PM.png

I tried the same argument without quotes in CF and it works. So it's something wrong in how we're creating the argument with quotation marks. 

<cfexecute name="d:\lame\lame.exe"
arguments="-b 128 d:\lame\queen.mp3 d:\lame\queen128.mp3"> 

 

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 23, 2020 Dec 23, 2020

Copy link to clipboard

Copied

Hi ghanna1

I followed these steps:

  1. downloaded the 64-bit Lame library from https://www.rarewares.org/mp3-lame-bundle.php and unpacked it to my D drive.
  2. downloaded a test MP3 at https://file-examples.com/index.php/sample-audio-files/sample-mp3-download/, and renamed the file to Abba - Dancing Queen.mp3
  3. ran the following code

 

<cfexecute name="d:\lame\lame.exe" arguments='-b 128 "d:\lame\Abba - Dancing Queen.mp3" "d:\lame\Abba - Dancing Queen 128.mp3"'></cfexecute>

 

It works as expected.

 

 

 

 

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Dec 23, 2020 Dec 23, 2020

Copy link to clipboard

Copied

LATEST

BKBK,

Thanks for going through all that effort! I really appreciate it. I must have fat-fingered something the first time I tried your example. I also got it to work late last night using: 

<cfexecute name="d:\lame\lame.exe"
arguments="-b 128 ""d:\lame\ABBA - Dancing Queen.mp3"" ""d:\lame\Abba - Dancing Queen128.mp3""" />

 

Appreciate everyone's help!

 

Gary

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation