В процессе фиксирования события, Opencast записывает исходники с помощью python-capture-agent, далее они отправляются на обработки и после нее становятся доступны в пользовательском интерфейсе.
Сначала устанавливаем docker и docker-compose. В Ubuntu и Debian можно сделать это через команду:
sudo apt install docker docker-compose
В админском интерфейсе нажимаем на кнопку открытия боковой панели → Users → Add user
В открывшимся окне заполняем поля, но запоминаем Username и Password.
Во вкладке Roles выбираем ROLE_CAPTURE_AGENT.
Берем отсюда docker-compose.sqlite3.yml, переименовываем в docker-compose.yml и кладем в пустую папку.
Туда же кладем pyca.conf отсюда. Но вместо него можно взять пример снизу:
###
# pyCA Configuration
##
# Notice: Most properties do have sensible defaults. Things that should be
# changed are those properties that are not commented out in this file.
[agent]
# Name of the capture agent
# Type: string
# Default: pyca@<hostname>
name = 'pyca-305-vm-299-docker'
# How often (in seconds) should the capture agent try to get an updated
# schedule from the core.
# Type: integer
# Default: 60
#update_frequency = 60
# For how many days in advance shall the capture agent get the schedule. A
# smaller value will be faster and less memory consuming. Setting this to 0
# will make pyCA request all scheduled events.
# Type: integer
# Default: 14
#cal_lookahead = 14
# In backup mode, the pyCA will not register itself or ingest anything to the
# core. It is useful if you want pyCA act as backup to another capture agent.
# To get the events for another agent, also set the name of the agent to the
# one that should be backed up.
# Type: boolean
# Default: False
#backup_mode = False
# Location of the database file to cache scheduled events in and keep a
# history of recordings. This can be any database supported by SQLAlchemy.
# Type: String
# Default: sqlite:///pyca.db
#database = sqlite:///pyca.db
[capture]
# Base directory to store recordings in. For each recording a subdirectory
# will be created.
# Type: string
# Default: ./recordings
directory = './recordings'
# Command to use for capturing. This may also be a script file. The only
# requirement is that the command terminates itself in time.
#
# Possible string substitutions you can use are:
# {{time}} Time to capture in seconds
# {{dir}} Directory to put recordings in
# {{name}} Autogenerated name of the recording.
# {{previewdir}} Directory to put preview images in
#
# Examples:
#
# Record pulseaudio source using FFmpeg:
# ffmpeg -f pulse -i default -t %(time)s -c:a flac -ac 1 {{dir}}/{{name}}.flac
#
# Record video stream on a Reaspberry Pi using the camera module:
# raspivid -n -t %(time)s000 -b 6000000 -fps 30 -o {{dir}}/{{name}}.h264
#
# Record audio using arecord (alsa recorder):
# arecord -c 2 -d {{time}} -r 44100 -f S16_LE -D hw:0 {{dir}}/{{name}}.wav
#
# Run custom shell script:
# /opt/rec.sh "{{dir}}" {{name}} {{time}}
#
# For more examples, have a look at the pyCA wiki.
#
# Type: string
# Default: ffmpeg -nostats -re -f lavfi -r 25 -i testsrc -t {{time}} {{dir}}/{{name}}.webm'
#command = 'ffmpeg -nostats -re -f lavfi -r 25 -i testsrc -f lavfi -i sine -t {{time}} {{dir}}/{{name}}.webm'
command = 'ffmpeg -err_detect ignore_err -thread_queue_size 2048 -rtsp_transport tcp -use_wallclock_as_timestamps 1 -itsoffset 3 -i rtsp://172.18.130.40:554/305/presenter -err_detect ignore_err -thread_queue_size 2048 -rtsp_transport tcp -use_wallclock_as_timestamps 1 -i rtsp://172.18.130.40:554/305/presentation -map_metadata 0 -map 0 -t {{time}} -c:v copy -an {{dir}}/{{name}}-presenter.mkv -map_metadata 1 -map 1 -t {{time}} -c copy {{dir}}/{{name}}-presentation.mkv'
# Flavors of output files produced by the capture command. One flavors should
# be specified for every output file.
# Type: list of strings (write as '...', '...')
# Default: 'presenter/source'
flavors = 'presenter/source', 'presentation/source'
# Output files produces by the capture command.
# Type: list of strings (write as '...', '...')
# Default: '{{dir}}/{{name}}.webm'
files = '{{dir}}/{{name}}-presenter.mkv', '{{dir}}/{{name}}-presentation.mkv'
# Base directory for preview images generated by the capture command. They can
# be as confidence monitoring in the web ui.
# Type: String
# Default: ./recordings
#preview_dir = './recordings'
# List of preview images to be included in the web ui.
# Type: list of strings (write as '...', '...')
# Default:
#preview =
# Custom signal value that is sent to the capture process to gracefully finish the
# recording. Common signal values can be found in 'man 7 signal'.
# Type: Integer
# Default: 2 (SIGINT)
#sigcustom = 2
# Time in seconds after an events end when the custom signal is sent to the capture
# process. Setting this to -1 will disabl the signal.
# Type: Integer
# Default: -1 (disabled)
#sigcustom_time = -1
# Time in seconds after an events end when a SIGTERM is sent to the capture
# process to shut it down in case it does not do that by itself. Setting this
# to -1 will disable the signal.
# Type: Integer
# Default: -1 (disabled)
#sigterm_time = -1
# Time in seconds after an events end when a SIGKILL is sent to the capture
# process to ensure it terminates and does not block further recordings. Note
# that setting this lower than `sigterm_time` will set this to `sigterm_time`.
# Setting this to -1 will disable the signal.
# Type: Integer
# Default: 120
#sigkill_time = 120
# An additional exit code to 0 indicating that the capture process has
# been completed successfully.
# Type: integer
# Default: 0
#exit_code = 0
[ingest]
# Delete recordings after they have been successfully uploaded. This does only
# apply to the content of the recording directory, not the metadata.
# Type: boolean
# Default: False
delete_after_upload = True
# Defines if pyCA will upload dublin core catalogs to Opencast.
# Deprecated: The option will be removed soon.
# Type: boolean
# Default: False
#upload_catalogs = False
# Delay ingesting a recorded event for a random amount of second between
# delay_min and delay_max before trying to ingest a recorded event. delay_max
# should be higher than or equal to delay_min.
# Type: integer
# Default: 0
#delay_min = 0
#delay_max = 120
delay_min = 0
delay_max = 0
# Limit upload rate in bytes per second. You can add the suffix m for megabyte
# or k for kilobyte (e.g. 2500k is same as 2500000 bytes).
# Floating point values are not allowed. Zero value will skip upload rate limitation.
# Type: String
# Default: '0'
upload_rate = '1m'
[server]
# Base URL of the admin server. This corresponds to the
# org.opencastproject.server.url setting of Opencast.
# Type: string
# Default: https://develop.opencast.org
url = 'https://video.miem.hse.ru'
# Analogue of -k, --insecure option in curl. Allows insercure SSL connections
# while using HTTPS on the server.
# Type: boolean
# Default: False
#insecure = False
# Authentication Method
#
# Historically, capture agents use HTTP digest authentication. The downside of
# this is, that all users need to be specified in the backend configuration
# files. Instead, HTTP Basic authentication can be used with front-end users
# (users created in the web interface). Whatever you use, make sure the user
# has appropriate rights (e.g. ROLE_CAPTURE_AGENT) to communicate with the
# capture agent API in Opencast.
#
# Type: options
# Allowed values: basic, digest
# Default: digest
auth_method = 'basic'
# Username for the admin server
# Type: string
# Default: opencast_system_account
username = 'pyca-1-vm-299-docker'
# Password for the admin server
# Type: string
# Default: CHANGE_ME
password = 'WB6UHTN77rdU3oW73NmU23hy9gdq'
# HTTPS certificates for verification. If signed by a certificate authority
# through an intermediate certificate, make sure to import the whole
# certificate chain.
# Type: string
# Default: ''
#certificate = ''
[ui]
# Username for the pyCA web interface
# Type: string
# Default: admin
username = 'pyca-305'
# Password for the pyCA web interface
# Type: string
# Default: opencast
password = 'WB6UHTN77rdU'
# How often (seconds) should the web interface refresh itself.
# Type: integer
# Default: 10
#refresh_rate = 10
# URL where the web interface is reachable. This will be sent to the Matterhorn
# core and displayed in the admin interface.
# Type: string
# Default: http://localhost:5000
url = 'http://172.18.130.53:5097'
# Command to execute for gathering logs which are then published via the
# web API. The command is executed whenever the JSON API endpoint is
# requested.
# Defining no command will effectively disable the endpoint.
# Type: string
# Default: no command
#log_command = 'journalctl --no-hostname -n 50 -u "pyca*"'
[logging]
# Log to the system logger. Note that this will use /dev/log which may not be
# available on non Linux systems.
# Type: boolean
# Default: False
#syslog = False
# Log to stderr
# Type: boolean
# Default: True
#stderr = True
# Log to file. An empty string will deactivate this log handler.
# Type: String
# Default: ''
#file = ''
# Configure the log level
# Possible values are: debug, info, warning and error
# Default: info
#level = info
# Log format configuration
# Default: [%(name)s:%(lineno)s:%(funcName)s()] [%(levelname)s] %(message)s
#format = [%(name)s:%(lineno)s:%(funcName)s()] [%(levelname)s] %(message)s
#
Пояснения (есть повторяющиеся поля, просматривайте сверху вниз):
name
– вставляем никнейм из окна создания аккаунтаdirectory
– папка, где будут размещаться записи внутри контейнераcommand
– записывающая команда, в данном случае она записывает с 2ух потоков в 2 файлаflavors
– “сигнал” записывающему агенту, что запись состоит из двух файловfiles
– где хранятся записиdelete_after_upload
– удаление записей после выгрузкиdelay_min
– минимальное время, которое должно проходить между концом записи и началом выгрузкиdelay_max
– максимальное время, которое должно проходить между концом записи и началом выгрузкиurl
- адрес админской нодыusername
– вставляем никнейм из окна создания аккаунтаpassword
– вставляем пароль из окна создания аккаунтаusername
– логин для входа в админский интерфейсpassword
– пароль для входа в админский интерфейсurl
- ссылка, по которой можно будет войти в интерфейс записывающего агента через админский интерфейсdocker-compose up -d
docker-compose down