Comments (2)
I use the following command to record a video to a number of separate files of nearly fixed duration:
ffmpeg -hide_banner -loglevel warning -i rtsp://192.168.1.64:554/Streaming/Channels/101 -c copy -f segment -segment_time 120 -reset_timestamps 1 -strftime 1 -y "capture-%Y-%m-%d %H-%M-%S.mp4"
The command is triggered by AppDaemon when the system is armed and a person is detected. That video is streamed directly from the camera. Sample config is here.
To record the video stream from Watsor (with rendered object detections) add ffmpeg.encoder
section in config:
ffmpeg:
decoder:
...
encoder:
- -hide_banner
- -loglevel
- error
- -hwaccel
- vaapi
- -hwaccel_device
- /dev/dri/renderD128
- -hwaccel_output_format
- yuv420p
- -f
- rawvideo
- -pix_fmt
- rgb24
- -i # detection output stream will follow -input ffmpeg argument automatically
- -an
- -f
- mp4
- -vcodec
- libx264
- -pix_fmt
- yuv420p
- -y
- -vf
- "drawtext='text=%{localtime\\:%c}': x=w-tw-lh: y=h-2*lh: fontcolor=white: box=1: [email protected]"
- -f
- segment
- -segment_time
- 120
- -reset_timestamps
- 1
- -strftime
- 1
and then output: !ENV "${HOME}/Videos/detect-%Y-%m-%d %H-%M-%S.mp4"
Note that hwaccel
options are optional and intended to enable video hardware acceleration.
It seems availability of strftime
option depends on ffmpeg version. Some distributions may not have it.
from watsor.
This is exactly what I was looking for. Thank you very much!
from watsor.
Related Issues (20)
- Car detection HOT 2
- Coral Stick HOT 2
- Broken Pipe HOT 2
- Implementing Yolov4 for Detection HOT 1
- [FR] Multiple Redundant Detectors HOT 1
- Zones as config? HOT 1
- Home Assistant Add-On crashes at boot HOT 2
- running on snap images HOT 1
- Develop an add-on for Home Assistant HOT 1
- [FR] Seekable video archive HOT 2
- ffmpeg error while decoding rtsp stream HOT 2
- Accelerator in "Dev Board 3 with Edge TPU 4 TOPS" HOT 6
- IPcam VCA/Dual VCA HOT 1
- Camera not able to reconnect after getting disconnected. HOT 1
- Геокамера HOT 1
- Геокамера HOT 1
- Jetson nano 2gb HOT 5
- Jetson Nano 2GB - Only CPU Detection Works! HOT 11
- Error on startup - google.protobuf.message.DecodeError: Truncated message. HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from watsor.