Not able to scale, pad and combine 2 videos using FFmpeg












0















I am using FFMpeg to scale, pad and merge 2 videos and generate one mp4 file. I am using the following command which leads to an output file with no audio for few seconds in the middle of the second video. Also, there is a faint white border displayed for few seconds on the black frame that I am creating. Though there are no errors in the command but I am getting a warning "[swscaler @ 0x6987800] Warning: data is not aligned! This can lead to a speed loss".



I checked other posts here and tried the solutions provided but it didn't work for me. It would be great if some one can help point out what I am missing.



Thanks in advance.



Here is the command:



ffmpeg -i 1_a.opus -i 2_a.opus -itsoffset 0.024181 -i 01_v.webm -itsoffset 0.113192 -i 02_v.webm -filter_complex 
"[1:a]adelay=15726.168|15726.168[a1];
[0:a][a1]amix;
[3:v]trim=0:15.726168,geq=0:128:128[silence];
[3:v]fifo[3v];
[silence][3v]concat[3_v_silence];
[3_v_silence]scale=-1:240[3v_scaled_240];
[3v_scaled_240]pad=width=320:height=240:x=(320-in_w)/2:y=(240-in_h)/2:color=black[3v_padded];
[2:v]scale=-1:240[2v_scaled_240];
[2v_scaled_240]pad=width=320:height=240:x=(320-in_w)/2:y=(240-in_h)/2:color=black[2v_padded];
[2v_padded]fifo[2v];
[2v][3v_padded]hstack[out_v];
[out_v]pad=width=640:height=480:x=(640-in_w)/2:y=(480-in_h)/2:color=black"
-crf 40 -preset ultrafast -y -r pal out.mp4


Console output:



