Skip to content

Instantly share code, notes, and snippets.

@Stephenitis
Last active August 29, 2015 14:06
Show Gist options
  • Save Stephenitis/a3a0d4da4f0a5d67cf04 to your computer and use it in GitHub Desktop.
Save Stephenitis/a3a0d4da4f0a5d67cf04 to your computer and use it in GitHub Desktop.
Video Processing in 3 simple steps with IronWorker's new FFMPEG stack
require 'streamio-ffmpeg'
require "benchmark"
require 'open-uri'
p Benchmark.measure {
movie = FFMPEG::Movie.new("harddrivespinning.mp4")
p "movie.duration : #{movie.duration } "
p "movie.bitrate : #{movie.bitrate} "
p "movie.size : #{movie.size} "
p "movie.video_stream : #{movie.video_stream} "
p "movie.video_codec : #{movie.video_codec} "
p "movie.colorspace : #{movie.colorspace} "
p "movie.resolution : #{movie.resolution} "
p "movie.width : #{movie.width} "
p "movie.height : #{movie.height} "
p "movie.frame_rate : #{movie.frame_rate} "
p "movie.audio_stream : #{movie.audio_stream} "
p "movie.audio_codec : #{movie.audio_codec} "
p "movie.audio_sample_rate : #{movie.audio_sample_rate} "
p "movie.audio_channels : #{movie.audio_channels} "
p "movie.valid? : #{movie.valid?} "
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment