Utilities for loading videos into Torch using FFmpeg libraries
C Lua Shell CMake
Permalink
Failed to load latest commit information.
doc Added timestamp method to frames Jul 14, 2016
rockspecs Use CMake Dec 23, 2015
src
test
.gitignore Use CMake Dec 23, 2015
CMakeLists.txt Use CMake Dec 23, 2015
Dockerfile Remove docker-compose Dec 23, 2015
LICENSE
README.md
build_and_test.sh Remove docker-compose Dec 23, 2015
config.ld Use CMake Dec 23, 2015

README.md

Torchvid

Utilities for loading videos into Torch using FFmpeg libraries.

local torchvid = require('torchvid')

local video =
  torchvid.Video.new('./centaur_1.mpg'):filter('yuv444p', 'scale=160x120,vflip')

local yuv_tensor = video
  :next_image_frame()
  :to_float_tensor()

Installation

Dependencies

  • Torch
  • pkg-config
  • FFmpeg development libraries

In Ubuntu you can download the non-Torch dependencies with the following command:

apt-get install \
    pkg-config \
    libavformat-ffmpeg-dev \
    libavcodec-ffmpeg-dev \
    libavutil-ffmpeg-dev \
    libavfilter-ffmpeg-dev

Building and installing Torchvid

git clone https://github.com/anibali/torchvid.git /tmp/torchvid
cd /tmp/torchvid
luarocks make rockspecs/torchvid-scm-0.rockspec
rm -rf /tmp/torchvid