• Stars
    star
    468
  • Rank 90,306 (Top 2 %)
  • Language
    C++
  • License
    Apache License 2.0
  • Created over 7 years ago
  • Updated 12 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Automagically generate thumbnails, animated GIFs, and summaries from videos

HECATE

Hecate [hek-uh-tee] is a video processing library that auto-magically generates thumbnails, animated GIFs, and video summaries from videos. This library is developed and maintained by Yahoo Research, New York.

The source code is Copyright 2016 Yahoo Inc. and is licensed under the terms of the Apache 2.0 License. See the LICENSE in the project root file for terms.

The technology behind this library is based on our research work. If you find this library useful in your work, we ask you to cite our research paper:

"To Click or Not To Click: Automatic Selection of Beautiful Thumbnails from Videos."
Yale Song, Miriam Redi, Jordi Vallmitjana, Alejandro Jaimes, 
Proceedings of the 25th ACM International on Conference on Information and Knowledge Management, CIKM 2016

Installation

Hecate has one dependency: OpenCV library with an FFMPEG support. You will need to install the library properly before trying out Hecate!

Once you install the dependenct library correctly, follow the instruction below:

$ git clone https://github.com/yahoo/hecate.git
$ cd hecate
$ vim Makefile.config
 - Set INCLUDE_DIRS and LIBRARY_DIRS to where your 
   opencv library is installed. Usually under /usr/local.
 - If your OpenCV version is 2.4.x, comment out the line 
   OPENCV_VERSION := 3
 - Save and exit
$ make all
$ make distribute

Once you've successfully compiled hecate, it will generate a binary executable under distribute/bin/. Run the following command to check if everything works properly:

$ ./distribute/bin/hecate

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 HECATE Copyright 2016 Yahoo Inc.
   Licensed under the terms of the Apache 2.0 License.
   Developed by : Yale Song ([email protected])
   Built on  : 11:46:03 Aug 11 2016
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
USAGE: hecate -i infile [options]

  -i  --in_video      (string)    Input video file
  -o  --out_dir       (string)    Output directory (./output)
  -s  --step          (int)       Frame subsampling step size (1)
  -n  --njpg          (int)       Number of thumbnails to be generated (5)
  -q  --ngif          (int)       Number of GIFs to be generated (5)
  -r  --lmov          (int)       Length of video summary to be generated (in seconds) (15)
  -u  --jpg_width_px  (int)       Pixel width of thumbnail images (360)
  -v  --gif_width_px  (int)       Pixel width of animated GIFs (360)
  -w  --mov_width_px  (int)       Pixel width of summary video (360)
  --generate_jpg                  Generate thumbnail images
  --generate_gif                  Generate animated GIFs
  --generate_mov                  Generate a summary video
  --generate_gifsum               Generate animated GIFs summary
  --generate_gifall               Generate all possible animated GIFs
  --print_shot_info               Print shot boundary detection results
  --print_keyfrm_info             Print keyframe indices

Congratulations! You have successfully installed hecate!

Get started

In order to get started, we will need a video file to play with. In this example, we will use the video "The Spirit of '43" by Walt Disney from The Internet Archive.

Let's download the video and save it as examples/video.mp4:

$ wget https://archive.org/download/TheSpiritOf43_56/The_Spirit_of__43_512kb.mp4 \
  --output-document examples/video.mp4 --no-check-certificate

Hecate provides three main functionalities through a binary executable hecate: Thumbnail extraction, GIF generation, and video summarization. There are various other functionalities the library provides, such as shot boundary detection and keyframe extraction.

We will explain each case below.

Shot boundary detection and keyframe extraction

Shot boundary detection and keyframe extraction are often the first steps towards various video processing methods. With Hecate, obtaining shot and keyframe information is easier than ever! Simply run the following command to get the result:

$ ./distribute/bin/hecate -i examples/video.mp4 --print_shot_info  --print_keyfrm_info

Below is the results we obtained on our dev machine (OS X 10.10 with OpenCV v3.1):

shots: [0:81],[84:93],[96:102],[108:270],[272:418],...,[9966:10131],[10135:10164]
keyframes: [52,85,98,128,165,208,242,259,265,273,...,10127,10141]

The units are frame indices (zero-based). You will notice that shot ranges are non-continuous; there are "gaps" between shots, e.g., two frames are missing between the first two shots [0:81] and [84:93]. This is normal and intentional: Hecate discards low-quality frames that aren't ideal in producing nicely looking thumbnails, animated GIFs, and video summaries. We refer to our CIKM 2016 paper for the rational behind our reason to invalidate low-quality frames.

Thumbnail generation

Hecate uses computer vision to determine frames that are most "suitable" as video thumbnails. By suitable, we mean a frame that is the most relevant to the video content and that is the most beautiful in terms of computational aesthetics; technical details are explained in our CIKM 2016 paper.

You can generate thumbnail images using Hecate. Run the following command to generate one thumbnail image from the video.

$ ./distribute/bin/hecate -i examples/video.mp4 --generate_jpg --njpg 1

You will see the generated thumbnail image under the output directory (set as output by default; you can change this using the option --out_dir YOUR_DIRECTORY). On our dev machine we get this thumbnail image:

alt text

In the above example, we generated only one thumbnail image. Are you not satisfied with the thumbnail image? Hecate can generate any number of thunbmail images! Let's generate five thumbnail images.

$ ./distribute/bin/hecate -i examples/video.mp4 --generate_jpg --njpg 3

