B4J Question jShell nohup under Windows

peacemaker

Expert
Licensed User
Longtime User
Hi, All

How to run console programs under Windows for endless running ? Say, ffmpeg.
 

peacemaker

Expert
Licensed User
Longtime User
start /min ffmpeg -rtsp_transport tcp -i rtsp://192.168.1.168:554/ch01/0 -r 3 -vsync 1 -qscale 1 -frames:v 50 -f image2 image_%03d.jpg

Such manual start works OK under Windows (in a minimized console window), and ffmpeg makes 3 pictures per second, up to 50 pcs (total files qty), but ... how to correctly start it by jShell ?
 
Last edited:
Upvote 0

teddybear

Well-Known Member
Licensed User
Create a batch file then jShell runs it
 
Upvote 0

Magma

Expert
Licensed User
Longtime User
Such manual start works OK under Windows (in a minimized console window), and ffmpeg makes 3 pictures per second, up to 50 pcs (total files qty), but ... how to correctly start it by jShell ?
check my "RECDesk" free source code...



It is also has the right way quitting from ffmpeg !!!
 
Upvote 0

peacemaker

Expert
Licensed User
Longtime User
"RECDesk" free source code
But here i need to start not ffmpeg, but "start" Windows utility with parameters. jShell does not work if to put whole command line into the single string.
 
Upvote 0

tchart

Well-Known Member
Licensed User
Longtime User
The correct way is to run it as a service

 
Upvote 0

Magma

Expert
Licensed User
Longtime User
But here i need to start not ffmpeg, but "start" Windows utility with parameters. jShell does not work if to put whole command line into the single string.
Why can't understand what exactly you want?

Sorry may be ... my poor English again..

...May be need to add quotes... also see the InitializeDoNotHandleQuotes...

Hmm... Run(-1)

...and another question... if you run manually the utility ...you want is it looping? Running forever?...

If not.. you can put it into a batch file that in the end will run itself.. calling bat again (simple)

But if the utility is ffmpeg has loop parameters...

Other way is to see or wait jshell to end (wait for) and loop it..

Hope helped you
 
Upvote 0

teddybear

Well-Known Member
Licensed User
Create a batch file then jShell runs it
B4X:
start /min ffmpeg -rtsp_transport tcp -i rtsp://192.168.1.168:554/ch01/0 -r 3 -vsync 1 -qscale 1 -frames:v 50 -f image2 image_%03d.jpg

Add it into batch file, such as doit.bat and put it to Objects folder

then do

B4X:
shl.Initialize("shl", "doit.bat",  null)
shl.Run(-1)

Doesn't it work?
 
Upvote 0

peacemaker

Expert
Licensed User
Longtime User
So, thanks to all here. I have found that it's too many differences for jShell under Windows and Linux for my needs.
And decided to debug the code directly under Linux target machine - no use to debug under Windows and later it does not work under target Linux.
Thanks all again.
 
Upvote 0
Top