Newest 'ffmpeg' Questions - Stack Overflow

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

Les articles publiés sur le site

  • Do H264 P&B frames contain pixels values ?

    29 janvier 2019, par Ibrahim Radwan

    From what I understand, the I-frames are the ones containing the actual pixels values, and the P&B frames just contain some kind of indicators on how to construct the next frames from the already decoded frames.

    With that being said, shouldn't I get a completely blue video, if I've only changed the I-frames to be completely blue pictures?

    Thank you!

  • ffmpeg : Command Execution failed

    29 janvier 2019, par PRABHJOT SINGH

    I am using this plugin plugin link and I am uploading mp4 videos and trying to compress the video on the server using node js FFmpeg module

    var vid = new ffmpeg( './' + req.file_name + '.mp4');
    vid.then(function (video) {
        video.setVideoSize('640x?', true, true)
            .save('./' + req.file_name + '_cp.mp4',
                function (err,file) {
                    if(err) {
                        res.send({status: 404, message: 'Unable to save video' })
                    } else {
                        revealCtrl.GetVideoData(req, res, next);
                    }
                })
    }, function (err) { });
    

    but it is not compressing my video and gives this error

    Here is the final command

    Command failed: ffmpeg -i ./jrbze37i.mp4  -strict -2  -filter_complex "scale=iw*sar:ih, pad=max(iw\,ih*(16/9)):ow/(16/9):(ow                                                                                                        -iw)/2:(oh-ih)/2" ./jrbze37i_cp.mp4 
    

    and here is the error

    Error: Command failed: ffmpeg -i ./jrbze37i.mp4  -strict -2  -filter_complex "scale=iw*sar:ih, pad=max(iw\,ih*(16/9)):ow/(16/9):(ow                                                                                                        -iw)/2:(oh-ih)/2" ./jrbze37i_cp.mp4
    ffmpeg version 2.8.15-0ubuntu0.16.04.1 Copyright (c) 2000-2018 the FFmpeg 
    developers
    built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.10) 20160609
    configuration: --prefix=/usr --extra-version=0ubuntu0.16.04.1 --build- 
    suffix=-ffmpeg --toolchain=hardened --libdir=/usr/lib/x86_64-                                                                                                        
    linux-gnu --incdir=/usr/include/x86_64-linux-gnu --cc=cc --cxx=g++ -- 
    enable-gpl --enable-shared --disable-stripping --disable-decoder                                                                                                        
    =libopenjpeg --disable-decoder=libschroedinger --enable-avresample -- 
    enable-avisynth --enable-gnutls --enable-ladspa --enable-libass                                                                                                         
    --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio -- 
    enable-libflite --enable-libfontconfig --enable-libfreetype -                                                                                                        
    -enable-libfribidi --enable-libgme --enable-libgsm --enable-libmodplug -- 
    enable-libmp3lame --enable-libopenjpeg --enable-libopus --en                                                                                                        
    able-libpulse --enable-librtmp --enable-libschroedinger --enable-libshine 
    --enable-libsnappy --enable-libsoxr --enable-libspeex --ena                                                                                                        
    ble-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis -- 
    enable-libvpx --enable-libwavpack --enable-libwebp --enable-li                                                                                                        
    bx265 --enable-libxvid --enable-libzvbi --enable-openal --enable-opengl -- 
    enable-x11grab --enable-libdc1394 --enable-libiec61883 --en                                                                                                        
    able-libzmq --enable-frei0r --enable-libx264 --enable-libopencv
    libavutil      54. 31.100 / 54. 31.100
    libavcodec     56. 60.100 / 56. 60.100
    libavformat    56. 40.101 / 56. 40.101
    libavdevice    56.  4.100 / 56.  4.100
    libavfilter     5. 40.101 /  5. 40.101
    libavresample   2.  1.  0 /  2.  1.  0
    libswscale      3.  1.101 /  3.  1.101
    libswresample   1.  2.101 /  1.  2.101
    libpostproc    53.  3.100 / 53.  3.100
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from './jrbze37i.mp4':
    Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf58.26.100
    Duration: 00:00:53.22, start: 0.023220, bitrate: 1553 kb/s
    Stream #0:0(und): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), 
    yuv420p, 1920x1080, 1418 kb/s, 30 fps, 30 tbr, 15360 tb                                                                                                        
    n, 60 tbc (default)
    Metadata:
      handler_name    : Core Media Video
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, mono, 
    fltp, 128 kb/s (default)
    Metadata:
      handler_name    : Core Media Audio
    [libx264 @ 0x1567760] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 
    AVX FMA3 AVX2 LZCNT BMI2
    [libx264 @ 0x1567760] profile High, level 4.0
    [libx264 @ 0x1567760] 264 - core 148 r2643 5c65704 - H.264/MPEG-4 AVC 
    codec - Copyleft 2003-2015 - http://www.videolan.org/x264.html                                                                                                         
    - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 
    psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 tr                                                                                                        
    ellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 
    threads=1 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1                                                                                                         
    interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 
    b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 ke                                                                                                        
    yint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf 
    mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_r                                                                                                        
    atio=1.40 aq=1:1.00
    Output #0, mp4, to './jrbze37i_cp.mp4':
      Metadata:
     major_brand     : isom
     minor_version   : 512
     compatible_brands: isomiso2avc1mp41
     encoder         : Lavf56.40.101
     Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 
       1920x1080, q=-1--1, 30 fps, 15360 tbn, 30 tbc (default)
     Metadata:
      encoder         : Lavc56.60.100 libx264
     Stream #0:1(und): Audio: aac ([64][0][0][0] / 0x0040), 44100 Hz, mono, 
     fltp, 128 kb/s (default)
     Metadata:
      handler_name    : Core Media Audio
      encoder         : Lavc56.60.100 aac
     Stream mapping:
       Stream #0:0 (h264) -> scale (graph 0)
       pad (graph 0) -> Stream #0:0 (libx264)
       Stream #0:1 -> #0:1 (aac (native) -> aac (native))
       Press [q] to stop, [?] for help
       Killed   42 fps=5.1 q=29.0 size=      94kB time=00:00:01.34 bitrate= 
        574.7kbits/s dup=1 drop=0
    
       at ChildProcess.exithandler (child_process.js:276:12)
       at emitTwo (events.js:126:13)
       at ChildProcess.emit (events.js:214:7)
       at maybeClose (internal/child_process.js:915:16)
       at Socket.stream.socket.on (internal/child_process.js:336:11)
       at emitOne (events.js:116:13)
       at Socket.emit (events.js:211:7)
       at Pipe._handle.close [as _onclose] (net.js:561:12)
     killed: false,
     code: 137,
     signal: null,
     cmd: 'ffmpeg -i ./jrbze37i.mp4  -strict -2  -filter_complex 
        "scale=iw*sar:ih, pad=max(iw\\,ih*(16/9)):ow/(16/9):(ow-iw)/2:(oh- 
       ih)/2 " ./jrbze37i_cp.mp4'
    

    My problem is that sometimes its work or sometimes it doesn't work.

  • Passing FFMpeg Options into FrameGrabber Has No Effect At All

    29 janvier 2019, par peter bence

    I'm using FFMpegFrameGrabber on android to consume an rtmp live stream, that streams at 30fps, i tried to set the grabber frame rate using setFrameRate(4) and setOption("framerate","4"), in order to resolve the lag, but neither worked. I also passed a set of options into the grabber such as ("fflags","nobuffer") that seems to be working for others, but non has an effect too. I

        grabber = FFmpegFrameGrabber.createDefault(this.listener.getVideoUrlOrPath());
    
        grabber.setTimeout(Math.abs((int) GlobalHandler.configMnger.getConnectionTimeout() / 1000));
        grabber.setOption("fflags", "nobuffer");
        grabber.setOption("nobuffer", "1");
        grabber.setOption("max_delay", "0");
        grabber.setOption("hwaccel", "auto");
        grabber.setOption("vsync", "0");
        grabber.setOption("r", "4");
        grabber.setOption("preset", "ultrafast");
        grabber.setOption("tune", "zerolatency");
        grabber.setOption("analyzeduration", "0");
        grabber.setOption("fflags", "flush_packets");
        grabber.setOption("fflags", "nofillin");
        grabber.setOption("fflags", "noparse");
        grabber.setOption("flags", "low_delay");
        grabber.setOption("framedrop", "1");
        grabber.setOption("fflags", "discardcorrupt");
        grabber.setOption("framerate", "4");
        grabber.setFrameRate(4);
        grabber.setVideoCodec(avcodec.AV_CODEC_ID_H264);
    
    
        grabber.start();
    
        Frame image;
    
        while((image=grabber.grabImage())!=null){
            ...
        }
    

    Please Note that remove all options gives identical results, where the only working option i have here is timout that is set using the setTimeout function above.

    Any help please?. Thanks!!

  • FFmpeg command execution

    29 janvier 2019, par Sanket990

    How to file name space allowed in ffmpeg command execution time and executing this command in android. i.e
    ffmpeg -y -i /sdcard/**folder name/file name**.mp4 any way to handle space allowed?

    I m getting error in logcat No such file or directory error

  • How to make terminal refer to more recent ffmpeg installation path (currently refers to Anaconda's installation) ? [on hold]

    29 janvier 2019, par John Doe

    I would like to use ffmpeg to convert a WAV audio file to MP3, but ffmpeg doesn't have a native MP3 encoder. Their documentation says you can use the external libmp3lame encoding library to achieve this, which "requires the presence of the libmp3lame headers and library during configuration" by "explicitly configur[ing] the build with --enable-libmp3lame."

    I tried installing the latest version of ffmpeg to my desktop and followed the configuration instructions to include libmp3lame. However, when I tried it out in my terminal, I got an error saying that ffmpeg could not find the libmp3lame encoder.

    When I enter "which ffmpeg" into my terminal, the path I am given refers to another, older installation of ffmpeg that was included automatically when I installed Anaconda years ago.

    How can I change the path of the installation my terminal refers to so that when I execute ffmpeg commands, it will use the version I more recently configured to include libmp3lame on my desktop and not the older installation included in Anaconda's directories?