Hello to everybody
I`m trying to execute a command from my application through JShell but i can`t, however if i write it in system symbol window it run ok.
With this code:
Here is the result
It seems the option "-r 10" is passed as "r 10"
And with this code:
The result is:
But if i copy and paste the command "C:\ffmpeg64\bin\ffmpeg.exe -r 10 -f image2 -s 640x480 -i C:\Users\Fran\AppData\Roaming\IpCam\Temp\%08d.png -vcodec libx264 -crf 25 -pix_fmt yuv420p C:\Users\Fran\AppData\Roaming\IpCam\Images\test.mp4" in a system symbol window it run ok.
Thank in advance
I`m trying to execute a command from my application through JShell but i can`t, however if i write it in system symbol window it run ok.
With this code:
B4X:
If File.Exists(FM.FotoDir, "test.mp4") Then
File.Delete(FM.FotoDir, "test.mp4")
End If
Dim Sh As Shell
Sh.Initialize("Shell", File.Combine("C:\ffmpeg64\bin", "ffmpeg.exe"), Array As String(" -r 10", "-f image2", "-s 640x480", "-i "& File.Combine(FM.TempDir, "%08d.png"), "-vcodec libx264", "-crf 25", "-pix_fmt yuv420p " & File.Combine(FM.FotoDir, "test.mp4")))
Sh.WorkingDirectory = "C:\ffmpeg64"
Sh.Run(100)
Here is the result
Waiting for debugger to connect...
Program started.
ffmpeg version N-87871-g7480f232d2 Copyright (c) 2000-2017 the FFmpeg developers
built with gcc 7.2.0 (GCC)
configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-bzlib --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-cuda --enable-cuvid --enable-d3d11va --enable-nvenc --enable-dxva2 --enable-avisynth --enable-libmfx
libavutil 55. 79.100 / 55. 79.100
libavcodec 57.108.100 / 57.108.100
libavformat 57. 84.100 / 57. 84.100
libavdevice 57. 11.100 / 57. 11.100
libavfilter 6.108.100 / 6.108.100
libswscale 4. 9.100 / 4. 9.100
libswresample 2. 10.100 / 2. 10.100
libpostproc 54. 8.100 / 54. 8.100
Unrecognized option 'r 10'.
Error splitting the argument list: Option not found
It seems the option "-r 10" is passed as "r 10"
And with this code:
B4X:
If File.Exists(FM.FotoDir, "test.mp4") Then
File.Delete(FM.FotoDir, "test.mp4")
End If
Dim Sh As Shell
Sh.Initialize("Shell", File.Combine("C:\ffmpeg64\bin", "ffmpeg.exe") & " -r 10 -f image2 -s 640x480 -i "& File.Combine(FM.TempDir, "%08d.png") & " -vcodec libx264 -crf 25 -pix_fmt yuv420p " & File.Combine(FM.FotoDir, "test.mp4"),Null)
Sh.WorkingDirectory = "C:\ffmpeg64"
Sh.Run(100)
The result is:
org.apache.commons.exec.ExecuteException: Execution failed (Exit value: -559038737. Caused by java.io.IOException: Cannot run program "C:\ffmpeg64\bin\ffmpeg.exe -r 10 -f image2 -s 640x480 -i C:\Users\Fran\AppData\Roaming\IpCam\Temp\%08d.png -vcodec libx264 -crf 25 -pix_fmt yuv420p C:\Users\Fran\AppData\Roaming\IpCam\Images\test.mp4" (in directory "C:\ffmpeg64"): CreateProcess error=2, El sistema no puede encontrar el archivo especificado)
But if i copy and paste the command "C:\ffmpeg64\bin\ffmpeg.exe -r 10 -f image2 -s 640x480 -i C:\Users\Fran\AppData\Roaming\IpCam\Temp\%08d.png -vcodec libx264 -crf 25 -pix_fmt yuv420p C:\Users\Fran\AppData\Roaming\IpCam\Images\test.mp4" in a system symbol window it run ok.
Thank in advance