Como posso mesclar vídeo com ffmpeg

0

Como posso obter os seguintes arquivos de vídeo mesclados com o ffmpeg?

Porfavormeajude

EDITAR

iUsadohstack&vstackoseguinteerro

06-2417:11:39.13314565-14565/com.parksangha.videorecorderI/System.out:onFailure:WARNING:linker:/data/data/com.parksangha.videorecorder/files/ffmpeghastextrelocations.Thisiswastingmemoryandpreventssecurityhardening.Pleasefix.06-2417:11:39.13314565-14565/com.parksangha.videorecorderI/System.out:ffmpegversionn2.4.2Copyright(c)2000-2014theFFmpegdevelopers06-2417:11:39.14314565-14565/com.parksangha.videorecorderI/System.out:builtonOct7201415:08:46withgcc4.8(GCC)06-2417:11:39.14314565-14565/com.parksangha.videorecorderI/System.out:configuration:--target-os=linux--cross-prefix=/home/sb/Source-Code/ffmpeg-android/toolchain-android/bin/arm-linux-androideabi---arch=arm--cpu=cortex-a8--enable-runtime-cpudetect--sysroot=/home/sb/Source-Code/ffmpeg-android/toolchain-android/sysroot--enable-pic--enable-libx264--enable-libass--enable-libfreetype--enable-libfribidi--enable-fontconfig--enable-pthreads--disable-debug--disable-ffserver--enable-version3--enable-hardcoded-tables--disable-ffplay--disable-ffprobe--enable-gpl--enable-yasm--disable-doc--disable-shared--enable-static--pkg-config=/home/sb/Source-Code/ffmpeg-android/ffmpeg-pkg-config--prefix=/home/sb/Source-Code/ffmpeg-android/build/armeabi-v7a-neon--extra-cflags='-I/home/sb/Source-Code/ffmpeg-android/toolchain-android/include-U_FORTIFY_SOURCE-D_FORTIFY_SOURCE=2-fno-strict-overflow-fstack-protector-all-mfpu=neon'--extra-ldflags='-L/home/sb/Source-Code/ffmpeg-android/toolchain-android/lib-Wl,-z,relro-Wl,-z,now-pie'--extra-libs='-lpng-lexpat-lm'--extra-cxxflags=06-2417:11:39.14314565-14565/com.parksangha.videorecorderI/System.out:libavutil54.7.100/54.7.10006-2417:11:39.14314565-14565/com.parksangha.videorecorderI/System.out:libavcodec56.1.100/56.1.10006-2417:11:39.14314565-14565/com.parksangha.videorecorderI/System.out:libavformat56.4.101/56.4.10106-2417:11:39.14314565-14565/com.parksangha.videorecorderI/System.out:libavdevice56.0.100/56.0.10006-2417:11:39.14314565-14565/com.parksangha.videorecorderI/System.out:libavfilter5.1.100/5.1.10006-2417:11:39.14314565-14565/com.parksangha.videorecorderI/System.out:libswscale3.0.100/3.0.10006-2417:11:39.14314565-14565/com.parksangha.videorecorderI/System.out:libswresample1.1.100/1.1.10006-2417:11:39.14314565-14565/com.parksangha.videorecorderI/System.out:libpostproc53.0.100/53.0.10006-2417:11:39.14314565-14565/com.parksangha.videorecorderI/System.out:Input#0,mov,mp4,m4a,3gp,3g2,mj2,from'/sdcard/testffmpeg/1.mp4':06-2417:11:39.14314565-14565/com.parksangha.videorecorderI/System.out:Metadata:06-2417:11:39.14314565-14565/com.parksangha.videorecorderI/System.out:major_brand:mp4206-2417:11:39.14314565-14565/com.parksangha.videorecorderI/System.out:minor_version:006-2417:11:39.14314565-14565/com.parksangha.videorecorderI/System.out:compatible_brands:isommp4206-2417:11:39.14314565-14565/com.parksangha.videorecorderI/System.out:creation_time:2016-06-2321:21:1606-2417:11:39.14314565-14565/com.parksangha.videorecorderI/System.out:Duration:00:00:05.42,start:0.000000,bitrate:3081kb/s06-2417:11:39.14314565-14565/com.parksangha.videorecorderI/System.out:Stream#0:0(eng):Video:h264(High)(avc1/0x31637661),yuv420p,1920x1080,2949kb/s,30.02fps,30tbr,90ktbn,180ktbc(default)06-2417:11:39.14314565-14565/com.parksangha.videorecorderI/System.out:Metadata:06-2417:11:39.14314565-14565/com.parksangha.videorecorderI/System.out:rotate:9006-2417:11:39.14314565-14565/com.parksangha.videorecorderI/System.out:creation_time:2016-06-2321:21:1606-2417:11:39.14314565-14565/com.parksangha.videorecorderI/System.out:handler_name:VideoHandle06-2417:11:39.14314565-14565/com.parksangha.videorecorderI/System.out:Sidedata:06-2417:11:39.14314565-14565/com.parksangha.videorecorderI/System.out:displaymatrix:rotationof-90.00degrees06-2417:11:39.14314565-14565/com.parksangha.videorecorderI/System.out:Stream#0:1(eng):Audio:aac(mp4a/0x6134706D),48000Hz,stereo,fltp,153kb/s(default)06-2417:11:39.14314565-14565/com.parksangha.videorecorderI/System.out:Metadata:06-2417:11:39.14314565-14565/com.parksangha.videorecorderI/System.out:creation_time:2016-06-2321:21:1606-2417:11:39.14314565-14565/com.parksangha.videorecorderI/System.out:handler_name:SoundHandle06-2417:11:39.14314565-14565/com.parksangha.videorecorderI/System.out:Input#1,mov,mp4,m4a,3gp,3g2,mj2,from'/sdcard/testffmpeg/2.mp4':06-2417:11:39.14314565-14565/com.parksangha.videorecorderI/System.out:Metadata:06-2417:11:39.14314565-14565/com.parksangha.videorecorderI/System.out:major_brand:mp4206-2417:11:39.15314565-14565/com.parksangha.videorecorderI/System.out:minor_version:006-2417:11:39.15314565-14565/com.parksangha.videorecorderI/System.out:compatible_brands:isommp4206-2417:11:39.15314565-14565/com.parksangha.videorecorderI/System.out:creation_time:2016-06-2321:21:1606-2417:11:39.15314565-14565/com.parksangha.videorecorderI/System.out:Duration:00:00:05.42,start:0.000000,bitrate:3081kb/s06-2417:11:39.15314565-14565/com.parksangha.videorecorderI/System.out:Stream#1:0(eng):Video:h264(High)(avc1/0x31637661),yuv420p,1920x1080,2949kb/s,30.02fps,30tbr,90ktbn,180ktbc(default)06-2417:11:39.15314565-14565/com.parksangha.videorecorderI/System.out:Metadata:06-2417:11:39.15314565-14565/com.parksangha.videorecorderI/System.out:rotate:9006-2417:11:39.15314565-14565/com.parksangha.videorecorderI/System.out:creation_time:2016-06-2321:21:1606-2417:11:39.15314565-14565/com.parksangha.videorecorderI/System.out:handler_name:VideoHandle06-2417:11:39.15314565-14565/com.parksangha.videorecorderI/System.out:Sidedata:06-2417:11:39.15314565-14565/com.parksangha.videorecorderI/System.out:displaymatrix:rotationof-90.00degrees06-2417:11:39.15314565-14565/com.parksangha.videorecorderI/System.out:Stream#1:1(eng):Audio:aac(mp4a/0x6134706D),48000Hz,stereo,fltp,153kb/s(default)06-2417:11:39.15314565-14565/com.parksangha.videorecorderI/System.out:Metadata:06-2417:11:39.15314565-14565/com.parksangha.videorecorderI/System.out:creation_time:2016-06-2321:21:1606-2417:11:39.15314565-14565/com.parksangha.videorecorderI/System.out:handler_name:SoundHandle06-2417:11:39.15314565-14565/com.parksangha.videorecorderI/System.out:Input#2,mov,mp4,m4a,3gp,3g2,mj2,from'/sdcard/testffmpeg/3.mp4':06-2417:11:39.15314565-14565/com.parksangha.videorecorderI/System.out:Metadata:06-2417:11:39.15314565-14565/com.parksangha.videorecorderI/System.out:major_brand:mp4206-2417:11:39.15314565-14565/com.parksangha.videorecorderI/System.out:minor_version:006-2417:11:39.15314565-14565/com.parksangha.videorecorderI/System.out:compatible_brands:isommp4206-2417:11:39.15314565-14565/com.parksangha.videorecorderI/System.out:creation_time:2016-06-2321:21:1606-2417:11:39.15314565-14565/com.parksangha.videorecorderI/System.out:Duration:00:00:05.42,start:0.000000,bitrate:3081kb/s06-2417:11:39.15314565-14565/com.parksangha.videorecorderI/System.out:Stream#2:0(eng):Video:h264(High)(avc1/0x31637661),yuv420p,1920x1080,2949kb/s,30.02fps,30tbr,90ktbn,180ktbc(default)06-2417:11:39.15314565-14565/com.parksangha.videorecorderI/System.out:Metadata:06-2417:11:39.15314565-14565/com.parksangha.videorecorderI/System.out:rotate:9006-2417:11:39.15314565-14565/com.parksangha.videorecorderI/System.out:creation_time:2016-06-2321:21:1606-2417:11:39.15314565-14565/com.parksangha.videorecorderI/System.out:handler_name:VideoHandle06-2417:11:39.15314565-14565/com.parksangha.videorecorderI/System.out:Sidedata:06-2417:11:39.15314565-14565/com.parksangha.videorecorderI/System.out:displaymatrix:rotationof-90.00degrees06-2417:11:39.15314565-14565/com.parksangha.videorecorderI/System.out:Stream#2:1(eng):Audio:aac(mp4a/0x6134706D),48000Hz,stereo,fltp,153kb/s(default)06-2417:11:39.15314565-14565/com.parksangha.videorecorderI/System.out:Metadata:06-2417:11:39.15314565-14565/com.parksangha.videorecorderI/System.out:creation_time:2016-06-2321:21:1606-2417:11:39.15314565-14565/com.parksangha.videorecorderI/System.out:handler_name:SoundHandle06-2417:11:39.15314565-14565/com.parksangha.videorecorderI/System.out:[AVFilterGraph@0xb5468240]Nosuchfilter:'hstack'06-2417:11:39.15314565-14565/com.parksangha.videorecorderI/System.out:Errorconfiguringfilters.06-2417:11:39.15314565-14565/com.parksangha.videorecorderI/LOG:OnFinish06-2417:11:39.15314565-14565/com.parksangha.videorecorderI/System.out:onFinish

EDITAR

Porcausadouso,vstackehstackforamparaaversão2016.

Eeuusooseguintecódigonoandroid:

String[]cmds=newString[]{"-i",video1+".mp4","-i",video2+".mp4","-i",video3+".mp4","-filter","complex","[1:v][2:v]hstack[bottom];[0:v][bottom]vstack",output+".mp4"};

Mas recebi o seguinte erro:

06-25 03:02:36.438 17859-17859/co.gioin.testsquarecamera I/System.out: onStart
06-25 03:02:36.548 17859-17859/co.gioin.testsquarecamera I/System.out: onProgress : ffmpeg version n3.0.1 Copyright (c) 2000-2016 the FFmpeg developers
06-25 03:02:36.548 17859-17859/co.gioin.testsquarecamera I/System.out: onProgress :   built with gcc 4.8 (GCC)
06-25 03:02:36.548 17859-17859/co.gioin.testsquarecamera I/System.out: onProgress :   configuration: --target-os=linux --cross-prefix=/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/bin/arm-linux-androideabi- --arch=arm --cpu=cortex-a8 --enable-runtime-cpudetect --sysroot=/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/sysroot --enable-pic --enable-libx264 --enable-libass --enable-libfreetype --enable-libfribidi --enable-libmp3lame --enable-fontconfig --enable-pthreads --disable-debug --disable-ffserver --enable-version3 --enable-hardcoded-tables --disable-ffplay --disable-ffprobe --enable-gpl --enable-yasm --disable-doc --disable-shared --enable-static --pkg-config=/home/vagrant/SourceCode/ffmpeg-android/ffmpeg-pkg-config --prefix=/home/vagrant/SourceCode/ffmpeg-android/build/armeabi-v7a --extra-cflags='-I/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/include -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fno-strict-overflow -fstack-protector-all' --extra-ldflags='-L/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/lib -Wl,-z,relro -Wl,-z,now -pie' --extra-libs='-lpng -lexpat -lm' --extra-cxxflags=
06-25 03:02:36.568 17859-17859/co.gioin.testsquarecamera I/System.out: onProgress :   libavutil      55. 17.103 / 55. 17.103
06-25 03:02:36.568 17859-17859/co.gioin.testsquarecamera I/System.out: onProgress :   libavcodec     57. 24.102 / 57. 24.102
06-25 03:02:36.578 17859-17859/co.gioin.testsquarecamera I/System.out: onProgress :   libavformat    57. 25.100 / 57. 25.100
06-25 03:02:36.578 17859-17859/co.gioin.testsquarecamera I/System.out: onProgress :   libavdevice    57.  0.101 / 57.  0.101
06-25 03:02:36.578 17859-17859/co.gioin.testsquarecamera I/System.out: onProgress :   libavfilter     6. 31.100 /  6. 31.100
06-25 03:02:36.578 17859-17859/co.gioin.testsquarecamera I/System.out: onProgress :   libswscale      4.  0.100 /  4.  0.100
06-25 03:02:36.588 17859-17859/co.gioin.testsquarecamera I/System.out: onProgress :   libswresample   2.  0.101 /  2.  0.101
06-25 03:02:36.588 17859-17859/co.gioin.testsquarecamera I/System.out: onProgress :   libpostproc    54.  0.100 / 54.  0.100
06-25 03:02:36.618 17859-17859/co.gioin.testsquarecamera I/System.out: onProgress : Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/storage/emulated/0/bitbox/3x1/t/mainVideo.mp4':
06-25 03:02:36.618 17859-17859/co.gioin.testsquarecamera I/System.out: onProgress :   Metadata:
06-25 03:02:36.618 17859-17859/co.gioin.testsquarecamera I/System.out: onProgress :     major_brand     : isom
06-25 03:02:36.618 17859-17859/co.gioin.testsquarecamera I/System.out: onProgress :     minor_version   : 512
06-25 03:02:36.628 17859-17859/co.gioin.testsquarecamera I/System.out: onProgress :     compatible_brands: isomiso2avc1mp41
06-25 03:02:36.628 17859-17859/co.gioin.testsquarecamera I/System.out: onProgress :     encoder         : Lavf56.4.101
06-25 03:02:36.628 17859-17859/co.gioin.testsquarecamera I/System.out: onProgress :   Duration: 00:00:00.68, start: 0.021333, bitrate: 3947 kb/s
06-25 03:02:36.628 17859-17859/co.gioin.testsquarecamera I/System.out: onProgress :     Stream #0:0(eng): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 902x1080, 5228 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc (default)
06-25 03:02:36.638 17859-17859/co.gioin.testsquarecamera I/System.out: onProgress :     Metadata:
06-25 03:02:36.638 17859-17859/co.gioin.testsquarecamera I/System.out: onProgress :       rotate          : 90
06-25 03:02:36.638 17859-17859/co.gioin.testsquarecamera I/System.out: onProgress :       handler_name    : VideoHandler
06-25 03:02:36.638 17859-17859/co.gioin.testsquarecamera I/System.out: onProgress :     Side data:
06-25 03:02:36.638 17859-17859/co.gioin.testsquarecamera I/System.out: onProgress :       displaymatrix: rotation of -90.00 degrees
06-25 03:02:36.638 17859-17859/co.gioin.testsquarecamera I/System.out: onProgress :     Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 94 kb/s (default)
06-25 03:02:36.648 17859-17859/co.gioin.testsquarecamera I/System.out: onProgress :     Metadata:
06-25 03:02:36.648 17859-17859/co.gioin.testsquarecamera I/System.out: onProgress :       handler_name    : SoundHandler
06-25 03:02:36.648 17859-17859/co.gioin.testsquarecamera I/System.out: onProgress : Input #1, mov,mp4,m4a,3gp,3g2,mj2, from '/storage/emulated/0/bitbox/3x1/t/leftVideo.mp4':
06-25 03:02:36.648 17859-17859/co.gioin.testsquarecamera I/System.out: onProgress :   Metadata:
06-25 03:02:36.648 17859-17859/co.gioin.testsquarecamera I/System.out: onProgress :     major_brand     : isom
06-25 03:02:36.648 17859-17859/co.gioin.testsquarecamera I/System.out: onProgress :     minor_version   : 512
06-25 03:02:36.648 17859-17859/co.gioin.testsquarecamera I/System.out: onProgress :     compatible_brands: isomiso2avc1mp41
06-25 03:02:36.658 17859-17859/co.gioin.testsquarecamera I/System.out: onProgress :     encoder         : Lavf56.4.101
06-25 03:02:36.658 17859-17859/co.gioin.testsquarecamera I/System.out: onProgress :   Duration: 00:00:01.22, start: 0.021333, bitrate: 2360 kb/s
06-25 03:02:36.658 17859-17859/co.gioin.testsquarecamera I/System.out: onProgress :     Stream #1:0(eng): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 1440x938, 2544 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc (default)
06-25 03:02:36.658 17859-17859/co.gioin.testsquarecamera I/System.out: onProgress :     Metadata:
06-25 03:02:36.658 17859-17859/co.gioin.testsquarecamera I/System.out: onProgress :       rotate          : 90
06-25 03:02:36.658 17859-17859/co.gioin.testsquarecamera I/System.out: onProgress :       handler_name    : VideoHandler
06-25 03:02:36.658 17859-17859/co.gioin.testsquarecamera I/System.out: onProgress :     Side data:
06-25 03:02:36.658 17859-17859/co.gioin.testsquarecamera I/System.out: onProgress :       displaymatrix: rotation of -90.00 degrees
06-25 03:02:36.658 17859-17859/co.gioin.testsquarecamera I/System.out: onProgress :     Stream #1:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 113 kb/s (default)
06-25 03:02:36.658 17859-17859/co.gioin.testsquarecamera I/System.out: onProgress :     Metadata:
06-25 03:02:36.668 17859-17859/co.gioin.testsquarecamera I/System.out: onProgress :       handler_name    : SoundHandler
06-25 03:02:36.678 17859-17859/co.gioin.testsquarecamera I/System.out: onProgress : Input #2, mov,mp4,m4a,3gp,3g2,mj2, from '/storage/emulated/0/bitbox/3x1/t/rightVideo.mp4':
06-25 03:02:36.678 17859-17859/co.gioin.testsquarecamera I/System.out: onProgress :   Metadata:
06-25 03:02:36.688 17859-17859/co.gioin.testsquarecamera I/System.out: onProgress :     major_brand     : isom
06-25 03:02:36.688 17859-17859/co.gioin.testsquarecamera I/System.out: onProgress :     minor_version   : 512
06-25 03:02:36.688 17859-17859/co.gioin.testsquarecamera I/System.out: onProgress :     compatible_brands: isomiso2avc1mp41
06-25 03:02:36.688 17859-17859/co.gioin.testsquarecamera I/System.out: onProgress :     encoder         : Lavf56.4.101
06-25 03:02:36.688 17859-17859/co.gioin.testsquarecamera I/System.out: onProgress :   Duration: 00:00:00.99, start: 0.021333, bitrate: 5945 kb/s
06-25 03:02:36.698 17859-17859/co.gioin.testsquarecamera I/System.out: onProgress :     Stream #2:0(eng): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 1440x938, 6933 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc (default)
06-25 03:02:36.698 17859-17859/co.gioin.testsquarecamera I/System.out: onProgress :     Metadata:
06-25 03:02:36.698 17859-17859/co.gioin.testsquarecamera I/System.out: onProgress :       rotate          : 90
06-25 03:02:36.698 17859-17859/co.gioin.testsquarecamera I/System.out: onProgress :       handler_name    : VideoHandler
06-25 03:02:36.698 17859-17859/co.gioin.testsquarecamera I/System.out: onProgress :     Side data:
06-25 03:02:36.698 17859-17859/co.gioin.testsquarecamera I/System.out: onProgress :       displaymatrix: rotation of -90.00 degrees
06-25 03:02:36.698 17859-17859/co.gioin.testsquarecamera I/System.out: onProgress :     Stream #2:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 109 kb/s (default)
06-25 03:02:36.698 17859-17859/co.gioin.testsquarecamera I/System.out: onProgress :     Metadata:
06-25 03:02:36.698 17859-17859/co.gioin.testsquarecamera I/System.out: onProgress :       handler_name    : SoundHandler
06-25 03:02:36.708 17859-17859/co.gioin.testsquarecamera I/System.out: onProgress : [NULL @ 0xb5460c00] Unable to find a suitable output format for '[1:v][2:v]hstack[bottom];[0:v][bottom]vstack'
06-25 03:02:36.708 17859-17859/co.gioin.testsquarecamera I/System.out: onProgress : [1:v][2:v]hstack[bottom];[0:v][bottom]vstack: Invalid argument
06-25 03:02:36.708 17859-17859/co.gioin.testsquarecamera I/System.out: onFailure : ffmpeg version n3.0.1 Copyright (c) 2000-2016 the FFmpeg developers
06-25 03:02:36.708 17859-17859/co.gioin.testsquarecamera I/System.out:   built with gcc 4.8 (GCC)
06-25 03:02:36.708 17859-17859/co.gioin.testsquarecamera I/System.out:   configuration: --target-os=linux --cross-prefix=/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/bin/arm-linux-androideabi- --arch=arm --cpu=cortex-a8 --enable-runtime-cpudetect --sysroot=/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/sysroot --enable-pic --enable-libx264 --enable-libass --enable-libfreetype --enable-libfribidi --enable-libmp3lame --enable-fontconfig --enable-pthreads --disable-debug --disable-ffserver --enable-version3 --enable-hardcoded-tables --disable-ffplay --disable-ffprobe --enable-gpl --enable-yasm --disable-doc --disable-shared --enable-static --pkg-config=/home/vagrant/SourceCode/ffmpeg-android/ffmpeg-pkg-config --prefix=/home/vagrant/SourceCode/ffmpeg-android/build/armeabi-v7a --extra-cflags='-I/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/include -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fno-strict-overflow -fstack-protector-all' --extra-ldflags='-L/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/lib -Wl,-z,relro -Wl,-z,now -pie' --extra-libs='-lpng -lexpat -lm' --extra-cxxflags=
06-25 03:02:36.708 17859-17859/co.gioin.testsquarecamera I/System.out:   libavutil      55. 17.103 / 55. 17.103
06-25 03:02:36.708 17859-17859/co.gioin.testsquarecamera I/System.out:   libavcodec     57. 24.102 / 57. 24.102
06-25 03:02:36.708 17859-17859/co.gioin.testsquarecamera I/System.out:   libavformat    57. 25.100 / 57. 25.100
06-25 03:02:36.718 17859-17859/co.gioin.testsquarecamera I/System.out:   libavdevice    57.  0.101 / 57.  0.101
06-25 03:02:36.718 17859-17859/co.gioin.testsquarecamera I/System.out:   libavfilter     6. 31.100 /  6. 31.100
06-25 03:02:36.718 17859-17859/co.gioin.testsquarecamera I/System.out:   libswscale      4.  0.100 /  4.  0.100
06-25 03:02:36.718 17859-17859/co.gioin.testsquarecamera I/System.out:   libswresample   2.  0.101 /  2.  0.101
06-25 03:02:36.718 17859-17859/co.gioin.testsquarecamera I/System.out:   libpostproc    54.  0.100 / 54.  0.100
06-25 03:02:36.718 17859-17859/co.gioin.testsquarecamera I/System.out: Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/storage/emulated/0/bitbox/3x1/t/mainVideo.mp4':
06-25 03:02:36.718 17859-17859/co.gioin.testsquarecamera I/System.out:   Metadata:
06-25 03:02:36.718 17859-17859/co.gioin.testsquarecamera I/System.out:     major_brand     : isom
06-25 03:02:36.718 17859-17859/co.gioin.testsquarecamera I/System.out:     minor_version   : 512
06-25 03:02:36.718 17859-17859/co.gioin.testsquarecamera I/System.out:     compatible_brands: isomiso2avc1mp41
06-25 03:02:36.718 17859-17859/co.gioin.testsquarecamera I/System.out:     encoder         : Lavf56.4.101
06-25 03:02:36.718 17859-17859/co.gioin.testsquarecamera I/System.out:   Duration: 00:00:00.68, start: 0.021333, bitrate: 3947 kb/s
06-25 03:02:36.718 17859-17859/co.gioin.testsquarecamera I/System.out:     Stream #0:0(eng): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 902x1080, 5228 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc (default)
06-25 03:02:36.718 17859-17859/co.gioin.testsquarecamera I/System.out:     Metadata:
06-25 03:02:36.718 17859-17859/co.gioin.testsquarecamera I/System.out:       rotate          : 90
06-25 03:02:36.718 17859-17859/co.gioin.testsquarecamera I/System.out:       handler_name    : VideoHandler
06-25 03:02:36.718 17859-17859/co.gioin.testsquarecamera I/System.out:     Side data:
06-25 03:02:36.718 17859-17859/co.gioin.testsquarecamera I/System.out:       displaymatrix: rotation of -90.00 degrees
06-25 03:02:36.718 17859-17859/co.gioin.testsquarecamera I/System.out:     Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 94 kb/s (default)
06-25 03:02:36.718 17859-17859/co.gioin.testsquarecamera I/System.out:     Metadata:
06-25 03:02:36.718 17859-17859/co.gioin.testsquarecamera I/System.out:       handler_name    : SoundHandler
06-25 03:02:36.718 17859-17859/co.gioin.testsquarecamera I/System.out: Input #1, mov,mp4,m4a,3gp,3g2,mj2, from '/storage/emulated/0/bitbox/3x1/t/leftVideo.mp4':
06-25 03:02:36.718 17859-17859/co.gioin.testsquarecamera I/System.out:   Metadata:
06-25 03:02:36.718 17859-17859/co.gioin.testsquarecamera I/System.out:     major_brand     : isom
06-25 03:02:36.718 17859-17859/co.gioin.testsquarecamera I/System.out:     minor_version   : 512
06-25 03:02:36.718 17859-17859/co.gioin.testsquarecamera I/System.out:     compatible_brands: isomiso2avc1mp41
06-25 03:02:36.718 17859-17859/co.gioin.testsquarecamera I/System.out:     encoder         : Lavf56.4.101
06-25 03:02:36.718 17859-17859/co.gioin.testsquarecamera I/System.out:   Duration: 00:00:01.22, start: 0.021333, bitrate: 2360 kb/s
06-25 03:02:36.718 17859-17859/co.gioin.testsquarecamera I/System.out:     Stream #1:0(eng): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 1440x938, 2544 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc (default)
06-25 03:02:36.718 17859-17859/co.gioin.testsquarecamera I/System.out:     Metadata:
06-25 03:02:36.718 17859-17859/co.gioin.testsquarecamera I/System.out:       rotate          : 90
06-25 03:02:36.718 17859-17859/co.gioin.testsquarecamera I/System.out:       handler_name    : VideoHandler
06-25 03:02:36.718 17859-17859/co.gioin.testsquarecamera I/System.out:     Side data:
06-25 03:02:36.718 17859-17859/co.gioin.testsquarecamera I/System.out:       displaymatrix: rotation of -90.00 degrees
06-25 03:02:36.718 17859-17859/co.gioin.testsquarecamera I/System.out:     Stream #1:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 113 kb/s (default)
06-25 03:02:36.718 17859-17859/co.gioin.testsquarecamera I/System.out:     Metadata:
06-25 03:02:36.718 17859-17859/co.gioin.testsquarecamera I/System.out:       handler_name    : SoundHandler
06-25 03:02:36.718 17859-17859/co.gioin.testsquarecamera I/System.out: Input #2, mov,mp4,m4a,3gp,3g2,mj2, from '/storage/emulated/0/bitbox/3x1/t/rightVideo.mp4':
06-25 03:02:36.718 17859-17859/co.gioin.testsquarecamera I/System.out:   Metadata:
06-25 03:02:36.718 17859-17859/co.gioin.testsquarecamera I/System.out:     major_brand     : isom
06-25 03:02:36.718 17859-17859/co.gioin.testsquarecamera I/System.out:     minor_version   : 512
06-25 03:02:36.718 17859-17859/co.gioin.testsquarecamera I/System.out:     compatible_brands: isomiso2avc1mp41
06-25 03:02:36.718 17859-17859/co.gioin.testsquarecamera I/System.out:     encoder         : Lavf56.4.101
06-25 03:02:36.718 17859-17859/co.gioin.testsquarecamera I/System.out:   Duration: 00:00:00.99, start: 0.021333, bitrate: 5945 kb/s
06-25 03:02:36.718 17859-17859/co.gioin.testsquarecamera I/System.out:     Stream #2:0(eng): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 1440x938, 6933 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc (default)
06-25 03:02:36.718 17859-17859/co.gioin.testsquarecamera I/System.out:     Metadata:
06-25 03:02:36.718 17859-17859/co.gioin.testsquarecamera I/System.out:       rotate          : 90
06-25 03:02:36.718 17859-17859/co.gioin.testsquarecamera I/System.out:       handler_name    : VideoHandler
06-25 03:02:36.718 17859-17859/co.gioin.testsquarecamera I/System.out:     Side data:
06-25 03:02:36.718 17859-17859/co.gioin.testsquarecamera I/System.out:       displaymatrix: rotation of -90.00 degrees
06-25 03:02:36.718 17859-17859/co.gioin.testsquarecamera I/System.out:     Stream #2:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 109 kb/s (default)
06-25 03:02:36.718 17859-17859/co.gioin.testsquarecamera I/System.out:     Metadata:
06-25 03:02:36.718 17859-17859/co.gioin.testsquarecamera I/System.out:       handler_name    : SoundHandler
06-25 03:02:36.718 17859-17859/co.gioin.testsquarecamera I/System.out: [NULL @ 0xb5460c00] Unable to find a suitable output format for '[1:v][2:v]hstack[bottom];[0:v][bottom]vstack'
06-25 03:02:36.718 17859-17859/co.gioin.testsquarecamera I/System.out: [1:v][2:v]hstack[bottom];[0:v][bottom]vstack: Invalid argument
06-25 03:02:36.718 17859-17859/co.gioin.testsquarecamera I/System.out: onFinish
    
