Ask A Question

Notifications

You’re not receiving notifications from this thread.

Transcode a video and move to a remote server

Nghia Nguyen asked in Rails

Hi Chris,

I'm following the introduction video where show the usage of Shrine and FFMPEG. What I'm trying to do is having the users upload the videos, then transcode them to MP4 and save to a dedicated server for videos. That way, the videos are ready to stream whenever.

Being new to Rails, I don't quite know how to do it. How do I kick off the transcoding jobs in the background as soon as the user upload the video?

Thanks in advance if you can help.
-James

Reply

Hey James,

Have you seen this episode? This runs transcoding in a background job after upload: https://gorails.com/episodes/shrine-background-and-video-transcoding

Reply

Hi Chris,

That's the video I was talking about. It copies files and transcoding with background jobs; exactly what we need. One thing missing is saving all the transcoded videos to a dedicated network drive.
Is there away for me to set up Shrine so that it uses a network drive as the 'store' directory? I'm fooling around with the Samba URL, it's obviously wrong.

Shrine.storages = {
cache: Shrine::Storage::FileSystem.new("public", prefix: "uploads/cache"), # temporary
store: Shrine::Storage::FileSystem.new("smb://xxx/yyy/") # permanent
}

Reply

You might need to build your own storage plugin for Shrine if your SMB share isn't mounted as a disk somewhere.

Reply
Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 84,387+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.