Encoding Progress

8 views
Skip to first unread message

David Rice

unread,
Oct 16, 2007, 7:59:39 PM10/16/07
to RVideo
Have there been any thoughts or work done towards implementing
encoding process with RVideo?

If so, please let me know I'm totally up for having a crack at it as
we need (want!) this for a startup project I'm working on.

Being able to grab the current FPS should be sufficient for a *good
enough* estimate.

Otherwise, potentially adding some optional benchmarking functionality
to RVideo (coupled with some storage and logic at the application
level, could help provide this)

Thoughts?

Best,
Dave

Jon Dahl

unread,
Oct 24, 2007, 11:15:20 AM10/24/07
to RVideo
Hi Dave. Job progress (e.g. 38% complete, 14 frames per second, etc.)
would be a fantastic addition. I haven't done any work on this, but
I'd love to see it added to RVideo. Let me know if you're still
interested in working on this.

If you haven't seen it already, here is a blog post by Dmytro
Shteflyuk that discusses how to implement this in Ruby.

http://kpumuk.info/ruby-on-rails/encoding-media-files-in-ruby-using-ffmpeg-mencoder-with-progress-tracking/

Cheers,
Jon

Andre Medeiros

unread,
Nov 4, 2007, 1:42:49 AM11/4/07
to RVideo
<2cents>
What would you want the progress for? Unless you're writing a GUI app
that uses RVideo (hmm... interesting idea), I wouldn't see much use on
it.

Maybe if the tool execution job yielded every time a progress update
occurs. Should be simple enough to do.
</2cents>

On Oct 24, 2:15 pm, Jon Dahl <jond...@gmail.com> wrote:
> Hi Dave. Job progress (e.g. 38% complete, 14 frames per second, etc.)
> would be a fantastic addition. I haven't done any work on this, but
> I'd love to see it added to RVideo. Let me know if you're still
> interested in working on this.
>
> If you haven't seen it already, here is a blog post by Dmytro
> Shteflyuk that discusses how to implement this in Ruby.
>

> http://kpumuk.info/ruby-on-rails/encoding-media-files-in-ruby-using-f...

Jon Dahl

unread,
Nov 6, 2007, 12:04:58 PM11/6/07
to rvi...@googlegroups.com
I'd say that a web app could be the GUI you mention, Andre. :)

Done properly, encoding progress could be great. Imagine you are using DRb to encode a job in the background. DRb could communicate with your database every n seconds to notify your system of the job's progress. This could be used to update a visual progress bar on the screen.

David, have you gotten a chance to work on this yet?

Andre Medeiros

unread,
Nov 6, 2007, 1:30:56 PM11/6/07
to RVideo
Won't the use of the process described on the page you linked
malfunction with mencoder?

On Nov 6, 4:04 pm, "Jon Dahl" <jond...@gmail.com> wrote:
> I'd say that a web app could be the GUI you mention, Andre. :)
> Done properly, encoding progress could be great. Imagine you are using DRb
> to encode a job in the background. DRb could communicate with your database
> every n seconds to notify your system of the job's progress. This could be
> used to update a visual progress bar on the screen.
>
> David, have you gotten a chance to work on this yet?
>

Andre Medeiros

unread,
Nov 6, 2007, 1:35:30 PM11/6/07
to RVideo
Well... I'd disagree on that implementation method because DRb or
whatever shouldn't know anything about your database.

Later tonight I'm going to give a shot to a execute_with_progress
method that will yield every time progress changes and see how it
goes. I'll let you know tomorrow.

On Nov 6, 4:04 pm, "Jon Dahl" <jond...@gmail.com> wrote:
> I'd say that a web app could be the GUI you mention, Andre. :)
> Done properly, encoding progress could be great. Imagine you are using DRb
> to encode a job in the background. DRb could communicate with your database
> every n seconds to notify your system of the job's progress. This could be
> used to update a visual progress bar on the screen.
>
> David, have you gotten a chance to work on this yet?
>

Andre Medeiros

unread,
Nov 6, 2007, 3:36:44 PM11/6/07
to RVideo
Done.

Uploading patch to the files area.

Mencoder works with a different Regexp (don't know why, the other one
wouldn't work), and I can't tell if ffmpeg is working because I don't
get the duration: part on the status lines. Perhaps you can test it?

The code I used for testing was:

--------------------------------------------------------------8<--------------------------------------------------------------
require 'rubygems'
require 'rvideo/lib/rvideo'
FILE_PATH = "/home/changelog/Development/ruby"
command = "mencoder $input_file$ -o $output_file$ -oac lavc -ovc lavc -
lavcopts vcodec=xvid:acodec=mp3"
# command = "ffmpeg -y -i $input_file$ -vcodec mpeg2video -s 640x480
$output_file$"
options = {
:input_file => "#{FILE_PATH}/input_file.avi",
:output_file => "#{FILE_PATH}/processed_file.avi",
:progress => true
}
RVideo::Transcoder.logger = Logger.new(STDOUT)
transcoder = RVideo::Transcoder.new

transcoder.execute(command, "#{FILE_PATH}/input_file.avi",
"#{FILE_PATH}/processed_file.avi", options) do |progress|
puts "Progress: #{progress}"
end
--------------------------------------------------------------8<--------------------------------------------------------------

Reply all
Reply to author
Forward
0 new messages