Newest 'ffmpeg' Questions - Stack Overflow

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

Les articles publiés sur le site

  • ffmpeg : -copyts makes -t stop at timestamps, not duration

    30 juillet 2017, par arielCo

    From

    -t duration (input/output)
    

    When used as an input option (before -i), limit the duration of data read from the input file.

    When used as an output option (before an output url), stop writing the output after its duration reaches duration.

    So this should yield a 1-minute file with timestamps starting at 1:49, right?

    ffmpeg -y -copyts -ss 1:49 -i ~/Videos/input.mkv -c copy -t 1:00 timing-1m49s.mkv 
    ffmpeg version 3.3.2 Copyright (c) 2000-2017 the FFmpeg developers
      built with gcc 7 (SUSE Linux)
      configuration: --prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/lib64 --incdir=/usr/include/ffmpeg --extra-cflags='-fmessage-length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -g' --optflags='-fmessage-length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -g' --disable-htmlpages --enable-pic --disable-stripping --enable-shared --disable-static --enable-gpl --disable-openssl --enable-avresample --enable-libcdio --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libcelt --enable-libcdio --enable-libdc1394 --enable-libfreetype --enable-libgsm --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libwebp --enable-netcdf --enable-vaapi --enable-vdpau --enable-libfdk_aac --enable-nonfree --enable-libmp3lame --enable-libtwolame --enable-libx264 --enable-libx265 --enable-libxvid
      libavutil      55. 58.100 / 55. 58.100
      libavcodec     57. 89.100 / 57. 89.100
      libavformat    57. 71.100 / 57. 71.100
      libavdevice    57.  6.100 / 57.  6.100
      libavfilter     6. 82.100 /  6. 82.100
      libavresample   3.  5.  0 /  3.  5.  0
      libswscale      4.  6.100 /  4.  6.100
      libswresample   2.  7.100 /  2.  7.100
      libpostproc    54.  5.100 / 54.  5.100
    Input #0, matroska,webm, from '/home/ariel/Videos/input.mkv':
      Metadata:
        encoder         : libebml v0.7.7 + libmatroska v0.8.0
        creation_time   : 2006-07-20T03:07:03.000000Z
      Duration: 00:23:57.06, start: 0.000000, bitrate: 1983 kb/s
        Stream #0:0: Video: h264 (High), yuv420p(progressive), 720x480, SAR 37:30 DAR 37:20, 29.97 fps, 29.97 tbr, 1k tbn, 59.94 tbc (default)
        Stream #0:1(eng): Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s (default)
        Stream #0:2(jpn): Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s
        Stream #0:3(eng): Subtitle: dvd_subtitle, 720x480 (default)
        Metadata:
          title           : English Audio
        Stream #0:4(eng): Subtitle: dvd_subtitle, 720x480
        Metadata:
          title           : Japanese Audio
    Output #0, matroska, to 'timing-1m49s.mkv':
      Metadata:
        encoder         : Lavf57.71.100
        Stream #0:0: Video: h264 (High) (H264 / 0x34363248), yuv420p(progressive), 720x480 [SAR 37:30 DAR 37:20], q=2-31, 29.97 fps, 29.97 tbr, 1k tbn, 1k tbc (default)
        Stream #0:1(eng): Audio: ac3 ([0] [0][0] / 0x2000), 48000 Hz, stereo, fltp, 192 kb/s (default)
    Stream mapping:
      Stream #0:0 -> #0:0 (copy)
      Stream #0:1 -> #0:1 (copy)
    Press [q] to stop, [?] for help
    frame=    0 fps=0.0 q=-1.0 Lsize=       1kB time=00:00:00.00 bitrate=N/A speed=   0x    
    video:0kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
    

    Wrong. It outputs a file with no frames:

    -rwxrwx--- 1 root users 805 Jul 30 01:36 timing-1m49s.mkv
    

    I have to specify -t 1:49 or more, and e.g. -t 1:55 produces a 6-second file that starts at 0:00 and according to the metadata should last 1:55.

    I arrived at this point trying to extract a clip and add subtitles in the same command, but this minimal case looks to me contrary to the documentation.

  • FFmpeg concat audio with video or gif looping

    30 juillet 2017, par Evandro Klimpel Balmant

    I'm looking for a solution in FFmpeg to merge audio (mp3) with a short video loop, or gif.

    I've already been able to generate a video from an image by joining with audio, but the video stays static frame for the audio duration, the command to make this:

    ffmpeg -loop 1 -i imagem.jpg -i audio.mp3 -vcodec h264 -tune stillimage -acodec aac -b:a 64k -pix_fmt yuv420p -shortest video.mp4
    

    I need video that has the duration of the audio, but that uses a loop of another mp4 or a gif. To keep repeating for the duration of the audio.

  • Overlay Image on moving object in Video (Argumented Reality / OpenCv)

    30 juillet 2017, par Karandeep Atwal

    I am using FFmpeg to overlay image/emoji on video by this command -

    "-i "+inputfilePath+" -filter_complex "+"[0][1]overlay=enable='between(t,"+startTime+","+endTime+")'[v1]"+" -map [v0] -map 0:a "+OutputfilePath;  
    

    But above command only overlay image over video and stays still.

    In Instagram and Snapchat there is New pin feature. I want exactly same ,eg blur on moving faces or as in below videos -

    enter image description here

    Here is link.

    Is it possible via FFmpeg?

    I think someone with OPENCV or Argumented Reality knowledge can help in this. It is quiet similar to AR as we need to move/zoom emoji exactly where we want to on video/live cam.

  • Adding Color Flags with ffmpeg

    29 juillet 2017, par user3534226

    If I have a video which lacks color space flags, specifically:

    Color primaries

    Transfer characteristics

    Matrix coefficients

    can I use ffmpeg to add these flags without re-encoding the entire video?

    Thank you.

  • Using ffmpeg with vid.stab on Ubuntu 17.06

    29 juillet 2017, par Andreas Mueller

    I'm trying to use ffmpeg with vid.stab on Ubuntu 17.04 as described here. However, it seems like there is no ppa for 17.04, so I was trying to build from source following these instructions.

    I was able to build ffmpeg and vid.stab from the git repositories, but I was not able to install the ffmpeg debian package that was created. The package has file conflicts with the libavcodec57 package (both contain libavcodec.so.57), so I tried uninstalling that. But ffmpeg also has a dependency on libchromaprint1 which in turn depends on libavcodec57. So there seems to be no way to fulfill the package requirements.

    Any help compiling or even better, pointers to pre-compiled packages would be much appreciated.