Overlay video as a background

Examples and samples for those who develop software with FFmpeg.
badrut
Posts: 11
Joined: Thu Nov 19, 2015 1:10 pm

Re: Overlay video as a background

Post by badrut » Tue Dec 01, 2015 3:04 am

sorry :) this is my command that I've tried

Code: Select all

ffmpeg -i fmd.mp4 -i img.jpg -i img2.jpg -filter_complex "[1:v]scale=1280:-1[top];[2:v]scale=1280:-1[bottom];[top][0:v][bottom]vstack=inputs=3[v]" -map "[v]" -map 0:a FMD2.mp4 

llogan
Posts: 332
Joined: Fri Mar 14, 2014 3:29 am

Re: Overlay video as a background

Post by llogan » Tue Dec 01, 2015 3:54 am

The complete console output from that command is missing.

badrut
Posts: 11
Joined: Thu Nov 19, 2015 1:10 pm

Re: Overlay video as a background

Post by badrut » Tue Dec 01, 2015 3:03 pm

llogan wrote:The complete console output from that command is missing.
could you please give the correct command?

llogan
Posts: 332
Joined: Fri Mar 14, 2014 3:29 am

Re: Overlay video as a background

Post by llogan » Tue Dec 01, 2015 5:21 pm

I can't because I'm waiting for you to provide all of the information I requested.

badrut
Posts: 11
Joined: Thu Nov 19, 2015 1:10 pm

Re: Overlay video as a background

Post by badrut » Wed Dec 02, 2015 5:34 pm

sorry to make you wait, do you mean by this

Code: Select all

C:\Users\Burhan\Documents>ffmpeg -i dbs21.mkv -i imgg.jpg -i img3.jpg -filter_co
mplex "[1:v]scale=1280:-1[top];[2:v]scale=1280:-1[bottom];[top][0:v][bottom]vsta
ck=inputs=3[v]" -map "[v]" -map 0:a myvid.mkv
ffmpeg version N-76041-g0418541 Copyright (c) 2000-2015 the FFmpeg developers
  built with gcc 5.2.0 (GCC)
  configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-av
isynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enab
le-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --
enable-libdcadec --enable-libfreetype --enable-libgme --enable-libgsm --enable-l
ibilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enab
le-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --en
able-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --ena
ble-libtwolame --enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc
 --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enabl
e-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-lzma --ena
ble-decklink --enable-zlib
  libavutil      55.  4.100 / 55.  4.100
  libavcodec     57.  6.100 / 57.  6.100
  libavformat    57.  4.100 / 57.  4.100
  libavdevice    57.  0.100 / 57.  0.100
  libavfilter     6. 11.100 /  6. 11.100
  libswscale      4.  0.100 /  4.  0.100
  libswresample   2.  0.100 /  2.  0.100
  libpostproc    54.  0.100 / 54.  0.100
Input #0, matroska,webm, from 'dbs21.mkv':
  Metadata:
    encoder         : libebml v1.3.1 + libmatroska v1.4.2
    creation_time   : 2015-11-29 06:27:06
  Duration: 00:23:24.53, start: 0.000000, bitrate: 722 kb/s
    Stream #0:0: Video: h264 (High), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 23.98
 fps, 23.98 tbr, 1k tbn, 47.95 tbc (default)
    Metadata:
      BPS             : 688571
      BPS-eng         : 688571
      DURATION        : 00:23:24.528000000
      DURATION-eng    : 00:23:24.528000000
      NUMBER_OF_FRAMES: 33675
      NUMBER_OF_FRAMES-eng: 33675
      NUMBER_OF_BYTES : 120889675
      NUMBER_OF_BYTES-eng: 120889675
      _STATISTICS_WRITING_APP: mkvmerge v7.7.0 ('Six Voices') 32bit built on Feb
 28 2015 23:23:00
      _STATISTICS_WRITING_APP-eng: mkvmerge v7.7.0 ('Six Voices') 32bit built on
 Feb 28 2015 23:23:00
      _STATISTICS_WRITING_DATE_UTC: 2015-11-29 06:27:06
      _STATISTICS_WRITING_DATE_UTC-eng: 2015-11-29 06:27:06
      _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
    Stream #0:1: Audio: aac (HE-AAC), 48000 Hz, stereo, fltp (default)
    Metadata:
      BPS             : 32011
      BPS-eng         : 32011
      DURATION        : 00:23:24.502000000
      DURATION-eng    : 00:23:24.502000000
      NUMBER_OF_FRAMES: 32918
      NUMBER_OF_FRAMES-eng: 32918
      NUMBER_OF_BYTES : 5620109
      NUMBER_OF_BYTES-eng: 5620109
      _STATISTICS_WRITING_APP: mkvmerge v7.7.0 ('Six Voices') 32bit built on Feb
 28 2015 23:23:00
      _STATISTICS_WRITING_APP-eng: mkvmerge v7.7.0 ('Six Voices') 32bit built on
 Feb 28 2015 23:23:00
      _STATISTICS_WRITING_DATE_UTC: 2015-11-29 06:27:06
      _STATISTICS_WRITING_DATE_UTC-eng: 2015-11-29 06:27:06
      _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
