MG 1.1 Updated Media Tagging, Video Uploads and More

Today, we're ready to talk about what's coming in version 1.1 of the XenForo Media Gallery add-on.

Updated media tagging
We intend on releasing updates to our official add-ons to add support for tagging.
So, this one likely isn't going to be much of a surprise. XFMG already includes a content tagging system for media. In XFMG 1.1 we are replacing that system with the same content agnostic system we introduced in XenForo 1.5.

As with XenForo 1.5 there are two possible positions for displaying tags. The top position in the gallery is just below the media title:
1.webp



And the bottom position is just below the media, controls, and author information:
2.webp



Adding / editing tags works in exactly the same way:
3.webp



And they also appear in the same way as they do on threads:
4.webp



There are some permissions relating to the ability to tag media which are similar to the permissions for thread tagging. In addition to a moderator permission that allows managing the tags of any media:
5.webp



It is also possible to specify a minimum number of tags to be required for media on a per category basis or globally specify a minimum number of tags to be added to media in albums.

When upgrading to XenForo Media Gallery 1.1, we will automatically transfer the tagged content to the new system.


Video uploads

One of our most popular suggestions is to allow the uploading of videos. This is switched off by default, but it can be set, like the other media types, on a per category basis, with permissions to allow it to be used in Albums.

The main concern with handling video uploads is one of compatibility, various pre-requisites and your server's ability to actually be able to handle the process. The solution we have implemented has been designed to ensure most of these concerns are mitigated in some way.

The good news is, this feature doesn't actually require any pre-requisites to be installed to be used in a basic way. Out of the box once you have set up permissions and some other options (see below) you can start uploading videos.

Once a video is uploaded we attempt to ascertain whether or not it should play in most modern browsers without the need to transcode it (typicaly this would be a H264 video and MP3/AAC audio). If it can't be, this error is shown:

6.webp


This really gives the ability to very easily support video uploads for what is probably becoming the most prevalent video format, straight out of the box without any configuration.

However, this does lack some desirable features. Aside from not being able to transcode, by default generating a thumbnail from the video isn't supported either. This is where FFMPEG comes in.

7.webp


FFMPEG is a cross platform solution used to convert audio and video formats. Setting this up should be simple. It should just be a case of downloading the binary files supported by your server OS and specifying the path in the options.

By default, providing the path to the FFMPEG binary doesn't actually enable anything. There are two things it can be used for. It can be used to generate video thumbnails. So, even without enabling the ability to transcode videos, you can, at least, allow thumbnails to be generated automatically from the supported videos you upload.

FFMPEG can also be used to transcode videos to a supported format when required. Given the same WMV file that caused an error above, this will now upload successfully:

8.webp


The video library used to actually display the uploaded videos, VideoJS, is actually included in the XenForo 1.5 package so it can be used for other uses if you wish.

Of course transcoding a video isn't a quick process, but the process is completely transparent to the end user. When saving media which includes some video that needs to be transcoded, a notice is displayed briefly notifying them that their media needs to be processed.

As you can see from the options in the screenshot above, you specify the path to your PHP binary and you set a limit to control how many videos will be processed at once. When a video requires processing we add it to the queue. Once the videos start processing, we defer this process to the command line which is then handled by the aforementioned PHP binary. This avoids various limits such as max_execution_time.

Once the processing is complete, the user receives an alert:

9.webp


Similarly if the process fails, for any reason, the user will receive another alert and an exception will be logged with more details in the Server Error Log.

As you would expect, there are options relating to the maximum file size and supported file extensions in the options in the new Video Options tab on the Gallery Options page.

Redesigned "Add Media" page

The first change is mostly aesthetic in nature in that it serves to slightly simplify the interface when adding media:

10.webp


We now hide certain elements on the page unless they are selected, e.g. the album drop down and the image upload URL field. We've also removed the rather sizeable block of quota details into a more subtle banner which includes the full quota details in an overlay.

The biggest changes, however, are slightly more functional in nature. Rather than the familiar grid format, when you are adding media, each media item now has its own row:

11.webp


Each media item being added can be expanded to reveal some additional options:

12.webp


This has enabled us to implement another one of the more popular suggestions which is to allow media to be tagged and have custom fields populated while the media is being added. We don't automatically show all custom fields when media is being added. The specific ones shown are controlled on a per-field basis:

13.webp


There is also a new option to set a field as "required" thus ensuring a field has to be populated if it is shown.

The changes to the add media form also extend to the edit media form, which is now also where custom fields are edited when adding media. When editing media, all custom fields applicable to the category/album will be shown.

Author Alerts

This one is mostly self explanatory - when a moderator is editing or deleting media, albums or comments they also have the ability to send an author alert.

14.webp



Sorting and Filtering

We have redesigned the media/album index pages so that the sorting and filtering controls are somewhat more subtle and simpler to use:

15.webp


We have replaced the tabs with menus which should allow a more consistent appearance on various devices with different styles. The sort options are the same as you're used to, just accessed from the menu instead of clicking on a tab.

We have added an additional filter option too:

16.webp


In addition to being able to filter down to media in categories/albums only, you can also filter down to a specific type of media.


This HYS thread actually concludes everything we have to tell you about XenForo Media Gallery 1.1. All that's left to do now is to install a preview of the new version here... soon! :)
 
Yeah, as briefly mentioned above we thought it worth including with XF itself rather than isolating it to the gallery. At least if people want to use video elsewhere on the site, outside of the gallery, or developers want to, then it can be done so in a consistent way :)
 
We don't do anything to support watermarking videos, no.

That said, there are two ways of watermarking a video. Either the video player itself displays a watermark inside the player as the video is playing, or the actual video source is watermarked during the transcoding process.

Both are valid suggestions but neither are included by default.

That said, the VideoJS player is extensible and actually has a watermark plugin. That would be fairly easy to implement, but obviously the source video would still not be watermarked if that's your aim.
 
A superb update to XFMG. :D

I'm delighted that tags and fields are now included on the media upload page, hopefully it'll mean that members will now use these excellent but mostly neglected features. The video upload is a great addition that will be popular with many on here.

Top work! (y)
 
We don't do anything to support watermarking videos, no.

That said, there are two ways of watermarking a video. Either the video player itself displays a watermark inside the player as the video is playing, or the actual video source is watermarked during the transcoding process.

Both are valid suggestions but neither are included by default.

That said, the VideoJS player is extensible and actually has a watermark plugin. That would be fairly easy to implement, but obviously the source video would still not be watermarked if that's your aim.

If someone got ambitious they could alter the command string for ffmpeg so that one could optionally add a png img and pass it through a filter, of course they would also have to extend the functionality of the media upload page to do that but it is possible to use ffmpeg so that it is hard-coded in the destination file unless I am mistaken here?
 
Why you are using the old ffmpeg and not the new libav-tools? ffmpeg is outdatet in Debian.
Ffmpeg is actively maintained.

Easiest way to get the most up to date version is from here:

FFmpeg Static Builds

They recommend using the latest git version which was last built today. No need to use the outdated versions from your distro's package manager.

Just to be clear: It's literally as simple as unpacking the archive and putting the ffmpeg binary only in an accessible location. You could install the outdated version from the package manager and replace the ffmpeg binary in that with the one from the packages available at the URL above. That should be sufficient.

Just a bit of clarification: Ffmpeg itself includes quite a few components including ffserver, qt-faststart and ffprobe - we don't use any of these and Ffmpeg has no dependency on them. You only need the Ffmpeg binary.
 
If someone got ambitious they could alter the command string for ffmpeg so that one could optionally add a png img and pass it through a filter, of course they would also have to extend the functionality of the media upload page to do that but it is possible to use ffmpeg so that it is hard-coded in the destination file unless I am mistaken here?
Indeed. Hence me saying it would need to be added during the transcoding process.

In theory, though, it would need custom code. We literally don't touch Ffmpeg unless the video needs to be transcoded (or getting the thumbnail but that's a special case). There's a fairly good chance that most videos (especially those taken on modern devices, cameras and smartphones) won't need transcoding.
 
Back
Top Bottom