Script to help with cross compiling

Announcements made by users.
rogerdpack
Posts: 1872
Joined: Fri Aug 05, 2011 9:56 pm

Re: Script to help with cross compiling

Post by rogerdpack » Tue Aug 23, 2016 11:52 pm

cdlvcdlv wrote:I would like to compile FFmpeg using your script with --disable-decoder=vp8,vp9 option. How could I?
You can add/tweak to the ffmpeg configure options in the

build_ffmpeg

method

Cheers!

cdlvcdlv
Posts: 28
Joined: Tue Mar 15, 2016 9:55 am

Re: Script to help with cross compiling

Post by cdlvcdlv » Wed Aug 24, 2016 12:24 am

Sorry, I don't get it. Do you mean build_locally_with_various_option_prompts.bat in native_build\windows folder?

I have had a look to cross_compile_ffmpeg.sh and found config_options= in line 1517. Adding --disable-decoder=vp8,vp9 at the end of the string would suffice?

cdlvcdlv
Posts: 28
Joined: Tue Mar 15, 2016 9:55 am

Re: Script to help with cross compiling

Post by cdlvcdlv » Thu Aug 25, 2016 6:18 am

Confirmed. Last night I downloaded latest version of cross_compile_ffmpeg.sh and added the option in line 1507, just after --enable-libzimg, left it compiling overnight and it worked fine. Thanks.

BiDouiLle
Posts: 42
Joined: Wed Oct 17, 2012 7:45 am
Location: Corsica

Re: Script to help with cross compiling

Post by BiDouiLle » Sat Jan 14, 2017 3:49 am

Hi Roger,

Would it be possible for you to add an option to build and link libnpp from NVIDIA, this allows to do scaling by GPGPU.

