Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transcoding progress #5

Closed
nordringrayhide opened this issue Sep 23, 2012 · 2 comments
Closed

Transcoding progress #5

nordringrayhide opened this issue Sep 23, 2012 · 2 comments

Comments

@nordringrayhide
Copy link

How i can control progress in percents of large file transcoding ?

@rheaton
Copy link
Owner

rheaton commented Sep 25, 2012

There is currently not a method for doing this in this gem.

It shouldn't be too hard to implement for normal streamio transcoding if you wanted to pass a block as an option to :encode_video

Here is how you pass the block: https://github.com/streamio/streamio-ffmpeg#transcoding

You would add it to the options and if it's set, execute it here: https://github.com/rheaton/carrierwave-video/blob/master/lib/carrierwave/video.rb#L57

Here's an example of how it might look in the end:

class VideoUploader < CarrierWave::Uploader::Base
  include CarrierWave::Video

  process encode_video: [:mp4, { progress_block: Proc.new {|progress| puts progress} } ]
end

If you wanted it to send a method to the object with the uploader, you'd have to check that the scope worked out. That might look like this:

class VideoUploader < CarrierWave::Uploader::Base
  include CarrierWave::Video

  process encode_video: [:mp4, { callbacks: { progress: :progress_method } ]
end

I can't remember if the ffmpeg2theora binary gives any progress as I'm not actively developing this anymore.

Feel free to create a pull request for this!

@rheaton
Copy link
Owner

rheaton commented Aug 28, 2013

This pull request solves the issue: #8
Please check readme and PR for use.

Thanks!

@rheaton rheaton closed this as completed Aug 28, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants