Batch file to convert

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

Batch file to convert

esikcalabrese
Any suggestions in a batch file which would take 2 user defined variables to
convert an audio file?  I have drafted the below which so far does not work.


 

echo off

set /p filename = "Enter Unconverted File Name: "

set /p outputfilename= "Enter Converted File Name: "

cd "c:\ffmpeg\bin"

START ffmpeg -i %filename% %outputfilename:

pause

 

Kirk Calabrese, MA,CMT, Network+ Certified Professional

IT Consultant

 

_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Batch file to convert

Michael Koch
Am 27.09.2018 um 21:33 schrieb [hidden email]:

> Any suggestions in a batch file which would take 2 user defined variables to
> convert an audio file?  I have drafted the below which so far does not work.
>
>
>  
>
> echo off
>
> set /p filename = "Enter Unconverted File Name: "
>
> set /p outputfilename= "Enter Converted File Name: "
>
> cd "c:\ffmpeg\bin"
>
> START ffmpeg -i %filename% %outputfilename:
>
> pause
>
>  

after outputfilename, replace : by %

Michael

_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Batch file to convert

Michael Koch
Am 27.09.2018 um 22:30 schrieb Michael Koch:

> Am 27.09.2018 um 21:33 schrieb [hidden email]:
>> Any suggestions in a batch file which would take 2 user defined
>> variables to
>> convert an audio file?  I have drafted the below which so far does
>> not work.
>>
>>
>>
>> echo off
>>
>> set /p filename = "Enter Unconverted File Name: "
>>
>> set /p outputfilename= "Enter Converted File Name: "
>>
>> cd "c:\ffmpeg\bin"
>>
>> START ffmpeg -i %filename% %outputfilename:
>>
>> pause
>>
>
> after outputfilename, replace : by %

Is your input file in the c:/ffmpeg/bin directory?
If not, then ffmpeg won't find it.

If you have the input file in the same directory where you have the
batch file, remove the cd command and then write:

c:/ffmpeg/bin/ffmpeg -i %filename% %outputfilename%

Michael

_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Batch file to convert

esikcalabrese
Yes it is there.  I can convert by command line but just can't get the batch to work.  I replaced : with " and the screen flashed a 2nd command prompt flashed, closed and back to enter any key to continue.  Nothing happened.  

Kirk Calabrese, MA,CMT, Network+ Certified Professional
IT Consultant

-----Original Message-----
From: ffmpeg-user <[hidden email]> On Behalf Of Michael Koch
Sent: Thursday, September 27, 2018 4:42 PM
To: [hidden email]
Subject: Re: [FFmpeg-user] Batch file to convert

Am 27.09.2018 um 22:30 schrieb Michael Koch:

> Am 27.09.2018 um 21:33 schrieb [hidden email]:
>> Any suggestions in a batch file which would take 2 user defined
>> variables to convert an audio file?  I have drafted the below which
>> so far does not work.
>>
>>
>>
>> echo off
>>
>> set /p filename = "Enter Unconverted File Name: "
>>
>> set /p outputfilename= "Enter Converted File Name: "
>>
>> cd "c:\ffmpeg\bin"
>>
>> START ffmpeg -i %filename% %outputfilename:
>>
>> pause
>>
>
> after outputfilename, replace : by %

Is your input file in the c:/ffmpeg/bin directory?
If not, then ffmpeg won't find it.

If you have the input file in the same directory where you have the
batch file, remove the cd command and then write:

c:/ffmpeg/bin/ffmpeg -i %filename% %outputfilename%

Michael

_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".

_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Batch file to convert

Michael Koch
Am 27.09.2018 um 22:45 schrieb [hidden email]:
> Yes it is there.  I can convert by command line but just can't get the batch to work.  I replaced : with " and the screen flashed a 2nd command prompt flashed, closed and back to enter any key to continue.  Nothing happened.

please show the console output.

Michael
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Batch file to convert

esikcalabrese


 

Kirk Calabrese, MA,CMT, Network+ Certified Professional

IT Consultant

 

-----Original Message-----
From: ffmpeg-user <[hidden email]> On Behalf Of Michael Koch
Sent: Thursday, September 27, 2018 4:59 PM
To: [hidden email]
Subject: Re: [FFmpeg-user] Batch file to convert

 

