In short, to enable support for GPU-assisted encoding with an NVIDIA GPU for ffmpeg, you need: Please see NVIDIA documentations and ffmpeg wiki page for further information. #Ffmpeg linux compile how toYou learned how to install FFmpeg with NVIDIA GPU acceleration hardware support on Debian or Ubuntu Linux to speed up encoding with the ffmpeg command. Make sure you read the following man pages using the man command: Asking for help, clarification, or responding to other answers. Mine is a consumer-grade GPU, but no doubt data center or professional-grade NVIDIA GPU gives even better performance. Thanks for contributing an answer to Stack Overflow Please be sure to answer the question.Provide details and share your research But avoid. Time ~/ffmpeg/ffmpeg -hwaccel cuda -y -i /tmp/input.mkv /tmp/out.mp4 Time command outputs with CPU used: realđm40.678sĪlso note down the speed: frame= 7320 fps= 73 q=-1.0 Lsize= 58306kB time=00:02:02.03 bitrate=3914.0kbits/s speed=1.22xĪnd now same file with NVIDIA GPU acceleration (note the path, I am calling the compiled version): Time /bin/ffmpeg -y -i /tmp/input.mkv /tmp/out.mp4 In this example, I am converting input.mkv to out.mp4 as follows without using GPU acceleration: #Ffmpeg linux compile androidLost somewhere? Feel free to comment below the article.Ĭompleted Successfully? Check my next article to integrate the SO files to our android project using android JNI.Related: Top 7 Linux GPU Monitoring and Diagnostic Commands Line Tools Result SO files (One without version names and one with version name) One without version name is the symbolic link. Open the lib folder, you can find various. There you can see some folders like “Include”, “lib”.etc. Have a tea, let your machine do the work for the next 20 minutes.Īfter some minutes (Depending on your machine’s architecture), you will find this path /path/to/ffmpeg/android/arm Please remember to replace /path/to/ndk to the NDK Path in your local machine.īefore you run the script file above, make sure that required permissions are given to the file, run the command chmod a+x ffmpeg_android.sh Copy paste the below commands into the file #!/bin/bash NDK=/path/to/ndk SYSROOT=$NDK/platforms/android-19/arch-arm/ TOOLCHAIN=$NDK/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64 function build_one CPU=arm PREFIX=$(pwd)/android/$CPU ADDI_CFLAGS="-marm" build_one Now in ffmpeg folder, create a new Build Script and name it as ffmpeg_android.sh (“Just a random name”). Your new ffmpeg path should look like this, /path/to/ndk/sources/ffmpeg-4.0 Now, move your ffmpeg to the sources folder in NDK. With SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)' LIB_INSTALL_EXTRA_CMD='$$(RANLIB) "$(LIBDIR)/$(LIBNAME)"' SLIB_INSTALL_NAME='$(SLIBNAME_WITH_MAJOR)' SLIB_INSTALL_LINKS='$(SLIBNAME)'įor the rest of the post, I assume that path to your NDK as /path/to/ndk and path to your ffmpeg as /path/to/ffmpeg. Your new ffmpeg path should look like this, /path/to/ndk/sources/ffmpeg-4.0īefore we actually configure ffmpeg, FFmpeg is configured by default to have version codes (Ex: libavcodec-10.so) but android can’t recognize such files, so all you need to do is to replace the lines in /path/to/ffmpeg/configure SLIBNAME_WITH_MAJOR='$(SLIBNAME).$(LIBMAJOR)' LIB_INSTALL_EXTRA_CMD='$$(RANLIB) "$(LIBDIR)/$(LIBNAME)"' SLIB_INSTALL_NAME='$(SLIBNAME_WITH_VERSION)' SLIB_INSTALL_LINKS='$(SLIBNAME_WITH_MAJOR) $(SLIBNAME)' That’s it, You are ready to go to Step 2.įor the rest of the post, I assume that path to your NDK is /path/to/ndk and path to your ffmpeg as /path/to/ffmpeg.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |