This document describes how to develop and extend
django-video-transcoding
.
$> src/manage.py test
$> pip install mypy django-stubs
$> cd src && mypy \
--config-file=../mypy.ini \
-p video_transcoding \
-p django_stubs_ext
- All configuration is stored in
video_transcoding.defaults
module. - Most important variables are configured from ENV
settings.VIDEO_TRANSCODING_CONFIG
may be used for overriding defaults.
- if you are running transcoder in docker, make sure that celery master process has pid 1 (docker will send SIGTERM to it by default)
- when using separate celery app, send SIGUSR1 from master to workers to trigger
soft shutdown handling
(see
video_transcoding.celery.send_term_to_children
) - celery master should set process group in order to send SIGUSR1 to workeres
(see
video_transcoding.celery.set_same_process_group
)
- extend
video_transcoding.tasks.TranscodeVideo
to change task behavior - top-level transcoding strategy is selected in
TranscodeVideo.init_strategy
, seevideo_transcoding.strategy.ResumableStrategy
as an example - see
video_transcoding.transcoding.transcoder
module for low-level transcoding steps examples - dealing with different intermediate files requires metadata extraction and
specific logic for this process is implemented in
video_transcoding.transcoding.extract.Extractor
subclasses. - missing metadata is restored by different analyzers in
video_transcoding.transcoding.analysis
module.
- For preset-related models use
<Model>Base
abstract models defined invideo_transcoding.models
. - For overriding
Video
model setVIDEO_TRANSCODING_CONFIG["VIDEO_MODEL"]
key toapp_label.ModelName
insettings
. - Connect other django models to
Video
usingvideo_transcoding.models.get_video_model()
. - When
Video
is overridden, video model admin is not registered automatically. As with migrations, this should be done manually.