The output files are named <video_filename>_<rank>.jpg. The files are ranked by their quality (rank 0 means it's the best one).

Animated GIF generation

Do you want to create animated GIFs from a video without the hassle of using manual tools? Hecate can automatically create them for you! Run the following command to create one animated GIF from the video.

$ ./distribute/bin/hecate -i examples/video.mp4 --generate_gif --ngif 1

On our dev machine, we get this animated GIF:

alt text

You can, of course, create more than just one GIF by setting the paramter --ngif N with an appropriate number N. When there are multiple GIFs, you can also generate a "summary GIF" by concatenating them, using this command:

$ ./distribute/bin/hecate -i examples/video.mp4 --generate_gif --ngif 3 --generate_gifsum

If you'd rather want to obtain all available GIFs from the video, use the following command:

$ ./distribute/bin/hecate -i examples/video.mp4 --generate_gifall

Video summary generation

Last but not least, Hecate can summarize a video! Run the following command to create a video summary of length 15 seconds.

$ ./distribute/bin/hecate -i examples/video.mp4 --generate_mov --lmov 15

We included the video summary generated on our dev machine here: https://github.com/yahoo/hecate/blob/master/examples/video_sum.mp4

Developer

Yale Song: github, website

More Repositories

1

CMAK

CMAK is a tool for managing Apache Kafka clusters
Scala
11,676
star
2

open_nsfw

Not Suitable for Work (NSFW) classification using deep neural network Caffe models.
Python
5,791
star
3

TensorFlowOnSpark

TensorFlowOnSpark brings TensorFlow programs to Apache Spark clusters.
Python
3,860
star
4

serialize-javascript

Serialize JavaScript to a superset of JSON that includes regular expressions and functions.
JavaScript
2,785
star
5

gryffin

Gryffin is a large scale web security scanning platform.
Go
2,075
star
6

fluxible

A pluggable container for universal flux applications.
JavaScript
1,815
star
7

AppDevKit

AppDevKit is an iOS development library that provides developers with useful features to fulfill their everyday iOS app development needs.
Objective-C
1,439
star
8

mysql_perf_analyzer

MySQL performance monitoring and analysis.
Java
1,436
star
9

squidb

SquiDB is a SQLite database library for Android and iOS
Java
1,313
star
10

CaffeOnSpark

Distributed deep learning on Hadoop and Spark clusters.
Jupyter Notebook
1,262
star
11

react-stickynode

A performant and comprehensive React sticky component.
JavaScript
1,227
star
12

blink-diff

A lightweight image comparison tool.
JavaScript
1,191
star
13

egads

A Java package to automatically detect anomalies in large scale time-series data
Java
1,152
star
14

elide

Elide is a Java library that lets you stand up a GraphQL/JSON-API web service with minimal effort.
Java
985
star
15

vssh

Go Library to Execute Commands Over SSH at Scale
Go
930
star
16

webseclab

set of web security test cases and a toolkit to construct new ones
Go
915
star
17

kubectl-flame

Kubectl plugin for effortless profiling on kubernetes
Go
746
star
18

streaming-benchmarks

Benchmarks for Low Latency (Streaming) solutions including Apache Storm, Apache Spark, Apache Flink, ...
Jupyter Notebook
621
star
19

lopq

Training of Locally Optimized Product Quantization (LOPQ) models for approximate nearest neighbor search of high dimensional data in Python and Spark.
Python
558
star
20

redislite

Redis in a python module.
Python
556
star
21

HaloDB

A fast, log structured key-value store.
Java
486
star
22

fetchr

Universal data access layer for web applications.
JavaScript
447
star
23

storm-yarn

Storm-yarn enables Storm clusters to be deployed into machines managed by Hadoop YARN.
Java
418
star
24

react-i13n

A performant, scalable and pluggable approach to instrumenting your React application.
JavaScript
383
star
25

FEL

Fast Entity Linker Toolkit for training models to link entities to KnowledgeBase (Wikipedia) in documents and queries.
Java
334
star
26

monitr

A Node.js process monitoring tool.
C++
312
star
27

Oak

A Scalable Concurrent Key-Value Map for Big Data Analytics
Java
266
star
28

TDOAuth

A BSD-licensed single-header-single-source OAuth1 implementation.
Swift
250
star
29

routr

A component that provides router related functionalities for both client and server.
JavaScript
246
star
30

mysql_partition_manager

MySQL Partition Manager
SQLPL
210
star
31

l3dsr

Direct Server Return load balancing across Layer 3 boundaries.
Shell
190
star
32

dnscache

dnscache for Node
JavaScript
184
star
33

object_relation_transformer

Implementation of the Object Relation Transformer for Image Captioning
Python
174
star
34

check-log4j

To determine if a host is vulnerable to log4j CVE‐2021‐44228
Shell
173
star
35

fili

Easily make RESTful web services for time series reporting with Big Data analytics engines like Druid and SQL Databases.
Java
171
star
36

sherlock

Sherlock is an anomaly detection service built on top of Druid
Java
149
star
37

YMTreeMap

High performance Swift treemap layout engine for iOS and macOS.
Swift
129
star
38

maha

A framework for rapid reporting API development; with out of the box support for high cardinality dimension lookups with druid.
Scala
127
star
39

covid-19-data

COVID-19 datasets are constructed entirely from primary (government and public agency) sources
110
star
40

subscribe-ui-event

Subscribe-ui-event provides a cross-browser and performant way to subscribe to browser UI Events.
JavaScript
109
star
41

jafar

🌟!(Just another form application renderer)
JavaScript
109
star
42

panoptes

A Global Scale Network Telemetry Ecosystem
Python
98
star
43

reginabox

Registry In A Box
JavaScript
97
star
44

preceptor

Test runner and aggregator
JavaScript
85
star
45

hive-funnel-udf

Hive UDFs for funnel analysis
Java
85
star
46

SparkADMM

Generic Implementation of Consensus ADMM over Spark
Python
82
star
47

react-cartographer

Generic component for displaying Yahoo / Google / Bing maps.
JavaScript
82
star
48

graphkit

A lightweight Python module for creating and running ordered graphs of computations.
Python
80
star
49

storm-perf-test

A simple storm performance/stress test
Java
76
star
50

UDPing

UDPing measures latency and packet loss across a link.
C++
72
star
51

bgjs

TypeScript
66
star
52

YMCache

YMCache is a lightweight object caching solution for iOS and Mac OS X that is designed for highly parallel access scenarios.
Objective-C
63
star
53

ycb

A multi-dimensional configuration library that builds bundles from resource files describing a variety of values.
JavaScript
63
star
54

ariel

Ariel is an AWS Lambda designed to collect, analyze, and make recommendations about Reserved Instances for EC2.
Python
62
star
55

validatar

Functional testing framework for Big Data pipelines.
Java
58
star
56

imapnio

Java imap nio client that is designed to scale well for thousands of connections per machine and reduce contention when using large number of threads and cpus.
Java
54
star
57

serviceping

A ping like utility for tcp services
Python
50
star
58

express-busboy

A simple body-parser like module for express that uses connect-busboy under the hood.
JavaScript
44
star
59

covid-19-api

Yahoo Knowledge COVID-19 API provides JSON-API and GraphQL interfaces to access COVID-19 publicly sourced data
JavaScript
43
star
60

proxy-verifier

Proxy Verifier is an HTTP replay tool designed to verify the behavior of HTTP proxies. It builds a verifier-client binary and a verifier-server binary which each read a set of YAML or JSON files that specify the HTTP traffic for the two to exchange.
C++
42
star
61

panoptes-stream

A cloud native distributed streaming network telemetry.
Go
41
star
62

yql-plus

The YQL+ parser, execution engine, and source SDK.
Java
40
star
63

context-parser

A robust HTML5 context parser that parses HTML 5 web pages and reports the execution context of each character.
HTML
40
star
64

cocoapods-blocklist

A CocoaPods plugin used to check a project against a list of pods that you do not want included in your build. Security is the primary use, but keeping specific pods that have conflicting licenses is another possible use.
Ruby
39
star
65

covid-19-dashboard

Source code for the Yahoo Knowledge Graph COVID-19 Dashboard
JavaScript
38
star
66

FmFM

Python
36
star
67

ember-gridstack

Ember components to build drag-and-drop multi-column grids powered by gridstack.js
JavaScript
36
star
68

VerizonVideoPartnerSDK-controls-ios

Public iOS implementation of the OneMobileSDK default custom controls interface... demonstrating how customers can implement their own custom video player controls.
Swift
35
star
69

k8s-namespace-guard

K8s - Admission controller for guarding namespace
Go
34
star
70

fluxible-action-utils

Utility methods to aid in writing actions for fluxible based applications.
JavaScript
34
star
71

parsec

A collection of libraries and utilities to simplify the process of building web service applications.
Java
34
star
72

mod_statuspage

Simple express/connect middleware to provide a status page with following details of the nodejs host.
JavaScript
32
star
73

bftkv

A distributed key-value storage that's tolerant to Byzantine fault.
JavaScript
30
star
74

protractor-retry

Use protractor features to automatically re-run failed tests with a specific configurable number of attempts.
JavaScript
28
star
75

cubed

Data Mart As A Service
Java
27
star
76

spivak

Python
27
star
77

jsx-test

An easy way to test your React Components (`.jsx` files).
JavaScript
27
star
78

ycb-java

YCB Java
Java
27
star
79

fluxible-immutable-utils

A mixin that provides a convenient interface for using Immutable.js inside react components.
JavaScript
25
star
80

SubdomainSleuth

Scanner to identify dangling DNS records and subdomain takeovers
Go
25
star
81

maaf

Modality-Agnostic Attention Fusion for visual search with text feedback
Python
25
star
82

node-limits

Simple express/connect middleware to set limit to upload size, set request timeout etc.
JavaScript
24
star
83

GitHub-Security-Alerts-Workflow

Automation to Incorporate GitHub Security Alerts Into your Business Workflow
Python
23
star
84

bandar-log

Monitoring tool to measure flow throughput of data sources and processing components that are part of Data Ingestion and ETL pipelines.
Scala
21
star
85

fumble

Simple error objects in node. Created specifically to be used with https://github.com/yahoo/fetchr and based on https://github.com/hapijs/boom
JavaScript
21
star
86

express-csp

Express extension for Content Security Policy
JavaScript
19
star
87

elide-js

Elide is a library that makes it easy to talk to a JSON API compliant backend.
JavaScript
18
star
88

Zake

A python package that works to provide a nice set of testing utilities for the kazoo library.
Python
18
star
89

npm-auto-version

Automatically generate new NPM versions based on Git tags when publishing
JavaScript
18
star
90

httpmi

An HTTP proxy for IPMI commands.
Python
17
star
91

hodman

Selenium object library
JavaScript
17
star
92

cerebro

JavaScript
17
star
93

SongbirdCharts

Allows for other apps to render accessible audio charts
Kotlin
17
star
94

Override

In app feature flag management
Swift
16
star
95

ychaos

YChaos - The Resilience Framework by Yahoo!
Python
16
star
96

elide-spring-boot-example

Spring Boot example using the Elide framework.
Java
15
star
97

parsec-libraries

Tools to simplify deploying web services with Parsec.
Java
15
star
98

node-info

Node environment information
JavaScript
14
star
99

NetCHASM

An Automated health checking and server status verification system.
C++
13
star
100

invirtualenv

Tool to deploy python virtualenvs
Python
13
star