1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

MG 1.1 Updated Media Tagging, Video Uploads and More

Discussion in 'Have You Seen...?' started by Chris D, Jul 15, 2015.

  1. Chris D

    Chris D XenForo Developer Staff Member

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

    Updated media 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:

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

    Adding / editing tags works in exactly the same way:

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

    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:

    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:


    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.


    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:


    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:


    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:


    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:


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


    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:


    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.


    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:


    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:


    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! :)
  2. Russ

    Russ Well-Known Member

    We saw the new videojs reference in the 1.5 download folder and figured something like this was coming :D, nice work!
    mcatze, NixFifty and Chris D like this.
  3. Chris D

    Chris D XenForo Developer Staff Member

    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 :)
    jeffwidman, 0ptima, Walter and 5 others like this.
  4. Jake B.

    Jake B. Well-Known Member

    Looks great!
  5. batpool52!

    batpool52! Well-Known Member

    So that means new HYS videos will be posted in Media here? :D

    Edit: @Chris D will the new video system make use of open graph tags?
  6. Chris D

    Chris D XenForo Developer Staff Member

    Valid suggestion but not currently planned, no.

    Realistically the only tags we can support are release date and tags; and that's assuming the release date would be ok simply being the date of the media being posted, which, in some cases, may not be accurate.
  7. Floyd R Turbo

    Floyd R Turbo Well-Known Member

    Oh yes! Video uploading!! This is perfect for me!!!!
    Glockie likes this.
  8. Neal

    Neal Well-Known Member

    Are you able to have your site name/watermark on uploaded videos?
    Jake B. likes this.
  9. Chris D

    Chris D XenForo Developer Staff Member

    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.
    jeffwidman and Neal like this.
  10. Martok

    Martok Well-Known Member

    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)
    Glockie and Chris D like this.
  11. Brett Chitty

    Brett Chitty Member

    Captioning in videos?
  12. Chris D

    Chris D XenForo Developer Staff Member

    Brett Chitty likes this.
  13. imthebest

    imthebest Formerly Super120

    Divvens likes this.
  14. Veer

    Veer Well-Known Member

    Awesome update for XFMG, Well done @Chris D and rest of the development team (y)
    Chris D likes this.
  15. DRaver

    DRaver Active Member

    Why you are using the old ffmpeg and not the new libav-tools? ffmpeg is outdatet in Debian.
  16. EQnoble

    EQnoble Well-Known Member

    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?
  17. Chris D

    Chris D XenForo Developer Staff Member

    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.
    jeffwidman and resonansER like this.
  18. Chris D

    Chris D XenForo Developer Staff Member

    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.
  19. Glockie

    Glockie Well-Known Member

    Can't wait for release, an excellent and seriously worthy update...
    Asks quietly, any idea to an eta ? :whistle::whistle:
  20. rexxxy

    rexxxy Active Member

    yes yes yes yes OMG did I say yes

    Would it easy to add audio support too for uploading mp3 files?
    Last edited: Jul 15, 2015
    Walter and Alfa1 like this.

Share This Page