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

MG 1.1 Assorted video upload questions

Discussion in 'Media Gallery Support' started by jauburn, Aug 14, 2015.

  1. jauburn

    jauburn Well-Known Member

    If I'm understanding it correctly, users can now upload their own videos. So I have various questions on exactly how to implement this.

    First, how does one turn the feature on? Is it simply a matter of clicking "Enable FFMPEG features"?

    And in that section, what should go in the FFMPEG Binary Path and PHP Binary Path fields? Let's say I have xenforo installed in the public_html/forum directory, for example purposes.

    Also, what kind of disk usage spike is the uploading of videos likely to cause? I see that one can enable a size quota, but what's the size of your typical 10-minute video? And how likely is it that users, on their end, will be able to downsize their videos in order to upload? (Downsizing requires some technical skill.)

    Which video files formats are the best to encourage members to use or start with?

    In the "allowed video file extensions" box, can one add more? If so, which ones are supported?

    Are there any other gotchas or things to watch out for when implementing this feature?

  2. Chris D

    Chris D XenForo Developer Staff Member

    Enabling FFMPEG provides two functions. The first is generating thumbnails from videos. The second is transcoding videos to a supported format. Both of these are actually optional. Without FFMPEG features you can still upload videos, but they must be already encoded in h264 for video and AAC for audio. This covers the most prevalent formats used by current smartphones and cameras. Any videos where we don't detect this format will be rejected. Also without FFMPEG features, thumbnails won't be generated. They would have to be manually uploaded after the media is saved.

    If you are enabling support for thumbnails only then you would only need to supply the FFMPEG Binary Path. FFMPEG is a third party piece of software that you would need to install on your server. How to do that is mostly beyond the scope of support, but once it is installed, generally typing "which ffmpeg" from a shell on your server should tell you the path where it can be found. If you wish to enable the transcoding features too, you would need to supply your PHP binary path, this is the location of the "php" command on your server. Again you may be able to find that with "which php".

    How long is a piece of string? This is a tricky one to answer. I have a 30 second 1080p video from my phone which is 70MB. I have a 2 minute 480p video which is only 10MB. It will vary wildly depending on the source format, resolution, length, and whether it needs to be transcoded or not. Users rarely resize images themselves so them resizing videos seems extra unlikely.

    MOV and MP4 will be the likely ones which are coming from their smartphone or cameras. It's mostly academic, however, as the extension shouldn't actually mean much, ultimately. It's how the video is encoded which matters and we check that at a much deeper level than just the file extension. Leaving it at the defaults is probably reasonable.

    You can add more, remove the default ones. Again, it's mostly academic. If you don't enable transcoding, the files can be any of the allowed extensions but they must be encoded with h264/aac or they will be rejected. If you do enable transcoding, the files can be any of the allowed extensions, but we'll transcode them into a supported format. The supported source formats will vary wildly depending on how FFMPEG has been compiled and what formats it can support. However, it pretty much supports everything!

    The FFMPEG needs to be a minimum version of 1.1.0 (which shouldn't be too much of a problem as that was released in 2013). The encoders that it supports may be an issue. Specifying the correct paths can sometimes be problematic. There's then various server configurations that could affect the ability to call external binaries. Most of these things will become apparent when trying to enable the feature, though. We detect most problems and let you know roughly what they are.
    jauburn likes this.
  3. jauburn

    jauburn Well-Known Member

    Thank you for the responses. There's a lot to chew on here. I'll have to contact my web host to get FFMPEG installed. More importantly, I'll have to determine whether my users even care enough to make this worth the trouble. I suspect that most folks aren't even technical enough to get videos off of their phones, much less know which folder the videos are in so that they can upload them via the xen interface. Maybe I'm underestimating everyone, though, since I'd have to figure this stuff out myself (I mean, iTunes doesn't help matters--Apple sure knows how to hide the file system from the user).

    Also, the space requirements sound potentially massive. While I think this video hosting capability is a great feature, I wonder what the advantages and disadvantages would be in hosting the videos yourself vs. having users first upload to their own YouTube (etc.) account and then embedding the videos from there.
  4. Chris D

    Chris D XenForo Developer Staff Member

    From an iPhone user's perspective, they just do the same thing as if they were uploading an image.

    You don't see the filesystem, you just get straight into your Photos and that's also where the videos are.
    jauburn likes this.
  5. Håkan Olsson

    Håkan Olsson Member

    So, in your setup, if someone uploads e.g., a mp4, h264, AAC video to the gallery, FFMPEG is not involved in any transcoding process because the uploaded video will play just fine on many devices – as it is. Right? If so, who makes that decision -- XF or FFMPEG?

    I haven't started using/trying FFMPEG yet but I think I will need to config all uploads to become transcoded to bitrates more suited for slow internet connections. Perhaps I want to add a down-resize too in case someone uploads a 1080p or a 4k. Another reason is, I tried playing an ipad-made-video (in a forum post) using two android phones but only one of them could play it.

    Can you mention something (generally) about if above case can be configured and what is set at XF and FFMPEG respectively? (Yes, bitrate and resizing would obviously be set at FFMPEG but what about the above or similar scenarios in general?)

  6. Chris D

    Chris D XenForo Developer Staff Member

    Correct. A script we modified for use in XF performs an analysis of the file and works out what codecs are used for video and audio. The decision is based on that.

    It would require custom development or an add-on to trigger it to do a transcode all the time. There's no option to change any of the bit rate settings or resize options; that would also require custom development or an add-on.
  7. Håkan Olsson

    Håkan Olsson Member

    I guess I should first find out how widespread the Android »issue» (unable to play .mov) really is. Depending on that, I might be back with a custom development question.

    Thank you for the help
  8. BrianC

    BrianC Member

    Sorry If I am kicking alive an older post. I am planning on getting media gallery soon and recognize the necessity of having FFMPEG available in order to process thumbnails and reformat video from phones that is not web ready. I believe the iphone uploads videos that can play but are quite large which might cause some performance issues.

    Question: Is it possible to use another service who processes FFMPEG for media conversion. I am adding a link not for consideration and do not know anything about them but apparently there are sites that process FFMPEG. Curious if this is an option. I am going to ask my vps host if I can install FFMPEG. Not sure how to do it or what impact it would have on my VPS performance.

  9. Brogan

    Brogan XenForo Moderator Staff Member

    It may be, but it's not something you could seamlessly integrate into XF without custom development.

Share This Page