Git Product home page Git Product logo

hecate's Introduction

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

hecate's People

Contributors

dathuynh avatar ikarenkov avatar nanne avatar yalesong avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hecate's Issues

Bad memory access

I try to run your algorithm through a short video (around 5 secs) to extract gif using the following command:

./distribute/bin/hecate -i media/video.mp4 --generate_gif --ngif 1 -o output

Then I get a terminated error. After debugging, I figure out it is because of bad memory access in the following line of code in file hecate_highlight.cpp :

// Collect IDs & scores of the shots in the k-th cluster
      vector<int> v_tmp_shotid;
      vector<double> v_tmp_score;
      for(int shotid=0; shotid<km_lbl.rows; shotid++) {
        int lbl = km_lbl.at<int>(shotid);
        if( lbl==k ) {
          double val = shot_diff_avg.at<double>(shotid);
          if( val > best_val ) {
            best_range = v_candidates[shotid];
            best_val = val;
          }
          v_tmp_shotid.push_back( shotid );
          v_tmp_score.push_back( val );
        }
      }

The case is that shotid was out of range for shot_diff_avg. In my case, shotid = 300 (km_lbl.rows = 2000) while shot_diff_avg.rows = 1 and shot_diff_avg.cols = 1.

I think that the for loop should also be constrained by v_candidates.size() .

no video result

when i run' ./distribute/bin/hecate -i examples/video.mp4 --generate_mov --lmov 15',there is no result in ./output.

still possible to build with newer versions of OpenCV/ FFMpeg? Which ones work

Hello. I am having trouble building the project.
Initially I tried to build with the latest OpenCV (4.6.0) and FFMPEG (5.1.) However 'make all' threw some errors. While I don't remember the exact wording it was something similar to "include/opencv3 not found". So I decided to first build & install OpenCV 3.4.16 instead from here: https://github.com/opencv/opencv/releases
Make all worked without errors this time, but when executing ./distribute/bin/hecate i get error message:

./distribute/bin/hecate: error while loading shared libraries: libopencv_core.so.3.4: cannot open shared object file: No such file or directory

libopencv_core.so.3.4 exists in /usr/local/lib, so Iam not sure what the issue is?

Alternatively, maybe someone can point me to older versions of the libraries which they succesfully compiled and tested!?
@yalesong

Fix for FFMPEG issue: The encoder 'aac' is experimental but experimental codecs are not enabled

Hi,
I have noticed that for some video clips, the Hecate won't generate 'gifsum' images, the tool returns message:
rm: cannot remove './output//palatte.png': No such file or directory

After some quick debugging I've found that in those cases FFMPEG in the method 'ffmpeg_video_crop' produces error message:
The encoder 'aac' is experimental but experimental codecs are not enabled, add '-strict -2' if you want to use it.

The issue is fixed by editing 'include/hecate/ffmpeg_helper.hpp' file and changing the ffmpeg cmd string on the line 49 from:
%s -ss %s -t %s -i %s -vf %s %s %s
to
%s -ss %s -t %s -i %s -strict -2 -vf %s %s %s

Note that the placement of the '-strict -2' is important, it has to come after '-i' option.

generate jpg blocked

hi, @yalesong

When i use hecate to generate jpg, but never finished the process. seems blocked at here

printf("VideoParser: VideoCapture\n");
VideoCapture vr( in_video );
printf("VideoParser: vr.isOpened\n");
if( !vr.isOpened() ) {
return -1;
}

my environment is:
centos6.6, opencv3.1 ffmpeg2.8.15

hecate]# ./distribute/bin/hecate -i examples/video_sum.mp4 --generate_jpg -o $PWD --debug

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
HECATE Copyright 2016 Yahoo Inc.
Licensed under the terms of the Apache 2.0 License.
Developed by : Yale Song ([email protected])
Built on : 10:10:35 Nov 6 2018
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
run_hecate: Video segmentation and keyframe extraction
run_hecate: PARSE
VideoParser: examples/video_sum.mp4
VideoParser: read_video("examples/video_sum.mp4",
step_sz=1, max_duration=-1.00, max_frm_len=160, ignore_rest=0)
VideoParser: VideoCapture

Error while trying to generate GIF

Hi,
I get this error when trying to generate gifs:

sh: 1: -ss: not found
sh: 1: -ss: not found
rm: cannot remove './output//palatte.png': No such file or directory

Generating jpeg works fine.

opencv api multi-threading

I found that this code will open multi-threading when calling OpenCV api when running. How can I close it? Thank you very much.

./include/hecate/hecate.hpp:48:10: fatal error: 'opencv2/ml.hpp' file not found

On running make all:

/*

  • HECTATE Video Processing Library
  • Copyright 2016 Yahoo Inc.
  • Licensed under the terms of the Apache 2.0 License.
  • See LICENSE file in the project root for terms.
  • Developer: Yale Song ([email protected])
    */

#ifndef HECATE_HPP
#define HECATE_HPP

/ml.hpp
LD -o .build_debug/lib/libhecate.so
clang: warning: argument unused during compilation: '-pthread'
CXX src/tools/hecate.cpp
In file included from src/tools/hecate.cpp:11:
./include/hecate/hecate.hpp:48:10: fatal error: 'opencv2/ml.hpp' file not found

When I checked the include directory, I found that ml.hpp was in /usr/local/include/opencv2/ml/, so I hacked hecate.hpp to include opencv2/ml/ml.hpp and it worked. Any idea why?

Out of memory error

Hi,

Thank you so much for making Hecate available! This is really generous of you and I really appreciate your hard work! :-)

I'm trying to run some of your examples on an AWS Lightsail instance with 1 GB of RAM, but I get out of memory errors:

bash> ./distribute/bin/hecate -i examples/video.mp4 --generate_jpg --njpg 1
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 HECATE Copyright 2016 Yahoo Inc.
   Licensed under the terms of the Apache 2.0 License.
   Developed by : Yale Song ([email protected])
   Built on  : 04:37:30 Apr 14 2018
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Killed

bash> dmesg
[37664845.289337] Out of memory: Kill process 16158 (hecate) score 862 or sacrifice child
[37664845.294055] Killed process 16158 (hecate) total-vm:1276288kB, anon-rss:872636kB, file-rss:336kB

So it looks like it's using 1.3 GB of memory and getting killed by the OOM system because the VM only has 1 GB of RAM. Is it possible to tell hecate to use a max amount of memory, say 512 MB, to avoid this?

The reason I ask is that I want to run a job system on Heroku making video thumbnails for my app, but the cheapest Heroku dyno that has more than 1 GB is the Performance-M, which costs $250/month per dyno. If I could limit the memory usage to 512 MB or less, I could run on a $50/month dyno.

Thanks,

Joel

Zero init False

In the "include/hecate/gapstat.hpp" file, line 84, "km_lbl = Mat::zeros(1,1, km_lbl.type());", when cout km_lbl.at(0), the result is a big Integer, not 0.

displaymatrix rotation in video not respected during jpg generation

Hi,

Thanks for making this awesome code available! :-)

I have a video that was shot in portrait on an iPhone and when I run it through hecate:

./distribute/bin/hecate -i examples/ryan.mov --generate_jpg --njpg 5 --generate_gif --ngif 5 --step=1

the gifs come out properly, but all of the jpgs that are generated by hecate are rotated 90 degrees counterclockwise, and made into landscape images.

If I run ffprobe on the video, I get:

ffprobe version 2.8.11-0ubuntu0.16.04.1 Copyright (c) 2007-2017 the FFmpeg developers
  built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.4) 20160609
  configuration: --prefix=/usr --extra-version=0ubuntu0.16.04.1 --build-suffix=-ffmpeg --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --cc=cc --cxx=g++ --enable-gpl --enable-shared --disable-stripping --disable-decoder=libopenjpeg --disable-decoder=libschroedinger --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librtmp --enable-libschroedinger --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzvbi --enable-openal --enable-opengl --enable-x11grab --enable-libdc1394 --enable-libiec61883 --enable-libzmq --enable-frei0r --enable-libx264 --enable-libopencv
  libavutil      54. 31.100 / 54. 31.100
  libavcodec     56. 60.100 / 56. 60.100
  libavformat    56. 40.101 / 56. 40.101
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 40.101 /  5. 40.101
  libavresample   2.  1.  0 /  2.  1.  0
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  2.101 /  1.  2.101
  libpostproc    53.  3.100 / 53.  3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'examples/ryan.mov':
  Metadata:
    major_brand     : qt
    minor_version   : 0
    compatible_brands: qt
    creation_time   : 2018-04-01 04:44:21
  Duration: 00:00:15.67, start: 0.000023, bitrate: 2218 kb/s
    Stream #0:0(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 95 kb/s (default)
    Metadata:
      creation_time   : 2018-04-01 04:44:21
      handler_name    : Core Media Data Handler
    Stream #0:1(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709), 1280x720, 2115 kb/s, 30 fps, 30 tbr, 600 tbn, 1200 tbc (default)
    Metadata:
      rotate          : 90
      creation_time   : 2018-04-01 04:44:21
      handler_name    : Core Media Data Handler
      encoder         : H.264
    Side data:
      displaymatrix: rotation of -90.00 degrees
    Stream #0:2(und): Data: none (mebx / 0x7862656D), 0 kb/s (default)
    Metadata:
      creation_time   : 2018-04-01 04:44:21
      handler_name    : Core Media Data Handler
    Stream #0:3(und): Data: none (mebx / 0x7862656D), 0 kb/s (default)
    Metadata:
      creation_time   : 2018-04-01 04:44:21
      handler_name    : Core Media Data Handler

Note the displaymatrix: rotation of -90.00 degrees.

So any idea why hecate seems to handle the rotation during gif generation (the resultant gifs have the correct orientation, same as the input video) but the hecate-generated jpgs are incorrectly rotated an extra 90 degrees counterclockwise and made landscape?

If it's an easy patch, could you give me a hint where to look and I could see if I can fix up the code myself? Just not sure where to start ...

Or maybe you have ideas on how to fix it?

Thanks again!

the aesthetic evaluation

I roughly read the source code and did not find any function about aesthetic evaluation.so I wonder if it is because i did not find it or you just did not achieve it.

Cannot build succesfully when using Opencv 4.1.2 + FFMPEG 4.2.1

On executing make all

CXX src/hecate/hecate_highlight.cpp
/usr/bin/clang++ src/hecate/hecate_highlight.cpp -MMD -MP -pthread -fPIC -std=c++0x -DNDEBUG -O2 -I/usr/local/include/opencv4 -I.build_release/src -I./include -Wall -Wno-sign-compare -c -o .build_release/src/hecate/hecate_highlight.o 2> .build_release/src/hecate/hecate_highlight.o.warnings.txt
|| (cat .build_release/src/hecate/hecate_highlight.o.warnings.txt; exit 1)
In file included from src/hecate/hecate_highlight.cpp:11:
In file included from ./include/hecate/hecate.hpp:39:
./include/hecate/gapstat.hpp:85:43: error: use of undeclared identifier 'CV_REDUCE_AVG'; did you mean 'REDUCE_AVG'?
cv::reduce( km_data, km_ctr, 0, CV_REDUCE_AVG );
^~~~~~~~~~~~~
REDUCE_AVG
/usr/local/include/opencv4/opencv2/core.hpp:220:20: note: 'REDUCE_AVG' declared here
REDUCE_AVG = 1, //!< the output is the mean vector of all rows/columns of the matrix.
^
In file included from src/hecate/hecate_highlight.cpp:11:
In file included from ./include/hecate/hecate.hpp:39:
./include/hecate/gapstat.hpp:89:44: error: use of undeclared identifier 'CV_TERMCRIT_ITER'
TermCriteria km_opt = TermCriteria(CV_TERMCRIT_ITER|CV_TERMCRIT_EPS, km_max_cnt, km_eps);
^
./include/hecate/gapstat.hpp:89:61: error: use of undeclared identifier 'CV_TERMCRIT_EPS'
TermCriteria km_opt = TermCriteria(CV_TERMCRIT_ITER|CV_TERMCRIT_EPS, km_max_cnt, km_eps);
^
In file included from src/hecate/hecate_highlight.cpp:11:
In file included from ./include/hecate/hecate.hpp:41:
./include/hecate/cc_parser.hpp:69:60: warning: 'bind1st<std::__1::not_equal_to, char>' is deprecated [-Wdeprecated-declarations]
dst.erase(dst.begin(), find_if(dst.begin(), dst.end(), bind1st(not_equal_to(), ' ')));
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/functional:1053:1: note: 'bind1st<std::__1::not_equal_to, char>' has been explicitly marked deprecated here
_LIBCPP_DEPRECATED_IN_CXX11 inline _LIBCPP_INLINE_VISIBILITY
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config:1101:39: note: expanded from macro '_LIBCPP_DEPRECATED_IN_CXX11'

define _LIBCPP_DEPRECATED_IN_CXX11 _LIBCPP_DEPRECATED

                                  ^

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config:1090:48: note: expanded from macro '_LIBCPP_DEPRECATED'

define _LIBCPP_DEPRECATED attribute ((deprecated))

                                           ^

In file included from src/hecate/hecate_highlight.cpp:11:
In file included from ./include/hecate/hecate.hpp:41:
./include/hecate/cc_parser.hpp:70:49: warning: 'bind1st<std::__1::not_equal_to, char>' is deprecated [-Wdeprecated-declarations]
dst.erase(find_if(dst.rbegin(), dst.rend(), bind1st(not_equal_to(), ' ')).base(), dst.end());
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/functional:1053:1: note: 'bind1st<std::__1::not_equal_to, char>' has been explicitly marked deprecated here
_LIBCPP_DEPRECATED_IN_CXX11 inline _LIBCPP_INLINE_VISIBILITY
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config:1101:39: note: expanded from macro '_LIBCPP_DEPRECATED_IN_CXX11'

define _LIBCPP_DEPRECATED_IN_CXX11 _LIBCPP_DEPRECATED

                                  ^

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config:1090:48: note: expanded from macro '_LIBCPP_DEPRECATED'

define _LIBCPP_DEPRECATED attribute ((deprecated))

                                           ^

In file included from src/hecate/hecate_highlight.cpp:11:
In file included from ./include/hecate/hecate.hpp:41:
./include/hecate/cc_parser.hpp:126:60: warning: 'bind1st<std::__1::not_equal_to, char>' is deprecated [-Wdeprecated-declarations]
dst.erase(dst.begin(), find_if(dst.begin(), dst.end(), bind1st(not_equal_to(), ' ')));
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/functional:1053:1: note: 'bind1st<std::__1::not_equal_to, char>' has been explicitly marked deprecated here
_LIBCPP_DEPRECATED_IN_CXX11 inline _LIBCPP_INLINE_VISIBILITY
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config:1101:39: note: expanded from macro '_LIBCPP_DEPRECATED_IN_CXX11'

define _LIBCPP_DEPRECATED_IN_CXX11 _LIBCPP_DEPRECATED

                                  ^

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config:1090:48: note: expanded from macro '_LIBCPP_DEPRECATED'

define _LIBCPP_DEPRECATED attribute ((deprecated))

                                           ^

In file included from src/hecate/hecate_highlight.cpp:11:
In file included from ./include/hecate/hecate.hpp:41:
./include/hecate/cc_parser.hpp:127:49: warning: 'bind1st<std::__1::not_equal_to, char>' is deprecated [-Wdeprecated-declarations]
dst.erase(find_if(dst.rbegin(), dst.rend(), bind1st(not_equal_to(), ' ')).base(), dst.end());
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/functional:1053:1: note: 'bind1st<std::__1::not_equal_to, char>' has been explicitly marked deprecated here
_LIBCPP_DEPRECATED_IN_CXX11 inline _LIBCPP_INLINE_VISIBILITY
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config:1101:39: note: expanded from macro '_LIBCPP_DEPRECATED_IN_CXX11'

