Newest 'ffmpeg' Questions - Stack Overflow

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

Les articles publiés sur le site

  • Using FFMPEG with QT

    7 mai 2018, par DearChild

    I'm having a problem with linking FFmpeg libraries to Qt 5.10 Projects. I downloaded the source code from the official website and successfully compiled and installed to my Ubuntu. I used: ./configure --enable-libvpx --disable-x86asm them: make && make install I'm able to find the installed libraries in /usr/local/lib (which are .a libs).

    my .pro looks like this:

    INCLUDEPATH += /usr/local/include
    LIBS += -L/usr/local/lib -lavformat -lavcodec -lavutil
    

    but i get the output:

    /usr/bin/x86_64-linux-gnu-ld: 
    /usr/loca/lib/libavformat.a(http.o):undefined reference to symbol 'inflateEnd'
    //lib/x86_64-linux-gnu/libz.so.1: error adding symbols: DSO missing from command line
    

    Does anyone know how to solve it? Thanks for the attention!

    Note: I would like to static link it to my project

  • How could I concatenate 3 videos in ffmpeg

    7 mai 2018, par Siddharth

    I'm using FFMPEG already for 2 videos and working fine with the following command

    ffmpeg -i intro.mp4 -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate1.ts
    ffmpeg -i outro.mp4 -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate2.ts
    ffmpeg -i "concat:intermediate1.ts|intermediate2.ts" -c copy -bsf:a aac_adtstoasc output.mp4
    

    but now I want to concatenate 3 videos or more how could I do that?

  • Why do different ffmpeg runs generates different files ?

    7 mai 2018, par Robby Ward

    I'm using ffmpeg to encode yuv videos into h.264 mp4 files. However, when I run the same command with the same input file I get different outputs. There is no visible difference when I play the 2 output files, but they are not exactly the same size and a binary comparison shows they are completely different. How can the same software with the same parameters generate different results on different runs on the same machine?

  • ffmpeg convrsion error for mkv to mp4 conversion

    7 mai 2018, par Bhumi Shah

    My command to convert mkv to mp4 is

    ffmpeg -i abc.mkv -vcodec copy -acodec copy  abc.mp4 null >/dev/null 2> log.log & echo $!;ff
    

    but if i remove -acodec copy

    ffmpeg -i abc.mkv -vcodec copy abc.mp4 null >/dev/null 2> log.log & echo $!;ff
    

    Here is my log:

    ffmpeg version 3.0.1 Copyright (c) 2000-2016 the FFmpeg developers
      built with gcc 4.8 (Ubuntu 4.8.4-2ubuntu1~14.04)
      configuration: --enable-gpl --enable-version3 --enable-shared --enable-nonfree --enable-postproc --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxvid --disable-yasm
      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
      libswscale      4.  0.100 /  4.  0.100
      libswresample   2.  0.101 /  2.  0.101
      libpostproc    54.  0.100 / 54.  0.100
    Input #0, matroska,webm, from 'abc.mkv':
      Metadata:
        COMPATIBLE_BRANDS: iso6avc1mp41
        MAJOR_BRAND     : dash
        MINOR_VERSION   : 0
        ENCODER         : Lavf58.3.100
      Duration: 00:00:44.58, start: 0.007000, bitrate: 1772 kb/s
        Stream #0:0: Video: h264 (Main), yuv420p(tv, bt709), 1280x720 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc (default)
        Metadata:
          HANDLER_NAME    : VideoHandler
          DURATION        : 00:00:44.545000000
        Stream #0:1(eng): Audio: opus, 48000 Hz, stereo, fltp (default)
        Metadata:
          DURATION        : 00:00:44.581000000
    [mp4 @ 0x848ae0] Could not find tag for codec opus in stream #1, codec not currently supported in container
    Output #0, mp4, to 'abc.mp4':
      Metadata:
        COMPATIBLE_BRANDS: iso6avc1mp41
        MAJOR_BRAND     : dash
        MINOR_VERSION   : 0
        encoder         : Lavf57.25.100
        Stream #0:0: Video: h264 ([33][0][0][0] / 0x0021), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], q=2-31, 23.98 fps, 23.98 tbr, 16k tbn, 1k tbc (default)
        Metadata:
          HANDLER_NAME    : VideoHandler
          DURATION        : 00:00:44.545000000
        Stream #0:1(eng): Audio: opus, 48000 Hz, stereo (default)
        Metadata:
          DURATION        : 00:00:44.581000000
    Stream mapping:
      Stream #0:0 -> #0:0 (copy)
      Stream #0:1 -> #0:1 (copy)
    Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
    

    ERROR

    Could not find tag for codec opus in stream #1, codec not currently supported in container
    Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
    

    command:

    ffmpeg -i abc.mkv -vcodec copy -acodec copy -strict -2 abc.mp4 null >/dev/null 2> log.log & echo $!;
    

    version

    ffmpeg version N-83692-gb8a7dcbde2-static http://johnvansickle.com/ffmpeg/  Copyright (c) 2000-2017 the FFmpeg developers
      built with gcc 5.4.1 (Debian 5.4.1-5) 20170205
    

    LOG:

    ffmpeg version N-83692-gb8a7dcbde2-static http://johnvansickle.com/ffmpeg/  Copyright (c) 2000-2017 the FFmpeg developers
      built with gcc 5.4.1 (Debian 5.4.1-5) 20170205
      configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc-5 --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gray --enable-libass --enable-libfreetype --enable-libfribidi --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libzimg
      libavutil      55. 47.100 / 55. 47.100
      libavcodec     57. 81.100 / 57. 81.100
      libavformat    57. 66.102 / 57. 66.102
      libavdevice    57.  3.100 / 57.  3.100
      libavfilter     6. 74.100 /  6. 74.100
      libswscale      4.  3.101 /  4.  3.101
      libswresample   2.  4.100 /  2.  4.100
      libpostproc    54.  2.100 / 54.  2.100
    Input #0, matroska,webm, from 'abc.mkv':
      Metadata:
        COMPATIBLE_BRANDS: iso6avc1mp41
        MAJOR_BRAND     : dash
        MINOR_VERSION   : 0
        ENCODER         : Lavf58.3.100
      Duration: 00:00:44.58, start: -0.007000, bitrate: 1772 kb/s
        Stream #0:0: Video: h264 (Main), yuv420p(tv, bt709, progressive), 1280x720 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc (default)
        Metadata:
          HANDLER_NAME    : VideoHandler
          DURATION        : 00:00:44.545000000
        Stream #0:1(eng): Audio: opus, 48000 Hz, stereo, fltp (default)
        Metadata:
          DURATION        : 00:00:44.581000000
    File 'abc.mp4' already exists. Overwrite ? [y/N] y
    [mp4 @ 0x4d172a0] Could not find tag for codec opus in stream #1, codec not currently supported in container
    Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
    Stream mapping:
      Stream #0:0 -> #0:0 (copy)
      Stream #0:1 -> #0:1 (copy)
        Last message repeated 1 times
    

    conversion is working. I am not getting why is creating issue. Anyone can help?

  • Buffering while converting stream to frames with ffmpeg

    7 mai 2018, par Pavel K.

    I am trying to convert udp stream into frames using ffmpeg. I run following command:

    ffmpeg -loglevel debug -strict 2 -re -i "udp://192.168.15.50:3200?fifo_size=1000000&overrun_nonfatal=1" -r 8 -vf scale=432:243 -f image2pipe -vcodec ppm pipe:1
    

    It happens with different stream types, mpeg2video and h264. Cpu load for core processing this specific stream is under 30%, its low quality sd stream with resolution of 640x576.

    It works well for the most time, however sometimes, once in a while, latency occurs and frames arrive later. So i want exactly 8 fps but sometime i get less, sometimes more.

    Why does this latency occur and how can i reduce it?

    update: i tried changing it to:

    ffmpeg -loglevel debug -i "udp://192.168.15.50:3200?fifo_size=1000000&overrun_nonfatal=1" -r 8 -preset ultrafast -fflags nobuffer -vf scale=432:243 -f image2pipe -vcodec ppm pipe:1
    

    But i still get the issue. For example, in ffmpeg log i get:

    [2016/02/11 13:32:30] frame= 7477 fps=8.0 q=-0.0 size= 2299638kB time=00:15:34.62 bitrate=20156.4kbits/s dup=7 drop=15867 ^M*** dropping frame 7477 from stream 0 at ts 7475
    [2016/02/11 13:32:30] ***dropping frame 7477 from stream 0 at ts 7476
    [2016/02/11 13:32:30] ***dropping frame 7478 from stream 0 at ts 7476
    [2016/02/11 13:32:32] Last message repeated 1 times
    [2016/02/11 13:32:32] frame= 7479 fps=8.0 q=-0.0 size= 2300253kB time=00:15:34.87 bitrate=20156.4kbits/s dup=7 drop=15871 ^M*** dropping frame 7479 from stream 0 at ts 7477
    

    As you can see, during second 31, no frames are output... and ffmpeg reported time between two frames is 0.25s