visit
Android SDK provides APIs for most of the common work which a developer uses every day like direct share
, app linking
, fingerprint authentication
and so on.Sometimes we might need to work on low-level functionality which mostly are available as .With Android NDK we can use these pre-built libraries by creating a C/C++ wrapper around it and the use JNI to invoke the native code from Kotlin/Java.
Remuxing
Transcoding is the process of converting a file from one encoding format to another so that the content can be viewed on different playback devices.
Transcoding
Depending on the requirements one can choose remuxing or transcoding.
For example:
To convert one format to another — Remuxing
To crop a video or play live streams — Transcoding
To reduce bit rates — Transrating
To change resolution — Transsizing
Often these methods are used in combination to obtain the desired results
.so
files.All the code related to the library is in this file, and it is referenced by programs using it at run-time.A program using a shared library only makes reference to the code that it uses in the shared library.
A program using a static library takes copies of the code that it uses from the static library and makes it part of the program.FFmpeg contains a set of shared libraries which can be used for different operations:
[libavcodec](//www.ffmpeg.org/libavcodec.html)
: provides a generic encoding/decoding framework and contains multiple decoders and encoders for audio, video and subtitle streams, and several bitstream filters.[libavutil](//www.ffmpeg.org/libavutil.html)
: is a utility library to aid portable multimedia programming.[libavformat](//www.ffmpeg.org/libavformat.html)
: provides a generic framework for multiplexing and demultiplexing (muxing and demuxing) audio, video and subtitle streams.[libavdevice](//www.ffmpeg.org/libavdevice.html)
: provides a generic framework for grabbing from and rendering to many common multimedia input/output devices, and supports several input and output devices, including Video4Linux2, VfW, DShow, and ALSA.[libavfilter](//www.ffmpeg.org/libavfilter.html)
: provides a generic audio/video filtering framework containing several filters, sources and sinks.[libavresample](//www.ffmpeg.org/doxygen/2.5/group__lavr.html)
: is a library that handles audio resampling, sample format conversion and mixing.[libswscale](//www.ffmpeg.org/libswscale.html)
: this library performs highly optimized image scaling and colorspace and pixel format conversion operations.[libswresample](//www.ffmpeg.org/libswresample.html)
: this library performs highly optimized audio resampling, rematrixing and sample format conversion operations.libpostproc
: is a post processing library for use in transcode.Depending on the project requirements one can choose the libraries required to be integrated in the project.
Adding Shared Libs and header files to project Add this to CMakeLists.txt file
As we have added the FFmpeg libraries to the project and linked the JNIFunctions.cpp
to the FFmpeg libraries using target_link_libraries
, we can now use the available functions from the libraries by including the header files in *.h
.
Catch me here:Twitter: _LinkedIn:_ Github: