Coder Social home page Coder Social logo

Transform360 about transform360 HOT 9 CLOSED

facebook avatar facebook commented on May 5, 2024
Transform360

from transform360.

Comments (9)

rpenggithub avatar rpenggithub commented on May 5, 2024 1

That is great. I will move the step to the README file in next update.

from transform360.

rpenggithub avatar rpenggithub commented on May 5, 2024

Sure. Will also add the following steps to the README file once you successfully build it.

  1. To build Transform360:
    You can use, say, cmake (https://cmake.org/). Followed is an example of the CMakeLists.txt with different components:
    (1) Write first part of CMakeLists.txt:

cmake_minimum_required(VERSION 2.8)

project (libtransform360)
set(CMAKE_BUILD_TYPE Release)

set (SOURCE_DIR "${PROJECT_SOURCE_DIR}/")

SET(SOURCES
${SOURCE_DIR}/VideoFrameTransform.cpp
${SOURCE_DIR}/VideoFrameTransformHandler.cpp)

SET(HEADERS
${SOURCE_DIR}VideoFrameTransform.h
${SOURCE_DIR}VideoFrameTransformHandler.h
${SOURCE_DIR}VideoFrameTransformHelper.h)

add_library(Transform360 STATIC ${SOURCES} ${HEADERS})
target_link_libraries(Transform360 ${PROJECT_LINK_LIBS} )

install(TARGETS Transform360
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
COMPONENT library
)
install(DIRECTORY . DESTINATION include/Transform360 FILES_MATCHING PATTERN "*.h")


(2) Add OpenCV:
We used a Facebook compiling tool to add OpenCV (>2.4.8) as a dependency of Transform360. You can try to add the following lines to the above file.


find_package(OpenCV REQUIRED)
include_directories(${OpenCV_INCLUDE_DIRS})
target_link_libraries(MY_TARGET_NAME ${OpenCV_LIBS})


(3) Specify CXXFLAGS:
Please follow http://stackoverflow.com/questions/10851247/how-to-activate-c-11-in-cmake to add "CXXFLAGS" and "-std=c++11" to the above CMakeLists.txt file based on the versions you are using.

  1. Build Transform360 library with FFmpeg:
    The successful building of Transform360 (with OpenCV as dependency) will generate the library file. We need to add it to FFmpeg as an extra library, which can be done by adding the following information to your FFmpeg configure line
    '--extra-libs= -ltransform360_pic -lstdc++'

  2. Add other stuff related to Transform360 to FFmpeg:
    You can follow the "To Build And Use Transform360" section in the README file to add vf_transform360.c to FFmpeg

Please let us know if it works for you.

from transform360.

telganainy avatar telganainy commented on May 5, 2024

Thanks so much Renbin for your detailed reply. Yes, it works for me.

I just made very minor changes. Here is the final CMakeLists.txt I used to build libTransform360.a:

cmake_minimum_required(VERSION 2.8)

project (libtransform360)
set(CMAKE_BUILD_TYPE Release)

set (SOURCE_DIR "${PROJECT_SOURCE_DIR}/")

SET(SOURCES
${SOURCE_DIR}/VideoFrameTransform.cpp
${SOURCE_DIR}/VideoFrameTransformHandler.cpp)

SET(HEADERS
${SOURCE_DIR}VideoFrameTransform.h
${SOURCE_DIR}VideoFrameTransformHandler.h
${SOURCE_DIR}VideoFrameTransformHelper.h)

list(APPEND CMAKE_CXX_FLAGS "-std=c++11 ${CMAKE_CXX_FLAGS}")

add_library(Transform360 STATIC ${SOURCES} ${HEADERS})
target_link_libraries(Transform360 ${PROJECT_LINK_LIBS} )

find_package(OpenCV REQUIRED)
include_directories(${OpenCV_INCLUDE_DIRS})
target_link_libraries(Transform360 ${OpenCV_LIBS})

install(TARGETS Transform360
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
COMPONENT library
)
install(DIRECTORY . DESTINATION include/Transform360 FILES_MATCHING PATTERN "*.h")

Also, here is the configuration line that I used for ffmpeg:

./configure --prefix=/usr/local --enable-gpl --enable-nonfree --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxvid --enable-libopencv --extra-libs='-lTransform360 -lstdc++'

Thanks again.

from transform360.

kwuerl avatar kwuerl commented on May 5, 2024

For any OSX + Homebrew guys:

./configure --prefix=/usr/local --enable-gpl --enable-nonfree --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxvid --enable-libopencv --extra-libs='-lTransform360 -lstdc++ ' --extra-cflags='-I/usr/local/include/ -I/usr/local/Cellar/lame/3.99.5/include/ -I/usr/local/Cellar/theora/1.1.1/include/' --host-ldflags=-L/usr/local/lib

Maybe you need to adjust your 'lame' and 'theora' versions at a later time.

from transform360.

michaelstrigy avatar michaelstrigy commented on May 5, 2024

hi there,
when doing cmake is finished and we run 'make', what is the result we are getting? what should we do with it, that is, how will ffmpeg know 'lTransform360' to use from configure?

thanks.

from transform360.

rpenggithub avatar rpenggithub commented on May 5, 2024

It will generate a transform360 lib which can be recognized by ffmpeg based on the setting of ffmpeg mentioned above.

from transform360.

michaelstrigy avatar michaelstrigy commented on May 5, 2024

thanks you,
I am working on OSX, what i got was a file with a ".a" extension, is that the lib? and do i need to copy it to the ffmpeg dir?

thanks.

from transform360.

rpenggithub avatar rpenggithub commented on May 5, 2024

You can put it in a place where FFmpeg can pick it up

from transform360.

michaelstrigy avatar michaelstrigy commented on May 5, 2024

ok i think i did it, just added in the configure command:
--extra-ldflags="-L/Transform360-lib-file-dir" --extra-cflags="-I/Transform360-include-dir"

now i get strange errors for AudioHardware.h on mac OSX, i guess something with transform360 and mac.

thanks

from transform360.

Related Issues (20)

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.