Development in Android local video player

Source: Internet
Author: User

In the local video section of the Android local video player development, we were able to search for local video and display pictures, titles, and lengths of each video, and of course, if you needed to add other lengths and widths of video, for example, you could use the video class method, and now that we get the videos, So next is decoding the video, decoding the video I'm using FFmpeg, so this is the FFmpeg library you can use to compile your phone with NDK.

ndk=/opt/android-ndk-r8d

platform= $NDK/platforms/android-8/arch-arm/

prebuilt= $NDK/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86

Local_arm_neon=true

Cpu=armv7-a

Optimize_cflags= "-mfloat-abi=softfp-mfpu=neon-marm-mcpu=cortex-a8"

Prefix=./android/$CPU

./configure--target-os=linux

--prefix= $PREFIX

--enable-cross-compile

--arch=arm

--enable-nonfree

--enable-asm

--cpu=cortex-a8

--enable-neon

--cc= $PREBUILT/BIN/ARM-LINUX-ANDROIDEABI-GCC

--cross-prefix= $PREBUILT/bin/arm-linux-androideabi-

--nm= $PREBUILT/bin/arm-linux-androideabi-nm

--sysroot= $PLATFORM

--extra-cflags= "-o3-fpic-dandroid-dhave_sys_uio_h=1 $OPTIMIZE _cflags"

--disable-shared

--enable-static

--extra-ldflags= "-wl,-rpath-link= $PLATFORM/usr/lib-l$platform/usr/lib-nostdlib-lc-lm-ldl-llog"

--disable-ffmpeg

--disable-ffplay

--disable-ffprobe

--disable-ffserver

--disable-swscale

--disable-swresample

--enable-avformat

--enable-avcodec

--disable-optimizations

--disable-debug

--disable-doc

--disable-stripping

--enable-pthreads

--disable-yasm

--enable-zlib

--enable-pic

--enable-small

Make clean

Make-j4 Install

$PREBUILT/bin/arm-linux-androideabi-ar D libavcodec/libavcodec.a INVERSE.O

$PREBUILT/bin/arm-linux-androideabi-ld-rpath-link= $PLATFORM/usr/lib-l$platform/usr/lib-soname libffmpeg-neon.so -shared-nostdlib-z noexecstack-bsymbolic--whole-archive--no-undefined-o $PREFIX/libffmpeg-neon.so libavcodec/ LIBAVCODEC.A libavformat/libavformat.a libavutil/libavutil.a-lc-lm-lz-ldl-llog--warn-once--dynamic-linker=/ System/bin/linker $PREBUILT/LIB/GCC/ARM-LINUX-ANDROIDEABI/4.4.3/LIBGCC.A

ndk=/opt/android-ndk-r8d

platform= $NDK/platforms/android-8/arch-arm/

prebuilt= $NDK/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86

Local_arm_neon=true

Cpu=armv7-a

Optimize_cflags= "-mfloat-abi=softfp-mfpu=neon-marm-mcpu=cortex-a8"

Prefix=./android/$CPU

./configure--target-os=linux

--prefix= $PREFIX

--enable-cross-compile

--arch=arm

--enable-nonfree

--enable-asm

--cpu=cortex-a8

--enable-neon

--cc= $PREBUILT/BIN/ARM-LINUX-ANDROIDEABI-GCC

--cross-prefix= $PREBUILT/bin/arm-linux-androideabi-

--nm= $PREBUILT/bin/arm-linux-androideabi-nm

--sysroot= $PLATFORM

--extra-cflags= "-o3-fpic-dandroid-dhave_sys_uio_h=1 $OPTIMIZE _cflags"

--disable-shared

--enable-static

--extra-ldflags= "-wl,-rpath-link= $PLATFORM/usr/lib-l$platform/usr/lib-nostdlib-lc-lm-ldl-llog"

--disable-ffmpeg

--disable-ffplay

--disable-ffprobe

--disable-ffserver

--disable-swscale

--disable-swresample

--enable-avformat

--enable-avcodec

--disable-optimizations

--disable-debug

--disable-doc

--disable-stripping

--enable-pthreads

--disable-yasm

--enable-zlib

--enable-pic

--enable-small

Make clean

Make-j4 Install

$PREBUILT/bin/arm-linux-androideabi-ar D libavcodec/libavcodec.a INVERSE.O

$PREBUILT/bin/arm-linux-androideabi-ld-rpath-link= $PLATFORM/usr/lib-l$platform/usr/lib-soname libffmpeg-neon.so -shared-nostdlib-z noexecstack-bsymbolic--whole-archive--no-undefined-o $PREFIX/libffmpeg-neon.so libavcodec/ LIBAVCODEC.A libavformat/libavformat.a libavutil/libavutil.a-lc-lm-lz-ldl-llog--warn-once--dynamic-linker=/ System/bin/linker $PREBUILT/LIB/GCC/ARM-LINUX-ANDROIDEABI/4.4.3/LIBGCC.A Note that the NDK above should be replaced by your local path. This script I was enabled neon, so can only run on neon mobile phones, if you want to run to a non-neon mobile phone, you need to remove the neon features.

Then execute this script, and it will generate libffmpeg-neon.so

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.