por Omid Naji 24.06.2016 / 00:35

2 respostas

3

Existem várias maneiras de fazer isso.

hstack & vstack

Este método usa hstack para empilhar horizontalmente video1 e video2 , então vstack para empilhar verticalmente video0 sobre eles.

ffmpeg -i video0 -i video1 -i video2 -filter_complex \
"[1:v][2:v]hstack[bottom];[0:v][bottom]vstack"
output

Se você precisar dimensionar para corresponder aos tamanhos

Se você precisar dimensionar qualquer uma das entradas primeiro, adicione o filtro escala :

ffmpeg -i video0 -i video1 -i video2 -filter_complex \
"[1:v]scale=320:-1[left]; \
 [2:v]scale=320:-1[right]; \
 [left][right]hstack[bottom]; \
 [0:v][bottom]vstack"
output

Combinando áudio

Você não mencionou áudio, mas se quiser também combinar todo o áudio, adicione amerge :

ffmpeg -i video0 -i video1 -i video2 -filter_complex \
"[1:v][2:v]hstack[bottom];[0:v][bottom]vstack[v]; \
 [0:a][1:a][2:a]amerge=inputs=3[a]" \
-map "[v]" -map "[a]" -ac 2 \
output

Se você quiser apenas o áudio de uma entrada, não use amerge e simplesmente mapeie o áudio desejado, como -map 1:a .

Para versões desatualizadas: pad + overlay

Seu decrépito ffmpeg é muito antigo para usar os filtros da pilha, por isso use bloco e sobreposição .

ffmpeg -noautorotate -i video0 -noautorotate -i video1 -noautorotate -i video2 \
-filter_complex \
"[0:v]scale=1280:-1[top];[1:v]scale=640:-1[left];[2:v]scale=640:-1[right]; \
 [top]pad=iw:ih+(ih/2)[bg];[bg][left]overlay=0:overlay_h*2[bg2]; \
 [bg2][right]overlay=overlay_w:overlay_h*2[v]; \
 [0:a][1:a][2:a]amerge=inputs=3[a]" \
-map "[v]" -map "[a]" -ac 2 output
    
por 24.06.2016 / 02:34
0

Crie um mosaico com vários vídeos de entrada

link

    
por 24.06.2016 / 00:51