Trouble With RunProgram()
Trouble With RunProgram()
I'm having trouble running a program called "ffprobe.exe". RunProgram() returns 0. I've checked permissions and none are set to "deny".
I'm able to run another program in the same folder called "ffmpeg.exe" RunProgram() returns 1.
Any ideas why?
OS is Windows 10.
I'm able to run another program in the same folder called "ffmpeg.exe" RunProgram() returns 1.
Any ideas why?
OS is Windows 10.
Re: Trouble With RunProgram()
Check if the pipes are required, adding the following options :
You can see the syntax to use to setup many options in the same time in the example in the RunProgram() documentation page.
You have to use '|' (OR binary gate) to do this.
PS : I apologize for my << in the... in the... in the... >> bad language...
Code: Select all
#PB_Program_Open
#PB_Program_Read
#PB_Program_Write
#PB_Program_Error
You have to use '|' (OR binary gate) to do this.
PS : I apologize for my << in the... in the... in the... >> bad language...
Re: Trouble With RunProgram()
Sorry, I tried adding these flags and it still returns 0:
I can run ffmpeg.exe without any flags, just the name of the executable name without the file extension, and it returns 1, which means it successfully ran.
Code: Select all
#PB_Program_Open|#PB_Program_Read
Re: Trouble With RunProgram()
Please post the original line where you call it.
Without no testing is possible.
Btw. if I use the file from https://ffmpeg.zeranoe.com/builds/ static linked it works without problems.
Do you use a dynamic linked file?
Have you all needed dlls?
Did you set the "working directory" ?
Without no testing is possible.
Btw. if I use the file from https://ffmpeg.zeranoe.com/builds/ static linked it works without problems.
Do you use a dynamic linked file?
Have you all needed dlls?
Did you set the "working directory" ?
Re: Trouble With RunProgram()
Alway use full filename with extension.I can run ffmpeg.exe without any flags, just the name of the executable name without the file extension, and it returns 1, which means it successfully ran.
without the extension, there may be a .cmd, .bat or other associated extension running in its place.
This works for me (return 1)
Code: Select all
Debug RunProgram("C:\Shotcut\ffprobe.exe", "", "")
Try this too, you will seen output console (change path to your ffprobe.exe)
Code: Select all
RunProgram("cmd", "/k C:\Shotcut\ffprobe.exe -version", "")
Code: Select all
ffprobe version n4.2.4-2-gd359b75 Copyright (c) 2007-2020 the FFmpeg developers
built with gcc 5.5.0 (GCC)
...
Re: Trouble With RunProgram()
Here is the line of code:
It makes no difference if I include the file extension or not.
This code runs ffmpeg and returns 1, whether I do or do not include the file extension:
I am using the static builds from Zeranoe.
Question: does RunProgram() work with batch files or just .exe files?
Code: Select all
result = RunProgram("ffprobe.exe","","",#PB_Program_Open|#PB_Program_Read) : Debug result
This code runs ffmpeg and returns 1, whether I do or do not include the file extension:
Code: Select all
result = RunProgram("ffmpeg") : Debug result
Question: does RunProgram() work with batch files or just .exe files?
Re: Trouble With RunProgram()
I tried RunProgram() on ffprobe in my copy of Shotcut and it worked. Bizarre.
Re: Trouble With RunProgram()
Yes, RunProgram() launch any program, batch or document if associated in system.Question: does RunProgram() work with batch files or just .exe files?
Batch (.cmd, .bat) is associated with cmd.exe for NT and command.com in Windwos 9.x so no need to use cmd /c or /k
You can use start.exe if need more option (start /? for option)
Code: Select all
I tried RunProgram() on ffprobe in my copy of Shotcut and it worked. Bizarre.
Maybe you have more than one ffprobe.exe in folders in path ? This is why I suggest to use fill path and extension.
If many exe, check version of each
Code: Select all
ffprobe.exe -version
Re: Trouble With RunProgram()
ffprobe requres several .dll files in order to run. Once found, it works.
Re: Trouble With RunProgram()
In this way (DLL requirements), no pipe flags.
RunProgram() has 3 first arguments :
Name$
Parameter$
WorkDir$
Name$ : the full path + "ffprobe.exe"
Parameter$ : I ignore what to add here for now
WorkDir$ : the full path of the DLLs
An other way consists in copying DLLs in the same path as the executable file.
RunProgram() has 3 first arguments :
Name$
Parameter$
WorkDir$
Name$ : the full path + "ffprobe.exe"
Parameter$ : I ignore what to add here for now
WorkDir$ : the full path of the DLLs
An other way consists in copying DLLs in the same path as the executable file.
Re: Trouble With RunProgram()
The static build needs no dllschris319 wrote: I am using the static builds from Zeranoe.
Re: Trouble With RunProgram()
Sorry to contradict you, but ffprobe does. It won't run without them and will run with them.infratec wrote:The static build needs no dllschris319 wrote: I am using the static builds from Zeranoe.
Re: Trouble With RunProgram()
A detail however about pipes : Could you test the error channel ? (#PB_Program_Open | #PB_Program_Error)
We expect an error thanks to ReadProgramError()
I find it is strange that no warning message appears when any DLLs miss.
We expect an error thanks to ReadProgramError()
I find it is strange that no warning message appears when any DLLs miss.