VideoHelp Forum

Our website is made possible by displaying online advertisements to our visitors. Consider supporting us by disable your adblocker or try DVDFab Passkey and copy Blu-ray and DVDs! :)
+ Reply to Thread
Results 1 to 8 of 8
Thread
  1. Member loa909's Avatar
    Join Date
    Mar 2007
    Location
    United Kingdom
    Search Comp PM
    I have this script for enhancing the audio on movies or clips. so when I dropped a .mp4 clip on the script all i get is this below in the cmd window. anyone know why


    Code:
     Audio processing, video is copied losslesly
    C:\ffmpeg-3.4-win64-static\bin\ShapeMaker: No such file or directory
    Press any key to continue . . .

    this is the script I use

    @setlocal

    @echo Audio processing, video is copied losslesly

    @rem folder where ffmpeg.exe is located
    @set FF=C:\ffmpeg-3.4-win64-static\bin
    @set PATH=%FF%;%PATH%

    @set filename=%1

    @rem audio bitrate
    @set ab=192

    @set aproc="pan=stereo|FL < FL+1.414FC+0.5BL+0.5SL+0.25LFE|FR < FR+1.414FC+0.5BR+0.5SR+0.25LFE,dynaudnorm=p=1/sqrt(2):m=100=20"

    @ffmpeg.exe -hide_banner -v 32 -stats -y -i "%filename%" -c:v copy -af %aproc% -c:a aac -b:a %ab%k -f matroska "%~n1_dynaudio.mkv"

    @endlocal
    @pause
    Quote Quote  
  2. Member Budman1's Avatar
    Join Date
    Jul 2012
    Location
    NORTHWEST ILLINOIS, USA
    Search Comp PM
    Be careful in batch files with percent signs. Sometimes need 2 (%%) and sometimes not depending if its batch usage or program usage as part of ffmpeg line. %%A usage is also different than %1.

    Also removing the @ signs and allowing lines to show complete output may help with errors.
    Quote Quote  
  3. Check if your C:\ffmpeg-3.4-win64-static\bin exist and if there is ffmpeg.exe in this folder.
    Quote Quote  
  4. Member
    Join Date
    Aug 2010
    Location
    San Francisco, California
    Search PM
    Change this line in your script
    Code:
    @set filename=%1
    to
    Code:
    @set filename=%~1
    and see if that helps.
    Quote Quote  
  5. Member loa909's Avatar
    Join Date
    Mar 2007
    Location
    United Kingdom
    Search Comp PM
    Originally Posted by Budman1 View Post
    Be careful in batch files with percent signs. Sometimes need 2 (%%) and sometimes not depending if its batch usage or program usage as part of ffmpeg line. %%A usage is also different than %1.

    Also removing the @ signs and allowing lines to show complete output may help with errors.
    I am a bit confused with this above I did remove all @ signs. but got a load of junk stuff


    pandy
    Re: ffmpeg help not working

    Check if your C:\ffmpeg-3.4-win64-static\bin exist and if there is ffmpeg.exe in this folder.

    yes ffmpeg.exe is in that bin folder


    JVRaines
    Re: ffmpeg help not working

    Change this line in your script
    Code:
    @set filename=%1
    to
    Code:
    @set filename=%~1
    and see if that helps.

    I cant see how to make that symbol @set filename=%~1 after the % sign I think its called tidle not sure now


    EDIT: Silly me its LSHIFT and the # key like this ~ I just added that ~ symbol like you said between the % and the 1 so its like this @set filename=%~1

    now it works seem weird to me as it worked before that ~ was there, but its working now

    thanks so much
    Last edited by loa909; 9th Jul 2018 at 09:49.
    Quote Quote  
  6. Originally Posted by loa909 View Post

    pandy
    Re: ffmpeg help not working

    Check if your C:\ffmpeg-3.4-win64-static\bin exist and if there is ffmpeg.exe in this folder.

    yes ffmpeg.exe is in that bin folder
    My bad - seem this is issue with name - seem there is forbidden character in name

    Originally Posted by loa909 View Post

    I cant see how to make that symbol @set filename=%~1 after the % sign I think its called tidle not sure now


    EDIT: Silly me its LSHIFT and the # key like this ~ I just added that ~ symbol like you said between the % and the 1 so its like this @set filename=%~1

    now it works seem weird to me as it worked before that ~ was there, but its working now

    thanks so much
    Next time just copy (Ctrl+C) and paste (Ctrl+V)
    Quote Quote  
  7. Member
    Join Date
    Aug 2010
    Location
    San Francisco, California
    Search PM
    Originally Posted by loa909 View Post
    EDIT: Silly me its LSHIFT and the # key like this ~ I just added that ~ symbol like you said between the % and the 1 so its like this @set filename=%~1

    now it works seem weird to me as it worked before that ~ was there, but its working now

    thanks so much
    You're welcome. Here's why it works: If you drag-and-drop a file on this script and there are any spaces in the pathname, then Windows will surround the value with quote marks. Since you are also putting quotes around %filename% in the call to ffmpeg, you will end up with doubled quotes on each side, like this
    ""C:\Users\Bozo\Desktop\My Lovely Video.mp4""
    The doubled quotes are treated as empty strings, so the pathname is unquoted and ffmpeg breaks it up on the spaces. Thus, it sees only "C:\Users\Bozo\Desktop\My" as the input file.

    Using the tilda in %~1 tells the command processor to remove any surrounding quotes from the parameter. Then, it becomes properly quoted in your call to ffmpeg.
    Quote Quote  
  8. Member loa909's Avatar
    Join Date
    Mar 2007
    Location
    United Kingdom
    Search Comp PM
    well many thanks to all of your replies but now I have added that symbol ~ its working fine.
    Quote Quote  



Similar Threads