Giter VIP home page Giter VIP logo

openube / apache-get-video-thumbnail Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dayvson/apache-get-video-thumbnail

0.0 2.0 0.0 64 KB

Video Thumb Extractor is a module for Apache2 to extract an image from a video in a specific second, you can also resizing/cropping it to a given size and to extract a storyboard(multiple video frames on sprite) from video.

Home Page: http://dayvson.github.io/Apache-Get-Video-Thumbnail/

apache-get-video-thumbnail's Introduction

Apache Video Thumb Extractor Module

Video Thumb Extractor is a module for Apache2 to extract an image from a video in a specific
second, you can also resizing/cropping it to a given size and to extract a storyboard(multiple video frames on sprite) from video.

  • This module is production ready!

Requirements

This module depends from some libraries (headers and shared objects) which has to be installed before it:
To install FFmpeg from source with the specified versions follow the steps bellow:

  git clone git://git.videolan.org/ffmpeg
  cd ffmpeg
  git checkout n0.8.7 -b tag_n0.8.7
  ./configure --prefix=/usr --disable-ffserver --disable-ffplay --enable-shared
  make
  make install

Requirements

All of these libraries was commonly distributed with FFmpeg or in “LIBAV

  • avformat >= 53.4.0
  • avcodec >= 53.7.0
  • avutil >= 51.9.1
  • swscale >= 2.0.0
  • libjpeg – libjpeg

How to compile

You can run the tests, and see video.jpg and storyboard.jpg saved file from demo video


make test

To compile and install this module on your apache run the command bellow, this action will create a video_thumbnail.so file and put this your Apache module folder.
Please check defines.mk file to set your path for installation.
Use this till I create a easy way to install like using autotools *


sudo make install

Configuration

To enable this module after installation edit httpd.conf file and in module section add
LoadModule videothumb_module [module_path]/mod_videothumb.so
[module_path] => Apache Directory modules in your architecture *

  • VideoThumb_Enabled true => Enable videothumb module
  • VideoThumb_MediasPath /www/my_videos/ => Path for videos in your filesystem
  • VideoThumb_AppPath /thumbnails/ => Path for which you want the module to respond (the URI path)
  • VideoThumb_JpegQuality 90 => Jpeg compress quality

How to use

After enable this module you can access using these urls
This module can receive four parameters:

  • second => Second of video (this module get the nearest keyframe to second) (Optional parameter in storyboard)
  • width => Optional parameter to resize width video frame
  • height => Optional parameter to resize height video frame
  • split => Optional parameter to create a storyboard if you define split=10 this module will return 10 frames from the beginner until the end of video
  • columns => Optional parameter to use with split parameter to define how many columns your storyboard must have
  • currentPage => Optional parameter to define the current page of storyboard
  • pageSize => Optional parameter to define how many frame one storyboard page must have

If you don’t use width or height parameters, the frame dimension will be equal to the video
If you use split parameter you can’t use second parameter, this function return a sprite with frames in a jpeg file

Sample usage :

Extract an unique video frame:

  http://your_host.org/thumbnails/bigbunny.ogg?second=30
  http://your_host.org/thumbnails/bigbunny.ogg?second=30&width=640
  http://your_host.org/thumbnails/bigbunny.ogg?second=30&width=640&height=360

Sample Frame

Extract a storyboard frames(with(out) pagination):

  http://your_host.org/thumbnails/bigbunny.ogg?height=100&split=30
  http://your_host.org/thumbnails/bigbunny.ogg?height=100&split=30&columns=5
  http://your_host.org/thumbnails/bigbunny.ogg?height=100&split=30&columns=5&currentPage=1&pageSize=10

Sample storyboard

apache-get-video-thumbnail's People

Contributors

dayvson avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.