android - 处理输入时发现无效数据

标签 android input ffmpeg

我想在我的库中使用 ffmpeg lib。为此,我已成功编译它。输入视频运行正常,但是当我尝试执行任何命令时,我收到此消息:

Invalid data found when processing input.

我不知道它背后的原因是什么。这是代码:
 public class Videokit extends Activity {
        String FilePath;
        String OutPut;
        Context mycontext;
        Videokit vk ;
        static 
        {
            System.loadLibrary("videokit");
        }

        public native void run(String[] args);

        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.main);
            FilePath =Environment.getExternalStorageDirectory().toString()+"/output.3gp";
            try {
                ffmpegrun();
            } catch (IOException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
        }

        public String ffmpegrun() throws IOException
        {
            boolean success=false;
            File folder = new File(Environment.getExternalStorageDirectory().toString() + "/image-%3d.jpeg");
            File file = new File(FilePath);
            System.out.println("filepath exists at:"+file.getAbsolutePath());
            if (!folder.exists()) {
                success = folder.mkdirs();
    //              Toast.makeText(mycontext,"outfile.mp4 exists at"+folder.getAbsolutePath(),Toast.LENGTH_LONG).show();
                 OutPut = folder.getAbsolutePath();
            }
            System.out.println("outfile.flv exists at:"+folder.getAbsolutePath());
            run(new String[]{
                    "ffmpeg",
                    "-i",
                    FilePath,
                    "-r 1", 
                     "-f",
                     "image2",
                     "image-%3d.jpeg"
            }); 
            return OutPut;
        }
    }

这是日志:
10-07 17:00:03.707: D/dalvikvm(8760): Trying to load lib /data/data/uk.co.halfninja.videokit/lib/libvideokit.so 0x44e8c958
10-07 17:00:03.837: D/dalvikvm(8760): Added shared lib /data/data/uk.co.halfninja.videokit/lib/libvideokit.so 0x44e8c958
10-07 17:00:03.837: I/Videokit(8760): Loading native library compiled at 13:52:27 Oct  7 2012
10-07 17:00:03.917: I/System.out(8760): filepath exists at:/sdcard/output.3gp
10-07 17:00:03.917: I/System.out(8760): outfile.flv exists at:/sdcard/image-%3d.jpeg
10-07 17:00:03.917: D/dalvikvm(8760): +++ not scanning '/system/lib/libwebcore.so' for 'run' (wrong CL)
10-07 17:00:03.917: D/dalvikvm(8760): +++ not scanning '/system/lib/libmedia_jni.so' for 'run' (wrong CL)
10-07 17:00:03.928: D/dalvikvm(8760): +++ not scanning '/system/lib/libexif.so' for 'run' (wrong CL)
10-07 17:00:03.928: D/Videokit(8760): run() called
10-07 17:00:03.928: D/Videokit(8760): run passing off to main()
10-07 17:00:03.928: D/Videokit(8760): main(): registering all modules
10-07 17:00:03.938: D/Videokit(8760): main(): registered everything
10-07 17:00:03.938: D/Videokit(8760): main(): initting opts
10-07 17:00:03.968: D/Videokit(8760): main(): initted opts.
10-07 17:00:03.968: E/Videokit(8760): ffmpeg version N-30996-gf925b24, Copyright (c) 2000-2011 the FFmpeg developers
10-07 17:00:03.979: E/Videokit(8760):   built on Oct  7 2012 13:52:32 with gcc 4.4.3
10-07 17:00:03.979: E/Videokit(8760):   configuration: --enable-cross-compile --arch=arm5te --enable-armv5te --target-os=linux --disable-stripping --prefix=../output --disable-neon --enable-version3 --disable-shared --enable-static --enable-gpl --enable-memalign-hack --cc=arm-linux-androideabi-gcc --ld=arm-linux-androideabi-ld --extra-cflags='-fPIC -DANDROID -D__thumb__ -mthumb -Wfatal-errors -Wno-deprecated' --disable-everything --enable-decoder=mjpeg --enable-demuxer=mjpeg --enable-parser=mjpeg --enable-demuxer=image2 --enable-muxer=mp4 --enable-encoder=libx264 --enable-libx264 --enable-decoder=rawvideo --enable-protocol=file --enable-hwaccels --disable-ffmpeg --disable-ffplay --disable-ffprobe --disable-ffserver --disable-network --enable-filter=buffer --enable-filter=buffersink --disable-demuxer=v4l --disable-demuxer=v4l2 --disable-indev=v4l --disable-indev=v4l2 --extra-cflags='-I../x264 -Ivideokit' --extra-ldflags=-L../x264
10-07 17:00:03.987: D/Videokit(8760): main(): parsing options
10-07 17:00:03.987: D/Videokit(8760): parse_options has 7 options to parse
10-07 17:00:04.050: E/Videokit(8760): /sdcard/output.3gp: Invalid data found when processing input
10-07 17:00:04.050: E/Videokit(8760): ffmpeg_exit(1) called!

请帮助我。我对这个问题一无所知。在此先感谢。

最佳答案

您是否编译了 FFmpeg 以便能够处理 flv 或 3gp... 文件?
我看到 mp4 在编译中,但 flv 和 3gp 不在...

关于android - 处理输入时发现无效数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12795079/

相关文章:

Java读取多行后打印多行

video - 使用 FFmpeg 搜索会为旧帧提供新的数据包时间戳

ffmpeg - 从网页下载 m3u8 视频

java - 有没有办法在 Java 文档中指定应从非 UI 线程调用方法

android - 列出应用程序的 Activity 和 Intent 过滤器?

input - 如何为 monogame metro 应用程序创建输入文本框

objective-c - 标准化音频文件中的音量

java - Apache 的 Base64.encodeBase64 和 Android 的 Base64.encode 与 Base64.Default 标志之间有什么区别吗?

android - 安卓下"openssl/aes.h: No such file or directory"

C++ 从文本文件中读取多个整数