A user, vaughajj, is experiencing issues with uploading large video files to Discourse, despite setting the upload_size parameter to 500m in app.yml. The error message “Sorry, there was an error uploading that file. Please try again” appears after reaching 100% transferred, and the CPU usage jumps to 100%.
vachajj is trying to set up a site where students can submit videos for review, but the use case doesn’t lend itself well to uploading to Dropbox or YouTube due to privacy concerns.
codinghorror suggests that Discourse isn’t oriented towards giant video sharing tasks and recommends uploading videos to Vimeo, YouTube, or similar platforms. 8BIT proposes using YouTube’s private upload feature, which allows users to upload videos directly from the YouTube app and set them to private.
vachajj tests YouTube as a solution and finds it to be a good option, but suggests integrating the YouTube video upload API to make the process seamless. supermathie proposes using unlisted videos instead of private ones, which would allow for easier embedding.
[pfaffman](/t/-/70963/4, 9, 11, 13) suggests that limiting video uploads to 5 minutes would make it easier for Discourse to handle them, but also provides instructions on how to increase the maximum upload size by adding a variable to app.yml. outofthebox asks if it’s possible to change the settings to allow Discourse to handle large files without combining different platforms.
I set params: upload_size: 500m in app.yml. Tried uploading a 153MB mp4 video and got the error message “Sorry, there was an error uploading that file. Please try again.” A 26.5MB mp4 video file uploads fine.
Checking the nginx conf file inside the docker container it is properly set to 500m.
When uploading the larger file, after reaching 100% transferred the %cpu on the discourse process jumps to 100%. Site is currently running on a Digital Ocean 8GB droplet.
from production.log
Started POST "/" for 108.253.248.44 at 2017-09-28 16:39:20 +0000
ActionController::RoutingError (No route matches [POST] "/")
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/actionpack-5.1.3/lib/action_dispatch/middleware/debug_exceptions.rb:63:in `call'
Processing by ExceptionsController#not_found as HTML
Parameters: {"RqRfk4mdN 9R2KtxVgGadDi0dwSNjAoyhViUJ07IhBlL74e8J6xNTDDONCo HBYPeVWcif9pCCcbgNjnaSN6QgVssKK1MlrIW9duc0rE0iVEc W2qi71kf6IBA7jGmTcszkhQuqBwIPVMzm6aK15K0apyjW/W/jyVndjZt3iagmPbYAPjCL L0Z0PhfXxBcfUDVsi3EQWlyfhO kHe8KqcGyXiy2O537tTTU8ZE1vFaDPgVPNRHqFyBZaIa1tgy571S 1x8Trha8xI8KEXEnNSniWIX1yLnVCN6kgPvr qDiaco2aWXUfTwaWSHX7GmCkoaKnNFDK8uPVmdJ7Ja9EZrckhI gTCMYiP7TSXxR0Mf/TpuDxPFhByAiV "=>nil}
Can't verify CSRF token authenticity.
Rendering text template
Rendered text template (0.0ms)
Filter chain halted as :verify_authenticity_token rendered or redirected
Completed 403 Forbidden in 2ms (Views: 0.8ms | ActiveRecord: 0.0ms)
Suggestions? I am trying to setup a site where students can submit videos for review and other students can comment on those videos with video. Unfortunately the use case doesn’t lend itself well to uploading to dropbox or youtube as the student work needs to be kept private and the class frequently uploads the movies directly from iOS devices lended out to them by our college so setting up Dropbox each time the devices were checked out won’t work.
And if there is a better platform to handle this amount of video feel free to chime in. I’m open to anything.
YouTube is a great solution to this though… as they can upload natively via the YouTube app and default to private so the video isn’t public and is only shared when embedded into your community site. It’s entirely free and the delivery / speed is top-notch.
Is there anything missing from the workflow that would preclude YT? I use this exact workflow for videos I make for my moderating team.
I did a proof of concept for someone needing to upload videos at a university (in a former life I was an instructional technology professor at a decent state university). If you keep the videos small enough you can make it work. As I recall, it was trouble upping the limit, but I got it to where I think it was good enough.
And if videos are longer than 5 minutes no one is going to watch them, so there’s no point in uploading the video anyway.
On the server side, not sure what to do about the connection reset.
On the client side, we could show a warning to let the user know that it’s probably better to use YouTube or similar to handle the video upload and just post a link here instead.
Thank you for all the feedback. Trying out YouTube as a solution, the 20 minute test video took about 8 minutes to compress, transfer to YouTube, convert, and be pasted into Discourse – directly from iOS. Not bad in my opinion. The only downside is the YouTube sign in and having to share a single Google account/YouTube login credentials with everyone in the class.
It would be great if you could integrate the YouTube video upload API. Videos could then be transferred seamlessly to YT without the end user having to setup a YT account.
Would it be sufficient to have the video ‘unlisted’ rather than ‘private’? That way uploading would be the same but it could still be embedded without difficulty.
That’s fairly special-purpose and would require a plugin. I’d still be inclined to limit videos to something like 5 minutes so that Discourse handle them.
This is what makes iOS devices so horrible for classrooms. Apple goes out of its way to make them for single users.
For the sake of user convenience - only using Discourse and not combining together different platforms - is it possible to change the settings so that Discourse can handle large files? An audio recording of a 30 minute presentation with an image-rich PPT that accompanies the audio can be larger than the default settings, but still well within the normal range of document sizes that people (at least myself) might want to share.
Yes, the topic I linked to includes instructions for increasing the maximum upload size by adding a variable to app.yml, then you can increase the max upload size site setting.