Related configure option is "--enable-libnpp". (instructions found in the middle of this page : https://developer.nvidia.com/ffmpeg

I think it superseeded the nvresize filter_complex that was provided in a patch from NVIDIA.

Thank you in advance for your response.

And by the way thank you for all the great work you and Zeranoe do here.

Louis

hydra3333
Posts: 124
Joined: Sun Apr 28, 2013 1:03 pm
Contact:

Re: Script to help with cross compiling

Post by hydra3333 » Mon Jan 16, 2017 5:37 am

Thought i'd look at it too, given I'm having a quick peek at building with OpenGL, to see it if builds.
I'm not all that pleased with nvidia's website https://developer.nvidia.com/ffmpeg which says to download and use sdk 7.5 however we know there's already a cuda kit at 8.0 ... maybe it'll be OK.

Maybe not.
Tried to build it using a variation of rdp's build script and it threw this error:

Code: Select all

ERROR: libnpp not found
after

Code: Select all

+ ./configure --arch=x86_64 --target-os=mingw32 --cross-prefix=/home/u/Desktop/ffmpeg-windows-build-helpers-master/sandbox/cross_compilers/mingw-w64-x86_64/bin/x86_64-w64-mingw32- --pkg-config=pkg-config --disable-w32threads --enable-libsoxr --enable-fontconfig --enable-libass --enable-libbluray --enable-iconv --enable-libtwolame --extra-cflags=-DLIBTWOLAME_STATIC --enable-libzvbi --enable-libcaca --enable-libmodplug --extra-libs=-lstdc++ --extra-libs=-lpng --enable-decklink --extra-libs=-loleaut32 --enable-libmp3lame --enable-version3 --enable-zlib --enable-librtmp --enable-libvorbis --enable-libtheora --enable-libspeex --enable-libopenjpeg --enable-gnutls --enable-libgsm --enable-libfreetype --enable-libopus --enable-bzlib --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvo-amrwbenc --enable-libschroedinger --enable-libvpx --enable-libilbc --enable-libwavpack --enable-libwebp --enable-libgme --enable-dxva2 --enable-avisynth --enable-gray --enable-libopenh264 --enable-netcdf --enable-libflite --enable-lzma --enable-libsnappy --enable-libzimg --enable-gpl --enable-libx264 --enable-libx265 --enable-frei0r --enable-filter=frei0r --enable-librubberband --enable-libvidstab --enable-libxavs --enable-libxvid --enable-libmfx --enable-avresample --extra-libs=-lpsapi --extra-libs=-lspeexdsp --extra-cflags=-O3 --enable-static --disable-shared --prefix=/home/u/Desktop/ffmpeg-windows-build-helpers-master/sandbox/cross_compilers/mingw-w64-x86_64/x86_64-w64-mingw32 --enable-nonfree --enable-libfdk-aac --enable-opencl --enable-cuda --enable-cuvid --enable-libnpp --extra-cflags=-Ilocal/include --extra-cflags=-I../nv_sdk --extra-ldflags=-L../nv_sdk --enable-runtime-cpudetect --disable-libx264
and this

Code: Select all

find . | grep npp
shows no sign of an npp.h

Code: Select all

./ffmpeg-windows-build-helpers-master/sandbox/x86_64/ffmpeg_git_pre_x264_with_fdk_aac/libavfilter/vf_scale_npp.c
./ffmpeg-windows-build-helpers-master/sandbox/cross_compilers/mingw-w64-x86_64/lib/libpsnppagn.a
./ffmpeg-windows-build-helpers-master/sandbox/cross_compilers/mingw-w64-x86_64/lib/libndisnpp.a
./ffmpeg-windows-build-helpers-master/sandbox/cross_compilers/mingw-w64-x86_64/lib/libnpptools.a
as identified in the config.log

Code: Select all

check_lib npp.h nppGetLibVersion -lnppi -lnppc
check_header npp.h
check_cpp
BEGIN /tmp/ffconf.axo3nwWT.c
    1	#include <npp.h>
    2	int x;
END /tmp/ffconf.axo3nwWT.c
/home/u/Desktop/ffmpeg-windows-build-helpers-master/sandbox/cross_compilers/mingw-w64-x86_64/bin/x86_64-w64-mingw32-gcc -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -U__STRICT_ANSI__ -D__USE_MINGW_ANSI_STDIO=1 -D__printf__=__gnu_printf__ -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -DPIC -O3 -DLIBTWOLAME_STATIC -O3 -Ilocal/include -I../nv_sdk -std=c11 -fomit-frame-pointer -pthread -I/home/u/Desktop/ffmpeg-windows-build-helpers-master/sandbox/cross_compilers/mingw-w64-x86_64/x86_64-w64-mingw32/include -I/home/u/Desktop/ffmpeg-windows-build-helpers-master/sandbox/cross_compilers/mingw-w64-x86_64/x86_64-w64-mingw32/include -I/home/u/Desktop/ffmpeg-windows-build-helpers-master/sandbox/cross_compilers/mingw-w64-x86_64/x86_64-w64-mingw32/include/freetype2 -I/home/u/Desktop/ffmpeg-windows-build-helpers-master/sandbox/cross_compilers/mingw-w64-x86_64/x86_64-w64-mingw32/include -I/home/u/Desktop/ffmpeg-windows-build-helpers-master/sandbox/cross_compilers/mingw-w64-x86_64/x86_64-w64-mingw32/include/fribidi -I/home/u/Desktop/ffmpeg-windows-build-helpers-master/sandbox/cross_compilers/mingw-w64-x86_64/x86_64-w64-mingw32/include/freetype2 -I/home/u/Desktop/ffmpeg-windows-build-helpers-master/sandbox/cross_compilers/mingw-w64-x86_64/x86_64-w64-mingw32/include -I/home/u/Desktop/ffmpeg-windows-build-helpers-master/sandbox/cross_compilers/mingw-w64-x86_64/x86_64-w64-mingw32/include -I/home/u/Desktop/ffmpeg-windows-build-helpers-master/sandbox/cross_compilers/mingw-w64-x86_64/x86_64-w64-mingw32/include -I/home/u/Desktop/ffmpeg-windows-build-helpers-master/sandbox/cross_compilers/mingw-w64-x86_64/x86_64-w64-mingw32/include -I/home/u/Desktop/ffmpeg-windows-build-helpers-master/sandbox/cross_compilers/mingw-w64-x86_64/x86_64-w64-mingw32/include -I/home/u/Desktop/ffmpeg-windows-build-helpers-master/sandbox/cross_compilers/mingw-w64-x86_64/x86_64-w64-mingw32/include/freetype2 -I/home/u/Desktop/ffmpeg-windows-build-helpers-master/sandbox/cross_compilers/mingw-w64-x86_64/x86_64-w64-mingw32/include -I/home/u/Desktop/ffmpeg-windows-build-helpers-master/sandbox/cross_compilers/mingw-w64-x86_64/x86_64-w64-mingw32/include/freetype2 -I/home/u/Desktop/ffmpeg-windows-build-helpers-master/sandbox/cross_compilers/mingw-w64-x86_64/x86_64-w64-mingw32/include -I/home/u/Desktop/ffmpeg-windows-build-helpers-master/sandbox/cross_compilers/mingw-w64-x86_64/x86_64-w64-mingw32/include/freetype2 -I/home/u/Desktop/ffmpeg-windows-build-helpers-master/sandbox/cross_compilers/mingw-w64-x86_64/x86_64-w64-mingw32/include -I/home/u/Desktop/ffmpeg-windows-build-helpers-master/sandbox/cross_compilers/mingw-w64-x86_64/x86_64-w64-mingw32/include -I/home/u/Desktop/ffmpeg-windows-build-helpers-master/sandbox/cross_compilers/mingw-w64-x86_64/x86_64-w64-mingw32/include -E -o /tmp/ffconf.MULBqhtr.o /tmp/ffconf.axo3nwWT.c
/tmp/ffconf.axo3nwWT.c:1:17: fatal error: npp.h: No such file or directory
 #include <npp.h>
                 ^
compilation terminated.
ERROR: libnpp not found
As a linux newbie, I'm stuck a this point :)

hydra3333
Posts: 124
Joined: Sun Apr 28, 2013 1:03 pm
Contact:

Re: Script to help with cross compiling

Post by hydra3333 » Mon Jan 16, 2017 6:15 am

maybe this has something to do with it
https://gist.github.com/Brainiarc7/9884 ... 2ebb47387a
Had to include lib path to cuda, otherwise libnpp was not found.
Adding --extra-cflags="-I/usr/local/cuda/include/" --extra-ldflags=-L/usr/local/cuda/lib64/ to configure
which means somehow downloading the windows nvidia cuda SDK (v8?) and unpacking it (its a windows installer?) and then copying npp.h and whatnot, sort of like already did with the codec sdk 7.5 per nvidia's instructions ?

Suggestions welcomed.

edit 1:
http://docs.nvidia.com/cuda/cuda-instal ... z4Vu6yTdhi says for Windows (for us to source the .h files and whatnot)
The NVIDIA CUDA Toolkit is available at http://developer.nvidia.com/cuda-downloads
Full Installer: An installer which contains all the components of the CUDA Toolkit and does not require any further download.
The CUDA Toolkit installs the CUDA driver and tools needed to create, build and run a CUDA application as well as libraries, header files, CUDA samples source code, and other resources.
The installer can be executed in silent mode by executing the package with the -s flag.
Additional parameters can be passed which will install specific subpackages instead of all packages. See the table below for a list of all the subpackage names.
...
compiler_8.0 Compiler components including NVCC and CUDART development libraries and headers.
command_line_tools_8.0 Command line tools including profiler, gpu-library-advisor, memcheck, and nvprune.
visual_profiler_8.0 GUI profiler for CUDA applications.
visual_studio_integration_8.0 Registers the CUDA plugins with supported and installed versions of Visual Studio. Also installs Nsight Visual Studio Edition as well as the NVIDIA Tools Extension SDK. This integration allows for CUDA development within Visual Studio.
demo_suite_8.0 Prebuilt demo applications using CUDA.
documentation_8.0 CUDA HTML and PDF documentation files including the CUDA C Programming Guide, CUDA C Best Practices Guide, CUDA library documentation, etc.
cublas_8.0 CUBLAS runtime libraries.
cublas_dev_8.0 CUBLAS development libraries and headers.
cudart_8.0 CUDART runtime libraries.
cufft_8.0 CUFFT runtime libraries.
cufft_dev_8.0 CUFFT development libraries and headers.
curand_8.0 CURAND runtime libraries.
curand_dev_8.0 CURAND development libraries and headers.
cusolver_8.0 CUSOLVER runtime libraries.
cusolver_dev_8.0 CUSOLVER development libraries and headers.
cusparse_8.0 CUSPARSE runtime libraries.
cusparse_dev_8.0 CUSPARSE development libraries and headers.
nvgraph_8.0 NVIDIA Graph Analytics runtime libraries.
nvgraph_dev_8.0 NVIDIA Graph Analytics development libraries and headers.
npp_8.0 NPP runtime libraries.
npp_dev_8.0 NPP development libraries and headers.

nvrtc_8.0 NVRTC runtime libraries.
nvrtc_dev_8.0 NVRTC development libraries and headers.
nvml_dev_8.0 NVML development libraries and headers.
occupancy_calculator_8.0 Excel spreadsheet used to test occupancy scenarios.
fortran_examples_8.0 CUDA Fortran examples.
Samples Subpackages (defaults to C:\ProgramData\NVIDIA Corporation\CUDA Samples\v8.0):
samples_8.0 Source code for many example CUDA applications using supported versions of Visual Studio.
...

So, I'm not sure if that means we need to also install the "NPP runtime libraries" on a Windows PC if a cross-compiled ffmpeg is to run on it.
Last edited by hydra3333 on Mon Jan 16, 2017 7:00 am, edited 1 time in total.

hydra3333
Posts: 124
Joined: Sun Apr 28, 2013 1:03 pm
Contact:

Re: Script to help with cross compiling

Post by hydra3333 » Mon Jan 16, 2017 6:18 am

ooh, is this
--enable-libopencv enable video filtering via libopencv
what I think it is ? opencv in ffmepg ? https://ffmpeg.org/pipermail/ffmpeg-dev ... 95078.html

hydra3333
Posts: 124
Joined: Sun Apr 28, 2013 1:03 pm
Contact:

Re: Script to help with cross compiling

Post by hydra3333 » Mon Jan 16, 2017 7:16 am

Hmm,

BiDouiLle, I wouldn't pin any hope on using npp for GPU scaling, from the looks of this thread; these are links to a couple of posts in it, alluding to bugs nvidia doesn't seem to want to address, as at Sept 2016:
http://ffmpeg.org/pipermail/ffmpeg-trac ... 36160.html
http://ffmpeg.org/pipermail/ffmpeg-trac ... 36609.html
The npp_scale filter may need to be declared as deprecated.
It may only be the filter will get removed due to this lack of
support, for having a low image quality and being bound to a specific
hardware and an external library.
It's then better to give users a "heads up" by declaring it as deprecated,
not to make it a secret, and to hope it's going to change in the future.
I'm giving up on npp now :roll: although I may still try to build a version with CUVID/CUDA just for fun.

hydra3333
Posts: 124
Joined: Sun Apr 28, 2013 1:03 pm
Contact:

Re: Script to help with cross compiling

Post by hydra3333 » Mon Jan 16, 2017 11:07 pm


BiDouiLle
Posts: 42
Joined: Wed Oct 17, 2012 7:45 am
Location: Corsica

Re: Script to help with cross compiling

Post by BiDouiLle » Wed Jan 18, 2017 7:23 pm

Hail Hydra,

Interesting results :)

If npp is bugged let's throw it out.

I read that QSV have nice possibilities to do such processing but dunno if it is yet accessible in any way from ffmpeg, perhaps using opencv like you said.

npp was promising because of the full GPGPU processing and gpu memory pipeline ^^'

Post Reply