define _LIBCPP_DEPRECATED_IN_CXX11 _LIBCPP_DEPRECATED

                                  ^

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config:1090:48: note: expanded from macro '_LIBCPP_DEPRECATED'

define _LIBCPP_DEPRECATED attribute ((deprecated))

                                           ^

In file included from src/hecate/hecate_highlight.cpp:11:
In file included from ./include/hecate/hecate.hpp:42:
./include/hecate/file_helper.hpp:78:72: warning: 'ptr_fun<int, int>' is deprecated [-Wdeprecated-declarations]
s.erase(s.begin(), std::find_if(s.begin(), s.end(), std::not1(std::ptr_fun<int, int>(std::isspace))));
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/functional:1097:1: note: 'ptr_fun<int, int>' has been explicitly marked deprecated here
_LIBCPP_DEPRECATED_IN_CXX11 inline _LIBCPP_INLINE_VISIBILITY
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config:1101:39: note: expanded from macro '_LIBCPP_DEPRECATED_IN_CXX11'

define _LIBCPP_DEPRECATED_IN_CXX11 _LIBCPP_DEPRECATED

                                  ^

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config:1090:48: note: expanded from macro '_LIBCPP_DEPRECATED'

define _LIBCPP_DEPRECATED attribute ((deprecated))

                                           ^

In file included from src/hecate/hecate_highlight.cpp:11:
In file included from ./include/hecate/hecate.hpp:42:
./include/hecate/file_helper.hpp:83:63: warning: 'ptr_fun<int, int>' is deprecated [-Wdeprecated-declarations]
s.erase(std::find_if(s.rbegin(), s.rend(), std::not1(std::ptr_fun<int, int>(std::isspace))).base(), s.end());
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/functional:1097:1: note: 'ptr_fun<int, int>' has been explicitly marked deprecated here
_LIBCPP_DEPRECATED_IN_CXX11 inline _LIBCPP_INLINE_VISIBILITY
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config:1101:39: note: expanded from macro '_LIBCPP_DEPRECATED_IN_CXX11'

define _LIBCPP_DEPRECATED_IN_CXX11 _LIBCPP_DEPRECATED

                                  ^

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config:1090:48: note: expanded from macro '_LIBCPP_DEPRECATED'

define _LIBCPP_DEPRECATED attribute ((deprecated))

                                           ^

In file included from src/hecate/hecate_highlight.cpp:11:
In file included from ./include/hecate/hecate.hpp:43:
In file included from ./include/hecate/video_parser.hpp:46:
./include/hecate/hist_opencv.hpp:49:29: error: use of undeclared identifier 'CV_BGR2HSV'; did you mean 'COLOR_BGR2HSV'?
cvtColor( img, img_cvt, CV_BGR2HSV );
^~~~~~~~~~
COLOR_BGR2HSV
/usr/local/include/opencv4/opencv2/imgproc.hpp:583:5: note: 'COLOR_BGR2HSV' declared here
COLOR_BGR2HSV = 40, //!< convert RGB/BGR to HSV (hue saturation value), @ref color_convert_rgb_hsv "color conversions"
^
In file included from src/hecate/hecate_highlight.cpp:11:
In file included from ./include/hecate/hecate.hpp:43:
In file included from ./include/hecate/video_parser.hpp:47:
./include/hecate/image_metrics.hpp:103:37: error: use of undeclared identifier 'CV_SORT_EVERY_COLUMN'; did you mean 'SORT_EVERY_COLUMN'?
cv::sort( ghist, hist_sorted, CV_SORT_EVERY_COLUMN|CV_SORT_DESCENDING );
^~~~~~~~~~~~~~~~~~~~
SORT_EVERY_COLUMN
/usr/local/include/opencv4/opencv2/core.hpp:155:18: note: 'SORT_EVERY_COLUMN' declared here
SORT_EVERY_COLUMN = 1, //!< each matrix column is sorted
^
In file included from src/hecate/hecate_highlight.cpp:11:
In file included from ./include/hecate/hecate.hpp:43:
In file included from ./include/hecate/video_parser.hpp:47:
./include/hecate/image_metrics.hpp:103:58: error: use of undeclared identifier 'CV_SORT_DESCENDING'; did you mean 'SORT_DESCENDING'?
cv::sort( ghist, hist_sorted, CV_SORT_EVERY_COLUMN|CV_SORT_DESCENDING );
^~~~~~~~~~~~~~~~~~
SORT_DESCENDING
/usr/local/include/opencv4/opencv2/core.hpp:160:18: note: 'SORT_DESCENDING' declared here
SORT_DESCENDING = 16 //!< each matrix row is sorted in the
^
src/hecate/hecate_highlight.cpp:175:47: error: use of undeclared identifier 'CV_REDUCE_AVG'; did you mean 'REDUCE_AVG'?
cv::reduce( Xsub, km_data.row(shotid), 0, CV_REDUCE_AVG );
^~~~~~~~~~~~~
REDUCE_AVG
/usr/local/include/opencv4/opencv2/core.hpp:220:20: note: 'REDUCE_AVG' declared here
REDUCE_AVG = 1, //!< the output is the mean vector of all rows/columns of the matrix.
^
src/hecate/hecate_highlight.cpp:444:23: error: use of undeclared identifier 'CV_CAP_PROP_FPS'; did you mean 'CAP_PROP_FPS'?
double fps = vr.get(CV_CAP_PROP_FPS);
^~~~~~~~~~~~~~~
CAP_PROP_FPS
/usr/local/include/opencv4/opencv2/videoio.hpp:137:8: note: 'CAP_PROP_FPS' declared here
CAP_PROP_FPS =5, //!< Frame rate.
^
6 warnings and 8 errors generated.
make: *** [.build_release/src/hecate/hecate_highlight.o] Error 1

Possible license troubles

This library has appache license but uses another library with GPL.
If I plan to use this library then should my own project use GPL too?!

documentation?

Hi,
I was wondering if any documentation is available for the video summarization? Like, how do you generate the summary?

  • One side question: I tested it to generate a 10s and 15s summary. I realized the 10s one is a subset of the 15s one. So wondering how the generation really works.

overflow

Hi there,
I have found an overflow in your tool, in file loading time.
may I report you by email?

output resolution fixed to low resolution (360x202)?

My source video:
Stream #0:1(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 960x540 [SAR 1:1 DAR 16:9], 986 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)

The summary video:
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 360x202 [SAR 404:405 DAR 16:9], 344 kb/s, 24.82 fps, 25.08 tbr, 12800 tbn, 50 tbc (default)

The thumbnails: 360x204

Can the output resolution be defined?

input files that contain spaces cause errors

Successful: file without space
./distribute/bin/hecate -i examples/video.mp4 --generate_mov --lmov 15

Successful: file with space - thumbnails
./distribute/bin/hecate -i examples/my\ video.mp4 --generate_jpg --njpg 3

Error message: file with space - summary video (or animated GIFs)
./distribute/bin/hecate -i examples/my\ video.mp4 --generate_mov --lmov 15

mv: rename ./output/__tmp__my_video_seg000.mp4 to ./output/__tmp__my_video_segV000.mp4: No such file or directory
mv: rename ./output/__tmp__my_video_seg001.mp4 to ./output/__tmp__my_video_segV001.mp4: No such file or directory
mv: rename ./output/__tmp__my_video_seg002.mp4 to ./output/__tmp__my_video_segV002.mp4: No such file or directory
mv: rename ./output/__tmp__my_video_seg003.mp4 to ./output/__tmp__my_video_segV003.mp4: No such file or directory
mv: rename ./output/__tmp__my_video_seg004.mp4 to ./output/__tmp__my_video_segV004.mp4: No such file or directory

result about paper

