Newest 'ffmpeg' Questions - Stack Overflow

http://stackoverflow.com/questions/tagged/ffmpeg

Les articles publiés sur le site

  • how to call avformat_alloc_output_context2 in ffmpeg 2.6.3 ?

    4 avril 2016, par patrick

    I'm developing an c/c++ app that uses ffmpeg to play audio/video.Now i want to enhance the application to allow the users to extract audio from video and save it. I followed this https://ffmpeg.org/doxygen/trunk/muxing_8c-source.html for the saving part but now the problem is with avformat_alloc_output_context2(). I'm getting an error: "undefined reference to `avformat_alloc_output_context2' ". Does anyone know about the proper way to call 'avformat_alloc_output_context2' in ffmpeg version 2.6.3

  • Running frei0r filters with ffmpeg - "Could not find module 'pixeliz0r'."

    4 avril 2016, par ksloan

    I installed frei0r using homebrew

    MacK:tmp kevin$ brew list frei0r
    /usr/local/Cellar/frei0r/1.4/include/frei0r.h
    /usr/local/Cellar/frei0r/1.4/lib/frei0r-1/ (119 files)
    /usr/local/Cellar/frei0r/1.4/lib/pkgconfig/frei0r.pc
    /usr/local/Cellar/frei0r/1.4/share/doc/ (4 files)
    

    Then I installed ffmpeg with the --with-frei0r flag, and everything compiled fine

    brew install ffmpeg --with-fdk-aac --with-ffplay --with-freetype --with-libass --with-libquvi --with-libvorbis --with-libvpx --with-opus --with-x265 --with-frei0r
    

    I tried telling ffmpeg where my frie0r filters were installed with

    export FREI0R_PATH=/usr/local/Cellar/frei0r/1.4/lib/frei0r-1/
    

    I even created symlinks from the default locations ffmpeg checks...

    MacK:tmp kevin$ ls -l  /usr/local/lib/frei0r-1
    lrwxr-xr-x  1 kevin  admin  33  4 Apr 04:43 /usr/local/lib/frei0r-1 -> ../Cellar/frei0r/1.4/lib/frei0r-1
    

    But I'm still seeing this error:

    [Parsed_frei0r_0 @ 0x7f8938f003c0] Could not find module 'perspective'.
    [AVFilterGraph @ 0x7f8938f00160] Error initializing filter 'frei0r' with args 'perspective'
    Error initializing complex filters.
    Invalid argument
    

    Full output:

    MacK:tmp kevin$ ffmpeg -i 1.mp4 -filter_complex "frei0r=perspective" out.mp4
    ffmpeg version 3.0.1 Copyright (c) 2000-2016 the FFmpeg developers
      built with Apple LLVM version 7.0.2 (clang-700.1.81)
      configuration: --prefix=/usr/local/Cellar/ffmpeg/3.0.1 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-opencl --enable-libx264 --enable-libmp3lame --enable-libxvid --enable-libfreetype --enable-libvorbis --enable-libvpx --enable-libass --enable-ffplay --enable-libfdk-aac --enable-libopus --enable-frei0r --enable-libx265 --enable-nonfree --enable-vda
      libavutil      55. 17.103 / 55. 17.103
      libavcodec     57. 24.102 / 57. 24.102
      libavformat    57. 25.100 / 57. 25.100
      libavdevice    57.  0.101 / 57.  0.101
      libavfilter     6. 31.100 /  6. 31.100
      libavresample   3.  0.  0 /  3.  0.  0
      libswscale      4.  0.100 /  4.  0.100
      libswresample   2.  0.101 /  2.  0.101
      libpostproc    54.  0.100 / 54.  0.100
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '1.mp4':
      Metadata:
        major_brand     : isom
        minor_version   : 512
        compatible_brands: isomiso2avc1mp41
        encoder         : Lavf57.25.100
      Duration: 00:00:08.34, start: 0.023220, bitrate: 4293 kb/s
        Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x720, 4161 kb/s, 60 fps, 60 tbr, 15360 tbn, 120 tbc (default)
        Metadata:
          handler_name    : VideoHandler
        Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 129 kb/s (default)
        Metadata:
          handler_name    : SoundHandler
    [Parsed_frei0r_0 @ 0x7f8938f003c0] Could not find module 'perspective'.
    [AVFilterGraph @ 0x7f8938f00160] Error initializing filter 'frei0r' with args 'perspective'
    Error initializing complex filters.
    Invalid argument
    

    I've run out of ideas to try next, what am I missing? Any help would be greatly appreciated.

  • How do I avoid an unsupported frame rate error ?

    4 avril 2016, par Hyperum

    I am on a Macbook and I am trying to read video from a camera using the ffmpeg library. The camera is a 10 meter USB underwater camera. I am using the C API through a D binding called ffmpeg-d. However, upon trying to open the input, I get this:

    [avfoundation @ 0x7fe0d2800000] Selected framerate (29.970030) is not supported by the device
    [avfoundation @ 0x7fe0d2800000] Supported modes:
    [avfoundation @ 0x7fe0d2800000]   160x120@[30.000030 30.000030]fps
    [avfoundation @ 0x7fe0d2800000]   176x144@[30.000030 30.000030]fps
    [avfoundation @ 0x7fe0d2800000]   320x240@[30.000030 30.000030]fps
    [avfoundation @ 0x7fe0d2800000]   352x288@[30.000030 30.000030]fps
    [avfoundation @ 0x7fe0d2800000]   640x480@[30.000030 30.000030]fps
    

    So how can I avoid this problem? Would setting the framerate manually be the answer? And if so, how could I do that?

    Here is a really short program to replicate my problem.

    import std.stdio;
    
    import ffmpeg.libavdevice.avdevice;
    import ffmpeg.libavcodec.avcodec;
    import ffmpeg.libavformat.avformat;
    import ffmpeg.libavfilter.avfilter;
    import ffmpeg.libavutil.avutil;
    import ffmpeg.libavutil.mem;
    import ffmpeg.libavutil.pixfmt;
    import ffmpeg.libswscale.swscale;
    
    import std.string;
    
    void main()
    {
        av_register_all();
        avdevice_register_all();
    
        string           cameraSource        = "USB";
    
        AVCodecContext*  cameraCodecContext  = null;
        AVFormatContext* cameraFormatContext = avformat_alloc_context();
        AVCodec*         cameraCodec         = null;
        AVInputFormat*   cameraFormat        = av_find_input_format("avfoundation");
        AVFrame*         rawFrame = null, convertedFrame = null;
    
        if (avformat_open_input(&cameraFormatContext, cameraSource.toStringz, cameraFormat, null) != 0) return;
    }
    
  • how to use latest FFMPEG in android studio project ?

    4 avril 2016, par arslan haktic

    I have a simple task to make a video from multiple images and an audio file, After searching a lot found that its possible with FFMPEG, Unfortunately there are no updated tutorials for FFMPEG, there are few but outdated and most of them are not working. As i have compiled FFMPEG for android using NDK android-ndk-r10e and ffmpeg-2.8.6 on my MAC with Android Studio following the tutorial http://www.roman10.net/how-to-build-ffmpeg-with-ndk-r9/ It makes the .so files as files generated from ffmpeg

    Now i can't understand what should i do to integrate this in my android project, I have also checked,

    How to use Ffmpeg in android studio?

    how to use ffmpeg in android?

    FFMPEG on Android

    and mainly this,

    http://www.roman10.net/how-to-build-android-applications-based-on-ffmpeg-by-an-example/

    https://github.com/roman10/android-ffmpeg-tutorial

    But its not working and having errors with no way to resolve this. Can anyone please mention some steps that should be followed to use FFMPEG .so files as in image attached.

  • How to use Java or Python to implement a RTSP streaming server ?

    4 avril 2016, par mirage1993

    I want to implement a RTSP streaming server like DSS(Darwin Streaming Server).

    My idea is :

    1. I can use ffmpeg to send rtsp stream to my server.

    2. My server can hold this stream and waiting for VLC connecting.

    3. When VLC connects to my server, stream can be sent from my server to VLC.

    It's only a fancy of mine, but I have no idea how to implement this server.

    Could you provide some advice or some documents.

    Thanks.