Rhazz Posted September 30, 2015 Share Posted September 30, 2015 Hello people.First of all, my English may contain errors, because I'm not a English speaker. If someone wants to correct my writing, I will accept it with pleasure.I'm learning AutoIt from scratch since two weeks ago. So I am still a newbie.Sorry if my question is repeated or very basic, but I couldn't find the answer on Google or in this forum.Yesterday, I've learned about FFmpeg and I developed a small code that is what I need.The problem is that I don't know how I can use FFmpeg in AutoIt.I already have the interface coded in AutoIt and, on the other hand, the code of the function what I need coded using FFmpeg. The two codes are separated and I want to join them.Thanks, regards. Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted September 30, 2015 Moderators Share Posted September 30, 2015 Hi, Rhazz, welcome to the AutoIt forum. Please post the two functions you have. We can then do our best to assist you in joining them into a single script. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
Rhazz Posted September 30, 2015 Author Share Posted September 30, 2015 (edited) Hi, Rhazz, welcome to the AutoIt forum. Please post the two functions you have. We can then do our best to assist you in joining them into a single script.@JLogan3o13 first, thanks!My code isn't finished, but here it is:expandcollapse popup#include <Array.au3> #include <MsgBoxConstants.au3> #include <GUIConstantsEx.au3> Local $nombreVideoSinExtension $nombreVideoSinExtension = InputBox("Definir nombre","Elige un nombre para el archivo final SIN EXTENSION ya que será un mp4","video-final","",-1,-1) Local $videoFinal $videoFinal = $nombreVideoSinExtension & ".mp4" Local $duracionVideoFinal $duracionVideoFinal = InputBox("Definir duración","Define la duración del video expresada en segundos","10","",-1,-1) Local $videoResolucion $videoResolucion = InputBox("Definir resolución","Define la resolución del video","1280x720","",-1,-1) Local $imagenes $imagenes = InputBox("Escoger imagen","Escribe el nombre de la imagen CON SU EXTENSION que será el fondo del video","audio.mp3","",-1,-1) Local $duracionCadaImagen $duracionCadaImagen = 5 Local $relacionDeAspecto $relacionDeAspecto = "4:3" Local $audioVideo $audioVideo = InputBox("Escoger audio","Escribe el nombre del audio CON SU EXTENSION","imagen.jpg","",-1,-1) Local $velocidadAlCodificar ;$velocidadAlCodificar[] = [ultrafast, superfast, veryfast, faster, fast, medium, slow, slower, veryslow] Local $fpsVideoFinal $fpsVideoFinal = 20 EstablecerVelocidadAlCodificar() Func EstablecerVelocidadAlCodificar() ; Create a GUI with various controls. Local $InterfazEstablecerVelocidadAlCodificar = GUICreate("Elige la velocidad de codificación", 300, 200) ; Create a combobox control. Local $idComboBox = GUICtrlCreateCombo("", 10, 10, 185, 20) Local $idClose = GUICtrlCreateButton("Cerrar", 210, 170, 85, 25) ; Add additional items to the combobox. GUICtrlSetData($idComboBox, "ultrafast|superfast|veryfast|faster|fast|medium|slow|slower|veryslow", "fast") ; Display the GUI. GUISetState(@SW_SHOW, $InterfazEstablecerVelocidadAlCodificar) Local $sComboRead = "" ; Loop until the user exits. While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE, $idClose ExitLoop Case $idComboBox $sComboRead = GUICtrlRead($idComboBox) MsgBox($MB_SYSTEMMODAL, "", "Elegiste " & $sComboRead & " como velocidad de codificación", 0, $InterfazEstablecerVelocidadAlCodificar) $velocidadAlCodificar = $sComboRead EndSwitch WEnd ; Delete the previous GUI and all controls. GUIDelete($InterfazEstablecerVelocidadAlCodificar) EndFuncAnd the FFmpeg code with AutoIt variables:ffmpeg -loop 1 -framerate 1/$duracionCadaImagen -i $imagenes -i $audioVideo -c:v libx264 -s $videoResolucion -t $duracionVideoFinal -aspect $relacionDeAspecto -c:a libvo_aacenc -ac 2 -ab 128k -r $fpsVideoFinal -preset $velocidadAlCodificar $videoFinalI want to create a program to generate a video from a combination of images+audio+text (code for insert text isn't written yet).Remember, I didn't finished the code, it have some errors or missing elements. Edited September 30, 2015 by Rhazz cite Link to comment Share on other sites More sharing options...
iamtheky Posted September 30, 2015 Share Posted September 30, 2015 something like?run ('cmd /k ffmpeg -loop 1 -framerate ' & 1 /$duracionCadaImagen & ' -i ' & $imagenes & ' -i ' & $audioVideo & ' -c:v libx264 -s ' & $videoResolucion & ' -t ' & $duracionVideoFinal & ' -aspect ' & $relacionDeAspecto & ' -c:a libvo_aacenc -ac 2 -ab 128k -r ' & $fpsVideoFinal & ' -preset ' & $velocidadAlCodificar & $videoFinal') Rhazz 1 ,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-. |(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/ (_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_) | | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) ( | | | | |)| | \ / | | | | | |)| | `--. | |) \ | | `-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_| '-' '-' (__) (__) (_) (__) Link to comment Share on other sites More sharing options...
Rhazz Posted October 1, 2015 Author Share Posted October 1, 2015 something like?run ('cmd /k ffmpeg -loop 1 -framerate ' & 1 /$duracionCadaImagen & ' -i ' & $imagenes & ' -i ' & $audioVideo & ' -c:v libx264 -s ' & $videoResolucion & ' -t ' & $duracionVideoFinal & ' -aspect ' & $relacionDeAspecto & ' -c:a libvo_aacenc -ac 2 -ab 128k -r ' & $fpsVideoFinal & ' -preset ' & $velocidadAlCodificar & $videoFinal') I will try your code but how can I integrate FFmpeg to AutoIt and then compile in a .exe only file.I want a final .exe without other files, and I want that the users could execute the program without installing anything.I don't know how to integrate FFmpeg (I'm very newbie, sorry) and then compile all together in a .exe file.Thanks a lot. Link to comment Share on other sites More sharing options...
MilesAhead Posted October 1, 2015 Share Posted October 1, 2015 This thread may be helpful getting an FFMPeg that is all one exe file rather than libraries:http://www.portablefreeware.com/forums/viewtopic.php?f=6&t=16912Then you could bundle it into your script's compiled exe using FileInstall()See FileInstall in the help. My Freeware Page Link to comment Share on other sites More sharing options...
Rhazz Posted October 1, 2015 Author Share Posted October 1, 2015 (edited) This thread may be helpful getting an FFMPeg that is all one exe file rather than libraries:http://www.portablefreeware.com/forums/viewtopic.php?f=6&t=16912Then you could bundle it into your script's compiled exe using FileInstall()See FileInstall in the help.Thanks! But also I have a doubt about using FFmpeg in AutoIt. Where I have to put the FFmpeg files? In the same folder as my AutoIt script? Edited October 1, 2015 by Rhazz Texto correction Link to comment Share on other sites More sharing options...
ahmeddzcom Posted October 1, 2015 Share Posted October 1, 2015 (edited) if you want combine your script use (FileInstall)something likeFileInstall("ffmpeg.exe" , @ScriptDir&"/ffmpeg.exe") $CMD = "ffmpeg -i xxxx.MP4 -codec copy yyyy.avi" RunWait(@ComSpec & " /c " & $CMD) Edited October 5, 2015 by ahmeddzcom Rhazz 1 Link to comment Share on other sites More sharing options...
Rhazz Posted October 2, 2015 Author Share Posted October 2, 2015 I still don't know where I have to put the FFmpeg library files. Link to comment Share on other sites More sharing options...
MilesAhead Posted October 2, 2015 Share Posted October 2, 2015 I still don't know where I have to put the FFmpeg library files.That is why I posted the link where you can find statically compiled FFMPeg. No DLLs to worry about.See the bottom post in the link. My Freeware Page Link to comment Share on other sites More sharing options...
Rhazz Posted October 5, 2015 Author Share Posted October 5, 2015 something like?run ('cmd /k ffmpeg -loop 1 -framerate ' & 1 /$duracionCadaImagen & ' -i ' & $imagenes & ' -i ' & $audioVideo & ' -c:v libx264 -s ' & $videoResolucion & ' -t ' & $duracionVideoFinal & ' -aspect ' & $relacionDeAspecto & ' -c:a libvo_aacenc -ac 2 -ab 128k -r ' & $fpsVideoFinal & ' -preset ' & $velocidadAlCodificar & $videoFinal') if you want combine your script use (FileInstall)something likeDirCreate(@DesktopDir&"/MyConvert") FileInstall("ffmpeg.exe" , @DesktopDir&"/MyConvert/ffmpeg.exe") $CMD = "ffmpeg -i xxxx.MP4 -codec copy yyyy.avi" RunWait(@ComSpec & " /c " & $CMD)xxxx.mp4 & yyyy.avi = path your file Thanks, Both codes worked fine!That is why I posted the link where you can find statically compiled FFMPeg. No DLLs to worry about.See the bottom post in the link. Oh, sorry! I looked very quickly the link and I thought that there was not what I was looking for.I could make it work! Now I will continue with the rest of the functions that I want to introduce in the program Thank you so much guys! Link to comment Share on other sites More sharing options...
MilesAhead Posted October 6, 2015 Share Posted October 6, 2015 Thanks, Both codes worked fine!Oh, sorry! I looked very quickly the link and I thought that there was not what I was looking for.I could make it work! Now I will continue with the rest of the functions that I want to introduce in the program Thank you so much guys! You are welcome. I am glad you are making progress. Rhazz 1 My Freeware Page Link to comment Share on other sites More sharing options...
varsha123 Posted December 14, 2021 Share Posted December 14, 2021 Hi Team, I need to compile all jpg images with naming convention like prt1.jpg, prt2.jpg etc. present in a folder to a video file. While running through cmd, the -i argument for the same would be -i "C:\myfolder\prt%01d.jpg". How can I pass the same argument when using ffmpeg through autoit. Link to comment Share on other sites More sharing options...
Developers Jos Posted December 14, 2021 Developers Share Posted December 14, 2021 @varsha123, Welcome, I assume you post in a 6 years old thread because you tried what is shown here and not working for you? So, show the script you have that isn't working for starters so we can see what you have tried. Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. 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