Input #1, image2, from 'imgg.jpg':
  Duration: 00:00:00.04, start: 0.000000, bitrate: 477209 kb/s
    Stream #1:0: Video: mjpeg, yuvj420p(pc, bt470bg/unknown/unknown), 2557x1108
[SAR 96:96 DAR 2557:1108], 25 tbr, 25 tbn, 25 tbc
Input #2, image2, from 'img3.jpg':
  Duration: 00:00:00.04, start: 0.000000, bitrate: 19217 kb/s
    Stream #2:0: Video: mjpeg, yuvj420p(pc, bt470bg/unknown/unknown), 1366x768 [
SAR 96:96 DAR 683:384], 25 tbr, 25 tbn, 25 tbc
[swscaler @ 00000000024a4b40] deprecated pixel format used, make sure you did se
t range correctly
[swscaler @ 0000000002510ea0] deprecated pixel format used, make sure you did se
t range correctly
[libx264 @ 0000000000506520] height not divisible by 2 (1280x1995)
Output #0, matroska, to 'myvid.mkv':
  Metadata:
    encoder         : libebml v1.3.1 + libmatroska v1.4.2
    Stream #0:0: Video: h264, none, q=2-31, 128 kb/s, SAR 283827:283648 DAR 0:0,
 25 fps (default)
    Metadata:
      encoder         : Lavc57.6.100 libx264
    Stream #0:1: Audio: vorbis, 0 channels, 128 kb/s (default)
    Metadata:
      BPS             : 32011
      BPS-eng         : 32011
      DURATION        : 00:23:24.502000000
      DURATION-eng    : 00:23:24.502000000
      NUMBER_OF_FRAMES: 32918
      NUMBER_OF_FRAMES-eng: 32918
      NUMBER_OF_BYTES : 5620109
      NUMBER_OF_BYTES-eng: 5620109
      _STATISTICS_WRITING_APP: mkvmerge v7.7.0 ('Six Voices') 32bit built on Feb
 28 2015 23:23:00
      _STATISTICS_WRITING_APP-eng: mkvmerge v7.7.0 ('Six Voices') 32bit built on
 Feb 28 2015 23:23:00
      _STATISTICS_WRITING_DATE_UTC: 2015-11-29 06:27:06
      _STATISTICS_WRITING_DATE_UTC-eng: 2015-11-29 06:27:06
      _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      encoder         : Lavc57.6.100 libvorbis
Stream mapping:
  Stream #0:0 (h264) -> vstack:input1 (graph 0)
  Stream #1:0 (mjpeg) -> scale (graph 0)
  Stream #2:0 (mjpeg) -> scale (graph 0)
  vstack (graph 0) -> Stream #0:0 (libx264)
  Stream #0:1 -> #0:1 (aac (native) -> vorbis (libvorbis))
Error while opening encoder for output stream #0:0 - maybe incorrect parameters
such as bit_rate, rate, width or height

C:\Users\Burhan\Documents>
imgg.jpg is top image
img3.jpg is bottom image
dbs21.mkv is my video
myvid.mkv is my output/result

Post Reply