Newest 'ffmpeg' Questions - Stack Overflow

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

Les articles publiés sur le site

  • ffplay / ffmpeg with audio and video filters

    20 juillet, par user10104150

    i tried to modify a already existing code for ffplay for hours, but I could not get it. I could not find a manual for vertical and horizontal stacking parameters. I’m always getting invalid argument errors when I try to adopt it to my needs. So I’m asking here for help.

    My idea is based on that: ffplay / ffmpeg setup table with audio and video filters

    The working code that I modified a little but want to modify further without luck is:

    ffplay -f lavfi \
             "amovie=in.mp4,asplit=3[sv][eb][av]; \
              [sv]showvolume=b=4:f=0:ds=log:c=VOLUME:w=720:h=68[sv-v]; \
              [eb]ebur128=video=1:size=720x540:meter=18[eb-v][out1]; \
              [av]avectorscope=s=720x540:zoom=1.3:rc=2:gc=200:bc=10:rf=1:gf=8:bf=7[av-v]; \
              [sv-v][eb-v][av-v]vstack=3[1c]; \
              movie=in.mp4,split=4[v][wf][wfc][vs]; \
              [wf]waveform=m=1:d=0:r=0:c=7[wf-vus]; \
              [wf-vus][v]scale2ref=iw:1220-ih[wf-va][sig]; \
              [wf-va]setsar=1[wf-v]; \
              [wfc]waveform=m=0:d=0:r=0:c=7,scale=610x610,setsar=1[wfc-v]; \
              [vs]vectorscope=m=color3:g=color,scale=610x610,setsar=1[vs-v]; \
              [sig][wf-v]vstack[2c]; \
              [wfc-v][vs-v]vstack[3c]; \
              [1c][2c][3c]hstack=3,scale=1920:-1[out0]"
    

    I’d like to change it to that style - I'm not yet allowed to post images directly in this question, so I need to link it:

    Link to image how I'd like the layout to be

    I’d like to have the video shown in 1920x1080 (keeping aspect ratio, downscale if necessary).

  • Aforge VideoSourcePlayer is too slow

    20 juillet, par Jasim Khan Afridi

    I am receiving continuous frames from a video device which I convert into image and then play them as live video on WPF application. I have used picture box control for this purpose. It works for 1 or two video streams. But as soon as I add more. It shows clear lag in performance and frames per second reduce drastically.

    I then tried using Aforge's VideoSourcePlayer control. I implemented IVideoSource that receives images and pushes them to VideoSourcePlayer via NewFrame?.Invoke(this, new NewFrameEventArgs(image)) and I am expecting them to be played seemlessly. Which is not the case. It is very laggy even for one video stream.

    My question is: Is there something wrong with my approach?

    Is there any other open source control that can help me with this problem?

  • OpenCV video capture - output even potentially corrupt frames

    20 juillet, par J. S.

    In FFmpeg, there is a flag "output_corrupt" that allows the command to output even corrupted frames. I am sending h264 stream to a server where its first few frames are corrupted. By setting "output_corrupt" flag in my FFmpeg command, I am able to view the live stream. I can see the live stream by piping FFmpeg data to OpenCV VideoCapture (i.e. cv2.VideoCapture('/dev/stdin'))

    Note: since my plan is to run CV algorithms on those frames, I need to be able to run it on OpenCV.

    However, by not directly sending the data through VideoCapture, it unavoidably causes some latency issue.

    The best scenario would be to just directly send the h264 stream to OpenCV VideoCapture (i.e. cv2.VideoCapture('udp://......')) However, because of the corrupted frames, the OpenCV script gets stuck after a second.

    Is there any way to run OpenCV VideoCapture such that it still outputs potentially corrupt frames?

    Thank you.

  • How make an API for android from ffmpeg source to join multiple mp3 ? [on hold]

    20 juillet, par Nam

    I'm researching on ffmpeg source to make an API that help me joining multiple mp3 file. But I don't know what's exactly functions in ffmpeg which I can use for my API.

  • ffmpeg h264_amf usage in C++

    19 juillet, par plq

    I want to use h264_amf encoder in my C++ code. In FFmpeg command-line tool I can write
    ffmpeg -i in_to_tree_1080p50.y4m -c:v h264_amf out.mp4
    And this works fine for me, but when I try to find this encoder by using avcodec_find_encoder_by_name I can't find it. My full code:

    static AVCodec* select_codec() {
      static std::array codecs = {
        "h264_nvenc",
        "h264_amf",
        "h264_omx",
        "h264_v4l2m2m",
        "h264_vaapi",
        "h264_videotoolbox",
      };
    
      for (const char* name : codecs) {
        if (auto* codec = avcodec_find_encoder_by_name(name)) {
          std::cout << "Using " << name << " encoder" << std::endl;
          return codec;
        }
      }
    
      std::cout << "Using default h264 encoder" << std::endl;
      return avcodec_find_encoder(AV_CODEC_ID_H264);
    }
    
    int main() {
      select_codec();
      return 0;
    }
    

    The output of this function is always Using default h264 encoder. Did I do something wrong?

    My configuration:

    • FFmpeg 4.0
    • Windows 10 x64
    • MSVC17 (141 toolset)
    • Radeon RX 470 Graphics