
Recherche avancée
Autres articles (20)
-
Multilang : améliorer l’interface pour les blocs multilingues
18 février 2011, parMultilang est un plugin supplémentaire qui n’est pas activé par défaut lors de l’initialisation de MediaSPIP.
Après son activation, une préconfiguration est mise en place automatiquement par MediaSPIP init permettant à la nouvelle fonctionnalité d’être automatiquement opérationnelle. Il n’est donc pas obligatoire de passer par une étape de configuration pour cela. -
List of compatible distributions
26 avril 2011, parThe table below is the list of Linux distributions compatible with the automated installation script of MediaSPIP. Distribution nameVersion nameVersion number Debian Squeeze 6.x.x Debian Weezy 7.x.x Debian Jessie 8.x.x Ubuntu The Precise Pangolin 12.04 LTS Ubuntu The Trusty Tahr 14.04
If you want to help us improve this list, you can provide us access to a machine whose distribution is not mentioned above or send the necessary fixes to add (...) -
Selection of projects using MediaSPIP
2 mai 2011, parThe examples below are representative elements of MediaSPIP specific uses for specific projects.
MediaSPIP farm @ Infini
The non profit organizationInfini develops hospitality activities, internet access point, training, realizing innovative projects in the field of information and communication technologies and Communication, and hosting of websites. It plays a unique and prominent role in the Brest (France) area, at the national level, among the half-dozen such association. Its members (...)
Sur d’autres sites (7206)
-
Issue #1 when compiling Xuggler for Raspberry pi with libspeex
23 juillet 2014, par Ashish SharmaI am trying to compile Xuggler for Raspberry Pi(Running on Debian OS aka Raspbian),
I followed the ’Basic Build Instructions’ available here for compiling Xuggler.
After I successfully installed all the prerequisites and set the correct paths, I ran the following command :
ant run-tests
After sometime I am facing the following error and the ant build fails :
scroll at the end of log to see the issue
[exec] Making all in libspeex
[exec] make[2]: Entering directory `/home/pi/Downloads/xuggle-xuggler/build/native/armv6l-unknown-linux-gnueabihf/captive/libspeex'
[exec] Incarcerated package must be reconfigured; regenerating out of date captive Makefile from: ../../../../../captive/libspeex/csrc/configure
[exec] /bin/mkdir -p csrc
[exec] cd csrc && sh ../incarcerate
[exec] checking for a BSD-compatible install... /usr/bin/install -c
[exec] checking whether build environment is sane... yes
[exec] checking for a thread-safe mkdir -p... /bin/mkdir -p
[exec] checking for gawk... no
[exec] checking for mawk... mawk
[exec] checking whether make sets $(MAKE)... yes
[exec] checking build system type... armv6l-unknown-linux-gnu
[exec] checking host system type... armv6l-unknown-linux-gnu
[exec] checking how to print strings... printf
[exec] checking for style of include used by make... GNU
[exec] checking for gcc... gcc
[exec] checking whether the C compiler works... yes
[exec] checking for C compiler default output file name... a.out
[exec] checking for suffix of executables...
[exec] checking whether we are cross compiling... no
[exec] checking for suffix of object files... o
[exec] checking whether we are using the GNU C compiler... yes
[exec] checking whether gcc accepts -g... yes
[exec] checking for gcc option to accept ISO C89... none needed
[exec] checking dependency style of gcc... none
[exec] checking for a sed that does not truncate output... /bin/sed
[exec] checking for grep that handles long lines and -e... /bin/grep
[exec] checking for egrep... /bin/grep -E
[exec] checking for fgrep... /bin/grep -F
[exec] checking for ld used by gcc... /usr/bin/ld
[exec] checking if the linker (/usr/bin/ld) is GNU ld... yes
[exec] checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
[exec] checking the name lister (/usr/bin/nm -B) interface... BSD nm
[exec] checking whether ln -s works... yes
[exec] checking the maximum length of command line arguments... 805306365
[exec] checking whether the shell understands some XSI constructs... yes
[exec] checking whether the shell understands "+="... yes
[exec] checking how to convert armv6l-unknown-linux-gnu file names to armv6l-unknown-linux-gnu format... func_convert_file_noop
[exec] checking how to convert armv6l-unknown-linux-gnu file names to toolchain format... func_convert_file_noop
[exec] checking for /usr/bin/ld option to reload object files... -r
[exec] checking for objdump... objdump
[exec] checking how to recognize dependent libraries... pass_all
[exec] checking for dlltool... false
[exec] checking how to associate runtime and link libraries... printf %s\n
[exec] checking for archiver @FILE support... @
[exec] checking for strip... strip
[exec] checking for ranlib... ranlib
[exec] checking command to parse /usr/bin/nm -B output from gcc object... ok
[exec] checking for sysroot... no
[exec] checking for mt... mt
[exec] checking if mt is a manifest tool... no
[exec] checking how to run the C preprocessor... gcc -E
[exec] checking for ANSI C header files... yes
[exec] checking for sys/types.h... yes
[exec] checking for sys/stat.h... yes
[exec] checking for stdlib.h... yes
[exec] checking for string.h... yes
[exec] checking for memory.h... yes
[exec] checking for strings.h... yes
[exec] checking for inttypes.h... yes
[exec] checking for stdint.h... yes
[exec] checking for unistd.h... yes
[exec] checking for dlfcn.h... yes
[exec] checking for objdir... .libs
[exec] checking if gcc supports -fno-rtti -fno-exceptions... no
[exec] checking for gcc option to produce PIC... -fPIC -DPIC
[exec] checking if gcc PIC flag -fPIC -DPIC works... yes
[exec] checking if gcc static flag -static works... yes
[exec] checking if gcc supports -c -o file.o... yes
[exec] checking if gcc supports -c -o file.o... (cached) yes
[exec] checking whether the gcc linker (/usr/bin/ld) supports shared libraries... yes
[exec] checking dynamic linker characteristics... GNU/Linux ld.so
[exec] checking how to hardcode library paths into programs... immediate
[exec] checking whether stripping libraries is possible... yes
[exec] checking if libtool supports shared libraries... yes
[exec] checking whether to build shared libraries... no
[exec] checking whether to build static libraries... yes
[exec] checking whether to enable maintainer-specific portions of Makefiles... no
[exec] checking whether byte ordering is bigendian... no
[exec] checking for an ANSI C-conforming const... yes
[exec] checking for inline... inline
[exec] checking for C/C++ restrict keyword... __restrict
[exec] checking for C99 variable-size arrays... yes
[exec] checking alloca.h usability... yes
[exec] checking alloca.h presence... yes
[exec] checking for alloca.h... yes
[exec] checking getopt.h usability... yes
[exec] checking getopt.h presence... yes
[exec] checking for getopt.h... yes
[exec] checking for alloca... yes
[exec] checking for SSE in current arch/CFLAGS... no
[exec] checking for ELF visibility... yes
[exec] checking sys/soundcard.h usability... yes
[exec] checking sys/soundcard.h presence... yes
[exec] checking for sys/soundcard.h... yes
[exec] checking sys/audioio.h usability... no
[exec] checking sys/audioio.h presence... no
[exec] checking for sys/audioio.h... no
[exec] checking for Ogg... yes
[exec] checking for sin in -lm... yes
[exec] checking for getopt_long... yes
[exec] checking for main in -lwinmm... no
[exec] checking for pkg-config... /usr/bin/pkg-config
[exec] checking pkg-config is at least version 0.9.0... yes
[exec] checking size of short... 0
[exec] checking size of int... 0
[exec] checking size of long... 0
[exec] configure: creating ./config.status
[exec] config.status: creating Makefile
[exec] config.status: creating libspeex/Makefile
[exec] config.status: creating src/Makefile
[exec] config.status: creating doc/Makefile
[exec] config.status: creating Speex.spec
[exec] config.status: creating include/Makefile
[exec] config.status: creating include/speex/Makefile
[exec] config.status: creating speex.pc
[exec] config.status: creating speexdsp.pc
[exec] config.status: creating win32/Makefile
[exec] config.status: creating win32/libspeex/Makefile
[exec] config.status: creating win32/speexenc/Makefile
[exec] config.status: creating win32/speexdec/Makefile
[exec] config.status: creating symbian/Makefile
[exec] config.status: creating win32/VS2003/Makefile
[exec] config.status: creating win32/VS2003/tests/Makefile
[exec] config.status: creating win32/VS2003/libspeex/Makefile
[exec] config.status: creating win32/VS2003/libspeexdsp/Makefile
[exec] config.status: creating win32/VS2003/speexdec/Makefile
[exec] config.status: creating win32/VS2003/speexenc/Makefile
[exec] config.status: creating win32/VS2005/Makefile
[exec] config.status: creating win32/VS2005/libspeex/Makefile
[exec] config.status: creating win32/VS2005/speexdec/Makefile
[exec] config.status: creating win32/VS2005/speexenc/Makefile
[exec] config.status: creating win32/VS2005/libspeexdsp/Makefile
[exec] config.status: creating win32/VS2005/tests/Makefile
[exec] config.status: creating win32/VS2008/libspeexdsp/Makefile
[exec] config.status: creating win32/VS2008/Makefile
[exec] config.status: creating win32/VS2008/speexdec/Makefile
[exec] config.status: creating win32/VS2008/tests/Makefile
[exec] config.status: creating win32/VS2008/libspeex/Makefile
[exec] config.status: creating win32/VS2008/speexenc/Makefile
[exec] config.status: creating include/speex/speex_config_types.h
[exec] config.status: creating ti/Makefile
[exec] config.status: creating ti/speex_C54_test/Makefile
[exec] config.status: creating ti/speex_C55_test/Makefile
[exec] config.status: creating ti/speex_C64_test/Makefile
[exec] config.status: creating config.h
[exec] config.status: executing depfiles commands
[exec] config.status: executing libtool commands
[exec] Type "make; make install" to compile and install Speex
[exec] Incarcerated package configured: ../../../../../captive/libspeex
[exec] Incarcerating package ../../../../../captive/libspeex to fake DESTDIR=/home/pi/Downloads/xuggle-xuggler/build/native/armv6l-unknown-linux-gnueabihf/captive/stage
[exec] make[3]: Entering directory `/home/pi/Downloads/xuggle-xuggler/build/native/armv6l-unknown-linux-gnueabihf/captive/libspeex/csrc'
[exec] make all-recursive
[exec] make[4]: Entering directory `/home/pi/Downloads/xuggle-xuggler/build/native/armv6l-unknown-linux-gnueabihf/captive/libspeex/csrc'
[exec] Making all in libspeex
[exec] make[4]: *** [all-recursive] Error 1
[exec] make[3]: *** [all] Error 2
[exec] make[4]: Leaving directory `/home/pi/Downloads/xuggle-xuggler/build/native/armv6l-unknown-linux-gnueabihf/captive/libspeex/csrc'
[exec] make[3]: Leaving directory `/home/pi/Downloads/xuggle-xuggler/build/native/armv6l-unknown-linux-gnueabihf/captive/libspeex/csrc'
[exec] Out of date files; re-running make
[exec] make[3]: Entering directory `/home/pi/Downloads/xuggle-xuggler/build/native/armv6l-unknown-linux-gnueabihf/captive/libspeex/csrc'
[exec] make all-recursive
[exec] make[4]: Entering directory `/home/pi/Downloads/xuggle-xuggler/build/native/armv6l-unknown-linux-gnueabihf/captive/libspeex/csrc'
[exec] Making all in libspeex
[exec] make[5]: Entering directory `/home/pi/Downloads/xuggle-xuggler/build/native/armv6l-unknown-linux-gnueabihf/captive/libspeex/csrc/libspeex'
[exec] /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I/home/pi/Downloads/xuggle-xuggler/build/native/armv6l-unknown-linux-gnueabihf/captive/../../../../captive/libspeex/csrc/libspeex -I.. -I/home/pi/Downloads/xuggle-xuggler/build/native/armv6l-unknown-linux-gnueabihf/captive/../../../../captive/libspeex/csrc/include -I../include -I.. -I/home/pi/Downloads/xuggler/include -I/home/pi/Downloads/xuggle-xuggler/build/native/armv6l-unknown-linux-gnueabihf/captive/stage/home/pi/Downloads/xuggler/include -fvisibility=hidden -O3 -msse -c -o cb_search.lo /home/pi/Downloads/xuggle-xuggler/build/native/armv6l-unknown-linux-gnueabihf/captive/../../../../captive/libspeex/csrc/libspeex/cb_search.c
[exec] libtool: compile: gcc -DHAVE_CONFIG_H -I. -I/home/pi/Downloads/xuggle-xuggler/build/native/armv6l-unknown-linux-gnueabihf/captive/../../../../captive/libspeex/csrc/libspeex -I.. -I/home/pi/Downloads/xuggle-xuggler/build/native/armv6l-unknown-linux-gnueabihf/captive/../../../../captive/libspeex/csrc/include -I../include -I.. -I/home/pi/Downloads/xuggler/include -I/home/pi/Downloads/xuggle-xuggler/build/native/armv6l-unknown-linux-gnueabihf/captive/stage/home/pi/Downloads/xuggler/include -fvisibility=hidden -O3 -msse -c /home/pi/Downloads/xuggle-xuggler/build/native/armv6l-unknown-linux-gnueabihf/captive/../../../../captive/libspeex/csrc/libspeex/cb_search.c -fPIC -DPIC -o cb_search.o
[exec] cc1: error: unrecognized command line option '-msse'
[exec] make[5]: *** [cb_search.lo] Error 1
[exec] make[4]: *** [all-recursive] Error 1
[exec] make[3]: *** [all] Error 2
[exec] make[2]: *** [all-local] Error 2
[exec] make[1]: *** [all-recursive] Error 1
[exec] make: *** [all-recursive] Error 1
[exec] make[5]: Leaving directory `/home/pi/Downloads/xuggle-xuggler/build/native/armv6l-unknown-linux-gnueabihf/captive/libspeex/csrc/libspeex'
[exec] make[4]: Leaving directory `/home/pi/Downloads/xuggle-xuggler/build/native/armv6l-unknown-linux-gnueabihf/captive/libspeex/csrc'
[exec] make[3]: Leaving directory `/home/pi/Downloads/xuggle-xuggler/build/native/armv6l-unknown-linux-gnueabihf/captive/libspeex/csrc'
[exec] make[2]: Leaving directory `/home/pi/Downloads/xuggle-xuggler/build/native/armv6l-unknown-linux-gnueabihf/captive/libspeex'
[exec] make[1]: Leaving directory `/home/pi/Downloads/xuggle-xuggler/build/native/armv6l-unknown-linux-gnueabihf/captive'
BUILD FAILED
/home/pi/Downloads/xuggle-xuggler/mk/buildtools/buildhelper.xml:1192: exec returned: 2
Total time: 73 minutes 17 secondsI am unable to understand the problem statment "unrecognized command line option ’-msse’" here, Can someone please tell me how can I resolve this or circumvent it in xuggler ?
-
android ffmpeg bad video output
20 août 2014, par Sujith ManjavanaI’m following this tutorial to create my first ffmpeg app. I have successfully build the shared libs and compiled the project without any errors. But when i run the app on my nexus 5 the output is this
Here is the native code
#include <libavcodec></libavcodec>avcodec.h>
#include <libavformat></libavformat>avformat.h>
#include <libswscale></libswscale>swscale.h>
#include <libavutil></libavutil>pixfmt.h>
#include
#include
#include
#include <android></android>native_window.h>
#include <android></android>native_window_jni.h>
#define LOG_TAG "android-ffmpeg-tutorial02"
#define LOGI(...) __android_log_print(4, LOG_TAG, __VA_ARGS__);
#define LOGE(...) __android_log_print(6, LOG_TAG, __VA_ARGS__);
ANativeWindow* window;
char *videoFileName;
AVFormatContext *formatCtx = NULL;
int videoStream;
AVCodecContext *codecCtx = NULL;
AVFrame *decodedFrame = NULL;
AVFrame *frameRGBA = NULL;
jobject bitmap;
void* buffer;
struct SwsContext *sws_ctx = NULL;
int width;
int height;
int stop;
jint naInit(JNIEnv *pEnv, jobject pObj, jstring pFileName) {
AVCodec *pCodec = NULL;
int i;
AVDictionary *optionsDict = NULL;
videoFileName = (char *)(*pEnv)->GetStringUTFChars(pEnv, pFileName, NULL);
LOGI("video file name is %s", videoFileName);
// Register all formats and codecs
av_register_all();
// Open video file
if(avformat_open_input(&formatCtx, videoFileName, NULL, NULL)!=0)
return -1; // Couldn't open file
// Retrieve stream information
if(avformat_find_stream_info(formatCtx, NULL)<0)
return -1; // Couldn't find stream information
// Dump information about file onto standard error
av_dump_format(formatCtx, 0, videoFileName, 0);
// Find the first video stream
videoStream=-1;
for(i=0; inb_streams; i++) {
if(formatCtx->streams[i]->codec->codec_type==AVMEDIA_TYPE_VIDEO) {
videoStream=i;
break;
}
}
if(videoStream==-1)
return -1; // Didn't find a video stream
// Get a pointer to the codec context for the video stream
codecCtx=formatCtx->streams[videoStream]->codec;
// Find the decoder for the video stream
pCodec=avcodec_find_decoder(codecCtx->codec_id);
if(pCodec==NULL) {
fprintf(stderr, "Unsupported codec!\n");
return -1; // Codec not found
}
// Open codec
if(avcodec_open2(codecCtx, pCodec, &optionsDict)<0)
return -1; // Could not open codec
// Allocate video frame
decodedFrame=avcodec_alloc_frame();
// Allocate an AVFrame structure
frameRGBA=avcodec_alloc_frame();
if(frameRGBA==NULL)
return -1;
return 0;
}
jobject createBitmap(JNIEnv *pEnv, int pWidth, int pHeight) {
int i;
//get Bitmap class and createBitmap method ID
jclass javaBitmapClass = (jclass)(*pEnv)->FindClass(pEnv, "android/graphics/Bitmap");
jmethodID mid = (*pEnv)->GetStaticMethodID(pEnv, javaBitmapClass, "createBitmap", "(IILandroid/graphics/Bitmap$Config;)Landroid/graphics/Bitmap;");
//create Bitmap.Config
//reference: https://forums.oracle.com/thread/1548728
const wchar_t* configName = L"ARGB_8888";
int len = wcslen(configName);
jstring jConfigName;
if (sizeof(wchar_t) != sizeof(jchar)) {
//wchar_t is defined as different length than jchar(2 bytes)
jchar* str = (jchar*)malloc((len+1)*sizeof(jchar));
for (i = 0; i < len; ++i) {
str[i] = (jchar)configName[i];
}
str[len] = 0;
jConfigName = (*pEnv)->NewString(pEnv, (const jchar*)str, len);
} else {
//wchar_t is defined same length as jchar(2 bytes)
jConfigName = (*pEnv)->NewString(pEnv, (const jchar*)configName, len);
}
jclass bitmapConfigClass = (*pEnv)->FindClass(pEnv, "android/graphics/Bitmap$Config");
jobject javaBitmapConfig = (*pEnv)->CallStaticObjectMethod(pEnv, bitmapConfigClass,
(*pEnv)->GetStaticMethodID(pEnv, bitmapConfigClass, "valueOf", "(Ljava/lang/String;)Landroid/graphics/Bitmap$Config;"), jConfigName);
//create the bitmap
return (*pEnv)->CallStaticObjectMethod(pEnv, javaBitmapClass, mid, pWidth, pHeight, javaBitmapConfig);
}
jintArray naGetVideoRes(JNIEnv *pEnv, jobject pObj) {
jintArray lRes;
if (NULL == codecCtx) {
return NULL;
}
lRes = (*pEnv)->NewIntArray(pEnv, 2);
if (lRes == NULL) {
LOGI(1, "cannot allocate memory for video size");
return NULL;
}
jint lVideoRes[2];
lVideoRes[0] = codecCtx->width;
lVideoRes[1] = codecCtx->height;
(*pEnv)->SetIntArrayRegion(pEnv, lRes, 0, 2, lVideoRes);
return lRes;
}
void naSetSurface(JNIEnv *pEnv, jobject pObj, jobject pSurface) {
if (0 != pSurface) {
// get the native window reference
window = ANativeWindow_fromSurface(pEnv, pSurface);
// set format and size of window buffer
ANativeWindow_setBuffersGeometry(window, 0, 0, WINDOW_FORMAT_RGBA_8888);
} else {
// release the native window
ANativeWindow_release(window);
}
}
jint naSetup(JNIEnv *pEnv, jobject pObj, int pWidth, int pHeight) {
width = pWidth;
height = pHeight;
//create a bitmap as the buffer for frameRGBA
bitmap = createBitmap(pEnv, pWidth, pHeight);
if (AndroidBitmap_lockPixels(pEnv, bitmap, &buffer) < 0)
return -1;
//get the scaling context
sws_ctx = sws_getContext (
codecCtx->width,
codecCtx->height,
codecCtx->pix_fmt,
pWidth,
pHeight,
AV_PIX_FMT_RGBA,
SWS_BILINEAR,
NULL,
NULL,
NULL
);
// Assign appropriate parts of bitmap to image planes in pFrameRGBA
// Note that pFrameRGBA is an AVFrame, but AVFrame is a superset
// of AVPicture
avpicture_fill((AVPicture *)frameRGBA, buffer, AV_PIX_FMT_RGBA,
pWidth, pHeight);
return 0;
}
void finish(JNIEnv *pEnv) {
//unlock the bitmap
AndroidBitmap_unlockPixels(pEnv, bitmap);
av_free(buffer);
// Free the RGB image
av_free(frameRGBA);
// Free the YUV frame
av_free(decodedFrame);
// Close the codec
avcodec_close(codecCtx);
// Close the video file
avformat_close_input(&formatCtx);
}
void decodeAndRender(JNIEnv *pEnv) {
ANativeWindow_Buffer windowBuffer;
AVPacket packet;
int i=0;
int frameFinished;
int lineCnt;
while(av_read_frame(formatCtx, &packet)>=0 && !stop) {
// Is this a packet from the video stream?
if(packet.stream_index==videoStream) {
// Decode video frame
avcodec_decode_video2(codecCtx, decodedFrame, &frameFinished,
&packet);
// Did we get a video frame?
if(frameFinished) {
// Convert the image from its native format to RGBA
sws_scale
(
sws_ctx,
(uint8_t const * const *)decodedFrame->data,
decodedFrame->linesize,
0,
codecCtx->height,
frameRGBA->data,
frameRGBA->linesize
);
// lock the window buffer
if (ANativeWindow_lock(window, &windowBuffer, NULL) < 0) {
LOGE("cannot lock window");
} else {
// draw the frame on buffer
LOGI("copy buffer %d:%d:%d", width, height, width*height*4);
LOGI("window buffer: %d:%d:%d", windowBuffer.width,
windowBuffer.height, windowBuffer.stride);
memcpy(windowBuffer.bits, buffer, width * height * 4);
// unlock the window buffer and post it to display
ANativeWindow_unlockAndPost(window);
// count number of frames
++i;
}
}
}
// Free the packet that was allocated by av_read_frame
av_free_packet(&packet);
}
LOGI("total No. of frames decoded and rendered %d", i);
finish(pEnv);
}
/**
* start the video playback
*/
void naPlay(JNIEnv *pEnv, jobject pObj) {
//create a new thread for video decode and render
pthread_t decodeThread;
stop = 0;
pthread_create(&decodeThread, NULL, decodeAndRender, NULL);
}
/**
* stop the video playback
*/
void naStop(JNIEnv *pEnv, jobject pObj) {
stop = 1;
}
jint JNI_OnLoad(JavaVM* pVm, void* reserved) {
JNIEnv* env;
if ((*pVm)->GetEnv(pVm, (void **)&env, JNI_VERSION_1_6) != JNI_OK) {
return -1;
}
JNINativeMethod nm[8];
nm[0].name = "naInit";
nm[0].signature = "(Ljava/lang/String;)I";
nm[0].fnPtr = (void*)naInit;
nm[1].name = "naSetSurface";
nm[1].signature = "(Landroid/view/Surface;)V";
nm[1].fnPtr = (void*)naSetSurface;
nm[2].name = "naGetVideoRes";
nm[2].signature = "()[I";
nm[2].fnPtr = (void*)naGetVideoRes;
nm[3].name = "naSetup";
nm[3].signature = "(II)I";
nm[3].fnPtr = (void*)naSetup;
nm[4].name = "naPlay";
nm[4].signature = "()V";
nm[4].fnPtr = (void*)naPlay;
nm[5].name = "naStop";
nm[5].signature = "()V";
nm[5].fnPtr = (void*)naStop;
jclass cls = (*env)->FindClass(env, "roman10/tutorial/android_ffmpeg_tutorial02/MainActivity");
//Register methods with env->RegisterNatives.
(*env)->RegisterNatives(env, cls, nm, 6);
return JNI_VERSION_1_6;
}Here is the build.sh
#!/bin/bash
NDK=$HOME/Desktop/adt/android-ndk-r9
SYSROOT=$NDK/platforms/android-9/arch-arm/
TOOLCHAIN=$NDK/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64
function build_one
{
./configure \
--prefix=$PREFIX \
--enable-shared \
--disable-static \
--disable-doc \
--disable-ffmpeg \
--disable-ffplay \
--disable-ffprobe \
--disable-ffserver \
--disable-avdevice \
--disable-doc \
--disable-symver \
--cross-prefix=$TOOLCHAIN/bin/arm-linux-androideabi- \
--target-os=linux \
--arch=arm \
--enable-cross-compile \
--sysroot=$SYSROOT \
--extra-cflags="-Os -fpic $ADDI_CFLAGS" \
--extra-ldflags="$ADDI_LDFLAGS" \
$ADDITIONAL_CONFIGURE_FLAG
make clean
make
make install
}
CPU=arm
PREFIX=$(pwd)/android/$CPU
ADDI_CFLAGS="-marm"
build_oneIt works on the Galaxy tab2. what can i do to make it work on all devices ?? Please help me..
-
Android ExoPlayer stream mp3 over HTTP
8 juillet 2016, par kevintcoughlinI’m trying to get a grasp on the new ExoPlayer library introduced this year at Google I/O 2014 so that I can incorporate it into my application.
I’m attempting to stream an mp3 over HTTP, but so far have been unsuccessful. I’m not sure if it’s possible, but I’m trying to accomplish this without extending any of the base Source/Sample classes. My code is as follows :
In my Activity
SampleSource s = new FrameworkSampleSource(this, Uri.parse("http://traffic.libsyn.com/joeroganexp/p518.mp3"), null, 1);
// Since I only have 1 audio renderer
ExoPlayer player = ExoPlayer.Factory.newInstance(1);
MediaCodecAudioTrackRenderer audioRenderer = new MediaCodecAudioTrackRenderer(s);
player.prepare(audioRenderer);
player.setPlayWhenReady(true);Logcat
3363-3376/com.kevintcoughlin.smodr V/FFmpegExtractor﹕ SniffFFMPEG
07-06 15:52:34.080 3363-3376/com.kevintcoughlin.smodr I/FFmpegExtractor﹕ android-source:0xb7c53e00
07-06 15:52:34.084 3363-3376/com.kevintcoughlin.smodr D/FFMPEG﹕ android source begin open
07-06 15:52:34.084 3363-3376/com.kevintcoughlin.smodr D/FFMPEG﹕ android open, url: android-source:0xb7c53e00
07-06 15:52:34.084 3363-3376/com.kevintcoughlin.smodr D/FFMPEG﹕ ffmpeg open android data source success, source ptr: 0xb7c53e00
07-06 15:52:34.088 3363-3376/com.kevintcoughlin.smodr D/FFMPEG﹕ android source open success
07-06 15:52:34.108 3363-3363/com.kevintcoughlin.smodr W/EGL_genymotion﹕ eglSurfaceAttrib not implemented
07-06 15:52:34.116 3363-3363/com.kevintcoughlin.smodr E/OpenGLRenderer﹕ Getting MAX_TEXTURE_SIZE from GradienCache
07-06 15:52:34.120 3363-3363/com.kevintcoughlin.smodr E/OpenGLRenderer﹕ MAX_TEXTURE_SIZE: 16384
07-06 15:52:34.128 3363-3363/com.kevintcoughlin.smodr E/OpenGLRenderer﹕ Getting MAX_TEXTURE_SIZE from Caches::initConstraints()
07-06 15:52:34.128 3363-3363/com.kevintcoughlin.smodr E/OpenGLRenderer﹕ MAX_TEXTURE_SIZE: 16384
07-06 15:52:34.128 3363-3363/com.kevintcoughlin.smodr D/OpenGLRenderer﹕ Enabling debug mode 0
07-06 15:52:34.640 3363-3376/com.kevintcoughlin.smodr I/FFMPEG﹕ [mp3 @ 0xb7c57040] Estimating duration from bitrate, this may be inaccurate
07-06 15:52:34.640 3363-3376/com.kevintcoughlin.smodr I/FFMPEG﹕ Input #0, mp3, from 'android-source:0xb7c53e00':
07-06 15:52:34.640 3363-3376/com.kevintcoughlin.smodr I/FFMPEG﹕ Metadata:
07-06 15:52:34.640 3363-3376/com.kevintcoughlin.smodr I/FFMPEG﹕ TSS : Logic Pro 9.1.8
07-06 15:52:34.644 3363-3376/com.kevintcoughlin.smodr I/FFMPEG﹕ title : #518 - Matt Fulchiron
07-06 15:52:34.644 3363-3376/com.kevintcoughlin.smodr I/FFMPEG﹕ artist : Joe Rogan Experience
07-06 15:52:34.644 3363-3376/com.kevintcoughlin.smodr I/FFMPEG﹕ album_artist : Joe Rogan Experience
07-06 15:52:34.644 3363-3376/com.kevintcoughlin.smodr I/FFMPEG﹕ Duration: 02:57:10.21, start: 0.000000, bitrate: 127 kb/s
07-06 15:52:34.644 3363-3376/com.kevintcoughlin.smodr I/FFMPEG﹕ Stream #0:0: Audio: mp3, 44100 Hz, stereo, s16p, 128 kb/s
07-06 15:52:34.644 3363-3376/com.kevintcoughlin.smodr I/FFmpegExtractor﹕ FFmpegExtrator, url: android-source:0xb7c53e00, format_name: mp3, format_long_name: MP2/3 (MPEG audio layer 2/3)
07-06 15:52:34.644 3363-3376/com.kevintcoughlin.smodr I/FFmpegExtractor﹕ list the formats suppoted by ffmpeg:
07-06 15:52:34.644 3363-3376/com.kevintcoughlin.smodr I/FFmpegExtractor﹕ ========================================
07-06 15:52:34.644 3363-3376/com.kevintcoughlin.smodr V/FFmpegExtractor﹕ format_names[00]: mpeg
07-06 15:52:34.644 3363-3376/com.kevintcoughlin.smodr V/FFmpegExtractor﹕ format_names[01]: mpegts
07-06 15:52:34.644 3363-3376/com.kevintcoughlin.smodr V/FFmpegExtractor﹕ format_names[02]: mov,mp4,m4a,3gp,3g2,mj2
07-06 15:52:34.644 3363-3376/com.kevintcoughlin.smodr V/FFmpegExtractor﹕ format_names[03]: matroska,webm
07-06 15:52:34.644 3363-3376/com.kevintcoughlin.smodr V/FFmpegExtractor﹕ format_names[04]: asf
07-06 15:52:34.644 3363-3376/com.kevintcoughlin.smodr V/FFmpegExtractor﹕ format_names[05]: rm
07-06 15:52:34.644 3363-3376/com.kevintcoughlin.smodr V/FFmpegExtractor﹕ format_names[06]: flv
07-06 15:52:34.644 3363-3376/com.kevintcoughlin.smodr V/FFmpegExtractor﹕ format_names[07]: swf
07-06 15:52:34.644 3363-3376/com.kevintcoughlin.smodr V/FFmpegExtractor﹕ format_names[08]: avi
07-06 15:52:34.644 3363-3376/com.kevintcoughlin.smodr V/FFmpegExtractor﹕ format_names[09]: ape
07-06 15:52:34.644 3363-3376/com.kevintcoughlin.smodr V/FFmpegExtractor﹕ format_names[10]: dts
07-06 15:52:34.644 3363-3376/com.kevintcoughlin.smodr V/FFmpegExtractor﹕ format_names[11]: flac
07-06 15:52:34.644 3363-3376/com.kevintcoughlin.smodr V/FFmpegExtractor﹕ format_names[12]: ac3
07-06 15:52:34.644 3363-3376/com.kevintcoughlin.smodr V/FFmpegExtractor﹕ format_names[13]: wav
07-06 15:52:34.644 3363-3376/com.kevintcoughlin.smodr V/FFmpegExtractor﹕ format_names[14]: ogg
07-06 15:52:34.644 3363-3376/com.kevintcoughlin.smodr V/FFmpegExtractor﹕ format_names[15]: vc1
07-06 15:52:34.644 3363-3376/com.kevintcoughlin.smodr V/FFmpegExtractor﹕ format_names[16]: hevc
07-06 15:52:34.644 3363-3376/com.kevintcoughlin.smodr I/FFmpegExtractor﹕ ========================================
07-06 15:52:34.644 3363-3376/com.kevintcoughlin.smodr D/FFMPEG﹕ android source close
07-06 15:52:34.644 3363-3376/com.kevintcoughlin.smodr W/FFmpegExtractor﹕ sniff through BetterSniffFFMPEG failed, try LegacySniffFFMPEG
07-06 15:52:34.644 3363-3376/com.kevintcoughlin.smodr I/FFmpegExtractor﹕ source url:http://traffic.libsyn.com/joeroganexp/p518.mp3
07-06 15:52:34.644 3363-3376/com.kevintcoughlin.smodr D/FFMPEG﹕ android source begin open
07-06 15:52:34.648 3363-3376/com.kevintcoughlin.smodr D/FFMPEG﹕ android open, url: android-source:0xb7c53e00|file:http://traffic.libsyn.com/joeroganexp/p518.mp3
07-06 15:52:34.648 3363-3376/com.kevintcoughlin.smodr D/FFMPEG﹕ ffmpeg open android data source success, source ptr: 0xb7c53e00
07-06 15:52:34.648 3363-3376/com.kevintcoughlin.smodr D/FFMPEG﹕ android source open success
07-06 15:52:34.708 3363-3394/com.kevintcoughlin.smodr D/dalvikvm﹕ GC_FOR_ALLOC freed 361K, 4% free 10852K/11288K, paused 75ms, total 75ms
07-06 15:52:34.844 3363-3376/com.kevintcoughlin.smodr I/FFMPEG﹕ [mp3 @ 0xb7ca7700] Estimating duration from bitrate, this may be inaccurate
07-06 15:52:34.844 3363-3376/com.kevintcoughlin.smodr I/FFMPEG﹕ Input #0, mp3, from 'android-source:0xb7c53e00|file:http://traffic.libsyn.com/joeroganexp/p518.mp3':
07-06 15:52:34.844 3363-3376/com.kevintcoughlin.smodr I/FFMPEG﹕ Metadata:
07-06 15:52:34.844 3363-3376/com.kevintcoughlin.smodr I/FFMPEG﹕ TSS : Logic Pro 9.1.8
07-06 15:52:34.848 3363-3376/com.kevintcoughlin.smodr I/FFMPEG﹕ title : #518 - Matt Fulchiron
07-06 15:52:34.848 3363-3376/com.kevintcoughlin.smodr I/FFMPEG﹕ artist : Joe Rogan Experience
07-06 15:52:34.848 3363-3376/com.kevintcoughlin.smodr I/FFMPEG﹕ album_artist : Joe Rogan Experience
07-06 15:52:34.848 3363-3376/com.kevintcoughlin.smodr I/FFMPEG﹕ Duration: 02:57:10.21, start: 0.000000, bitrate: 127 kb/s
07-06 15:52:34.848 3363-3376/com.kevintcoughlin.smodr I/FFMPEG﹕ Stream #0:0: Audio: mp3, 44100 Hz, stereo, s16p, 128 kb/s
07-06 15:52:34.848 3363-3376/com.kevintcoughlin.smodr I/FFmpegExtractor﹕ FFmpegExtrator, url: android-source:0xb7c53e00|file:http://traffic.libsyn.com/joeroganexp/p518.mp3, format_name: mp3, format_long_name: MP2/3 (MPEG audio layer 2/3)
07-06 15:52:34.852 3363-3376/com.kevintcoughlin.smodr I/FFmpegExtractor﹕ list the formats suppoted by ffmpeg:
07-06 15:52:34.852 3363-3376/com.kevintcoughlin.smodr I/FFmpegExtractor﹕ ========================================
07-06 15:52:34.852 3363-3376/com.kevintcoughlin.smodr V/FFmpegExtractor﹕ format_names[00]: mpeg
07-06 15:52:34.852 3363-3376/com.kevintcoughlin.smodr V/FFmpegExtractor﹕ format_names[01]: mpegts
07-06 15:52:34.852 3363-3376/com.kevintcoughlin.smodr V/FFmpegExtractor﹕ format_names[02]: mov,mp4,m4a,3gp,3g2,mj2
07-06 15:52:34.852 3363-3376/com.kevintcoughlin.smodr V/FFmpegExtractor﹕ format_names[03]: matroska,webm
07-06 15:52:34.852 3363-3376/com.kevintcoughlin.smodr V/FFmpegExtractor﹕ format_names[04]: asf
07-06 15:52:34.852 3363-3376/com.kevintcoughlin.smodr V/FFmpegExtractor﹕ format_names[05]: rm
07-06 15:52:34.852 3363-3376/com.kevintcoughlin.smodr V/FFmpegExtractor﹕ format_names[06]: flv
07-06 15:52:34.852 3363-3376/com.kevintcoughlin.smodr V/FFmpegExtractor﹕ format_names[07]: swf
07-06 15:52:34.852 3363-3376/com.kevintcoughlin.smodr V/FFmpegExtractor﹕ format_names[08]: avi
07-06 15:52:34.852 3363-3376/com.kevintcoughlin.smodr V/FFmpegExtractor﹕ format_names[09]: ape
07-06 15:52:34.852 3363-3376/com.kevintcoughlin.smodr V/FFmpegExtractor﹕ format_names[10]: dts
07-06 15:52:34.856 3363-3376/com.kevintcoughlin.smodr V/FFmpegExtractor﹕ format_names[11]: flac
07-06 15:52:34.856 3363-3376/com.kevintcoughlin.smodr V/FFmpegExtractor﹕ format_names[12]: ac3
07-06 15:52:34.856 3363-3376/com.kevintcoughlin.smodr V/FFmpegExtractor﹕ format_names[13]: wav
07-06 15:52:34.856 3363-3376/com.kevintcoughlin.smodr V/FFmpegExtractor﹕ format_names[14]: ogg
07-06 15:52:34.856 3363-3376/com.kevintcoughlin.smodr V/FFmpegExtractor﹕ format_names[15]: vc1
07-06 15:52:34.856 3363-3376/com.kevintcoughlin.smodr V/FFmpegExtractor﹕ format_names[16]: hevc
07-06 15:52:34.856 3363-3376/com.kevintcoughlin.smodr I/FFmpegExtractor﹕ ========================================
07-06 15:52:34.856 3363-3376/com.kevintcoughlin.smodr D/FFMPEG﹕ android source close
07-06 15:52:34.856 3363-3376/com.kevintcoughlin.smodr D/FFmpegExtractor﹕ SniffFFMPEG failed to sniff this source
07-06 15:52:34.856 3363-3397/com.kevintcoughlin.smodr D/dalvikvm﹕ GC_FOR_ALLOC freed 120K, 3% free 12342K/12696K, paused 29ms, total 60ms
07-06 15:52:34.860 3363-3397/com.kevintcoughlin.smodr I/dalvikvm-heap﹕ Grow heap (frag case) to 13.981MB for 1960012-byte allocation
07-06 15:52:34.872 3363-3387/com.kevintcoughlin.smodr D/dalvikvm﹕ GC_FOR_ALLOC freed <1K, 3% free 14256K/14612K, paused 10ms, total 10ms
07-06 15:52:34.880 3363-3376/com.kevintcoughlin.smodr I/OMXClient﹕ Using client-side OMX mux.
07-06 15:52:34.976 3363-3400/com.kevintcoughlin.smodr I/OMXClient﹕ Using client-side OMX mux.
07-06 15:52:35.144 3363-3393/com.kevintcoughlin.smodr D/dalvikvm﹕ GC_FOR_ALLOC freed 1512K, 12% free 13705K/15532K, paused 12ms, total 36ms
07-06 15:52:35.152 3363-3393/com.kevintcoughlin.smodr I/dalvikvm-heap﹕ Grow heap (frag case) to 15.315MB for 1962812-byte allocation
07-06 15:52:35.200 3363-3388/com.kevintcoughlin.smodr D/dalvikvm﹕ GC_FOR_ALLOC freed <1K, 11% free 15621K/17452K, paused 39ms, total 39ms
07-06 15:52:35.356 3363-3400/com.kevintcoughlin.smodr E/ACodec﹕ OMX/mediaserver died, signalling error!
07-06 15:52:35.356 3363-3400/com.kevintcoughlin.smodr E/MediaCodec﹕ Codec reported an error. (omx error 0x8000100d, internalError -32)
07-06 15:52:35.376 3363-3400/com.kevintcoughlin.smodr A/ACodec﹕ frameworks/av/media/libstagefright/ACodec.cpp:499 CHECK(mem.get() != NULL) failed.
07-06 15:52:35.376 3363-3400/com.kevintcoughlin.smodr A/libc﹕ Fatal signal 4 (SIGILL) at 0xb76d563d (code=2), thread 3400 (MediaCodec_loop)To my untrained eye it seems like I can get the TrackInfo correctly, but am having a problem reading the data over HTTP. It also seems that how the framework sniffs the mimetype is failing even though I do receive type ’audio/mpeg’.
Again, I appreciate any direction I receive. I realize that these APIs are very new.
Thanks !