RapTure Posted October 24, 2012 Share Posted October 24, 2012 This is one of my first times coding and definitely my first time using autoit. I keep getting this error whenever I try to test my script. >"C:\Program Files (x86)\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "C:\Users\Jeremiah\Documents\FFMpegEncoder.au3" C:\Users\Jeremiah\Documents\FFMpegEncoder.au3 (9) : ==> Missing separator character after keyword.: Global $encoder = divx Global $encoder = divx^ ERROR >Exit code: 1 Time: 0.212 Sometimes it will throw a different variable with the same error. My script: ;# FFMpeg Encode Script v1 #RequireAdmin ;##### CONFIG STARTS HERE ##### Global $fps 60 Global $encoder divx Global $threads 2 Global $audiobitrate 128k Global $ffmpeg "ffmpeg.exe" ;##### CONFIG ENDS HERE ##### ;----------------------------------------------------------------------------- ;----------------------------- DO NOT EDIT BELOW ----------------------------- ;----------------------------------------------------------------------------- Global $flvname Global $videoout Global $soundout While 1 ;Ask user for .flv file name $flvname = InputBox(“FFMpeg Encoder”, “What is the name of the .flv that you wish to encode? Make sure it’s in the same directory as FFMpeg and the FFMpeg Encoder”) ;Ask for Video Output $videoout = InputBox(“FFMpeg Encoder”, “What would you like the video file to be named?”) ;Ask for Audio Output $audioout = InputBox("FFMpeg Encoder", "What would you like your audio file to be named?") ;Build FFMpeg Video Params Line Global $ffmpegparams = “-i “ & $flvname & “.flv -c:a libmp3lame -b:a “ & $audiobitrate & “ -sameq -r “ & $fps & “ -vtag “ & $encoder & “ -threads “ & $threads & ‘“‘ & $videoout & ‘“.avi" ;Start video encode ShellExecute($ffmpeg, $ffmpegparams) ;Build FFMpeg Audio Params Line Global $audioparams = "-i " & $flvname & ".flv -b:a " & $audiobitrate & " " & $soundout & ".mp3" ;Start audio encode ShellExecute($ffmpeg, $audioparams) ;Close script (Exit) Exit WEnd Again this is my first time coding autoit so I am sure it is a silly little basic error, however any help is greatly appreciated. Link to comment Share on other sites More sharing options...
jdelaney Posted October 24, 2012 Share Posted October 24, 2012 (edited) must set the value of variables with an '=' Global $fps = 60 Global $encoder = "divx" Global $threads = 2 Global $audiobitrate = "128k" Global $ffmpeg = "ffmpeg.exe" Edited October 24, 2012 by jdelaney IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted October 24, 2012 Moderators Share Posted October 24, 2012 RapTure,Welcome to the AutoIt forum. A few syntax errors there. You need an "=" to assign values to a variable - and non-numeric values need to be enclosed in "". There were also some problems with the quotes in the $ffmpegparams line. See if this is any better - at least it does not error when I test. ;# FFMpeg Encode Script v1 #RequireAdmin ;##### CONFIG STARTS HERE ##### Global $fps = 60 Global $encoder = "divx" Global $threads = 2 Global $audiobitrate = "128k" Global $ffmpeg = "ffmpeg.exe" ;##### CONFIG ENDS HERE ##### ;----------------------------------------------------------------------------- ;----------------------------- DO NOT EDIT BELOW ----------------------------- ;----------------------------------------------------------------------------- Global $flvname Global $videoout Global $soundout While 1 ;Ask user for .flv file name $flvname = InputBox("FFMpeg Encoder", "What is the name of the .flv that you wish To encode? Make sure it’s In the same directory as FFMpeg And the FFMpeg Encoder") ;Ask for Video Output $videoout = InputBox("FFMpeg Encoder", "What would you like the video file To be named?") ;Ask for Audio Output $audioout = InputBox("FFMpeg Encoder", "What would you like your audio file to be named?") ;Build FFMpeg Video Params Line Global $ffmpegparams = " - i " & $flvname & ".flv - c:a libmp3lame - b:a " & $audiobitrate & " - sameq - r " & $fps & " - vtag " & $encoder & " - threads " & $threads & '"' & $videoout & ".avi" ;Start video encode ShellExecute($ffmpeg, $ffmpegparams) ;Build FFMpeg Audio Params Line Global $audioparams = "-i " & $flvname & ".flv -b:a " & $audiobitrate & " " & $soundout & ".mp3" ;Start audio encode ShellExecute($ffmpeg, $audioparams) ;Close script (Exit) Exit WEndWe may still have to work on the $ffmpegparams line to get the quotes correct. Do you code in SciTE? M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
kylomas Posted October 24, 2012 Share Posted October 24, 2012 Rapture, You need an equal sign after the global declares, e.g. Global $fps = 60 kylomas Forum Rules Procedure for posting code "I like pigs. Dogs look up to us. Cats look down on us. Pigs treat us as equals." - Sir Winston Churchill Link to comment Share on other sites More sharing options...
water Posted October 24, 2012 Share Posted October 24, 2012 The Global statements need an assign operator and quotes:Global $fps = 60 Global $encoder = "divx" Global $threads = 2 Global $audiobitrate = "128k" Global $ffmpeg = "ffmpeg.exe" My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
water Posted October 24, 2012 Share Posted October 24, 2012 Now you have a lot of answers to select from My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
RapTure Posted October 24, 2012 Author Share Posted October 24, 2012 Thanks a lot guys. I put equal signs before but I got a different error so I guess that was my problem the whole time. thanks a lot. Link to comment Share on other sites More sharing options...
RapTure Posted October 24, 2012 Author Share Posted October 24, 2012 RapTure, Welcome to the AutoIt forum. A few syntax errors there. You need an "=" to assign values to a variable - and non-numeric values need to be enclosed in "". There were also some problems with the quotes in the $ffmpegparams line. See if this is any better - at least it does not error when I test. ;# FFMpeg Encode Script v1 #RequireAdmin ;##### CONFIG STARTS HERE ##### Global $fps = 60 Global $encoder = "divx" Global $threads = 2 Global $audiobitrate = "128k" Global $ffmpeg = "ffmpeg.exe" ;##### CONFIG ENDS HERE ##### ;----------------------------------------------------------------------------- ;----------------------------- DO NOT EDIT BELOW ----------------------------- ;----------------------------------------------------------------------------- Global $flvname Global $videoout Global $soundout While 1 ;Ask user for .flv file name $flvname = InputBox("FFMpeg Encoder", "What is the name of the .flv that you wish To encode? Make sure it’s In the same directory as FFMpeg And the FFMpeg Encoder") ;Ask for Video Output $videoout = InputBox("FFMpeg Encoder", "What would you like the video file To be named?") ;Ask for Audio Output $audioout = InputBox("FFMpeg Encoder", "What would you like your audio file to be named?") ;Build FFMpeg Video Params Line Global $ffmpegparams = " - i " & $flvname & ".flv - c:a libmp3lame - b:a " & $audiobitrate & " - sameq - r " & $fps & " - vtag " & $encoder & " - threads " & $threads & '"' & $videoout & ".avi" ;Start video encode ShellExecute($ffmpeg, $ffmpegparams) ;Build FFMpeg Audio Params Line Global $audioparams = "-i " & $flvname & ".flv -b:a " & $audiobitrate & " " & $soundout & ".mp3" ;Start audio encode ShellExecute($ffmpeg, $audioparams) ;Close script (Exit) Exit WEnd We may still have to work on the $ffmpegparams line to get the quotes correct. Do you code in SciTE? M23 Yeah I was coding in SciTE. this script was able to compile for me but the program would only run $audioparams, not $ffmpegparams so I am getting my output audio file (no name for some reason though) and no video. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted October 24, 2012 Moderators Share Posted October 24, 2012 RapTure,I thought the quotes might not be quite right. Add this line immediately after "Global $ffmpegparams = ...." and see if what you get in the lower pane of SciTe is what you actually need:ConsoleWrite($ffmpegparams & @CRLF)M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
RapTure Posted October 24, 2012 Author Share Posted October 24, 2012 RapTure, I thought the quotes might not be quite right. Add this line immediately after "Global $ffmpegparams = ...." and see if what you get in the lower pane of SciTe is what you actually need: ConsoleWrite($ffmpegparams & @CRLF) M23 I actually found my error. there was a space in "-i" so ffmpeg wasn't recognizing what the command was and was just opening and closing immediately. I am still getting blank file names though Link to comment Share on other sites More sharing options...
RapTure Posted October 24, 2012 Author Share Posted October 24, 2012 Found my problem. Program is working perfectly now. Thank you everyone for you help. Also my error was that late last night I decided $audioout was just a weird looking name for the variable so I renamed it to $soundout, however when I did so I did it only in the $audioparams line instead of the rest of the code as well. New finished version if anyone would like it. expandcollapse popup;# FFMpeg Encode Script v1 #RequireAdmin ;##### CONFIG STARTS HERE ##### Global $fps = 60 Global $encoder = "divx" Global $threads = 2 Global $audiobitrate = "128k" Global $ffmpeg = "ffmpeg.exe" ;##### CONFIG ENDS HERE ##### ;----------------------------------------------------------------------------- ;----------------------------- DO NOT EDIT BELOW ----------------------------- ;----------------------------------------------------------------------------- Global $flvname Global $videoout Global $soundout While 1 ;Ask user for .flv file name $flvname = InputBox("FFMpeg Encoder", "What is the name of the .flv that you wish To encode? Make sure it’s In the same directory as FFMpeg And the FFMpeg Encoder") ;Ask for Video Output $videoout = InputBox("FFMpeg Encoder", "What would you like the video file To be named?") ;Ask for Audio Output $soundout = InputBox("FFMpeg Encoder", "What would you like your audio file to be named?") ;Build FFMpeg Video Params Line Global $ffmpegparams = "-i " & $flvname & ".flv -c:a libmp3lame -b:a " & $audiobitrate & " -sameq -r " & $fps & " -vtag " & $encoder & " -threads " & $threads & " " & $videoout & ".avi" ;Start video encode ShellExecute($ffmpeg, $ffmpegparams) ;Build FFMpeg Audio Params Line Global $audioparams = "-i " & $flvname & ".flv -b:a " & $audiobitrate & " " & $soundout & ".mp3" ;Start audio encode ShellExecute($ffmpeg, $audioparams) ;Close script (Exit) Exit WEnd Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now