Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/205.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在预览视频时对视频应用过滤器,并将其与应用的过滤器和原始音频一起保存在android中_Android_Ffmpeg_Android Ndk_Video Processing - Fatal编程技术网

在预览视频时对视频应用过滤器,并将其与应用的过滤器和原始音频一起保存在android中

在预览视频时对视频应用过滤器,并将其与应用的过滤器和原始音频一起保存在android中,android,ffmpeg,android-ndk,video-processing,Android,Ffmpeg,Android Ndk,Video Processing,我是视频处理新手。我想在运行时对视频应用过滤器,并在应用过滤器后保存该视频 关于这一点,我正在做一项研究。我浏览了很多图书馆,但我正在努力实现我的目标 开发环境 我试过了 AndroidFastImageprocessingLibrary 克里斯巴特-> 此库使用GLSurfaceview显示筛选器,但我们无法将其保存到mp4文件 所以我在github中找到了它的另一个实现->AndroidFastImageProcessing 该库使用JavaCV编译ffmpeg。但它失败了 JavaCV J

我是视频处理新手。我想在运行时对视频应用过滤器,并在应用过滤器后保存该视频

关于这一点,我正在做一项研究。我浏览了很多图书馆,但我正在努力实现我的目标

开发环境 我试过了
  • AndroidFastImageprocessingLibrary

    克里斯巴特->

    此库使用GLSurfaceview显示筛选器,但我们无法将其保存到mp4文件

    所以我在github中找到了它的另一个实现->AndroidFastImageProcessing

    该库使用JavaCV编译ffmpeg。但它失败了

  • JavaCV

    JavaCV使用过时的ffmpeg,因此被放弃

  • Grafika->

    我在格拉菲卡用RecordFBOActivity尝试了Android快速图像处理。但我失败了。此库使用MediaRecorder记录GLSURFACHEVIEW的内容。但它录制的视频没有音频(我测试了RecordFBOActivity并分析了代码)

  • 平台框架中的过滤器包

    它的安卓4.2内核经过编辑。我无法运行此代码,因为jni依赖项太多

  • ffmpeg

    我尝试了由guardianproject实现的ffmpeg3.1编译过程。它成功地建立了一个静态库,但我不能建立动态库(所以文件)。我被链接器错误卡住了。我认为链接顺序很重要。我尝试了下面链接中指定的链接顺序 但这没用。出现以下错误

    [armeabi-v7a] SharedLibrary  : libffmpeg.so
    jni/ffmpeg.c:200: error: undefined reference to 'av_frame_alloc'
    jni/ffmpeg.c:201: error: undefined reference to 'av_frame_alloc'
    jni/ffmpeg.c:209: error: undefined reference to 'av_register_all'
    jni/ffmpeg.c:210: error: undefined reference to 'avfilter_register_all'
    jni/ffmpeg.c:45: error: undefined reference to 'avformat_open_input'
    jni/ffmpeg.c:50: error: undefined reference to 'avformat_find_stream_info'
    jni/ffmpeg.c:56: error: undefined reference to 'av_find_best_stream'
    jni/ffmpeg.c:63: error: undefined reference to 'av_opt_set_int'
    jni/ffmpeg.c:66: error: undefined reference to 'avcodec_open2'
    jni/ffmpeg.c:67: error: undefined reference to 'av_log'
    jni/ffmpeg.c:78: error: undefined reference to 'avfilter_get_by_name'
    jni/ffmpeg.c:79: error: undefined reference to 'avfilter_get_by_name'
    jni/ffmpeg.c:80: error: undefined reference to 'avfilter_inout_alloc'
    jni/ffmpeg.c:81: error: undefined reference to 'avfilter_inout_alloc'
    jni/ffmpeg.c:85: error: undefined reference to 'avfilter_graph_alloc'
    jni/ffmpeg.c:98: error: undefined reference to 'avfilter_graph_create_filter'
    jni/ffmpeg.c:106: error: undefined reference to 'avfilter_graph_create_filter'
    jni/ffmpeg.c:113: error: undefined reference to 'av_int_list_length_for_size'
    jni/ffmpeg.c:113: error: undefined reference to 'av_opt_set_bin'
    jni/ffmpeg.c:116: error: undefined reference to 'av_log'
    jni/ffmpeg.c:131: error: undefined reference to 'av_strdup'
    jni/ffmpeg.c:142: error: undefined reference to 'av_strdup'
    jni/ffmpeg.c:147: error: undefined reference to 'avfilter_graph_parse_ptr'
    jni/ffmpeg.c:151: error: undefined reference to 'avfilter_graph_config'
    jni/ffmpeg.c:155: error: undefined reference to 'avfilter_inout_free'
    jni/ffmpeg.c:156: error: undefined reference to 'avfilter_inout_free'
    jni/ffmpeg.c:218: error: undefined reference to 'av_read_frame'
    jni/ffmpeg.c:223: error: undefined reference to 'avcodec_decode_video2'
    jni/ffmpeg.c:230: error: undefined reference to 'av_frame_get_best_effort_timestamp'
    jni/ffmpeg.c:233: error: undefined reference to 'av_buffersrc_add_frame_flags'
    jni/ffmpeg.c:234: error: undefined reference to 'av_log'
    jni/ffmpeg.c:240: error: undefined reference to 'av_buffersink_get_frame'
    jni/ffmpeg.c:171: error: undefined reference to 'av_rescale_q'
    jni/ffmpeg.c:246: error: undefined reference to 'av_frame_unref'
    jni/ffmpeg.c:248: error: undefined reference to 'av_frame_unref'
    jni/ffmpeg.c:251: error: undefined reference to 'av_packet_unref'
    jni/ffmpeg.c:254: error: undefined reference to 'avfilter_graph_free'
    jni/ffmpeg.c:255: error: undefined reference to 'avcodec_close'
    jni/ffmpeg.c:256: error: undefined reference to 'avformat_close_input'
    jni/ffmpeg.c:257: error: undefined reference to 'av_frame_free'
    jni/ffmpeg.c:258: error: undefined reference to 'av_frame_free'
    jni/include/libavutil/error.h:111: error: undefined reference to 'av_strerror'
    collect2.exe: error: ld returned 1 exit status
    make: *** [obj/local/armeabi/libffmpeg.so] Error 1
  • MediaCodec、MediaExtractor、MediaRecord、MediaMuxer

    最后,我计划将AndroidFastImageProcessing与MediaCodec、MediaExtractor、MediaRecord和MediaMuxer相结合

    所以我尝试使用mediamuxer从视频中提取音频 . 我使用mp4视频(MIME类型的视频/avc,有2个音轨音频和视频)来提取音频,但结果文件已损坏(仅4KB)

  • 我认为这个问题是对现有问题的另一种看法,如果有人遇到这个问题,请指导我。

    我使用的是ffmpeg编译的;您可以选择添加opencv和一些疯狂的人脸检测库,但我编译了它(它将输出的大小增加了一倍)。
    [armeabi-v7a] SharedLibrary  : libffmpeg.so
    jni/ffmpeg.c:200: error: undefined reference to 'av_frame_alloc'
    jni/ffmpeg.c:201: error: undefined reference to 'av_frame_alloc'
    jni/ffmpeg.c:209: error: undefined reference to 'av_register_all'
    jni/ffmpeg.c:210: error: undefined reference to 'avfilter_register_all'
    jni/ffmpeg.c:45: error: undefined reference to 'avformat_open_input'
    jni/ffmpeg.c:50: error: undefined reference to 'avformat_find_stream_info'
    jni/ffmpeg.c:56: error: undefined reference to 'av_find_best_stream'
    jni/ffmpeg.c:63: error: undefined reference to 'av_opt_set_int'
    jni/ffmpeg.c:66: error: undefined reference to 'avcodec_open2'
    jni/ffmpeg.c:67: error: undefined reference to 'av_log'
    jni/ffmpeg.c:78: error: undefined reference to 'avfilter_get_by_name'
    jni/ffmpeg.c:79: error: undefined reference to 'avfilter_get_by_name'
    jni/ffmpeg.c:80: error: undefined reference to 'avfilter_inout_alloc'
    jni/ffmpeg.c:81: error: undefined reference to 'avfilter_inout_alloc'
    jni/ffmpeg.c:85: error: undefined reference to 'avfilter_graph_alloc'
    jni/ffmpeg.c:98: error: undefined reference to 'avfilter_graph_create_filter'
    jni/ffmpeg.c:106: error: undefined reference to 'avfilter_graph_create_filter'
    jni/ffmpeg.c:113: error: undefined reference to 'av_int_list_length_for_size'
    jni/ffmpeg.c:113: error: undefined reference to 'av_opt_set_bin'
    jni/ffmpeg.c:116: error: undefined reference to 'av_log'
    jni/ffmpeg.c:131: error: undefined reference to 'av_strdup'
    jni/ffmpeg.c:142: error: undefined reference to 'av_strdup'
    jni/ffmpeg.c:147: error: undefined reference to 'avfilter_graph_parse_ptr'
    jni/ffmpeg.c:151: error: undefined reference to 'avfilter_graph_config'
    jni/ffmpeg.c:155: error: undefined reference to 'avfilter_inout_free'
    jni/ffmpeg.c:156: error: undefined reference to 'avfilter_inout_free'
    jni/ffmpeg.c:218: error: undefined reference to 'av_read_frame'
    jni/ffmpeg.c:223: error: undefined reference to 'avcodec_decode_video2'
    jni/ffmpeg.c:230: error: undefined reference to 'av_frame_get_best_effort_timestamp'
    jni/ffmpeg.c:233: error: undefined reference to 'av_buffersrc_add_frame_flags'
    jni/ffmpeg.c:234: error: undefined reference to 'av_log'
    jni/ffmpeg.c:240: error: undefined reference to 'av_buffersink_get_frame'
    jni/ffmpeg.c:171: error: undefined reference to 'av_rescale_q'
    jni/ffmpeg.c:246: error: undefined reference to 'av_frame_unref'
    jni/ffmpeg.c:248: error: undefined reference to 'av_frame_unref'
    jni/ffmpeg.c:251: error: undefined reference to 'av_packet_unref'
    jni/ffmpeg.c:254: error: undefined reference to 'avfilter_graph_free'
    jni/ffmpeg.c:255: error: undefined reference to 'avcodec_close'
    jni/ffmpeg.c:256: error: undefined reference to 'avformat_close_input'
    jni/ffmpeg.c:257: error: undefined reference to 'av_frame_free'
    jni/ffmpeg.c:258: error: undefined reference to 'av_frame_free'
    jni/include/libavutil/error.h:111: error: undefined reference to 'av_strerror'
    collect2.exe: error: ld returned 1 exit status
    make: *** [obj/local/armeabi/libffmpeg.so] Error 1