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! :)
 
We've created a Test Videos category now and we've enabled FFMPEG features for thumbnails and transcoding videos:

Test Videos | XenForo Community

Please be patient when you submit videos. We have currently set a limit of 1 video transcoding at a time but generally a video is transcoded quite quickly. If a video needs transcoding you will be notified in the success message at the top of the screen when you save the media. We're working on making that more visible (it's currently blink and you miss it).

If there are any suggestions, questions or bugs, please post in the relevant forum. (Ideally not in this thread).
 
Interesting sample video you uploaded. How did you even come across such a thing?

On topic: That's fantastic, I'll have to play around with it sometime :D
 
How did I miss this :eek: :cool:

Is it possible to sort albums / categories alphabetic now?
I have most country names in there, and I can tell you it's a massive job if a name changes or I add something to sort everything again.
 
The album owner has always been able to sort albums in whatever order they like. There are some presets that order alphabetically. This has been available since before XFMG launched:

image.webp


There hasn't, to the best of my recollection, been a suggestion to add that to categories or albums as a standard sort option.

If it has been show your support for it. If it hasn't been then feel free to suggest it.
 
@Chris D will be be able to upload swf videos too? If not, please consider adding the option for it. We've got a bunch of "historic" swfs that I'd like to be able to put into the gallery so that they're properly filed & archived for posterity.
 
@Chris D will be be able to upload swf videos too? If not, please consider adding the option for it. We've got a bunch of "historic" swfs that I'd like to be able to put into the gallery so that they're properly filed & archived for posterity.
Yes you can, almost any video extension/codes I think.
As long as ffmpeg support it.
 
Few questions and suggestions for future versions or addon developers.

- let us download YouTube/other site videos to our servers once they're embedded on our site, that way if they get deleted from YouTube, we still have them.

- ad support in pause screen and pre/post roll of the video, with option to skip. I'm sure @Siropu may consider this after it's officially released. I only used pause screen ads on my old site, and they got a TON of clicks.

- a clickable watermark is definitely needed, mostly for when people share your video on social media. if they're running up your host bill, at least get a few clicks from them.

- rest looks good. nice work!
 
- let us download YouTube/other site videos to our servers once they're embedded on our site, that way if they get deleted from YouTube, we still have them.
Pretty sure that's against YouTube's terms of service and most of the uploader's license agreements.

As for the others, they're potentially valid suggestions but the best place to post them would be the Suggestions forum. They may get buried and lost in this thread unfortunately. (One thread per suggestion).
 
Nope. It works with locally hosted files only.

Thumbnails for embedded media are best handled with some custom development.
 
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.
@Chris D Thanks for this excellent addition. What do you think would reasonably be the minimum resources for video processing that would not cause performance issues? Is shared hosting an option or could the host consider the resource usage as excessive?
 
It's not something I can comment on. It's very intensive, but this is why we leave the transcode limit set to 1 - this means only one video can be transcoded at a time.

I'm sure your shared hosts or the other customers sharing your box won't thank you. That's if they even allow binaries such as ffmpeg to be executed in the first place.

If you don't enable the ffmpeg features then obviously there's no processing at all but it reduces dramatically the number of formats you can accept (this is handled automatically) and no thumbnails will be created. But, it should at least be better for resource usage - aside from the fact that you would need to be able to accept larger files and all of the configuration changes this may need.
 
Actually we only convert videos if they need converting. If they are already in a format that is playable (most modern devices will produce videos in this format) then we don't touch them. If we do process them, they actually are compressed and come out fairly good quality while being somewhat smaller in size.

It's a tricky balance to get right. Because you don't really want to be transcoding everything, but at the same time you may want to to ensure the videos are optimised accordingly.

It's possibly something we would remedy in the future.
 
Back
Top Bottom