ffmpeg version 4.0.2-static https://johnvansickle.com/ffmpeg/  Copyright (c) 2000-2018 the FFmpeg developers
built with gcc 6.3.0 (Debian 6.3.0-18+deb9u1) 20170516
configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc-6 --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gray --enable-libaom --enable-libfribidi --enable-libass --enable-libvmaf --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librubberband --enable-libsoxr --enable-libspeex --enable-libvorbis --enable-libopus --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg
libavutil 56. 14.100 / 56. 14.100
libavcodec 58. 18.100 / 58. 18.100
libavformat 58. 12.100 / 58. 12.100
libavdevice 58. 3.100 / 58. 3.100
libavfilter 7. 16.100 / 7. 16.100
libswscale 5. 1.100 / 5. 1.100
libswresample 3. 1.100 / 3. 1.100
libpostproc 55. 1.100 / 55. 1.100
Input #0, ogg, from '1_a.opus':
Duration: 00:01:03.82, start: -0.020000, bitrate: 37 kb/s
Stream #0:0: Audio: opus, 48000 Hz, stereo, fltp
Input #1, ogg, from '2_a.opus':
Duration: 00:00:52.40, start: -0.020000, bitrate: 44 kb/s
Stream #1:0: Audio: opus, 48000 Hz, stereo, fltp
Input #2, matroska,webm, from '01_v.webm':
Metadata:
encoder : Lavf56.40.101
Duration: 00:01:03.83, start: 0.000000, bitrate: 202 kb/s
Stream #2:0: Video: vp8, yuv420p(progressive), 640x480, SAR 1:1 DAR 4:3, 333 fps, 333 tbr, 1k tbn, 1k tbc (default)
Input #3, matroska,webm, from '02_v.webm':
Metadata:
encoder : Lavf56.40.101
Duration: 00:00:52.34, start: 0.000000, bitrate: 200 kb/s
Stream #3:0: Video: vp8, yuv420p(progressive), 480x640, SAR 1:1 DAR 3:4, 25 fps, 25 tbr, 1k tbn, 1k tbc (default)
Stream mapping:
Stream #0:0 (opus) -> amix:input0
Stream #1:0 (opus) -> adelay
Stream #2:0 (vp8) -> scale
Stream #3:0 (vp8) -> trim
Stream #3:0 (vp8) -> fifo
amix -> Stream #0:0 (aac)
pad -> Stream #0:1 (libx264)
Press [q] to stop, [?] for help
[swscaler @ 0x6484740] Warning: data is not aligned! This can lead to a speed loss
[libx264 @ 0x63a0d40] using SAR=1/1
[libx264 @ 0x63a0d40] using cpu capabilities: MMX2 SSE2Fast SSSE3 Cache64 SlowShuffle
[libx264 @ 0x63a0d40] profile Constrained Baseline, level 3.0
[libx264 @ 0x63a0d40] 264 - core 155 r2901 7d0ff22 - H.264/MPEG-4 AVC codec - Copyleft 2003-2018 - http://www.videolan.org/x264.html - options: cabac=0 ref=1 deblock=0:0:0 analyse=0:0 me=dia subme=0 psy=1 psy_rd=1.00:0.00 mixed_ref=0 me_range=16 chroma_me=1 trellis=1 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=0 threads=3 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0 weightp=0 keyint=250 keyint_min=25 scenecut=0 intra_refresh=0 rc=crf mbtree=0 crf=40.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=0
Output #0, mp4, to 'out.mp4':
Metadata:
encoder : Lavf58.12.100
Stream #0:0: Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s (default)
Metadata:
encoder : Lavc58.18.100 aac
Stream #0:1: Video: h264 (libx264) (avc1 / 0x31637661), yuv420p, 640x480 [SAR 1:1 DAR 4:3], q=-1--1, 25 fps, 12800 tbn, 25 tbc (default)
Metadata:
encoder : Lavc58.18.100 libx264
Side data:
cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
frame= 1598 fps=131 q=-1.0 Lsize= 1375kB time=00:01:08.16 bitrate= 165.3kbits/s dup=2 drop=1047 speed=5.57x
video:455kB audio:883kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 2.787654%
[aac @ 0x63a31c0] Qavg: 32520.934
[libx264 @ 0x63a0d40] frame I:7 Avg QP:32.00 size: 5746
[libx264 @ 0x63a0d40] frame P:1591 Avg QP:33.93 size: 267
[libx264 @ 0x63a0d40] mb I I16..4: 100.0% 0.0% 0.0%
[libx264 @ 0x63a0d40] mb P I16..4: 0.3% 0.0% 0.0% P16..4: 4.2% 0.0% 0.0% 0.0% 0.0% skip:95.5%
[libx264 @ 0x63a0d40] coded y,uvDC,uvAC intra: 21.3% 18.9% 3.0% inter: 1.1% 0.5% 0.0%
[libx264 @ 0x63a0d40] i16 v,h,dc,p: 54% 27% 11% 9%
[libx264 @ 0x63a0d40] i8c dc,h,v,p: 69% 17% 10% 4%
[libx264 @ 0x63a0d40] kb/s:58.22









