Using the Shell class, conversion works, but the GUI freezes during video encoding and doesnt update until the task is finished. I would like to show the progress percentage in the GUI.
If you use a Shell with mode=0 (i.e. Synchronous), then the Execute method will always block until the command is finished.
If you want to get the text printed out by FFMPEG while it is executing, then you need to set the ‘mode’ of your Shell to 1 or 2 (preferably 2, as it doesn’t change anything really).
Thanks, but when I set it to Mode=2 the Textarea doesn’t update at all and conversion fails…
Also, I wonder how I would read the terminal output in realtime, so that I can parse it for a progress percentage.
Whenever you set mode to 2 (or 1), you NEED to have a Shell object somewhere in your Window so you can write some code for the different events it provides.
Thanks Christoph, but my company has been fully licensed by MPEG LA since 2004.
Considering you have experience with FFmpeg & Xojo. Do you know the solution to my problem?
[quote=413895:@StphaneMons]It is impossible to write some code like:
dim sh as new Shell
sh.mode = 2
… //do some stuff[/quote]
That is only correct in that you’ve not handled waiting for the shell. This would be more correct and works very well:
Dim sh As New Shell
sh.Mode = 2
sh.Execute "LongRunningCommand"
Do
sh.Poll
CallSomeMethod
Check sh.Result for a prompt
Loop Until Not sh.IsRunning Or InStrB(sh.Result, WatchedForPrompt) <> 0
I’m having an issue with the build of my project. My app works fine with FFmpeg in the IDE, but when I add the FFmpeg console application to my project with a build step (copy files), the resulting compiled, single binary does not work.
When I run my Xojo app (with built-in FFmpeg binary) from the desktop, the console output says::
bash: /Users/vincent/Desktop/FFmpeg: No such file or directory
Clearly the Xojo app does not see the FFmpeg binary.
You really can’t do that - both license-wise for ffmpeg and binary requirements, you’ll run into issues. Rather than trying to include ffmpeg within your all, you need to do what others do and simply state that the user must download and preinstall the ffmpeg binary and provide the link to the downloads.