Giter VIP home page Giter VIP logo

ffmpeg-commands-executor-library's Introduction

This is AS version
Eclipse version, please refer to Old Eclipse Version

ffmpeg-commands-executor-library

execute ffmpeg commands as a shared librar, you can try example.apk
[Note]: This library may not support all the codecs you want, for example, h264.

Usage

add dependency in your build.gradle

dependencies {
    compile 'cn.dxjia:ffmpegexecutor:0.1.7'
}

import package

import cn.dxjia.ffmpeg.library.FFmpegNativeHelper;

run command

FFmpegNativeHelper.runCommand("ffmpeg -version");

NOTE:

  • now, runCommand() will return some strings as result, not very friendly;
  • this library modified some ffmpeg source code, invasion is relatively strong.

Compile library or example by yourself

If you want to compile this library by yourself, you can do that as follow steps.

Step 1

Build jni manually

Linux or Ubuntu

cd library/jni
chmod a+x build.sh
. build.sh

Windows

Make sure you have add your NDK path to your PC Enviroment.
Open a CMD terminal

cd library\jni
build.cmd

Step 2

Android Studio -> Open Existing Project

Step 3

modify code & build project

NOTE: Every time you changed the jni source code, you need to build it manually before building the project from Android Studio.

Any issues and PRs are welcome.

License

   Copyright (c) 2015 dxjia

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.

ffmpeg-commands-executor-library's People

Contributors

dxjia avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ffmpeg-commands-executor-library's Issues

UnsatisfiedLinkError

Caused by: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.archery.archery.tv-2/base.apk"],nativeLibraryDirectories=[/data/app/com.archery.archery.tv-2/lib/arm, /cust/lib, /vendor/lib, /system/lib]]] couldn't find "libavutil-54.so"
这是什么原因,会是和Ijkplayer混用导致的库冲突吗

为什么运行命令找不到?h264??

ffmpeg -i K:/ffmpegtest/20160614104833_10.MP4 -vcodec h264 -s 320*240 -an -f mp4 K:/ffmpegtest/result_m4v.MP4

运行这段命令找不到h264??还有好多命令都用吧了,但是widows版本的没问题,是不是少编译了东西

Run a same transfer command two times will bring APP to crash

my step:

  1. recorder video profile :
    mProfile = CamcorderProfile.get(CamcorderProfile.QUALITY_480P);
    mProfile.fileFormat = MediaRecorder.OutputFormat.MPEG_4;
    mProfile.videoCodec = MediaRecorder.VideoEncoder.H264;
    mProfile.audioCodec = MediaRecorder.AudioEncoder.AAC;
    mProfile.videoFrameRate = 15;
    mProfile.videoBitRate = 1200000;
  2. create video file : /sdcard/demo.mp4
  3. run ffmpeg -y -i /sdcard/demo.mp4 -vf crop=iw/3:ih:0:0 -strict -2 /sdcard/demo2.mp4

It's perfect for the first time. and not kill app, do the second . the app is dead.

07-03 00:36:52.363 20375-20375/com.demo D/ffmpeg-jni﹕ ffmpeg
07-03 00:36:52.363 20375-20375/com.demo D/ffmpeg-jni﹕ -version
07-03 00:36:52.363 20375-20375/com.demo D/ffmpeg-jni﹕ reset_record done!
07-03 00:36:52.363 20375-20375/com.demo D/ffmpeg-jni﹕ Splitting the commandline.
07-03 00:36:52.363 20375-20375/com.demo D/ffmpeg-jni﹕ Reading option '-version' ...
07-03 00:36:52.363 20375-20375/com.demo D/ffmpeg-jni﹕ matched as option 'version' (show version) with argument ''.
07-03 00:36:52.363 20375-20375/com.demo D/ffmpeg-jni﹕ Finished splitting the commandline.
07-03 00:36:52.363 20375-20375/com.demo D/ffmpeg-jni﹕ Parsing a group of options: global .
07-03 00:36:52.363 20375-20375/com.demo D/ffmpeg-jni﹕ Applying option version (show version) with argument .
07-03 00:36:52.363 20375-20375/com.demo D/ffmpeg-jni﹕ reset_record done!
07-03 00:36:52.363 20375-20375/com.demo D/ffmpeg-jni﹕ Successfully parsed a group of options.
07-03 00:36:52.363 20375-20375/com.demo A/libc﹕ Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1), thread 20375 (com.demo)

FFmpegNativeHelper.runCommand Second use error(第二次调用失败)