share|improve this question





























    0















    I am using FFMpeg to scale, pad and merge 2 videos and generate one mp4 file. I am using the following command which leads to an output file with no audio for few seconds in the middle of the second video. Also, there is a faint white border displayed for few seconds on the black frame that I am creating. Though there are no errors in the command but I am getting a warning "[swscaler @ 0x6987800] Warning: data is not aligned! This can lead to a speed loss".



    I checked other posts here and tried the solutions provided but it didn't work for me. It would be great if some one can help point out what I am missing.



    Thanks in advance.



    Here is the command:



    ffmpeg -i 1_a.opus -i 2_a.opus -itsoffset 0.024181 -i 01_v.webm -itsoffset 0.113192 -i 02_v.webm -filter_complex 
    "[1:a]adelay=15726.168|15726.168[a1];
    [0:a][a1]amix;
    [3:v]trim=0:15.726168,geq=0:128:128[silence];
    [3:v]fifo[3v];
    [silence][3v]concat[3_v_silence];
    [3_v_silence]scale=-1:240[3v_scaled_240];
    [3v_scaled_240]pad=width=320:height=240:x=(320-in_w)/2:y=(240-in_h)/2:color=black[3v_padded];
    [2:v]scale=-1:240[2v_scaled_240];
    [2v_scaled_240]pad=width=320:height=240:x=(320-in_w)/2:y=(240-in_h)/2:color=black[2v_padded];
    [2v_padded]fifo[2v];
    [2v][3v_padded]hstack[out_v];
    [out_v]pad=width=640:height=480:x=(640-in_w)/2:y=(480-in_h)/2:color=black"
    -crf 40 -preset ultrafast -y -r pal out.mp4


    Console output:



    ffmpeg version 4.0.2-static https://johnvansickle.com/ffmpeg/  Copyright (c) 2000-2018 the FFmpeg developers
    built with gcc 6.3.0 (Debian 6.3.0-18+deb9u1) 20170516
    configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc-6 --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gray --enable-libaom --enable-libfribidi --enable-libass --enable-libvmaf --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librubberband --enable-libsoxr --enable-libspeex --enable-libvorbis --enable-libopus --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg
    libavutil 56. 14.100 / 56. 14.100
    libavcodec 58. 18.100 / 58. 18.100
    libavformat 58. 12.100 / 58. 12.100
    libavdevice 58. 3.100 / 58. 3.100
    libavfilter 7. 16.100 / 7. 16.100
    libswscale 5. 1.100 / 5. 1.100
    libswresample 3. 1.100 / 3. 1.100
    libpostproc 55. 1.100 / 55. 1.100
    Input #0, ogg, from '1_a.opus':
    Duration: 00:01:03.82, start: -0.020000, bitrate: 37 kb/s
    Stream #0:0: Audio: opus, 48000 Hz, stereo, fltp
    Input #1, ogg, from '2_a.opus':
    Duration: 00:00:52.40, start: -0.020000, bitrate: 44 kb/s
    Stream #1:0: Audio: opus, 48000 Hz, stereo, fltp
    Input #2, matroska,webm, from '01_v.webm':
    Metadata:
    encoder : Lavf56.40.101
    Duration: 00:01:03.83, start: 0.000000, bitrate: 202 kb/s
    Stream #2:0: Video: vp8, yuv420p(progressive), 640x480, SAR 1:1 DAR 4:3, 333 fps, 333 tbr, 1k tbn, 1k tbc (default)
    Input #3, matroska,webm, from '02_v.webm':
    Metadata:
    encoder : Lavf56.40.101
    Duration: 00:00:52.34, start: 0.000000, bitrate: 200 kb/s
    Stream #3:0: Video: vp8, yuv420p(progressive), 480x640, SAR 1:1 DAR 3:4, 25 fps, 25 tbr, 1k tbn, 1k tbc (default)
    Stream mapping:
    Stream #0:0 (opus) -> amix:input0
    Stream #1:0 (opus) -> adelay
    Stream #2:0 (vp8) -> scale
    Stream #3:0 (vp8) -> trim
    Stream #3:0 (vp8) -> fifo
    amix -> Stream #0:0 (aac)
    pad -> Stream #0:1 (libx264)
    Press [q] to stop, [?] for help
    [swscaler @ 0x6484740] Warning: data is not aligned! This can lead to a speed loss
    [libx264 @ 0x63a0d40] using SAR=1/1
    [libx264 @ 0x63a0d40] using cpu capabilities: MMX2 SSE2Fast SSSE3 Cache64 SlowShuffle
    [libx264 @ 0x63a0d40] profile Constrained Baseline, level 3.0
    [libx264 @ 0x63a0d40] 264 - core 155 r2901 7d0ff22 - H.264/MPEG-4 AVC codec - Copyleft 2003-2018 - http://www.videolan.org/x264.html - options: cabac=0 ref=1 deblock=0:0:0 analyse=0:0 me=dia subme=0 psy=1 psy_rd=1.00:0.00 mixed_ref=0 me_range=16 chroma_me=1 trellis=1 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=0 threads=3 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0 weightp=0 keyint=250 keyint_min=25 scenecut=0 intra_refresh=0 rc=crf mbtree=0 crf=40.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=0
    Output #0, mp4, to 'out.mp4':
    Metadata:
    encoder : Lavf58.12.100
    Stream #0:0: Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s (default)
    Metadata:
    encoder : Lavc58.18.100 aac
    Stream #0:1: Video: h264 (libx264) (avc1 / 0x31637661), yuv420p, 640x480 [SAR 1:1 DAR 4:3], q=-1--1, 25 fps, 12800 tbn, 25 tbc (default)
    Metadata:
    encoder : Lavc58.18.100 libx264
    Side data:
    cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
    frame= 1598 fps=131 q=-1.0 Lsize= 1375kB time=00:01:08.16 bitrate= 165.3kbits/s dup=2 drop=1047 speed=5.57x
    video:455kB audio:883kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 2.787654%
    [aac @ 0x63a31c0] Qavg: 32520.934
    [libx264 @ 0x63a0d40] frame I:7 Avg QP:32.00 size: 5746
    [libx264 @ 0x63a0d40] frame P:1591 Avg QP:33.93 size: 267
    [libx264 @ 0x63a0d40] mb I I16..4: 100.0% 0.0% 0.0%
    [libx264 @ 0x63a0d40] mb P I16..4: 0.3% 0.0% 0.0% P16..4: 4.2% 0.0% 0.0% 0.0% 0.0% skip:95.5%
    [libx264 @ 0x63a0d40] coded y,uvDC,uvAC intra: 21.3% 18.9% 3.0% inter: 1.1% 0.5% 0.0%
    [libx264 @ 0x63a0d40] i16 v,h,dc,p: 54% 27% 11% 9%
    [libx264 @ 0x63a0d40] i8c dc,h,v,p: 69% 17% 10% 4%
    [libx264 @ 0x63a0d40] kb/s:58.22









    share|improve this question



























      0












      0








      0








      I am using FFMpeg to scale, pad and merge 2 videos and generate one mp4 file. I am using the following command which leads to an output file with no audio for few seconds in the middle of the second video. Also, there is a faint white border displayed for few seconds on the black frame that I am creating. Though there are no errors in the command but I am getting a warning "[swscaler @ 0x6987800] Warning: data is not aligned! This can lead to a speed loss".



      I checked other posts here and tried the solutions provided but it didn't work for me. It would be great if some one can help point out what I am missing.



      Thanks in advance.



      Here is the command:



      ffmpeg -i 1_a.opus -i 2_a.opus -itsoffset 0.024181 -i 01_v.webm -itsoffset 0.113192 -i 02_v.webm -filter_complex 
      "[1:a]adelay=15726.168|15726.168[a1];
      [0:a][a1]amix;
      [3:v]trim=0:15.726168,geq=0:128:128[silence];
      [3:v]fifo[3v];
      [silence][3v]concat[3_v_silence];
      [3_v_silence]scale=-1:240[3v_scaled_240];
      [3v_scaled_240]pad=width=320:height=240:x=(320-in_w)/2:y=(240-in_h)/2:color=black[3v_padded];
      [2:v]scale=-1:240[2v_scaled_240];
      [2v_scaled_240]pad=width=320:height=240:x=(320-in_w)/2:y=(240-in_h)/2:color=black[2v_padded];
      [2v_padded]fifo[2v];
      [2v][3v_padded]hstack[out_v];
      [out_v]pad=width=640:height=480:x=(640-in_w)/2:y=(480-in_h)/2:color=black"
      -crf 40 -preset ultrafast -y -r pal out.mp4


      Console output:



      ffmpeg version 4.0.2-static https://johnvansickle.com/ffmpeg/  Copyright (c) 2000-2018 the FFmpeg developers
      built with gcc 6.3.0 (Debian 6.3.0-18+deb9u1) 20170516
      configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc-6 --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gray --enable-libaom --enable-libfribidi --enable-libass --enable-libvmaf --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librubberband --enable-libsoxr --enable-libspeex --enable-libvorbis --enable-libopus --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg
      libavutil 56. 14.100 / 56. 14.100
      libavcodec 58. 18.100 / 58. 18.100
      libavformat 58. 12.100 / 58. 12.100
      libavdevice 58. 3.100 / 58. 3.100
      libavfilter 7. 16.100 / 7. 16.100
      libswscale 5. 1.100 / 5. 1.100
      libswresample 3. 1.100 / 3. 1.100
      libpostproc 55. 1.100 / 55. 1.100
      Input #0, ogg, from '1_a.opus':
      Duration: 00:01:03.82, start: -0.020000, bitrate: 37 kb/s
      Stream #0:0: Audio: opus, 48000 Hz, stereo, fltp
      Input #1, ogg, from '2_a.opus':
      Duration: 00:00:52.40, start: -0.020000, bitrate: 44 kb/s
      Stream #1:0: Audio: opus, 48000 Hz, stereo, fltp
      Input #2, matroska,webm, from '01_v.webm':
      Metadata:
      encoder : Lavf56.40.101
      Duration: 00:01:03.83, start: 0.000000, bitrate: 202 kb/s
      Stream #2:0: Video: vp8, yuv420p(progressive), 640x480, SAR 1:1 DAR 4:3, 333 fps, 333 tbr, 1k tbn, 1k tbc (default)
      Input #3, matroska,webm, from '02_v.webm':
      Metadata:
      encoder : Lavf56.40.101
      Duration: 00:00:52.34, start: 0.000000, bitrate: 200 kb/s
      Stream #3:0: Video: vp8, yuv420p(progressive), 480x640, SAR 1:1 DAR 3:4, 25 fps, 25 tbr, 1k tbn, 1k tbc (default)
      Stream mapping:
      Stream #0:0 (opus) -> amix:input0
      Stream #1:0 (opus) -> adelay
      Stream #2:0 (vp8) -> scale
      Stream #3:0 (vp8) -> trim
      Stream #3:0 (vp8) -> fifo
      amix -> Stream #0:0 (aac)
      pad -> Stream #0:1 (libx264)
      Press [q] to stop, [?] for help
      [swscaler @ 0x6484740] Warning: data is not aligned! This can lead to a speed loss
      [libx264 @ 0x63a0d40] using SAR=1/1
      [libx264 @ 0x63a0d40] using cpu capabilities: MMX2 SSE2Fast SSSE3 Cache64 SlowShuffle
      [libx264 @ 0x63a0d40] profile Constrained Baseline, level 3.0
      [libx264 @ 0x63a0d40] 264 - core 155 r2901 7d0ff22 - H.264/MPEG-4 AVC codec - Copyleft 2003-2018 - http://www.videolan.org/x264.html - options: cabac=0 ref=1 deblock=0:0:0 analyse=0:0 me=dia subme=0 psy=1 psy_rd=1.00:0.00 mixed_ref=0 me_range=16 chroma_me=1 trellis=1 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=0 threads=3 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0 weightp=0 keyint=250 keyint_min=25 scenecut=0 intra_refresh=0 rc=crf mbtree=0 crf=40.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=0
      Output #0, mp4, to 'out.mp4':
      Metadata:
      encoder : Lavf58.12.100
      Stream #0:0: Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s (default)
      Metadata:
      encoder : Lavc58.18.100 aac
      Stream #0:1: Video: h264 (libx264) (avc1 / 0x31637661), yuv420p, 640x480 [SAR 1:1 DAR 4:3], q=-1--1, 25 fps, 12800 tbn, 25 tbc (default)
      Metadata:
      encoder : Lavc58.18.100 libx264
      Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
      frame= 1598 fps=131 q=-1.0 Lsize= 1375kB time=00:01:08.16 bitrate= 165.3kbits/s dup=2 drop=1047 speed=5.57x
      video:455kB audio:883kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 2.787654%
      [aac @ 0x63a31c0] Qavg: 32520.934
      [libx264 @ 0x63a0d40] frame I:7 Avg QP:32.00 size: 5746
      [libx264 @ 0x63a0d40] frame P:1591 Avg QP:33.93 size: 267
      [libx264 @ 0x63a0d40] mb I I16..4: 100.0% 0.0% 0.0%
      [libx264 @ 0x63a0d40] mb P I16..4: 0.3% 0.0% 0.0% P16..4: 4.2% 0.0% 0.0% 0.0% 0.0% skip:95.5%
      [libx264 @ 0x63a0d40] coded y,uvDC,uvAC intra: 21.3% 18.9% 3.0% inter: 1.1% 0.5% 0.0%
      [libx264 @ 0x63a0d40] i16 v,h,dc,p: 54% 27% 11% 9%
      [libx264 @ 0x63a0d40] i8c dc,h,v,p: 69% 17% 10% 4%
      [libx264 @ 0x63a0d40] kb/s:58.22









      share|improve this question
















      I am using FFMpeg to scale, pad and merge 2 videos and generate one mp4 file. I am using the following command which leads to an output file with no audio for few seconds in the middle of the second video. Also, there is a faint white border displayed for few seconds on the black frame that I am creating. Though there are no errors in the command but I am getting a warning "[swscaler @ 0x6987800] Warning: data is not aligned! This can lead to a speed loss".



      I checked other posts here and tried the solutions provided but it didn't work for me. It would be great if some one can help point out what I am missing.



      Thanks in advance.



      Here is the command:



      ffmpeg -i 1_a.opus -i 2_a.opus -itsoffset 0.024181 -i 01_v.webm -itsoffset 0.113192 -i 02_v.webm -filter_complex 
      "[1:a]adelay=15726.168|15726.168[a1];
      [0:a][a1]amix;
      [3:v]trim=0:15.726168,geq=0:128:128[silence];
      [3:v]fifo[3v];
      [silence][3v]concat[3_v_silence];
      [3_v_silence]scale=-1:240[3v_scaled_240];
      [3v_scaled_240]pad=width=320:height=240:x=(320-in_w)/2:y=(240-in_h)/2:color=black[3v_padded];
      [2:v]scale=-1:240[2v_scaled_240];
      [2v_scaled_240]pad=width=320:height=240:x=(320-in_w)/2:y=(240-in_h)/2:color=black[2v_padded];
      [2v_padded]fifo[2v];
      [2v][3v_padded]hstack[out_v];
      [out_v]pad=width=640:height=480:x=(640-in_w)/2:y=(480-in_h)/2:color=black"
      -crf 40 -preset ultrafast -y -r pal out.mp4


      Console output:



      ffmpeg version 4.0.2-static https://johnvansickle.com/ffmpeg/  Copyright (c) 2000-2018 the FFmpeg developers
      built with gcc 6.3.0 (Debian 6.3.0-18+deb9u1) 20170516
      configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc-6 --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gray --enable-libaom --enable-libfribidi --enable-libass --enable-libvmaf --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librubberband --enable-libsoxr --enable-libspeex --enable-libvorbis --enable-libopus --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg
      libavutil 56. 14.100 / 56. 14.100
      libavcodec 58. 18.100 / 58. 18.100
      libavformat 58. 12.100 / 58. 12.100
      libavdevice 58. 3.100 / 58. 3.100
      libavfilter 7. 16.100 / 7. 16.100
      libswscale 5. 1.100 / 5. 1.100
      libswresample 3. 1.100 / 3. 1.100
      libpostproc 55. 1.100 / 55. 1.100
      Input #0, ogg, from '1_a.opus':
      Duration: 00:01:03.82, start: -0.020000, bitrate: 37 kb/s
      Stream #0:0: Audio: opus, 48000 Hz, stereo, fltp
      Input #1, ogg, from '2_a.opus':
      Duration: 00:00:52.40, start: -0.020000, bitrate: 44 kb/s
      Stream #1:0: Audio: opus, 48000 Hz, stereo, fltp
      Input #2, matroska,webm, from '01_v.webm':
      Metadata:
      encoder : Lavf56.40.101
      Duration: 00:01:03.83, start: 0.000000, bitrate: 202 kb/s
      Stream #2:0: Video: vp8, yuv420p(progressive), 640x480, SAR 1:1 DAR 4:3, 333 fps, 333 tbr, 1k tbn, 1k tbc (default)
      Input #3, matroska,webm, from '02_v.webm':
      Metadata:
      encoder : Lavf56.40.101
      Duration: 00:00:52.34, start: 0.000000, bitrate: 200 kb/s
      Stream #3:0: Video: vp8, yuv420p(progressive), 480x640, SAR 1:1 DAR 3:4, 25 fps, 25 tbr, 1k tbn, 1k tbc (default)
      Stream mapping:
      Stream #0:0 (opus) -> amix:input0
      Stream #1:0 (opus) -> adelay
      Stream #2:0 (vp8) -> scale
      Stream #3:0 (vp8) -> trim
      Stream #3:0 (vp8) -> fifo
      amix -> Stream #0:0 (aac)
      pad -> Stream #0:1 (libx264)
      Press [q] to stop, [?] for help
      [swscaler @ 0x6484740] Warning: data is not aligned! This can lead to a speed loss
      [libx264 @ 0x63a0d40] using SAR=1/1
      [libx264 @ 0x63a0d40] using cpu capabilities: MMX2 SSE2Fast SSSE3 Cache64 SlowShuffle
      [libx264 @ 0x63a0d40] profile Constrained Baseline, level 3.0
      [libx264 @ 0x63a0d40] 264 - core 155 r2901 7d0ff22 - H.264/MPEG-4 AVC codec - Copyleft 2003-2018 - http://www.videolan.org/x264.html - options: cabac=0 ref=1 deblock=0:0:0 analyse=0:0 me=dia subme=0 psy=1 psy_rd=1.00:0.00 mixed_ref=0 me_range=16 chroma_me=1 trellis=1 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=0 threads=3 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0 weightp=0 keyint=250 keyint_min=25 scenecut=0 intra_refresh=0 rc=crf mbtree=0 crf=40.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=0
      Output #0, mp4, to 'out.mp4':
      Metadata:
      encoder : Lavf58.12.100
      Stream #0:0: Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s (default)
      Metadata:
      encoder : Lavc58.18.100 aac
      Stream #0:1: Video: h264 (libx264) (avc1 / 0x31637661), yuv420p, 640x480 [SAR 1:1 DAR 4:3], q=-1--1, 25 fps, 12800 tbn, 25 tbc (default)
      Metadata:
      encoder : Lavc58.18.100 libx264
      Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
      frame= 1598 fps=131 q=-1.0 Lsize= 1375kB time=00:01:08.16 bitrate= 165.3kbits/s dup=2 drop=1047 speed=5.57x
      video:455kB audio:883kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 2.787654%
      [aac @ 0x63a31c0] Qavg: 32520.934
      [libx264 @ 0x63a0d40] frame I:7 Avg QP:32.00 size: 5746
      [libx264 @ 0x63a0d40] frame P:1591 Avg QP:33.93 size: 267
      [libx264 @ 0x63a0d40] mb I I16..4: 100.0% 0.0% 0.0%
      [libx264 @ 0x63a0d40] mb P I16..4: 0.3% 0.0% 0.0% P16..4: 4.2% 0.0% 0.0% 0.0% 0.0% skip:95.5%
      [libx264 @ 0x63a0d40] coded y,uvDC,uvAC intra: 21.3% 18.9% 3.0% inter: 1.1% 0.5% 0.0%
      [libx264 @ 0x63a0d40] i16 v,h,dc,p: 54% 27% 11% 9%
      [libx264 @ 0x63a0d40] i8c dc,h,v,p: 69% 17% 10% 4%
      [libx264 @ 0x63a0d40] kb/s:58.22






      audio video ffmpeg video-processing






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 21 '18 at 18:25







      Mayank

















      asked Nov 20 '18 at 21:54









      MayankMayank

      113




      113
























          0






          active

          oldest

          votes











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53402173%2fnot-able-to-scale-pad-and-combine-2-videos-using-ffmpeg%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53402173%2fnot-able-to-scale-pad-and-combine-2-videos-using-ffmpeg%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          How to change which sound is reproduced for terminal bell?

          Can I use Tabulator js library in my java Spring + Thymeleaf project?

          Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents