Newest 'ffmpeg' Questions - Stack Overflow

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

Les articles publiés sur le site

  • Extract the time of the video with ffmpeg in Ubuntu

    6 mai 2017, par PHP Developer

    I am using Ubuntu 14.04.5 LTS 32 bit and ffmpeg to extract the time of a video.

    In Windows 10 the command works:

    /usr/bin/ffmpeg -i video.mp4 -vstats 2> & 1
    

    In Linux ffmpeg returns the error in red:

    At least one output file must be specified

    The error complete is here:

    ffmpeg version 2.4.3-1ubuntu1~trusty6 Copyright (c) 2000-2014 the FFmpeg developers
     built on Nov 22 2014 17:07:19 with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1) 
    configuration: --prefix=/usr --extra-version='1ubuntu1~trusty6' --build-suffix=-ffmpeg --toolchain=hardened
    --extra-cflags= --extra-cxxflags= --libdir=/usr/lib/i386-linux-gnu --shlibdir=/usr/lib/i386-linux-gnu --incdir=/
    usr/include/i386-linux-gnu --enable-gpl --enable-shared --disable-stripping --enable-avresample 
    --enable-avisynth --enable-fontconfig --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray 
    --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfreetype --enable-libfribidi
     --enable-libgme --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-libopus
    --enable-libpulse --enable-librtmp --enable-libschroedinger --enable-libshine --enable-libspeex --enable-libssh
    --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp
    --enable-opengl --enable-x11grab --enable-libxvid --enable-libx265 --enable-libdc1394 --enable-libiec61883
    --enable-libzvbi --enable-libzmq --enable-frei0r --enable-libx264 --enable-libsoxr --enable-openal
    --enable-libopencv  
    libavutil      54.  7.100 / 54.  7.100  
    libavcodec     56.  1.100 / 56.  1.100  
    libavformat    56.  4.101 / 56.  4.101  
    libavdevice    56.  0.100 / 56.  0.100  
    libavfilter     5.  1.100 /  5.  1.100  
    libavresample   2.  1.  0 /  2.  1.  0  
    libswscale      3.  0.100 /  3.  0.100  
    libswresample   1.  1.100 /  1.  1.100  
    libpostproc    53.  0.100 / 53.  0.100
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'video.mp4':  
    Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: mp41isom
    creation_time   : 2017-01-29 15:42:02
    location        : -21.6646-46.7394/
    location-eng    : -21.6646-46.7394/  
    Duration: 00:01:49.43, start: 0.000000, bitrate: 1171 kb/s
    Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv), 640x360 [SAR 1:1 DAR 16:9], 992 kb/s,
    15.01 fps, 15 tbr, 30k tbn, 60 tbc (default)
    Metadata:
      creation_time   : 2017-01-29 15:42:02
      handler_name    : VideoHandler
      encoder         : AVC Coding
    Stream #0:1(und): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 174 kb/s (default)
    Metadata:
      creation_time   : 2017-01-29 15:42:02
      handler_name    : SoundHandler
    At least one output file must be specified
    

    How can I fix this problem?

  • Fade out video/audio with FFMPEG

    6 mai 2017, par AleCaputo13

    i'm trying to simply fade out both video and audio of an input.mp4. The video lasts 00:29:59 (1799 sec) and i want to fade out the last sec. I'm using this command (it should just fadeout the video):

    ffmpeg -i input.mp4 -vf fade=t=out:st=1798:d=1 output.mp4

    but it always give me the same error:

    Too many packets buffered for output stream 0:1.
    [aac @ 0000000002605b60] Qavg: 2430.591
    [aac @ 0000000002605b60] 2 frames left in the queue on closing
    

    What am I doing wrong?

    EDIT: The file i was trying to edit was corrupted, with other files the filter works well :)

  • Convert compressed swf to mp4

    6 mai 2017, par skmvasu

    I'm looking for a batch script to convert swf to mp4, lossless. I tried using both ffmpeg and handbrake, but apparently swf is compressed and I can't convert them this way.

    ffmpeg -i input -c:v libx264 -preset ultrafast -qp 0 output.mkv
    
    HandBrakeCLI -i source -o destination
    

    I know I acn use a tool like xilisoft, but I've more than 3000 videos and would need to run this automatically. Is there a script/ algorithm that can help me automate this process?

  • ffmpeg convert vp9 video to mp4

    6 mai 2017, par Sulli

    I am using this command

    ffmpeg -i $youtubeUrl -strict -2 -c copy output.mp4
    

    (with $youtubeUrl generated by youtube-dl) to download this youtube video : https://www.youtube.com/watch?v=wnCJhq-JOck

    I can't play the downloaded video though on Ubuntu or Windows (for a problem of vp09 codec) and I have to convert the video to webm and then back to mp4 to be able to play it:

    ffmpeg -i output.mp4 -vcodec libvpx-vp9 -strict experimental output_2.webm
    ffmpeg -i output_2.webm -strict 2 output_3.mp4
    

    This happens only with some youtube videos, not all of them.

    Is there a way to download all youtube videos in a readable format with only one command line, without having to convert to webm?

  • Why are Cb and Cr planes displaced differently from lum by the displace complex filter in ffmpeg ?

    6 mai 2017, par Neb

    I have a video encoded with the yuv420p pixel format and I want to displace its pixels. I'm using ffmpeg and its new displace filter. The filter takes as inputs (the video to be displaced and) two displacement maps respectively for X and Y axis. I decided to create the displacement maps directly into ffmpeg using the nullsrc video source filter and the geq filter to specify the value of the three planes: lum, Cb, Cr. The script is the following:

    ffmpeg INPUT.mp4 -f lavfi -i nullsrc=size=${WIDTH}x${HEIGHT}:d=0.1,geq='lum=128+30*sin(2*PI*X/400):Cb=128+30*sin(2*PI*X/400):Cr='128+30*sin(2*PI*X/400)' -f lavfi -i nullsrc=size=${WIDTH}x${HEIGHT}:d=0.1,geq='lum=128+30*sin(2*PI*X/400):Cb=128+30*sin(2*PI*X/400):Cr=128+30*sin(2*PI*X/400)' -lavfi '[0][1][2]displace' OUTPUT.mp4
    

    I used the example provided in the documentation of ffmpeg, since the expression used in geq is irrelevant for the purposes of the problem.

    At the and of the computation, I get the pixels of the input video not properly displaced, meaning that I can clearly see a sort of ghost carrying-color-information video under a displaced but b/w one. After some tests, I noticed that the displacemnt map created had only the luma plane displaced correctly while the chrominance planes were displaced, but differently from luma, which is the origin of the planes disalignment in the intput video as you can see in the following extract frames:

    Planes separated

    I also noticed that the video describing the Cb and Cr planes of the displacement maps have half resolution of the luma plane.

    My question is: how can i setup correctly the Cr and Cb planes in the geq definition so that they are exactly identical to the luma plane?

    It would be also great if someone could explain me why ffmpeg gives me an output so much different for luma and Cb, Cr planes even if the function provided is the same.

    If, it can help, i'm using ffmpeg 3.3-static build.

    Thanks for your time.