FFmpegNativeHelper.runCommand("") The second call failed
07-07 18:32:39.218 29687-29716/cn.dxjia.ffmpegexecutor I/ffmpeg-jni: frame= 60 fps= 12 q=0.0 q=0.0 size= 5244kB time=00:00:00.00 bitrate=N/A
07-07 18:32:39.719 29687-29716/cn.dxjia.ffmpegexecutor I/ffmpeg-jni: frame= 60 fps= 11 q=0.0 q=0.0 size= 5244kB time=00:00:00.00 bitrate=N/A
Uploading QQ图片20170707182046.png…

ffmpeg报“Out of memory”错误

你好,我用ffmpeg处理视频压缩。
命令如下:"ffmpeg -y -i " + url + " -strict experimental -r 20 -vcodec mpeg4 -b 10000 -s 640*480 /storage/emulated/0/abc.mp4"
第一次运行压缩成功,但是第二次运行就会报错,错误如下:
“ffmpeg-jni: [audio format for output stream 0:1 @ 0x9bef4960] Query format failed for 'audio format for output stream 0:1': Out of memory”
必须重启应用才可以再次压缩,然而也只能执行一次,第二次就报错了。

请教

大神,step2 和step3能否写清楚点?我按照你另一个例子编译出来so库了,但是卡在step2和step3。就是如何将ffmpeg.c改为FFmpegNativeHelper.c那步,以及ndk-build的时候会提示h文件缺失,需要引入include外的ffmpeg源码中的h文件那个步骤。

第二次执行视频转码命令时报错

采用gradle依赖(compile 'cn.dxjia:ffmpegexecutor:0.1.7')
同一个视频转码命令("ffmpeg -i /sdcard/Media/VID_1149.mp4 -r 30 -f gif /sdcard/1149_20.gif")第一次正常执行,第二次报错,错误信息如下:
A/ffmpeg-jni: Option threads not found.
E/ffmpeg-jni: Error, assert_avoptions

编译出错

java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/cn.dxjia.ffmpegexecutor-1/base.apk"],nativeLibraryDirectories=[/vendor/lib64, /system/lib64]]] couldn't find "libavutil-54.so"

java.lang.UnsatisfiedLinkError

compile 'cn.dxjia:ffmpegexecutor:0.1.7' but i'm get error that
java.lang.UnsatisfiedLinkError:dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.jlx.resumeshow-1/base.apk"],nativeLibraryDirectories=[/data/app/com.jlx.resumeshow-1/lib/arm, /data/app/com.jlx.resumeshow-1/base.apk!/lib/armeabi-v7a, /vendor/lib, /system/lib]]] couldn't find "libffmpegjni.so" how do i get this ".so"?

x264

如何支持x264的类库

关于例子中命令行的使用问题

您好,
按照您readme的说明,完成了ffmpeg的编译工作,也成功运行了您的例子。但是例子中的命令行,在cmdutils.c中没找到你实现方法的命令行说明。
我要使用其他命令行,该如何操作,或者说阅读哪些文件,能知道命令行的使用方法。
谢谢您,对代码的开源,对我有很大的帮助。
希望您能给我解答。

failed on android4.2.2,4.3

Phone :
SAMSUNG GALAXY MEGA android 4.2.2
honor H30-C00 android 4.3
it is run succsed ,but the return string is FAIL,and it's very slow .

Here is the command:

"ffmpeg",
                    "-i",
                    base + "/input.mp4",
                    "-vframes",
                    "1",
                    "-f",
                    "image2",
                    base + "/extractFrame.jpg"

Here is the LOG:

08-11 19:09:55.874 17527-17527/com.kingty.ffmpegtest D/GestureDetector: [Surface Touch Event] mSweepDown False, mLRSDCnt : -1 mTouchCnt : 7 mFalseSizeCnt:0
08-11 19:09:55.894 17527-17527/com.kingty.ffmpegtest I/MediaMetadataRetrieverJNI: native_setup
08-11 19:09:55.904 17527-17527/com.kingty.ffmpegtest V/MediaMetadataRetrieverJNI: setDataSource
08-11 19:09:56.194 17527-17527/com.kingty.ffmpegtest E/duration:: 8000
08-11 19:09:56.194 17527-17527/com.kingty.ffmpegtest E/width:: 1080
08-11 19:09:56.194 17527-17527/com.kingty.ffmpegtest E/height:: 1920
08-11 19:09:56.194 17527-17527/com.kingty.ffmpegtest E/mineType:: video/mp4
08-11 19:09:56.194 17527-17527/com.kingty.ffmpegtest E/audioCodec:: null
08-11 19:09:56.194 17527-17527/com.kingty.ffmpegtest E/videoCodec:: h264
08-11 19:09:56.194 17527-17527/com.kingty.ffmpegtest E/rotation:: 0
08-11 19:09:56.194 17527-17527/com.kingty.ffmpegtest E/bitrate_by_ffm: null
08-11 19:09:56.194 17527-17527/com.kingty.ffmpegtest E/bitrate:: null
08-11 19:09:56.194 17527-17527/com.kingty.ffmpegtest I/MediaMetadataRetrieverJNI: release
08-11 19:09:56.194 17527-17527/com.kingty.ffmpegtest E/FILE_EXSIT: true
08-11 19:09:56.194 17527-17527/com.kingty.ffmpegtest E/ffmpeg-jni: kingty's log : run start!
08-11 19:09:56.194 17527-17527/com.kingty.ffmpegtest E/ffmpeg-jni: kingty's log  pid=22266
08-11 19:09:56.194 22266-22266/? E/ffmpeg-jni: kingty's log  pid=0
08-11 19:09:56.194 22266-22266/? E/ffmpeg-jni: kingty's log  do command work
08-11 19:09:56.194 17527-17527/com.kingty.ffmpegtest E/ffmpeg-jni: kingty's log  pid>0
08-11 19:09:56.194 22266-22266/? D/ffmpeg-jni: reset_record done!
08-11 19:09:56.194 22266-22266/? D/ffmpeg-jni: Opening an input file: /storage/emulated/0/input.mp4.
08-11 19:09:56.204 22266-22266/? D/ffmpeg-jni: [file @ 0x5ad12310] Setting default whitelist 'file,crypto'
08-11 19:09:56.204 22266-22266/? D/ffmpeg-jni: [mov,mp4,m4a,3gp,3g2,mj2 @ 0x5aeb4f70] Format mov,mp4,m4a,3gp,3g2,mj2 probed with size=2048 and score=100
08-11 19:09:56.204 22266-22266/? D/ffmpeg-jni: [mov,mp4,m4a,3gp,3g2,mj2 @ 0x5aeb4f70] ISO: File Type Major Brand: isom
08-11 19:09:56.204 22266-22266/? D/ffmpeg-jni: [mov,mp4,m4a,3gp,3g2,mj2 @ 0x5aeb4f70] Unknown dref type 0x08206c7275 size 12
08-11 19:09:56.204 22266-22266/? D/ffmpeg-jni: [mov,mp4,m4a,3gp,3g2,mj2 @ 0x5aeb4f70] Before avformat_find_stream_info() pos: 3104 bytes read:32768 seeks:0 nb_streams:1
08-11 19:09:56.204 22266-22266/? D/ffmpeg-jni: [h264 @ 0x5dd77bb0] nal_unit_type: 7, nal_ref_idc: 3
08-11 19:09:56.204 22266-22266/? D/ffmpeg-jni: [h264 @ 0x5dd77bb0] nal_unit_type: 8, nal_ref_idc: 3
08-11 19:09:56.204 22266-22266/? D/ffmpeg-jni: [h264 @ 0x5dd77bb0] nal_unit_type: 5, nal_ref_idc: 3
08-11 19:09:56.304 22266-22266/? D/ffmpeg-jni: [h264 @ 0x5dd77bb0] nal_unit_type: 1, nal_ref_idc: 2
08-11 19:09:56.344 22266-22266/? D/ffmpeg-jni: [h264 @ 0x5dd77bb0] nal_unit_type: 1, nal_ref_idc: 2
08-11 19:09:56.364 22266-22266/? D/ffmpeg-jni: [h264 @ 0x5dd77bb0] nal_unit_type: 1, nal_ref_idc: 2
08-11 19:09:56.384 22266-22266/? D/ffmpeg-jni: [h264 @ 0x5dd77bb0] nal_unit_type: 1, nal_ref_idc: 2
08-11 19:09:56.404 22266-22266/? D/ffmpeg-jni: [h264 @ 0x5dd77bb0] nal_unit_type: 1, nal_ref_idc: 2
08-11 19:09:56.414 22266-22266/? D/ffmpeg-jni: [h264 @ 0x5dd77bb0] nal_unit_type: 1, nal_ref_idc: 2
08-11 19:09:56.444 22266-22266/? D/ffmpeg-jni: [mov,mp4,m4a,3gp,3g2,mj2 @ 0x5aeb4f70] All info found
08-11 19:09:56.444 22266-22266/? D/ffmpeg-jni: [mov,mp4,m4a,3gp,3g2,mj2 @ 0x5aeb4f70] After avformat_find_stream_info() pos: 192354 bytes read:196608 seeks:0 frames:21
08-11 19:09:56.444 22266-22266/? I/ffmpeg-jni: Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/storage/emulated/0/input.mp4':
08-11 19:09:56.444 22266-22266/? I/ffmpeg-jni:   Metadata:
08-11 19:09:56.444 22266-22266/? I/ffmpeg-jni:     major_brand     : 
08-11 19:09:56.444 22266-22266/? I/ffmpeg-jni: isom
08-11 19:09:56.444 22266-22266/? I/ffmpeg-jni:     minor_version   : 
08-11 19:09:56.444 22266-22266/? I/ffmpeg-jni: 0
08-11 19:09:56.444 22266-22266/? I/ffmpeg-jni:     compatible_brands: 
08-11 19:09:56.444 22266-22266/? I/ffmpeg-jni: isom3gp4
08-11 19:09:56.444 22266-22266/? I/ffmpeg-jni:     creation_time   : 
08-11 19:09:56.444 22266-22266/? I/ffmpeg-jni: 2016-05-17 10:03:09
08-11 19:09:56.444 22266-22266/? I/ffmpeg-jni:   Duration: 
08-11 19:09:56.444 22266-22266/? I/ffmpeg-jni: 00:00:08.24
08-11 19:09:56.444 22266-22266/? I/ffmpeg-jni: , start: 
08-11 19:09:56.444 22266-22266/? I/ffmpeg-jni: 0.000000
08-11 19:09:56.444 22266-22266/? I/ffmpeg-jni: , bitrate: 
08-11 19:09:56.444 22266-22266/? I/ffmpeg-jni: 666 kb/s
08-11 19:09:56.444 22266-22266/? I/ffmpeg-jni:     Stream #0:0
08-11 19:09:56.444 22266-22266/? I/ffmpeg-jni: (eng)
08-11 19:09:56.444 22266-22266/? D/ffmpeg-jni: , 21, 1/90000
08-11 19:09:56.444 22266-22266/? I/ffmpeg-jni: : Video: h264, 1 reference frame (avc1 / 0x31637661), yuv420p(left), 1080x1920 (1088x1920), 0/1, 663 kb/s
08-11 19:09:56.444 22266-22266/? I/ffmpeg-jni: , SAR 1:1 DAR 9:16
08-11 19:09:56.444 22266-22266/? I/ffmpeg-jni: , 
08-11 19:09:56.444 22266-22266/? I/ffmpeg-jni: 21.01 fps, 
08-11 19:09:56.444 22266-22266/? I/ffmpeg-jni: 90k tbr, 
08-11 19:09:56.444 22266-22266/? I/ffmpeg-jni: 90k tbn, 
08-11 19:09:56.444 22266-22266/? I/ffmpeg-jni: 180k tbc
08-11 19:09:56.444 22266-22266/? I/ffmpeg-jni:  (default)
08-11 19:09:56.444 22266-22266/? I/ffmpeg-jni:     Metadata:
08-11 19:09:56.454 22266-22266/? I/ffmpeg-jni:       creation_time   : 
08-11 19:09:56.454 22266-22266/? I/ffmpeg-jni: 2016-05-17 10:03:09
08-11 19:09:56.454 22266-22266/? I/ffmpeg-jni:       handler_name    : 
08-11 19:09:56.454 22266-22266/? I/ffmpeg-jni: VideoHandle
08-11 19:09:56.454 22266-22266/? D/ffmpeg-jni: Successfully opened the file.
08-11 19:09:56.454 22266-22266/? D/ffmpeg-jni: Opening an output file: /storage/emulated/0/extractFrame.jpg.
08-11 19:09:56.454 22266-22266/? A/ffmpeg-jni: Not overwriting - exiting
08-11 19:09:56.454 22266-22266/? D/ffmpeg-jni: Successfully opened the file.
08-11 19:09:56.454 22266-22266/? D/ffmpeg-jni: detected 2 logical cores
08-11 19:09:56.454 22266-22266/? D/ffmpeg-jni: [graph 0 input from stream 0:0 @ 0x600afef0] Setting 'video_size' to value '1080x1920'
08-11 19:09:56.454 22266-22266/? D/ffmpeg-jni: [graph 0 input from stream 0:0 @ 0x600afef0] Setting 'pix_fmt' to value '0'
08-11 19:09:56.454 22266-22266/? D/ffmpeg-jni: [graph 0 input from stream 0:0 @ 0x600afef0] Setting 'time_base' to value '1/90000'
08-11 19:09:56.454 22266-22266/? D/ffmpeg-jni: [graph 0 input from stream 0:0 @ 0x600afef0] Setting 'pixel_aspect' to value '1/1'
08-11 19:09:56.464 22266-22266/? D/ffmpeg-jni: [graph 0 input from stream 0:0 @ 0x600afef0] Setting 'sws_param' to value 'flags=2'
08-11 19:09:56.464 22266-22266/? D/ffmpeg-jni: [graph 0 input from stream 0:0 @ 0x600afef0] Setting 'frame_rate' to value '3892500/185297'
08-11 19:09:56.464 22266-22266/? V/ffmpeg-jni: [graph 0 input from stream 0:0 @ 0x600afef0] w:1080 h:1920 pixfmt:yuv420p tb:1/90000 fr:3892500/185297 sar:1/1 sws_param:flags=2
08-11 19:09:56.464 22266-22266/? D/ffmpeg-jni: [format @ 0x60f10d30] compat: called with args=[yuvj420p|yuvj422p|yuvj444p]
08-11 19:09:56.464 22266-22266/? D/ffmpeg-jni: [format @ 0x60f10d30] Setting 'pix_fmts' to value 'yuvj420p|yuvj422p|yuvj444p'
08-11 19:09:56.464 22266-22266/? D/ffmpeg-jni: [auto-inserted scaler 0 @ 0x61399430] Setting 'flags' to value 'bicubic'
08-11 19:09:56.464 22266-22266/? V/ffmpeg-jni: [auto-inserted scaler 0 @ 0x61399430] w:iw h:ih flags:'bicubic' interl:0
08-11 19:09:56.464 22266-22266/? V/ffmpeg-jni: [format @ 0x60f10d30] auto-inserting filter 'auto-inserted scaler 0' between the filter 'Parsed_null_0' and the filter 'format'
08-11 19:09:56.464 22266-22266/? D/ffmpeg-jni: [AVFilterGraph @ 0x5ad04d20] query_formats: 4 queried, 2 merged, 1 already done, 0 delayed
08-11 19:09:56.464 22266-22266/? D/ffmpeg-jni: [auto-inserted scaler 0 @ 0x61399430] picking yuvj420p out of 3 ref:yuv420p alpha:0
08-11 19:09:56.464 22266-22266/? W/ffmpeg-jni: [swscaler @ 0x60072990] deprecated pixel format used, make sure you did set range correctly
08-11 19:09:56.464 22266-22266/? V/ffmpeg-jni: [auto-inserted scaler 0 @ 0x61399430] w:1080 h:1920 fmt:yuv420p sar:1/1 -> w:1080 h:1920 fmt:yuvj420p sar:1/1 flags:0x4
08-11 19:09:56.474 22266-22266/? D/ffmpeg-jni: [h264 @ 0x61398e20] nal_unit_type: 7, nal_ref_idc: 3
08-11 19:09:56.474 22266-22266/? D/ffmpeg-jni: [h264 @ 0x61398e20] nal_unit_type: 8, nal_ref_idc: 3
08-11 19:09:56.474 22266-22266/? D/ffmpeg-jni: [mjpeg @ 0x61398a30] Forcing thread count to 1 for MJPEG encoding, use -thread_type slice or a constant quantizer if you want to use multiple cpu cores
08-11 19:09:56.474 22266-22266/? D/ffmpeg-jni: [mjpeg @ 0x61398a30] intra_quant_bias = 96 inter_quant_bias = 0
08-11 19:09:56.474 22266-22266/? W/ffmpeg-jni: [image2 @ 0x60f106f0] Using AVStream.codec to pass codec parameters to muxers is deprecated, use AVStream.codecpar instead.
08-11 19:09:56.474 22266-22266/? I/ffmpeg-jni: Output #0, image2, to '/storage/emulated/0/extractFrame.jpg':
08-11 19:09:56.474 22266-22266/? I/ffmpeg-jni:   Metadata:
08-11 19:09:56.474 22266-22266/? I/ffmpeg-jni:     major_brand     : 
08-11 19:09:56.474 22266-22266/? I/ffmpeg-jni: isom
08-11 19:09:56.474 22266-22266/? I/ffmpeg-jni:     minor_version   : 
08-11 19:09:56.474 22266-22266/? I/ffmpeg-jni: 0
08-11 19:09:56.474 22266-22266/? I/ffmpeg-jni:     compatible_brands: 
08-11 19:09:56.474 22266-22266/? I/ffmpeg-jni: isom3gp4
08-11 19:09:56.474 22266-22266/? I/ffmpeg-jni:     encoder         : 
08-11 19:09:56.474 22266-22266/? I/ffmpeg-jni: Lavf57.41.100
08-11 19:09:56.474 22266-22266/? I/ffmpeg-jni:     Stream #0:0
08-11 19:09:56.474 22266-22266/? I/ffmpeg-jni: (eng)
08-11 19:09:56.474 22266-22266/? D/ffmpeg-jni: , 0, 185297/3892500
08-11 19:09:56.474 22266-22266/? I/ffmpeg-jni: : Video: mjpeg, 1 reference frame, yuvj420p(pc, left), 1080x1920 [SAR 1:1 DAR 9:16], 0/1, q=2-31, 200 kb/s
08-11 19:09:56.474 22266-22266/? I/ffmpeg-jni: , 
08-11 19:09:56.474 22266-22266/? I/ffmpeg-jni: 21.01 fps, 
08-11 19:09:56.474 22266-22266/? I/ffmpeg-jni: 21.01 tbn, 
08-11 19:09:56.474 22266-22266/? I/ffmpeg-jni: 21.01 tbc
08-11 19:09:56.484 22266-22266/? I/ffmpeg-jni:  (default)
08-11 19:09:56.484 22266-22266/? I/ffmpeg-jni:     Metadata:
08-11 19:09:56.484 22266-22266/? I/ffmpeg-jni:       creation_time   : 
08-11 19:09:56.484 22266-22266/? I/ffmpeg-jni: 2016-05-17 10:03:09
08-11 19:09:56.484 22266-22266/? I/ffmpeg-jni:       handler_name    : 
08-11 19:09:56.484 22266-22266/? I/ffmpeg-jni: VideoHandle
08-11 19:09:56.484 22266-22266/? I/ffmpeg-jni:       encoder         : 
08-11 19:09:56.484 22266-22266/? I/ffmpeg-jni: Lavc57.48.101 mjpeg
08-11 19:09:56.484 22266-22266/? I/ffmpeg-jni:     Side data:
08-11 19:09:56.484 22266-22266/? I/ffmpeg-jni:       
08-11 19:09:56.484 22266-22266/? I/ffmpeg-jni: cpb: 
08-11 19:09:56.484 22266-22266/? I/ffmpeg-jni: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: -1
08-11 19:09:56.484 22266-22266/? I/ffmpeg-jni: Stream mapping:
08-11 19:09:56.484 22266-22266/? I/ffmpeg-jni:   Stream #0:0 -> #0:0
08-11 19:09:56.484 22266-22266/? I/ffmpeg-jni:  (h264 (native) -> mjpeg (native))
08-11 19:09:56.484 22266-22266/? I/ffmpeg-jni: Press [q] to stop, [?] for help
08-11 19:09:56.484 22266-22266/? D/ffmpeg-jni: cur_dts is invalid (this is harmless if it occurs once at the start per stream)
08-11 19:09:56.484 22266-22274/? D/ffmpeg-jni: [h264 @ 0x61398e20] nal_unit_type: 5, nal_ref_idc: 3
08-11 19:09:56.494 22266-22266/? D/ffmpeg-jni: cur_dts is invalid (this is harmless if it occurs once at the start per stream)
08-11 19:09:56.494 22266-22266/? D/ffmpeg-jni: cur_dts is invalid (this is harmless if it occurs once at the start per stream)
08-11 19:09:56.494 22266-22275/? D/ffmpeg-jni: [h264 @ 0x60f1ff80] nal_unit_type: 1, nal_ref_idc: 2
08-11 19:09:56.515 22266-22276/? D/ffmpeg-jni: [h264 @ 0x60f0f3d0] nal_unit_type: 1, nal_ref_idc: 2
08-11 19:09:56.665 22266-22266/? D/ffmpeg-jni: Clipping frame in rate conversion by 0.000008
08-11 19:09:56.755 22266-22266/? D/ffmpeg-jni: [file @ 0x617addc0] Setting default whitelist 'file,crypto'
08-11 19:09:56.765 22266-22266/? D/ffmpeg-jni: [AVIOContext @ 0x617ade80] Statistics: 0 seeks, 4 writeouts
08-11 19:09:56.765 22266-22266/? V/ffmpeg-jni: No more output streams to write to, finishing.
08-11 19:09:56.825 22266-22266/? I/ffmpeg-jni: frame=    1 fps=0.0 q=8.9 Lsize=N/A time=00:00:00.04 bitrate=N/A speed=0.138x    
08-11 19:09:56.825 22266-22266/? I/ffmpeg-jni: video:106kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 
08-11 19:09:56.825 22266-22266/? I/ffmpeg-jni: unknown
08-11 19:09:56.825 22266-22266/? V/ffmpeg-jni: Input file #0 (/storage/emulated/0/input.mp4):
08-11 19:09:56.825 22266-22266/? V/ffmpeg-jni:   Input stream #0:0 (video): 
08-11 19:09:56.825 22266-22266/? V/ffmpeg-jni: 3 packets read (48772 bytes); 
08-11 19:09:56.825 22266-22266/? V/ffmpeg-jni: 2 frames decoded
08-11 19:09:56.825 22266-22266/? V/ffmpeg-jni: ; 
08-11 19:09:56.825 22266-22266/? V/ffmpeg-jni:   Total: 3 packets (48772 bytes) demuxed
08-11 19:09:56.825 22266-22266/? V/ffmpeg-jni: Output file #0 (/storage/emulated/0/extractFrame.jpg):
08-11 19:09:56.825 22266-22266/? V/ffmpeg-jni:   Output stream #0:0 (video): 
08-11 19:09:56.835 22266-22266/? V/ffmpeg-jni: 1 frames encoded
08-11 19:09:56.835 22266-22266/? V/ffmpeg-jni: ; 
08-11 19:09:56.835 22266-22266/? V/ffmpeg-jni: 1 packets muxed (108336 bytes); 
08-11 19:09:56.835 22266-22266/? V/ffmpeg-jni:   Total: 1 packets (108336 bytes) muxed
08-11 19:09:56.845 22266-22266/? A/libc: Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1), thread 22266 (ngty.ffmpegtest)
08-11 19:09:56.945 302-302/? I/DEBUG: pid: 22266, tid: 22266, name: ngty.ffmpegtest  >>> com.kingty.ffmpegtest <<<
08-11 19:09:57.285 302-302/? I/DEBUG:     #02  pc 00203f47  /data/app-lib/com.kingty.ffmpegtest-2/libffmpeg.so (av_vbprintf+40)
08-11 19:09:57.285 302-302/? I/DEBUG:          be86459c  60e8b25a  /data/app-lib/com.kingty.ffmpegtest-2/libvideokit.so
08-11 19:09:57.285 302-302/? I/DEBUG:          be8645c0  60e95244  /data/app-lib/com.kingty.ffmpegtest-2/libvideokit.so
08-11 19:09:57.305 302-302/? I/DEBUG:          be864ce4  60e89f15  /data/app-lib/com.kingty.ffmpegtest-2/libvideokit.so
08-11 19:09:57.315 302-302/? I/DEBUG:          be864d3c  60b30487  /data/app-lib/com.kingty.ffmpegtest-2/libffmpeg.so
08-11 19:09:57.315 302-302/? I/DEBUG:          be864d40  60e89f08  /data/app-lib/com.kingty.ffmpegtest-2/libvideokit.so
08-11 19:09:57.516 827-916/? D/CrashAnrDetector: Build: samsung/melius3gzm/melius3g:4.2.2/JDQ39/I9208ZMUCNF1:user/release-keys
                                                 Hardware: MSM8960
                                                 Revision: 11
                                                 Bootloader: I9208ZMUCNF1
                                                 Radio: unknown
                                                 Kernel: Linux version 3.4.0-2686884 (se.infra@R0301-05) (gcc version 4.6.x-google 20120106 (prerelease) (GCC) ) #1 SMP PREEMPT Tue Jun 3 13:58:28 KST 2014

                                                 *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
                                                 Build fingerprint: 'samsung/melius3gzm/melius3g:4.2.2/JDQ39/I9208ZMUCNF1:user/release-keys'
                                                 Revision: '11'
                                                 pid: 22266, tid: 22266, name: ngty.ffmpegtest  >>> com.kingty.ffmpegtest <<<
                                                 signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 00000000
                                                     r0 00000008  r1 be865998  r2 be864684  r3 00000001
                                                     r4 be865dcc  r5 00000001  r6 00000000  r7 40316afc
                                                     r8 00000000  r9 be864cc4  sl be865588  fp be865188
                                                     ip ffffffff  sp be8645d0  lr 402f5637  pc 402f3aaa  cpsr 00000030
                                                     d0  3a6c61746f542020  d1  656b636170203120
                                                     d2  3338303128207374  d3  7365747962203633
                                                     d4  3ce23b5c28f5c28f  d5  0000000000000000
                                                     d6  0000000000000000  d7  0000000200000000
                                                     d8  00000000d1c92a6a  d9  0000000000000000
                                                     d10 0000000000000000  d11 0000000000000000
                                                     d12 0000000000000000  d13 0000000000000000
                                                     d14 0000000000000000  d15 0000000000000000
                                                     d16 0000000000000000  d17 0000000000000000
                                                     d18 0000000000000000  d19 0000000000000000
                                                     d20 0000000000000000  d21 0000000000000000
                                                     d22 0000000000000000  d23 0000000000000000
                                                     d24 0000000003e4b000  d25 0000000003e4b000
                                                     d26 ffffffffffffffff  d27 dee0d8da8e717977
                                                     d28 007e00bc00ec00de  d29 0078007700770077
                                                     d30 0000100000001000  d31 0000100000001000
                                                     scr 88000016

                                                 backtrace:
                                                     #00  pc 0001faaa  /system/lib/libc.so (__vfprintf+265)
                                                     #01  pc 00021633  /system/lib/libc.so (vsnprintf+70)
                                                     #02  pc 00203f47  /data/app-lib/com.kingty.ffmpegtest-2/libffmpeg.so (av_vbprintf+40)

                                                 stack:
                                                          be864590  00000000  
                                                          be864594  be864638  [stack]
                                                          be864598  00000001  
                                                          be86459c  60e8b25a  /data/app-lib/com.kingty.ffmpegtest-2/libvideokit.so
                                                          be8645a0  0000002f  
                                                          be8645a4  be86467c  [stack]
                                                          be8645a8  be864cb4  [stack]
                                                          be8645ac  ffffffff  
                                                          be8645b0  be865178  [stack]
                                                          be8645b4  402f3997  /system/lib/libc.so
                                                          be8645b8  be865dcc  [stack]
                                                          be8645bc  402f4bbd  /system/lib/libc.so (__vfprintf+4636)
                                                          be8645c0  60e95244  /data/app-lib/com.kingty.ffmpegtest-2/libvideokit.so
                                                          be8645c4  be864680  [stack]
                                                          be8645c8  df0027ad  
                                                          be8645cc  00000000  
                                                     #00  be8645d0  be864d04  [stack]
                                                          be8645d4  be864680  [stack]
                                                          be8645d8  0000002f  
                                                          be8645dc  be864680  [stack]
                                                          be8645e0  00000005  
                                                          be8645e4  00000000  
                                                          be8645e8  be865988  [stack]
                                                          be8645ec  be8646c4  [stack]
                                                          be8645f0  be864d04  [stack]
                                                          be8645f4  00000000  
                                                          be8645f8  ffffffd1  
                                                          be8645fc  00000000  
                                                          be864600  00000000  
                                                          be864604  402f4b99  /system/lib/libc.so (__vfprintf+4600)
                                                          be864608  00000000  
                                                          be86460c  00000000  
                                                          ........  ........
                                                     #01  be864cb0  00000000  
                                                          be864cb4  00000000  
                                                          be864cb8  00000000  
                                                          be864cbc  00000000  
                                                          be864cc0  00004000  
                                                          be864cc4  be865998  [stack]
                                                          be864cc8  00000000  
                                                          be864ccc  000003ef  
                                                          be864cd0  ffff0208  [vectors]
                                                          be864cd4  be865998  [stack]
                                                          be864cd8  000003ef  
                                                          be864cdc  be864d80  [stack]
                                                          be864ce0  00000002  
                                                          be864ce4  60e89f15  /data/app-lib/com.kingty.ffmpegtest-2/libvideokit.so
                                                          be864ce8  00000002  
                                                          be864cec  be864dc4  [stack]
                                                          ........  ........
                                                     #02  be864d20  be865988  [stack]
                                                          be864d24  be865dcc  [stack]
                                                          be864d28  be864d88  [stack]
                                                          be864d2c  00000020  
                                                          be864d30  00000000  
                                                          be864d34  00000000  
                                                          be864d38  00000000  
                                                          be864d3c  60b30487  /data/app-lib/com.kingty.ffmpegtest-2/libffmpeg.so
                                                          be864d40  60e89f08  /data
08-11 19:09:57.516 827-916/? D/CrashAnrDetector: processName:com.kingty.ffmpegtest
08-11 19:09:57.516 827-916/? D/CrashAnrDetector: broadcastEvent : com.kingty.ffmpegtest SYSTEM_TOMBSTONE
08-11 19:10:03.742 17527-17527/com.kingty.ffmpegtest E/ffmpeg-jni: kingty's log  go done
08-11 19:10:03.742 17527-17527/com.kingty.ffmpegtest E/TAG: 7543:command time
08-11 19:10:03.742 17527-17527/com.kingty.ffmpegtest E/TAG: FAIL

如何使用单一的libffmpeg.so文件进行链接呢?

我之前按照项目需求单独生成了libffmpeg.so,把你Android.mk里那一堆prebuild so的地方改成了
include $(CLEAR_VARS) LOCAL_MODULE := ffmpeg LOCAL_SRC_FILES := prebuilt/armeabi/libffmpeg.so include $(PREBUILT_SHARED_LIBRARY)
其他不变,缺失的头文件也从源码里面拷到include里面了。
最后ndk-build的时候出现了一堆undefined引用
image
请问这个能如何解决呢?还是说我编译ffmpeg configure的时候必须选enable-shared?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.