When I verified the results of the paper, the video key frame obtained according to the code you provided was inconsistent with your results.for example, the file /YahooScreen/thumbnail-master/results/ours_unsupervised/951f7361-5c20-3d98-bc70-a4a9f43d04d7.txt shows "5906 8472 7800 3741 2399 7947" .but when i run 951f7361-5c20-3d98-bc70-a4a9f43d04d7.mp4 i just got "2715 1519 3193 1103 3442 ".
so i want to know what is the difference between your test code and this exposed code.

make all throws error (dyld library not loaded) and process in stuck/sleeping state?

Trying to install hecate on my Mac (Sierra).
Two issues:

  1. the default build throws an error related to rpath dyld
  2. after fixing the command runs but does not finish? (update: it does finish, but takes 8+ minutes for the 5:40 video)

I have opencv3 installed: brew install opencv3 --with-ffmpeg

I have updated Makefile.config:

INCLUDE_DIRS := /usr/local/opt/opencv3/include
LIBRARY_DIRS := /usr/local/opt/opencv3/lib

After make all & distribute, when running ./distribute/bin/hecate I get:

dyld: Library not loaded: @rpath/libopencv_core.3.2.dylib
  Referenced from: /www/npo.mobinat.com/summary/hecate/./distribute/bin/hecate
  Reason: image not found
Abort trap: 6

Output of otool -L ./distribute/bin/hecate:

./distribute/bin/hecate:
	@rpath/libopencv_core.3.2.dylib (compatibility version 3.2.0, current version 3.2.0)
	@rpath/libopencv_highgui.3.2.dylib (compatibility version 3.2.0, current version 3.2.0)
	@rpath/libopencv_imgproc.3.2.dylib (compatibility version 3.2.0, current version 3.2.0)
	@rpath/libopencv_imgcodecs.3.2.dylib (compatibility version 3.2.0, current version 3.2.0)
	@rpath/libopencv_videoio.3.2.dylib (compatibility version 3.2.0, current version 3.2.0)
	@rpath/libhecate.so (compatibility version 0.0.0, current version 0.0.0)
	/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 307.5.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1238.51.1)

Not sure if correct, but I then used:

install_name_tool -change @rpath/libopencv_core.3.2.dylib /usr/local/opt/opencv3//lib/libopencv_core.3.2.dylib ./distribute/bin/hecate
install_name_tool -change @rpath/libopencv_highgui.3.2.dylib /usr/local/opt/opencv3//lib/libopencv_highgui.3.2.dylib ./distribute/bin/hecate
install_name_tool -change @rpath/libopencv_imgproc.3.2.dylib /usr/local/opt/opencv3//lib/libopencv_imgproc.3.2.dylib ./distribute/bin/hecate
install_name_tool -change @rpath/libopencv_imgcodecs.3.2.dylib /usr/local/opt/opencv3//lib/libopencv_imgcodecs.3.2.dylib ./distribute/bin/hecate
install_name_tool -change @rpath/libopencv_videoio.3.2.dylib /usr/local/opt/opencv3//lib/libopencv_videoio.3.2.dylib ./distribute/bin/hecate

After this when running ./distribute/bin/hecate I correctly get the usage info.

But when running the demo commands, I always only get the header info. Even after 10 minutes or so nothing else happens:

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

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 HECATE Copyright 2016 Yahoo Inc.
   Licensed under the terms of the Apache 2.0 License.
   Developed by : Yale Song ([email protected])
   Built on  : 14:34:23 Apr 14 2017
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=



The process stays in stuck or sleeping state:

PID    COMMAND      %CPU TIME     #TH  #WQ  #POR MEM  PURG CMPRS  PGRP  PPID  STATE    BOOSTS     %CPU_ME %CPU_OTHRS UID
24785  hecate       9.6  00:29.08 2    1    42   53M- 0B   1010M+ 24785 19908 stuck    *0[1]      0.00000 0.00000    501

update: after 8m44.434s the task completed and displayed the keyframe info. Is it supposed to take that long for a 5m40 video?

Code running speed

What is the configuration of the machine on which you run the code? I am running at a slower rate than mentioned in the paper.

Output quality is low?

Interesting work. I compiled and was trying the video summarization, but noticed it reduces the output resolution/quality significantly. Any ways we can preserve the input resolution?

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.