Package: wagtailvideos
Based on wagtailimages. The aim was to have feature parity with images
but for html5 videos. Includes the ability to transcode videos to a
html5 compliant codec using ffmpeg.RequirementsWagtail >= 4.0 (for older wagtail version see the tags)ffmpegInstallingInstall using pypipipinstallwagtailvideosAddwagtailvideosto your installed apps.INSTALLED_APPS=['wagtailvideos',]UsingOn a page model:Implement as aForeignKeyrelation, same as wagtailimages.fromdjango.dbimportmodelsfromwagtail.admin.edit_handlersimportFieldPanelfromwagtail.core.fieldsimportRichTextFieldfromwagtail.core.modelsimportPagefromwagtailvideos.edit_handlersimportVideoChooserPanelclassHomePage(Page):body=RichtextField()header_video=models.ForeignKey('wagtailvideos.Video',related_name='+',null=True,on_delete=models.SET_NULL)content_panels=Page.content_panels+[FieldPanel('body'),VideoChooserPanel('header_video'),]In a Streamfield:A VideoChooserBlock is includedfromwagtail.admin.edit_handlersimportStreamFieldPanelfromwagtail.core.fieldsimportStreamFieldfromwagtail.core.modelsimportPagefromwagtailvideos.blocksimportVideoChooserBlockclassContentPage(Page):body=StreamField([('video',VideoChooserBlock()),])content_panels=Page.content_panels+[StreamFieldPanel('body'),]In template:The video template tag takes one required postitional argument, a video
field. All extra attributes are added to the surrounding<video>tag. The original video and all extra transcodes are added as<source>tags.{%loadwagtailvideos_tags%}{%videoself.header_videoautoplaycontrolswidth=256%}Jinja2 extensions are also included.How to transcode using ffmpeg:Using the video collection manager from the left hand menu. In the video
editing section you can see the available transcodes and a form that can
be used to create new transcodes. It is assumed that your compiled
version of ffmpeg has the matching codec libraries required for the
transcode.Disable transcode:Transcode can be disabled using theWAGTAIL_VIDEOS_DISABLE_TRANSCODEsetting.# settings.py
WAGTAIL_VIDEOS_DISABLE_TRANSCODE = TrueModify Thumbnail extension:The automatically generated Thumbnail extension can be modified  using theWAGTAIL_VIDEOS_THUMBNAIL_EXTENSIONsetting. Default value is jpg# settings.py
WAGTAIL_VIDEOS_THUMBNAIL_EXTENSION = 'webp'Custom Video models:Same as Wagtail Images, a custom model can be used to replace the built in Video model using theWAGTAILVIDEOS_VIDEO_MODELsetting.# settings.py
WAGTAILVIDEOS_VIDEO_MODEL = 'videos.AttributedVideo'

# app.videos.models
from django.db import models
from modelcluster.fields import ParentalKey
from wagtailvideos.models import AbstractVideo, AbstractVideoTranscode

class AttributedVideo(AbstractVideo):
    attribution = models.TextField()

    admin_form_fields = (
        'title',
        'attribution',
        'file',
        'collection',
        'thumbnail',
        'tags',
    )

class CustomTranscode(AbstractVideoTranscode):
    video = models.ForeignKey(AttributedVideo, related_name='transcodes', on_delete=models.CASCADE)

    class Meta:
        unique_together = (
            ('video', 'media_format')
        )

# Only needed if you are using the text tracks feature
class CustomTrackListing(AbstractTrackListing):
    video = models.OneToOneField(AttributedVideo, related_name='track_listing', on_delete=models.CASCADE)

class CustomVideoTrack(AbstractVideoTrack):
    listing = ParentalKey(CustomTrackListing, related_name='tracks', on_delete=models.CASCADE)Video text tracks:To enable the uploading and displaying of VTT tracks (e.g. subtitles, captions) you’ll need to addwagtail.contrib.modeladminto your installed apps.
Once added, there will be an new area in the admin for attaching VTT files to videos with associaled metadata.Future featuresSome docsRichtext embedTranscoding via external service rather than ffmpeg