Am 27.09.2018 um 22:45 schrieb  <mailto:[hidden email]> [hidden email]:

> Yes it is there.  I can convert by command line but just can't get the batch to work.  I replaced : with " and the screen flashed a 2nd command prompt flashed, closed and back to enter any key to continue.  Nothing happened.

 

please show the console output.

 

Michael

_______________________________________________

ffmpeg-user mailing list

 <mailto:[hidden email]> [hidden email]

 <http://ffmpeg.org/mailman/listinfo/ffmpeg-user> http://ffmpeg.org/mailman/listinfo/ffmpeg-user

 

To unsubscribe, visit link above, or email  <mailto:[hidden email]> [hidden email] with subject "unsubscribe".


_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".

image001.png (106K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Batch file to convert

Michael Koch
Am 28.09.2018 um 03:48 schrieb [hidden email]:
> please show the console output.

That's not enough. When you remove the "echo off" command, you will see
much more. Also it's possible to copy and paste the content of the
console window. Make a right click in the top line of the console
window, then "select all", then "copy".

Michael

--
**********************************************
   ASTRO ELECTRONIC   Dipl.-Ing. Michael Koch
        Raabestr. 43   37412 Herzberg
           www.astro-electronic.de
   Tel. +49 5521 854265   Fax +49 5521 854266
**********************************************

_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Batch file to convert

esikcalabrese
Thank you Michael:

Based on new information, I have revised the script with the following.  It seems to be working a bit better; however, still not there yet.  Below is the new script with output below:


set /p filename = "Enter Unconverted File Name: "
set /p outputfilename= "Enter Converted File Name: "
CALL "C:\ffmpeg\bin\ffmpeg.exe" "C:\ffmpeg\bin\ffmpeg -i %filename% %outputfilename%"
pause





C:\Users\Kirk Calabrese\Desktop>set /p filename = "Enter Unconverted File Name: "
Enter Unconverted File Name: Robinson.WAV

C:\Users\Kirk Calabrese\Desktop>set /p outputfilename= "Enter Converted File Name: "
Enter Converted File Name: robinsonconverted.wav

C:\Users\Kirk Calabrese\Desktop>CALL "C:\ffmpeg\bin\ffmpeg.exe" "C:\ffmpeg\bin\ffmpeg -i  robinsonconverted.wav"
ffmpeg version N-92058-gefb65abedf Copyright (c) 2000-2018 the FFmpeg developers
  built with gcc 8.2.1 (GCC) 20180813
  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth
  libavutil      56. 19.101 / 56. 19.101
  libavcodec     58. 31.100 / 58. 31.100
  libavformat    58. 18.102 / 58. 18.102
  libavdevice    58.  4.104 / 58.  4.104
  libavfilter     7. 33.100 /  7. 33.100
  libswscale      5.  2.100 /  5.  2.100
  libswresample   3.  2.100 /  3.  2.100
  libpostproc    55.  2.100 / 55.  2.100
Output #0, wav, to 'C:\ffmpeg\bin\ffmpeg -i  robinsonconverted.wav':
Output file #0 does not contain any stream

C:\Users\Kirk Calabrese\Desktop>pause
Press any key to continue . . .

Kirk Calabrese, MA,CMT, Network+ Certified Professional
IT Consultant

-----Original Message-----
From: ffmpeg-user <[hidden email]> On Behalf Of Michael Koch
Sent: Friday, September 28, 2018 3:20 AM
To: [hidden email]
Subject: Re: [FFmpeg-user] Batch file to convert

Am 28.09.2018 um 03:48 schrieb [hidden email]:
> please show the console output.

That's not enough. When you remove the "echo off" command, you will see much more. Also it's possible to copy and paste the content of the console window. Make a right click in the top line of the console window, then "select all", then "copy".

Michael

--
**********************************************
   ASTRO ELECTRONIC   Dipl.-Ing. Michael Koch
        Raabestr. 43   37412 Herzberg
           www.astro-electronic.de
   Tel. +49 5521 854265   Fax +49 5521 854266
**********************************************

_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email [hidden email] with subject "unsubscribe".

_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Batch file to convert

Michael Koch
Am 28.09.2018 um 15:20 schrieb [hidden email]:

> Thank you Michael:
>
> Based on new information, I have revised the script with the following.  It seems to be working a bit better; however, still not there yet.  Below is the new script with output below:
>
>
> set /p filename = "Enter Unconverted File Name: "
> set /p outputfilename= "Enter Converted File Name: "
> CALL "C:\ffmpeg\bin\ffmpeg.exe" "C:\ffmpeg\bin\ffmpeg -i %filename% %outputfilename%"
> pause
>
>
>
>
>
> C:\Users\Kirk Calabrese\Desktop>set /p filename = "Enter Unconverted File Name: "
> Enter Unconverted File Name: Robinson.WAV
>
> C:\Users\Kirk Calabrese\Desktop>set /p outputfilename= "Enter Converted File Name: "
> Enter Converted File Name: robinsonconverted.wav
>
> C:\Users\Kirk Calabrese\Desktop>CALL "C:\ffmpeg\bin\ffmpeg.exe" "C:\ffmpeg\bin\ffmpeg -i  robinsonconverted.wav"

As you can see here, the input filename is missing in the command string.
Try removing the space characters left and right of = in the set
commands. Please note that you have no space character left of = in the
second set command. This may be the difference why this line works.

Michael

_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Batch file to convert

esikcalabrese
Thanks Michael for the recommendation.  Spaces removed; however, same error.

set /p filename="Enter Unconverted File Name: "
set /p outputfilename="Enter Converted File Name: "
CALL "C:\ffmpeg\bin\ffmpeg.exe" "C:\ffmpeg\bin\ffmpeg -i %filename% %outputfilename%"
pause

Kirk Calabrese, MA,CMT, Network+ Certified Professional
IT Consultant

-----Original Message-----
From: ffmpeg-user <[hidden email]> On Behalf Of Michael Koch
Sent: Friday, September 28, 2018 9:47 AM
To: [hidden email]
Subject: Re: [FFmpeg-user] Batch file to convert

Am 28.09.2018 um 15:20 schrieb [hidden email]:

> Thank you Michael:
>
> Based on new information, I have revised the script with the following.  It seems to be working a bit better; however, still not there yet.  Below is the new script with output below:
>
>
> set /p filename = "Enter Unconverted File Name: "
> set /p outputfilename= "Enter Converted File Name: "
> CALL "C:\ffmpeg\bin\ffmpeg.exe" "C:\ffmpeg\bin\ffmpeg -i %filename% %outputfilename%"
> pause
>
>
>
>
>
> C:\Users\Kirk Calabrese\Desktop>set /p filename = "Enter Unconverted File Name: "
> Enter Unconverted File Name: Robinson.WAV
>
> C:\Users\Kirk Calabrese\Desktop>set /p outputfilename= "Enter Converted File Name: "
> Enter Converted File Name: robinsonconverted.wav
>
> C:\Users\Kirk Calabrese\Desktop>CALL "C:\ffmpeg\bin\ffmpeg.exe" "C:\ffmpeg\bin\ffmpeg -i  robinsonconverted.wav"

As you can see here, the input filename is missing in the command string.
Try removing the space characters left and right of = in the set commands. Please note that you have no space character left of = in the second set command. This may be the difference why this line works.

Michael

_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email [hidden email] with subject "unsubscribe".

_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Batch file to convert

Moritz Barsnick
In reply to this post by esikcalabrese
On Fri, Sep 28, 2018 at 09:20:22 -0400, [hidden email] wrote:
> C:\Users\Kirk Calabrese\Desktop>CALL "C:\ffmpeg\bin\ffmpeg.exe" "C:\ffmpeg\bin\ffmpeg -i  robinsonconverted.wav"
> ffmpeg version N-92058-gefb65abedf Copyright (c) 2000-2018 the FFmpeg developers
[...]
> Output #0, wav, to 'C:\ffmpeg\bin\ffmpeg -i  robinsonconverted.wav':

This is obviously not the desired effect.

Without using Windows right now, my guess would be that you should be
using:
CALL "C:\ffmpeg\bin\ffmpeg.exe" -i %filename% %outputfilename%

Moritz
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".