I am looking for a way to convert video formats in grails.
I need to be able to do the following:
- user can upload videos from their mobile device to this Grails web-app. The web-app will then convert from the uploaded format to mp4 and ogg and display it in a browser using html 5 video tag.
- User can upload directly to the Grails web-app in most common formats. This will be converted to mp4 and ogg and display in a browser using html5 video tag.
There must be a way of doing this in grails that I just can’t find it.
Any ideas?
Your best bet will be to drop out of Grails and execute one of the numerous command-line video conversion utilities to do the “heavy lifting” of the actual conversion. Then all Grails has to worry about is:
This lets Grails do what it does best (deal with web things) and leaves the hard part to others.
One thing I would strongly advise would be to separate out the video conversion process from the web serving process using a job queue (like RabbitMQ) to queue up conversion jobs and then have a service (or a whole different server) take care of running the conversion jobs. This will keep your web server responding well and will let you scale the conversion process as you need to.