Video Recorder: video-storage and video-streamer-cpu
Video Recorder is an optional part of the FindFace Server. It works in the following way:
The
video-storageservice implements video chunk management. It takes video chunks from thevideo-workercomponent, puts them into the storage (upload), and writes their meta-information and whereabouts to the MongoDB database. By request, it issues info about existing video chunks and Websocket-links to the corresponding streams. These links are further used byvideo-streamer-cputo deliver the video to a user for viewing and downloading.After receiving an API request, this service extracts the requested video chunks from
video-storageandvideo-worker(only the last chunk if it’s not yet recorded to the storage). Then it merges the video chunks into a one-piece video and delivers it to a user for viewing and downloading using WebSocket.
Configure Video Recorder
The
video-storageconfiguration is done through environment variables or command line flags. You can also use avideo-storage.yamlconfiguration file and find its default contenthere.When configuring
video-storage, refer to the following parameters:Command line flags
Type
Description
-chunk-storage-localfs-directorystring
The directory to store files.
-chunk-storage-s3-access-keystring
Access key for the object storage.
-chunk-storage-s3-bucket-namestring
S3 storage bucket name.
-chunk-storage-s3-endpointstring
S3 compatible object storage endpoint.
-chunk-storage-s3-operation-timeoutint
Storage operations (Get, Put, Delete) timeout in seconds (default 30).
-chunk-storage-s3-public-urlstring
Storage public url.
-chunk-storage-s3-regionstring
Storage region.
-chunk-storage-s3-secret-access-keystring
Secret key for the object storage.
-chunk-storage-s3-secure–
If
trueAPI requests will be secure (HTTPS), and insecure (HTTP) otherwise (default true).-chunk-storage-typestring
Chunk storage type: inmemory, localfs, webdav, s3 (default
inmemory).-chunk-storage-webdav-keepaliveduration
Keep-alive connection timeout (default 24h0m0s).
-chunk-storage-webdav-max-idle-conns-per-hostint
Max idle keep-alive connections per host (default 20).
-chunk-storage-webdav-timeouts-connectduration
chunk-storage-webdav-timeouts-connect (default 5s).
-chunk-storage-webdav-timeouts-idle-connectionduration
chunk-storage-webdav-timeouts-idle-connection (default 10s).
-chunk-storage-webdav-timeouts-overallduration
chunk-storage-webdav-timeouts-overall (default 35s).
-chunk-storage-webdav-timeouts-response-headerduration
chunk-storage-webdav-timeouts-response-header (default 30s).
-chunk-storage-webdav-trace–
Enable HTTP tracing (extremely verbose, slows everything down considerably).
-chunk-storage-webdav-upload-urlstring
Webdav storage URL (default
http://127.0.0.1:3333/uploads/video_storage).-configstring
A path to a config file.
-config-template–
Output config template and exit.
-debug–
Enable debug logging.
-external-addressstring
Used to access
video-storagevia external links (defaulthttp://127.0.0.1:18611/).-help–
Print help information.
-listenstring
IP:port to listen on (default
:18611).-meta-storage-databasestring
meta-storage-database (default
video-storage).-meta-storage-mongo-uristring
meta-storage-mongo-uri (default
mongodb://127.0.0.1).-meta-storage-timings-connectduration
meta-storage-timings-connect (default 3s).
-streamer-endpointsvalue
List of streamer endpoint URLs (default
127.0.0.1:9000).The format of environment variable for flag
-my-flagisCFG_MY_FLAG.Priority:
Defaults from source code (lowest priority).
Configuration file.
Environment variables.
Command line.
The
video-streamer-cpuconfiguration is done through environment variables or command line flags, or through thevideo-streamer-cpu.yamlconfiguration file. You can find its default contenthere.When configuring
video-streamer-cpu, refer to the following parameters:Command line flags
Type
Description
-h,--help{bool}
Display this help and exit (env:
CFG_HELP).-c,--config{string}
A path to a config file (env:
CFG_CONFIG).-C,--config-template{bool}
Echo default config to stdout (env:
CFG_CONFIG_TEMPLATE).--config-template-format{string}
config-template output format (yaml/env/ini) (env:
CFG_CONFIG_TEMPLATE_FORMAT).--streamer-port{number}
Streamer port (env:
CFG_STREAMER_PORT).--streamer-max-backpressure{number}
Max backpressure for client connection (bytes) (env:
CFG_STREAMER_MAX_BACKPRESSURE).--streamer-io-buffer-size{number}
Muxer’s io buffer size (bytes) (env:
CFG_STREAMER_IO_BUFFER_SIZE).--video-storage-url{string}
video-storageREST-api url (env:CFG_VIDEO_STORAGE_URL).--video-storage-timeout{double}
video-storageapi requests timeout, seconds (env:CFG_VIDEO_STORAGE_TIMEOUT).--cache-dir{string}
Absolute path to the temporary chunk storage folder (env:
CFG_CACHE_DIR).