mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-06 12:20:52 +01:00
Summary: Adding a simple video data layer which allows to read video data from frames, videos and output 5D tensor. It also allows multiple labels. The current implementation is based on ffmpeg Differential Revision: D4801798 fbshipit-source-id: 46448e9c65fb055c2d71855447383a33ade0e444
66 lines
1.9 KiB
CMake
66 lines
1.9 KiB
CMake
# - Try to find ffmpeg libraries
|
|
# (libavcodec, libavformat, libavutil, libswscale)
|
|
# Once done this will define
|
|
#
|
|
# FFMPEG_FOUND - system has ffmpeg or libav
|
|
# FFMPEG_INCLUDE_DIR - the ffmpeg include directory
|
|
# FFMPEG_LIBRARIES - Link these to use ffmpeg
|
|
#
|
|
|
|
if (FFMPEG_LIBRARIES AND FFMPEG_INCLUDE_DIR)
|
|
# in cache already
|
|
set(FFMPEG_FOUND TRUE)
|
|
else (FFMPEG_LIBRARIES AND FFMPEG_INCLUDE_DIR)
|
|
|
|
find_path(FFMPEG_AVCODEC_INCLUDE_DIR
|
|
NAMES libavcodec/avcodec.h
|
|
PATHS ${_FFMPEG_AVCODEC_INCLUDE_DIRS} /usr/include /usr/local/include /opt/local/include /sw/include
|
|
PATH_SUFFIXES ffmpeg libav
|
|
)
|
|
|
|
find_library(FFMPEG_LIBAVCODEC
|
|
NAMES avcodec
|
|
PATHS ${_FFMPEG_AVCODEC_LIBRARY_DIRS} /usr/lib /usr/local/lib /opt/local/lib /sw/lib
|
|
)
|
|
|
|
find_library(FFMPEG_LIBAVFORMAT
|
|
NAMES avformat
|
|
PATHS ${_FFMPEG_AVFORMAT_LIBRARY_DIRS} /usr/lib /usr/local/lib /opt/local/lib /sw/lib
|
|
)
|
|
|
|
find_library(FFMPEG_LIBAVUTIL
|
|
NAMES avutil
|
|
PATHS ${_FFMPEG_AVUTIL_LIBRARY_DIRS} /usr/lib /usr/local/lib /opt/local/lib /sw/lib
|
|
)
|
|
|
|
|
|
find_library(FFMPEG_LIBSWSCALE
|
|
NAMES swscale
|
|
PATHS ${_FFMPEG_SWSCALE_LIBRARY_DIRS} /usr/lib /usr/local/lib /opt/local/lib /sw/lib
|
|
)
|
|
|
|
if (FFMPEG_LIBAVCODEC AND FFMPEG_LIBAVFORMAT)
|
|
set(FFMPEG_FOUND TRUE)
|
|
endif()
|
|
|
|
if (FFMPEG_FOUND)
|
|
set(FFMPEG_INCLUDE_DIR ${FFMPEG_AVCODEC_INCLUDE_DIR})
|
|
|
|
set(FFMPEG_LIBRARIES
|
|
${FFMPEG_LIBAVCODEC}
|
|
${FFMPEG_LIBAVFORMAT}
|
|
${FFMPEG_LIBAVUTIL}
|
|
${FFMPEG_LIBSWSCALE}
|
|
)
|
|
|
|
if (NOT FFMPEG_FIND_QUIETLY)
|
|
message(STATUS "Found FFMPEG or Libav: ${FFMPEG_LIBRARIES}, ${FFMPEG_INCLUDE_DIR}")
|
|
endif (NOT FFMPEG_FIND_QUIETLY)
|
|
else (FFMPEG_FOUND)
|
|
if (FFMPEG_FIND_REQUIRED)
|
|
message(FATAL_ERROR "Could not find libavcodec or libavformat or libavutil")
|
|
endif (FFMPEG_FIND_REQUIRED)
|
|
endif (FFMPEG_FOUND)
|
|
|
|
endif (FFMPEG_LIBRARIES AND FFMPEG_INCLUDE_DIR)
|