Newest 'ffmpeg' Questions - Stack Overflow

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

Les articles publiés sur le site

  • Start .bat after files get download in torrent client qBittorrent

    16 mai 2018, par AniEncoder

    I tried to start a .bat file which is located in a particular folder but it doesn't start even if I write the file location.

    The files get downloaded

    C:\Users\Dhrubo\Desktop\torrent.bat
    

    TorrentScreenshot

  • ffmpeg Error configuring complex filters

    16 mai 2018, par Armand

    having some issues with an ffmpeg command, maybe someone can point me in the right direction, i used this link to build my command: SO Question

    The output I am getting:

    ffmpeg version N-81646-gc19da0c Copyright (c) 2000-2016 the FFmpeg developers
      built with gcc 5.4.0 (GCC)
      configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-dxva2 --enable-libmfx --enable-nvenc --enable-avisynth --enable-bzlib --enable-libebur128 --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-decklink --enable-zlib
      libavutil      55. 29.100 / 55. 29.100
      libavcodec     57. 55.101 / 57. 55.101
      libavformat    57. 48.103 / 57. 48.103
      libavdevice    57.  0.102 / 57.  0.102
      libavfilter     6. 62.100 /  6. 62.100
      libswscale      4.  1.100 /  4.  1.100
      libswresample   2.  1.100 /  2.  1.100
      libpostproc    54.  0.100 / 54.  0.100
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'E:\Documents\Content Bar\Photo Booth\PhotosDrop\20180416215218.mp4':
      Metadata:
        major_brand     : isom
        minor_version   : 512
        compatible_brands: isomiso2avc1mp41
        encoder         : Lavf58.11.101
      Duration: 00:00:25.32, start: 0.000000, bitrate: 838 kb/s
        Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 800x600 [SAR 1:1 DAR 4:3], 702 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc (default)
        Metadata:
          handler_name    : VideoHandler
        Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 127 kb/s (default)
        Metadata:
          handler_name    : SoundHandler
    Input #1, mov,mp4,m4a,3gp,3g2,mj2, from 'E:\Desktop\Videos\Processing\2018-05-15 14-01-16.mp4':
      Metadata:
        major_brand     : isom
        minor_version   : 512
        compatible_brands: isomiso2avc1mp41
        encoder         : Lavf57.84.100
      Duration: 00:00:04.20, start: 0.000000, bitrate: 4476 kb/s
        Stream #1:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x720, 4339 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc (default)
        Metadata:
          handler_name    : VideoHandler
        Stream #1:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s (default)
        Metadata:
          handler_name    : SoundHandler
    Input #2, mov,mp4,m4a,3gp,3g2,mj2, from 'E:\Documents\Content Bar\Photo Booth\PhotosDrop\20180416215218.mp4':
      Metadata:
        major_brand     : isom
        minor_version   : 512
        compatible_brands: isomiso2avc1mp41
        encoder         : Lavf58.11.101
      Duration: 00:00:25.32, start: 0.000000, bitrate: 838 kb/s
        Stream #2:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 800x600 [SAR 1:1 DAR 4:3], 702 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc (default)
        Metadata:
          handler_name    : VideoHandler
        Stream #2:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 127 kb/s (default)
        Metadata:
          handler_name    : SoundHandler
    Input #3, mov,mp4,m4a,3gp,3g2,mj2, from 'E:\Desktop\Videos\Processing\2018-05-15 14-01-27.mp4':
      Metadata:
        major_brand     : isom
        minor_version   : 512
        compatible_brands: isomiso2avc1mp41
        encoder         : Lavf57.84.100
      Duration: 00:00:04.20, start: 0.000000, bitrate: 4877 kb/s
        Stream #3:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x720, 4739 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc (default)
        Metadata:
          handler_name    : VideoHandler
        Stream #3:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s (default)
        Metadata:
          handler_name    : SoundHandler
    Input #4, mov,mp4,m4a,3gp,3g2,mj2, from 'E:\Documents\Content Bar\Photo Booth\PhotosDrop\20180416215218.mp4':
      Metadata:
        major_brand     : isom
        minor_version   : 512
        compatible_brands: isomiso2avc1mp41
        encoder         : Lavf58.11.101
      Duration: 00:00:25.32, start: 0.000000, bitrate: 838 kb/s
        Stream #4:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 800x600 [SAR 1:1 DAR 4:3], 702 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc (default)
        Metadata:
          handler_name    : VideoHandler
        Stream #4:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 127 kb/s (default)
        Metadata:
          handler_name    : SoundHandler
    Input #5, mov,mp4,m4a,3gp,3g2,mj2, from 'E:\Documents\Content Bar\Photo Booth\PhotosDrop\20180416215218.mp4':
      Metadata:
        major_brand     : isom
        minor_version   : 512
        compatible_brands: isomiso2avc1mp41
        encoder         : Lavf58.11.101
      Duration: 00:00:25.32, start: 0.000000, bitrate: 838 kb/s
        Stream #5:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 800x600 [SAR 1:1 DAR 4:3], 702 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc (default)
        Metadata:
          handler_name    : VideoHandler
        Stream #5:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 127 kb/s (default)
        Metadata:
          handler_name    : SoundHandler
    Input #6, mov,mp4,m4a,3gp,3g2,mj2, from 'E:\Desktop\Videos\Processing\2018-05-15 14-01-33.mp4':
      Metadata:
        major_brand     : isom
        minor_version   : 512
        compatible_brands: isomiso2avc1mp41
        encoder         : Lavf57.84.100
      Duration: 00:00:04.20, start: 0.000000, bitrate: 4446 kb/s
        Stream #6:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x720, 4309 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc (default)
        Metadata:
          handler_name    : VideoHandler
        Stream #6:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s (default)
        Metadata:
          handler_name    : SoundHandler
    Input #7, mov,mp4,m4a,3gp,3g2,mj2, from 'E:\Documents\Content Bar\Photo Booth\PhotosDrop\20180416215218.mp4':
      Metadata:
        major_brand     : isom
        minor_version   : 512
        compatible_brands: isomiso2avc1mp41
        encoder         : Lavf58.11.101
      Duration: 00:00:25.32, start: 0.000000, bitrate: 838 kb/s
        Stream #7:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 800x600 [SAR 1:1 DAR 4:3], 702 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc (default)
        Metadata:
          handler_name    : VideoHandler
        Stream #7:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 127 kb/s (default)
        Metadata:
          handler_name    : SoundHandler
    [Parsed_concat_0 @ 07212280] Input link in1:v0 parameters (size 1280x720, SAR 0:1) do not match the corresponding output link in0:v0 parameters (800x600, SAR 1:1)
    [Parsed_concat_0 @ 07212280] Failed to configure output pad on Parsed_concat_0
    Error configuring complex filters.
    Invalid argument
    

    The arguments I am using:

     -i "E:\Documents\Content Bar\Photo Booth\PhotosDrop\20180416215218.mp4" -i "E:\Desktop\Videos\Processing\2018-05-15 14-01-16.mp4" -i "E:\Documents\Content Bar\Photo Booth\PhotosDrop\20180416215218.mp4" -i "E:\Desktop\Videos\Processing\2018-05-15 14-01-27.mp4" -i "E:\Documents\Content Bar\Photo Booth\PhotosDrop\20180416215218.mp4" -i "E:\Documents\Content Bar\Photo Booth\PhotosDrop\20180416215218.mp4" -i "E:\Desktop\Videos\Processing\2018-05-15 14-01-33.mp4" -i "E:\Documents\Content Bar\Photo Booth\PhotosDrop\20180416215218.mp4" -filter_complex "[0:v] [0:a] [1:v] [1:a] [2:v] [2:a] [3:v] [3:a] [4:v] [4:a] [5:v] [5:a] [6:v] [6:a] concat=n=7:v=1:a=1 [v] [a]" -map "[v]" -map "[a]" "E:\Desktop\Videos\Processing\2018-05-15 14-01-16OUT.mp4"
    

    From what I understood is it isn't supposed to care about the video sizes when doing it this way?

  • How to add a 5.1 .flac audio track to a .ts file with already 3 audio tracks ?

    16 mai 2018, par Pablo

    I want to add a 5.1 .flac audio track to a .ts file that already has three audio tracks. I tried with tsMuxer and ffmpeg with unsuccessful results. In tsMuxeR the .flac track is not recognized and in ffmpeg everything seems to work fine until the very last moment when I check the file and the .flac audio track is not included in the "output.ts". The .flac track is about 3GB and its lenght is around two and a half hours.

    Thank you so much.

  • FFMPEG with node , using child_process , suppressing un-necessary stderr

    16 mai 2018, par drexdelta

    I am trying to resize the video using (FFMPEG + node + child_process). and my code looks something like this , You can read comments and understand it. it's self-explanatory for people who are familiar with node and ffmpeg. when I run this code, I keep getting error in newThread.stderr.on() function . which is not expected behaviour. After running this process I am getting expected video translation, which is expected behaviour.

    const spawn = require('child_process').spawn;
    
    // resize and compress video promise  = prom2
    const resizeVideoWith_FFMPEG_Promise = (sourceFile , sinkFile)=>{
        return new Promise ( (resolve , reject)=>{
    
            // actual command for ffmpeg is something like this , "ffmpeg -i oldVideo -vf scale=-2:480 newVideo"
            // New thread
            const newThread = spawn('ffmpeg' , ['-i','vid1.mp4','-vf','scale=-2:480','vid2.mp4']);
    
            // on close signal
            newThread.on('close',(data)=>{
                console.log(' thread closed for video ' , sourceFile);
                return resolve();
            });
            // on stderr signals
            newThread.stderr.on('data',(data)=>{
                console.log(' got error in the thread of video ' , sourceFile);
                fullError = data.toString();
                console.log(fullError);
                // return resolve();
                // return reject();
            });
            newThread.stdout.on('data',(data)=>{
                // just ignore all stadanrd outputs
            });
        });
    }
    
    resizeVideoWith_FFMPEG_Promise('vid1.mp4' , 'vid2.mp4' ).then((res)=>{
        console.log(res);
    });
    

    For the sake of simplicity I am resolving the promise everytime, even if I get stderr. And at end of running this code I get output something like this ,

     got error in the thread of video  vid1.mp4
    frame= 3277 fps=116 q=28.0 size=   12288kB time=00:02:16.64 bitrate= 736.7kbits/s speed=4.82x    
     got error in the thread of video  vid1.mp4
    frame= 3313 fps=115 q=28.0 size=   12544kB time=00:02:18.15 bitrate= 743.8kbits/s speed=4.79x    
     got error in the thread of video  vid1.mp4
    frame= 3362 fps=115 q=28.0 size=   12800kB time=00:02:20.17 bitrate= 748.0kbits/s speed=4.78x    
     got error in the thread of video  vid1.mp4
    frame= 3408 fps=114 q=28.0 size=   12800kB time=00:02:22.12 bitrate= 737.8kbits/s speed=4.77x    
     got error in the thread of video  vid1.mp4
    frame= 3465 fps=114 q=28.0 size=   13056kB time=00:02:24.49 bitrate= 740.2kbits/s speed=4.76x    
     got error in the thread of video  vid1.mp4
    frame= 3522 fps=114 q=28.0 size=   13312kB time=00:02:26.86 bitrate= 742.5kbits/s speed=4.76x    
     got error in the thread of video  vid1.mp4
    frame= 3580 fps=114 q=28.0 size=   13568kB time=00:02:29.28 bitrate= 744.6kbits/s speed=4.76x
    

    Now, my problem is if I always keep resolving errors, then I will never be able to catch when the video ACTUALLY FAILED TO RESCALE. so, how can I ignore these type of un-necessary stderr and catch only useful errors ?

    Pls someone help.

    I have been through lot of related links like this, but none of these actually solve my problem(even if they did, I couldn't figure out)

    Error while using h264_cuvid decoder with ffmpeg

    Using module "child_process" without Webpack

    Suppressing STDOUT with node child_process

    Small hint will be very helpful. Thank you .

    BTW , SO moderators , My actual title was like

    stderr problem while using FFMPEG with node via child_process module

    But it didn't allow me to use such title. so, I am using some dummy title.

  • -to value smaller than -ss error while clipping videos with ffmpeg

    16 mai 2018, par dusa

    I am trying to clip videos using frame information, I first convert the frame to time since ffmpeg uses this notion to clip videos.

    The problem is for shorter videos, it gives the error:

    -to; value smaller than -ss; aborting.

    But in reality, this is false. For example, I get an error even with these values:

    0:0:47.4 -to 0:0:47.21  (format -> hh:mm:ss.frame)
    

    Can anyone tell me how I can fix this?

    The video frame rate is 25 fps and the command structure I use is:

     os.system('ffmpeg -i ' + inputvideo + '.mp4' + ' -qscale:v 2 -vf scale=427:240 ' + ' -ss '+ str(fhours) + ':' + str(fminutes) + ':' + str(fseconds) + '.' + str(fframes) + ' -to ' + str(lhours) + ':' + str(lminutes) + ':' + str(lseconds) + '.' + str(lframes) + ' ' + outputvideo + '.avi')