Skip to content

Instantly share code, notes, and snippets.

@westoque
Created September 14, 2009 07:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save westoque/186546 to your computer and use it in GitHub Desktop.
Save westoque/186546 to your computer and use it in GitHub Desktop.
def create_video_thumb_nails(event)
videopath = "#{RAILS_ROOT}/public#{event.video.url}"
tpath = "#{RAILS_ROOT}/public/videos/#{event.id}/original/thumbnail.jpg"
image_path = "/videos/#{event.id}/original/thumbnail.jpg"
system `ffmpeg -itsoffset -30 -i #{videopath} -y -vcodec mjpeg -vframes 1 -an -f rawvideo -s 140x100 #{tpath}`
return image_path
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment