Usage
Scan
Run adaptive- regularly, e.g. every 10 minutes as Scheduler task
Execute console commands or as cron job. It only queues jobs and returns
quickly. References saved in the backend do not wait for it, they are queued
on save.
# List files that would be queued
vendor/bin/typo3 adaptive-video:scan --dry-run
# Queue and list them
vendor/bin/typo3 adaptive-video:scan -v
Worker
The worker encodes one video at a time. Run exactly one worker per environment; encodings are CPU heavy and long videos take hours.
Recommended is a process manager such as Supervisor or systemd. The TYPO3 core stops a worker after one hour (after the current job), the process manager restarts it, so new code is loaded regularly.
[program:adaptive_video_worker]
command=/path/to/vendor/bin/typo3 messenger:consume adaptive_video
autorestart=true
numprocs=1
; Lets a running encoding finish on stop
stopwaitsecs=10800
Without a process manager, cron with flock works as well. Calls fail on
the lock while a worker is running:
* * * * * flock -n /tmp/adaptive_video.lock /path/to/vendor/bin/typo3 messenger:consume adaptive_video
Restart the worker after a deployment. An encoding aborted by a restart is
handed out again after redeliver and continues from the start.
-v, -vv and -vvv print the progress of the worker: -vv shows when a
video is started, encoded and ready.
Status
# Versions per status, running and failed jobs
vendor/bin/typo3 adaptive-video:status
# Additionally skipped versions
vendor/bin/typo3 adaptive-video:status -v
# Versions of a file, active version and playlist URL
vendor/bin/typo3 adaptive-video:status <fileUid>
Retry and reprocess
- Retry a failed or skipped version: delete its row from
tx_; the next scan queues the file again.adaptivevideo_ version - Reprocess everything (e.g. after a broken profile): empty the artifact
directory and the table
tx_, then run the scan. The originals are delivered until the new versions are ready.adaptivevideo_ version
Old versions and their files are not removed automatically.
Environments and deployment
Database and artifact directory belong together: a ready version without
its files results in a broken player (the renderer does not check the
files). When copying a database between environments, copy the artifact
directory as well.
A typical rollout:
- Deploy with
processingandEnabled = 1 deliveryon production. Videos are encoded, the frontend still delivers the originals.Enabled = 0 - Copy database and artifact directory to a test environment with
deliveryand test there.Enabled = 1 - Enable delivery on production and flush the page cache.