This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)' | |
LIB_INSTALL_EXTRA_CMD='$$(RANLIB) "$(LIBDIR)/$(LIBNAME)"' | |
SLIB_INSTALL_NAME='$(SLIBNAME_WITH_MAJOR)' | |
SLIB_INSTALL_LINKS='$(SLIBNAME)' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
NDK=/path/to/android-ndk/ | |
SYSROOT=$NDK/platforms/android-14/arch-arm/ | |
TOOLCHAIN=$NDK/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64 | |
function build_one | |
{ | |
./configure \ | |
--prefix=$PREFIX \ | |
--enable-shared \ | |
--disable-static \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <android/log.h> | |
#include "com_example_Controller.h" | |
#include <stdlib.h> | |
#include <stdbool.h> | |
int main(int argc, char **argv); | |
JavaVM *sVm = NULL; | |
jint JNI_OnLoad( JavaVM* vm, void* reserved ) | |
{ | |
sVm = vm; | |
return JNI_VERSION_1_6; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <jni.h> | |
#ifndef _Included_com_example_Controller | |
#define _Included_com_example_Controller | |
#ifdef __cplusplus | |
extern "C" { | |
#endif | |
/* | |
* Class: com_example_Controller | |
* Method: run | |
* Signature: ([Ljava/lang/String;)V |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LOCAL_PATH := $(call my-dir) | |
#$(warning $(LOCAL_PATH)) | |
include $(CLEAR_VARS) | |
LOCAL_MODULE := libffmpeg | |
LOCAL_LDLIBS := -llog -ljnigraphics -lz -landroid | |
LOCAL_CFLAGS := -Wdeprecated-declarations | |
ANDROID_LIB := -landroid | |
LOCAL_C_INCLUDES:=/path/to/ffmpeg | |
LOCAL_SRC_FILES := ffmpeg_controller.c ffmpeg.c ffmpeg_filter.c ffmpeg_opt.c cmdutils.c | |
LOCAL_SHARED_LIBRARIES := libavformat libavcodec libswscale libavutil libswresample libavfilter libavdevice |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
include $(CLEAR_VARS) | |
LOCAL_MODULE:= libavdevice | |
LOCAL_SRC_FILES:= lib/libavdevice-56.so | |
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include | |
include $(PREBUILT_SHARED_LIBRARY) | |
include $(CLEAR_VARS) | |
LOCAL_MODULE:= libavcodec | |
LOCAL_SRC_FILES:= lib/libavcodec-56.so | |
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include | |
include $(PREBUILT_SHARED_LIBRARY) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example; | |
import java.io.DataOutputStream; | |
import java.io.File; | |
import java.io.IOException; | |
public class Controller { | |
static { | |
System.loadLibrary("ffmpeg"); | |
} | |
public static native void run(String[] argv); | |
public static void testFFMPEG(){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
compile 'com.madhavanmalolan.android:ffmpegandroidlibrary:0.0.4' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Controller.getInstance().run(new String{ | |
"-y", | |
"-i", | |
"input_file.mp4", | |
"-vcodec", | |
"copy", | |
"-an", | |
"output_file.mp4" | |
}); |
OlderNewer