I am trying to record the live streaming and stopping it after few minutes but i am not able to stop the recording. I am able to create new recording but the script doesnot stop. I am using the following command on ubuntu:-
cvlc -vvv http://cab.mpeg --sout "#transcode{}:duplicate{dst=std{access=file,mux=ts,dst={CabTest_$NOW.ts}" > video_log 2>&1 &
echo "Start recording the test case...."
run_uiautomator 'test.jar demo.jar'
com.epl.test.mini.RankingAlgoTest
echo "Stop recording the test case...."
stop
this stop command does not stop live recording
stop is not a valid command in this case. Try killall -SIGTERM vlc instead
Related
I have a shell script which looks like this
set -o xtrace #traces commands before executing them
echo hello world
echo starting appium here in background
appium &
echo I have some other processes here
I want to start the process of appium in background and print its logs in a new file. I does not want them to be available in console when I run the script.
Side by side I want other processes to run as usual.
Here are the commands that I have tried:
appium &> appiumLogs.log
appium &> appiumLogs.log &
appium &>> appiumLogs.log &
But in all cases appium process was running in background but never saved logs in file appiumLogs.
You can use AppiumServiceBuilder for that.
service = AppiumDriverLocalService.buildService(new AppiumServiceBuilder().. .................... .withLogFile(new File("AppiumLog.text"))
service.start();
Log will be saved in new file.
I want to use headless firefox to capture an image of a webpage on macos.
This is the command I executed: /Applications/Firefox.app/Contents/MacOS/firefox-bin -screenshot https://developer.mozilla.com
This is what I see in the terminal:
$ /Applications/Firefox.app/Contents/MacOS/firefox-bin -screenshot https://developer.mozilla.com
*** You are running in headless mode.
The problem is the firefox application does not terminated after the image is created. I can see a screenshot.png is already created in the directory I run the command, as seen in the following screenshot:
I have to kill the process by Ctrl-C at the end.
Is there any parameter I can pass to the executable to make it exit after the screen capture is done?
I think you would have to manually quit firefox once the screenshot is done. This command should work:
/Applications/Firefox.app/Contents/MacOS/firefox-bin -screenshot https://developer.mozilla.com; pkill firefox
Explanation:
";" will run the first command followed by the second, regardless of success
"pkill" will kill all currently running processes with "firefox" in the name
I'm using mjpg-streamer to stream video to a webpage through the yun. The stream is working fine but since it's not recording and only live streaming I thought of having it capturing pictures from time to time (3 mins gap maybe) and add a button to the webpage to capture the picture as that button is pressed.
I decided to aproach the button first and the problem I found was that if the device is live streaming it can't take pictures at the same time, I have to stop the stream in order to capture the picture. I found that I can take a single picture when manualy typing the following commands:
/etc/init.d/mjpg-streamer stop
mjpg_streamer -i "./input_uvc.so -d /dev/video0 -r 640x480 -yuv -n -f 1 -q 80" -o "./output_file.so -f ./tests/ -d 5000"
/etc/init.d/mjpg-streamer stop
/etc/init.d/mjpg-streamer start
but when having a .cgi file running all this the stream stops and the device keeps capturing pictures until rebooted...
I'm not fully aware of what all the parameters do here... Without a delay (-d) does the yun only take one picture or is it really necessary to have a certain delay value even if I only want one picture?
Is there a better way to achieve my goal?
Thanks in advance!
Installing fswebcam and using:
#!/bin/ash
echo "Content-type: text/html"
echo
echo "<html><head><meta http-equiv='refresh' content='0;URL=http://arduino/stream-url' /><title>Take Picture</title></head><body></body></html>"
/etc/init.d/mjpg-streamer stop
sleep 0.4; fswebcam /mnt/sda1/pictures/$(date +"%Y.%m.%d.%H.%M.%S").png
/etc/init.d/mjpg-streamer start
exit 0
was the best way around :)
How to keep play application running after putty terminal closed?
After deploying play application in to server, I ssh'ed into server with putty terminal and ran the play application.
However, once I close the putty terminal, play application no longer accepts http requests from client.
To start the play application I used following command;
./{myplayapp}/bin/{executable} -Dhttp.port=8000
use screen to start your application. view existing screens with "screen -ls" and switch between them with "screen -r"
http://wiki.ubuntuusers.de/screen
I would recommend nohup:
nohup ./script -Dhttp.port=8000 &
It will create nohup.out file with all the logs. If you want to quit it, grep RUNNING_PID and sudo kill it.
Got the answer! Using & symbol run the process in background so that even if putty terminal is closed, process not terminated.
./{myplayapp}/bin/{executable} -Dhttp.port=8000 > app.out &
Hello I Am Trying To Run Two Instances Of vlc at the same time using a bash script:
#!/bin/bash
vlc http://testvideo1.com/video.mp4
vlc http://testvideo1.com/video.m3u8
but when i run this the second command will not run until i close the first instance of vlc
By default, a script will wait for each command until the process returns. (i.e. closes) You should use the ampersand operator to run the commands in the background. Your bash script should read:
#!/bin/bash
vlc http://testvideo1.com/video.mp4 &
vlc http://testvideo1.com/video.m3u8 &