When i use the live parameter in my command line like this :
omxplayer -o hdmi http://www.example.com/video.mp4 --live
If I press "p" the video is paused but seek +6s.
I doesn't have the problem when i doesn't use the live parameter.
Thanks.
Use --loop instead of --live
Try this one:
omxplayer -o hdmi --loop http://www.example.com/video.mp4
In my experiences the --live command doesn't do anything at all.
Related
I have been using my Raspberry Pi 2 to do some motion detection using a USB webcam and the motion package and am incredibly frustrated.
Can someone explain to me how the on_motion_detected method is supposed to work??????
The idea is that when the camera detects motion, a script is executed. The script just echo's a few words for testing purposes.
The video stream works great on my local network, and I can see the motion writing the JPG and .avi files to the directory.
Even when I try to add my script to the movie start trigger, nothing happens.
Some examples I have tried:
; on_motion_detected python /home/pi/Desktop/Python/script.py
; on_movie_start python /home/pi/Desktop/Python/script.py
; on_picture_save sudo python /home/pi/Desktop/Python/script.py
I have also changed the script to different directories, speculating a permission issue. Still nothing happens. I have tried removing the ; before the methods, still nothing happens. I have tried sudo, I have tried executing as a script. Please, can someone offer some help. I have searched years and years of threads and not found an answer anywhere.
My script is not being executed.
This question has been asked 1000 times and nobody has answered it. I have been searching for several hours for an answer.
Here's just a few of the threads that have gone uanswered:
https://unix.stackexchange.com/questions/59091/problems-running-python-script-from-motion
https://www.raspberrypi.org/forums/viewtopic.php?t=86534&p=610482
https://raspberrypi.stackexchange.com/questions/8273/running-script-in-motion
Ypu have to remove ; which stands for commenting the line
; on_motion_detected python /home/pi/Desktop/Python/script.py
but
on_motion_detected python /home/pi/Desktop/Python/script.py
if you use threads: threat1.conf, threat2.conf -- try to write script config to them.
My threads:
thread1.conf
videodevice /dev/video0
text_left USBWebcam-1
target_dir /samba/hdd/share/motion/usb
rotate 180
width 1024
height 768
#webcam_port 9081
#on_event_start /bin/bash /root/scripts/tg_msg.sh
on_picture_save /bin/bash /root/scripts/tg_msg.sh %f
#on_motion_detected /bin/bash /root/scripts/tg_msg.sh
#on_area_detected /bin/bash /root/scripts/tg_msg.sh
#on_movie_start /bin/bash /root/scripts/tg_msg.sh
and thread2.conf:
text_left Foscam IP
netcam_url http://192.168.111.7:8080/video
target_dir /samba/hdd/share/motion/ip
width 1024
height 768
#on_event_start /bin/bash /root/scripts/tg_msg.sh
on_picture_save /bin/bash /root/scripts/tg_msg.sh %f
#on_motion_detected /bin/bash /root/scripts/tg_msg.sh
#on_area_detected /bin/bash /root/scripts/tg_msg.sh
#on_movie_start /bin/bash /root/scripts/tg_msg.sh
I have a simple solution but someone needs to explain how this works. Start motion as root. Add a line to /etc/rc.local 'sudo motion' reboot and most events will work if started as root, on_event_end sudo ...command or script...
Check that you have specified the process id properly in motion.conf:
process_id_file /var/run/motion/motion.pid
Once you have checked that, change the following settings to arbitrarily low values e.g.
threshold 1
noise_level 1
sudo chown motion:motion /home/pi/Desktop/Python/script.py
I have been searching in google since one day and I have not found any information of how to resize the webbrowser window (for example, half of the screen) just starting the raspberry pi.
At the moment I achieved starting the webbrowser in kiosk with this code:
In /etc/xdg/lxsession/LXDE-pi/autostart
#xset s off
#xset -dpms
#xset s noblank
#epiphany-browser http://www.google.de
Any idea of how can give/configure a given size to the browser?
I solved by my own.
Just creating a script and using wmctrl in the script.
When starting the PC it run automatically this script.
#!/bin/bash
epiphany http://www.google.de &
sleep 15s
epiphany --new-window www.wikipedia.com &
sleep 15s
SOURCE=/usr/bin
echo "$SOURCE"
$SOURCE/wmctrl -r wikipedia -e 0,0,0,800,1080
$SOURCE/wmctrl -r Google -e 0,800,0,1120,1080
I'm trying to send commands to an STM32F4 microcontroller board via terminal in Linux.
I've tried the following commands:
~$: stty -F /dev/ttyACM0 raw
~$: echo -e -n "\xAA\0xAB\0x10\0x00\0x00\0x00\0x00\0x00\0x01\0x00\0x00\0x00\0x00\0x00\0x00\0x00" > dev/ttyACM0 (this command should tell the stm32 to start recording)
And there is no error, but my STM32F4 board isn't giving me any response back.
Am I doing something wrong? Is there a better way to do this?
First of all, thanks everyone who is even reading this.
I'm able to save a stream from my IP CAM into a file using the given command (although I'm getting no audio recorded to the file, if anyone can help with that would be great too)
cvlc "http://***.***.*.***:****/videostream.asf?user=admin&pwd=**&rate=12&resolution=32" --run-time=10 --sout="#std{access=file,mux=asf,dst=path\test.asf}" vlc://quit --qt-start-minimized --no-qt-notification
This gives me a 7~8 seconds long recording, but the lenght of the video I want to make will be determined by an external factor (the camera's motion detection alarm). If I remove the "--run-time" it starts recording undefinatelly, so how can I tell VLC that it's time to stop saving the stream?
ps: I want to make this automatic, so I'm only using command line.
ps2: I'm using Ubuntu OS.
Thank you all very much!
I'm by no means and expert on this subject but I am also capturing a live stream to start and stop at specific times. I don't know about the audio issue but here is my code maybe it will help you out somewhat.
at 2014-05-23 10:00
cvlc "http://*My url to video stream*" --sout file/mp4:*THEFILENAMEYOUCHOOSE*.mp4 --run-time=300 --stop-time=300 vlc://quit
Essentially I use the runtime and stop time switches to make sure it stops when I need it to, 300 seconds works out to almost an hour and a half of video so that's plenty for my needs, I'm having some trouble with being able to automatically script this so at this point I'm having to type the commands in by hand to set up the recording which is less than ideal.
Hope this helps you out even a little.
Later but if anyone is looking for the script, this my service in Debian/Ubuntu based compact recorder:
First, I create a bash script in /bin/usr/rec.sh
Put this script there whith sudo nano /usr/bin/rec.sh:
#!/bin/bash
while :
do
raiz=$(date +'/logger/%Y/%m/%d/')
saida=$(date +'/logger/%Y/%m/%d/%H%M%S.opus')
read min sec <<<$(date +'%M %S')
duracao=$((3600 - 10#$min*60 - 10#$sec))
duracao=60
echo "Starting new hour loging..."
echo "$saida"
echo "$duracao"
mkdir -p "$raiz"
vlc **your url here** --no-repeat --no-loop -I dummy --run-time="$duracao" --sout "#transcode{vcodec=none,acodec=opus,ab=64,channels=2,samplerate=48000,afilter=normvol,scodec=none}:std{access=file{no-overwrite},mux=ogg,dst='$saida'}" vlc://quit
echo "Done a hour logged!"
done
Make executable: sudo chmod +x /usr/bin/rec.sh
So, you need create a service Systemd for the script.
sudo nano /lib/systemd/system/rec.service
This sample help you:
[Unit]
Description=URL logger service
[Service]
ExecStart=/usr/bin/rec.sh
[Install]
WantedBy=multi-user.target
Reload systemd:
sudo systemctl daemon-reload
Enable and the service:
sudo systemctl enable shellscript.service
sudo systemctl start shellscript.service
check status:
sudo systemctl status shellscript.service
REMINDER: cvlc don't run as root by default. Here is the trick to do this:
sudo sed -i 's/geteuid/getppid/' /usr/bin/vlc
This service will record the url and transcode audio to OPUS in /logger directory, separated by YEAR / MONTH / DAY / HMS.opus (since record beggining). Each new file is started every hour o'clock.
I hope that help someone.
References:
https://tecadmin.net/run-shell-script-as-systemd-service/
and https://www.tecmint.com/run-vlc-media-player-as-root-in-linux/
Sorry my bad English.
I'm trying to make a little script which involves playing YouTube videos from the command line using VLC. I'm using Windows 7 with VLC in the search path.
Typing
vlc http://www.youtube.com/watch?v=v0faacLn8K4
plays the video, but always at the highest quality. In the internet browser, appending the term '&fmt=18' forces a low-resolution mode. However, using this in the command line,
vlc http://www.youtube.com/watch?v=v0faacLn8K4&fmt=18
gives an error:
´fmt´ is not recognized as an internal or external command,
operable program or batch file.
I've tried quoting the url with various quotes, to no avail. The entire link gets passed to VLC, including the quotes.
What's the solution to this? Is there a VLC switch for selecting stream quality? The VLC command-line help may have the answer, but understanding the meaning of all the switches is a little beyond me.
Music credit: By Your Side by Breakbot
Go to VLC directory from command prompt and then type
vlc "http://www.youtube.com/watch?v=v0faacLn8K4&fmt=18"
Works for me.
Install Streamlink:
sudo -H pip install streamlink
Send the stream to cvlc --fullscreen:
streamlink --player="cvlc --fullscreen" "https://www.youtube.com/freecodecamp/live" best
To save bandwidth you could use worst instead of best.
Also posted here.
Do you need to run from the command line?
If you just start VLC itself then use 'ctrl+N' to open an 'Open Media' dialogue, which will be on the network tab, you can enter the url + the "&fmt=18" in the "Please enter a network URL:" area.
ie just the full path without any quotes.
Works with my VLC version 2.2.1.