Skip to content

Add wagtailvideos #106

Merged
merged 7 commits into from
Jan 19, 2021
Merged

Add wagtailvideos #106

merged 7 commits into from
Jan 19, 2021

Conversation

donald
Copy link
Member

@donald donald commented Jan 10, 2021

Addresses #46

Adds wagtailvideos and a streamfield block for it. Seems to kind of work, but it is far from perfect.

The admin interface seems not always to be updated promptly. For some reason is doesn't always show the video stills. The style is ugly (text on top of each other). It has options and three profiles to transcode to different formats (for different browsers) but tah needs to be requested manually for each video. Otherwise you might end up with just the original video on the web page which might be unplayable or much bigger then required. This should be automatic (like YouTube upload). So it can be used to embed a video in a wiki page, but the ugly, imperfect interface might be a bit annoying.

OTOH, I also need something for the work safety videos, too.

I'd like @ballaschk to decide.

But it would be annoying to install something on the live server just for testing. Because removing a feature requires additional database migrations. Maybe we need a staging server to preview suggested features.

@ballaschk
Copy link
Collaborator

Sounds good, basic functionality is better than nothing :)

Text on top of each other sounds bad though, and the state of things as you describe it does not seem to allow "normal" editors to use the functionality. Would it be possible to restrict the availability of the streamfield block to privileged users, i.e. admins?

Testing/staging/playground server sounds like a great idea! (I think I never approved the sorting function of the literature list either, since we all have not been to the Institute regularly).

Add wagtailvideos from https://github.com/neon-jungle.

The version in PyPi is a fork of an older version and incompatible
Django 3.

Pick current latest commit from the master branch, because the last
fixes seem to be usefull and there is no release for it.
Update python requirements with

    (cd requirements;  make)

The virtual environment can be update to the specified versions with

    pip-sync requirements/dev.txt
The <p> element at this level are wrong, because the StreamField blocks
will add their own <p> elements and nested <p> elements are not legal.
This structural errors makes the fallback text in a <video> element
visible, even when the video is playable.

Remove <p> element.
Create migrations with

    ./manage.py makemigrations
@donald
Copy link
Member Author

donald commented Jan 14, 2021

Here it is to test and paly around: https://intranet2.molgen.mpg.de/. Dhe database and file can be cloned any time from the real Site. Perhaps I automate that to restore every night or Sunday or whatver (?). wagtailvideos is integrated. Admin-Interface has "Videos". Videos can be added in the streamfield of pages. Here's a testpage with a video: https://intranet2.molgen.mpg.de/de/service/scientific-service/it/test/

After upload the videos can be transcoded into a set of formats. All generated formats (and the original) are "offered" to the browser when a video is embedded in a page. However, the available formats are inserted in random order and browsers big the first one they can decode. So adding a format which is not optimal can have negative effects. E.g. when you add ogg, a modern Firefox might display that instead of webm, and the off file is much much longer. Maybe webm is the only thing you need nowaday anyway. You can't delete individual encodings, just the original video with all generated encodings.

Sorting function not yet included. Need to rebase that.

@ballaschk
Copy link
Collaborator

I tested it with a typical video of a talk (~2h) and everything seems fine! I checked with Firefox, Safari and Chrome on the Mac and everything plays perfectly. What about your Linux machine, does it work with my upload as well? Do you have a Windows system at hand to test it?

Although I'm not sure about the generation of alternative versions / transcodes. I tried to generate WebM files (which took forever) but I can't find the files anywhere. So I can't really say if it was successful.

If you think it looks good in other Browsers, I think we are good to go!

@donald
Copy link
Member Author

donald commented Jan 19, 2021

Your video has (only) the webm encoding (which I assume is fine). This is visible, when you go to the "Videos" from the admin page, then click your video. There is a bullet list "Transcodes" which only lists "* VP8 and Vorbis in WebM (Default quality) ".

Yes, I am able to view the video with Firefox from Linux and Windows. I have no doubt, that Chrome is able to display the video, too. So I'm going to merge this PR and install it on the main server.

Please be careful with the https://intranet2.molgen.mpg.de. I'm afraid, someday you might be doing a lot of work on the Intranet, just to find, that you've been on the wrong server the next day when I reset and wiped it. Maybe, I should hack another background color into it :-)

@ballaschk
Copy link
Collaborator

Your video has (only) the webm encoding (which I assume is fine).

This is interesting since the original file is an .mp4 with H.264/AAC encoding. Maybe there is something miswired in the interface? It also states "Voris" instead of Vorbis.

I'll make a few really small test files and upload them before you merge this.

@donald
Copy link
Member Author

donald commented Jan 19, 2021

I used a sloppy formulation. Of course, the original video is there, too. The .webm is the only transcoding the server added.
If you add the video to a wiki page, the browser will be offered all transcondings and the original format, too.

        <h2 class="label">Video preview</h2> <video  controls="" poster="/media/original_videos/vlcsnap-2021-01-18-12h21m06s193.png" style="max-width:100%">
<source src='/media/video_transcodes/ThomasGraf_DahlemColloquium_MPIMG_200616.webm' type='video/webm' >
<source src='/media/original_videos/ThomasGraf_DahlemColloquium_MPIMG_200616.mp4' type='video/mp4'>
<p>Sorry, your browser doesn't support playback for this video</p>
</video>

@ballaschk
Copy link
Collaborator

There is a bullet list "Transcodes" which only lists "* VP8 and Vorbis in WebM (Default quality) ".

This list actually gives additional transcodes (in addition to the original file).

So everything should be fine and I look forward to seeing this on the production server ;)

@donald
Copy link
Member Author

donald commented Jan 19, 2021

@donald donald merged commit a39fa4b into master Jan 19, 2021
@donald
Copy link
Member Author

donald commented Jan 19, 2021

Its active on the main site.

@donald donald mentioned this pull request Jan 19, 2021
Sign in to join this conversation on GitHub.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants