使用带有正确布局代码的 -ffmpeg- 在 5x5 网格中显示 25 个输入
Displaying 25 inputs into a 5x5 grid using -ffmpeg- with the correct layout code
我现在正在寻求将 扩展为一个采用 25 个不同且等比例缩放的音频和视频输入来制作 5x5 网格(到那时,我将停止):
ffmpeg -i a.mp4 -i b.mp4 -i c.mp4 -i d.mp4 -i e.mp4 -i f.mp4 -i g.mp4 -i h.mp4 -i i.mp4 -i j.mp4 -i k.mp4 -i l.mp4 -i m.mp4 -i n.mp4 -i o.mp4 -i p.mp4 -i q.mp4 -i r.mp4 -i s.mp4 -i t.mp4 -i u.mp4 -i v.mp4 -i w.mp4 -i x.mp4 -i y.mp4 \
-filter_complex \
"[0:v]scale=iw/5:-1[v0];[1:v]scale=iw/5:-1[v1];[2:v]scale=iw/5:-1[v2]; \
[3:v]scale=iw/5:-1[v3];[4:v]scale=iw/5:-1[v4];[5:v]scale=iw/5:-1[v5]; \
[6:v]scale=iw/5:-1[v6];[7:v]scale=iw/5:-1[v7];[8:v]scale=iw/5:-1[v8]; \
[9:v]scale=iw/5:-1[v9];[10:v]scale=iw/5:-1[v10];[11:v]scale=iw/5:-1[v11]; \
[12:v]scale=iw/5:-1[v12];[13:v]scale=iw/5:-1[v13];[14:v]scale=iw/5:-1[v14]; \
[15:v]scale=iw/5:-1[v15];[16:v]scale=iw/5:-1[v16];[17:v]scale=iw/5:-1[v17]; \
[18:v]scale=iw/5:-1[v18];[19:v]scale=iw/5:-1[v19];[20:v]scale=iw/5:-1[v20]; \
[21:v]scale=iw/5:-1[v21];[22:v]scale=iw/5:-1[v22];[23:v]scale=iw/5:-1[v23]; \
[24:v]scale=iw/5:-1[v24]; \
[v0][v1][v2][v3][v4][v5][v6][v7][v8][v9][v10][v11][v12][v13][v14][v15][v16][v17][v18][v19][v20][v21][v22][v23][v24]xstack=inputs=25:layout=0_0|0_h0|0_h0+h1|0_h0+h1+h2|0_h0+h1+h2+h3|w0_0|w0_h0|w0_h0+h1|w0_h0+h1+h2|w0_h0+h1+h2+h3|w0+w4_0|w0+w4_h0|w0+w4_h0+h1|w0+w4_h0+h1+h2|w0+w4_h0+h1+h2+h3|w0+w4+w8_0|w0+w4+w8_h0|w0+w4+w8_h0+h1|w0+w4+w8_h0+h1+h2|w0+w4+w8_h0+h1+h2+h3|w0+w4+w8+w12_0|w0+w4+w8+w12_h0|w0+w4+w8+w12_h0+h1|w0+w4+w8+w12_h0+h1+h2|w0+w4+w8+w12_h0+h1+h2+h3; \
[0:a][1:a][2:a][3:a][4:a][5:a][6:a][7:a][8:a][9:a][10:a][11:a][12:a][13:a][14:a][15:a][16:a][17:a][18:a][19:a][20:a][21:a][22:a][23:a][24:a]amix=inputs=25" \
output.mp4
不幸的是,这会产生错误:
ffmpeg version 4.3.2-0+deb11u1ubuntu1 Copyright (c) 2000-2021 the FFmpeg developers
built with gcc 10 (Ubuntu 10.2.1-20ubuntu1)
configuration: --prefix=/usr --extra-version=0+deb11u1ubuntu1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-pocketsphinx --enable-libmfx --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-nvenc --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
WARNING: library configuration mismatch
avcodec configuration: --prefix=/usr --extra-version=0+deb11u1ubuntu1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-pocketsphinx --enable-libmfx --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-nvenc --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared --enable-version3 --disable-doc --disable-programs --enable-libaribb24 --enable-liblensfun --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libtesseract --enable-libvo_amrwbenc
libavutil 56. 51.100 / 56. 51.100
libavcodec 58. 91.100 / 58. 91.100
libavformat 58. 45.100 / 58. 45.100
libavdevice 58. 10.100 / 58. 10.100
libavfilter 7. 85.100 / 7. 85.100
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 7.100 / 5. 7.100
libswresample 3. 7.100 / 3. 7.100
libpostproc 55. 7.100 / 55. 7.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'abc.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.45.100
Duration: 00:00:08.00, start: 0.000000, bitrate: 248 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 640x360, 41 kb/s, 60 fps, 60 tbr, 15360 tbn, 120 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 193 kb/s (default)
Metadata:
handler_name : SoundHandler
Input #1, mov,mp4,m4a,3gp,3g2,mj2, from 'ang.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.45.100
Duration: 00:00:10.00, start: 0.000000, bitrate: 480 kb/s
Stream #1:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 640x360, 271 kb/s, 60 fps, 60 tbr, 15360 tbn, 120 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #1:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 194 kb/s (default)
Metadata:
handler_name : SoundHandler
Input #2, mov,mp4,m4a,3gp,3g2,mj2, from 'ard.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.45.100
Duration: 00:00:09.00, start: 0.000000, bitrate: 256 kb/s
Stream #2:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 640x360, 49 kb/s, 60 fps, 60 tbr, 15360 tbn, 120 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #2:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 193 kb/s (default)
Metadata:
handler_name : SoundHandler
Input #3, mov,mp4,m4a,3gp,3g2,mj2, from 'atv.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.45.100
Duration: 00:00:17.00, start: 0.000000, bitrate: 259 kb/s
Stream #3:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 640x360, 53 kb/s, 60 fps, 60 tbr, 15360 tbn, 120 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #3:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 193 kb/s (default)
Metadata:
handler_name : SoundHandler
Input #4, mov,mp4,m4a,3gp,3g2,mj2, from 'bor.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.45.100
Duration: 00:00:09.00, start: 0.000000, bitrate: 255 kb/s
Stream #4:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 640x360, 48 kb/s, 60 fps, 60 tbr, 15360 tbn, 120 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #4:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 192 kb/s (default)
Metadata:
handler_name : SoundHandler
Input #5, mov,mp4,m4a,3gp,3g2,mj2, from 'cen.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.45.100
Duration: 00:00:07.00, start: 0.000000, bitrate: 461 kb/s
Stream #5:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 640x360, 250 kb/s, 60 fps, 60 tbr, 15360 tbn, 120 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #5:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 196 kb/s (default)
Metadata:
handler_name : SoundHandler
Input #6, mov,mp4,m4a,3gp,3g2,mj2, from 'cha.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.45.100
Duration: 00:00:05.00, start: 0.000000, bitrate: 267 kb/s
Stream #6:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 640x360, 59 kb/s, 60 fps, 60 tbr, 15360 tbn, 120 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #6:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 194 kb/s (default)
Metadata:
handler_name : SoundHandler
Input #7, mov,mp4,m4a,3gp,3g2,mj2, from 'grad.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.45.100
Duration: 00:00:05.01, start: 0.000000, bitrate: 246 kb/s
Stream #7:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 640x360, 39 kb/s, 60 fps, 60 tbr, 15360 tbn, 120 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #7:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 192 kb/s (default)
Metadata:
handler_name : SoundHandler
Input #8, mov,mp4,m4a,3gp,3g2,mj2, from 'gram.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.45.100
Duration: 00:00:09.00, start: 0.000000, bitrate: 294 kb/s
Stream #8:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 640x360, 86 kb/s, 60 fps, 60 tbr, 15360 tbn, 120 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #8:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 195 kb/s (default)
Metadata:
handler_name : SoundHandler
Input #9, mov,mp4,m4a,3gp,3g2,mj2, from 'htv.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.45.100
Duration: 00:00:12.01, start: 0.000000, bitrate: 238 kb/s
Stream #9:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 640x360, 29 kb/s, 60 fps, 60 tbr, 15360 tbn, 120 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #9:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 196 kb/s (default)
Metadata:
handler_name : SoundHandler
Input #10, mov,mp4,m4a,3gp,3g2,mj2, from 'its1.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.45.100
Duration: 00:00:07.00, start: 0.000000, bitrate: 238 kb/s
Stream #10:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 640x360, 31 kb/s, 60 fps, 60 tbr, 15360 tbn, 120 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #10:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 192 kb/s (default)
Metadata:
handler_name : SoundHandler
Input #11, mov,mp4,m4a,3gp,3g2,mj2, from 'its2.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.45.100
Duration: 00:00:08.00, start: 0.000000, bitrate: 241 kb/s
Stream #11:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 640x360, 34 kb/s, 60 fps, 60 tbr, 15360 tbn, 120 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #11:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 192 kb/s (default)
Metadata:
handler_name : SoundHandler
Input #12, mov,mp4,m4a,3gp,3g2,mj2, from 'lwt.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.45.100
Duration: 00:00:10.00, start: 0.000000, bitrate: 239 kb/s
Stream #12:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 640x360, 30 kb/s, 60 fps, 60 tbr, 15360 tbn, 120 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #12:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 195 kb/s (default)
Metadata:
handler_name : SoundHandler
Input #13, mov,mp4,m4a,3gp,3g2,mj2, from 'sou.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.45.100
Duration: 00:00:08.00, start: 0.000000, bitrate: 247 kb/s
Stream #13:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 640x360, 39 kb/s, 60 fps, 60 tbr, 15360 tbn, 120 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #13:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 194 kb/s (default)
Metadata:
handler_name : SoundHandler
Input #14, mov,mp4,m4a,3gp,3g2,mj2, from 'stv.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.45.100
Duration: 00:00:09.00, start: 0.000000, bitrate: 257 kb/s
Stream #14:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 640x360, 51 kb/s, 60 fps, 60 tbr, 15360 tbn, 120 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #14:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 192 kb/s (default)
Metadata:
handler_name : SoundHandler
Input #15, mov,mp4,m4a,3gp,3g2,mj2, from 'tha.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.45.100
Duration: 00:00:06.00, start: 0.000000, bitrate: 454 kb/s
Stream #15:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 640x360, 245 kb/s, 60 fps, 60 tbr, 15360 tbn, 120 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #15:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 194 kb/s (default)
Metadata:
handler_name : SoundHandler
Input #16, mov,mp4,m4a,3gp,3g2,mj2, from 'tlc.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.45.100
Duration: 00:00:09.00, start: 0.000000, bitrate: 275 kb/s
Stream #16:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 640x360, 67 kb/s, 60 fps, 60 tbr, 15360 tbn, 120 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #16:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 194 kb/s (default)
Metadata:
handler_name : SoundHandler
Input #17, mov,mp4,m4a,3gp,3g2,mj2, from 'tsw.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.45.100
Duration: 00:00:11.00, start: 0.000000, bitrate: 457 kb/s
Stream #17:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 640x360, 251 kb/s, 60 fps, 60 tbr, 15360 tbn, 120 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #17:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 192 kb/s (default)
Metadata:
handler_name : SoundHandler
Input #18, mov,mp4,m4a,3gp,3g2,mj2, from 'ttt.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.45.100
Duration: 00:00:10.01, start: 0.000000, bitrate: 258 kb/s
Stream #18:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 640x360, 51 kb/s, 60 fps, 60 tbr, 15360 tbn, 120 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #18:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 193 kb/s (default)
Metadata:
handler_name : SoundHandler
Input #19, mov,mp4,m4a,3gp,3g2,mj2, from 'tvam.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf57.82.100
Duration: 00:00:11.31, start: 0.000000, bitrate: 383 kb/s
Stream #19:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 352x288 [SAR 178:163 DAR 1958:1467], 251 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #19:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 125 kb/s (default)
Metadata:
handler_name : SoundHandler
Input #20, mov,mp4,m4a,3gp,3g2,mj2, from 'tvs.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.45.100
Duration: 00:00:10.01, start: 0.000000, bitrate: 252 kb/s
Stream #20:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 640x360, 44 kb/s, 60 fps, 60 tbr, 15360 tbn, 120 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #20:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 194 kb/s (default)
Metadata:
handler_name : SoundHandler
Input #21, mov,mp4,m4a,3gp,3g2,mj2, from 'tww.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.45.100
Duration: 00:00:09.00, start: 0.000000, bitrate: 277 kb/s
Stream #21:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 640x360, 69 kb/s, 60 fps, 60 tbr, 15360 tbn, 120 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #21:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 194 kb/s (default)
Metadata:
handler_name : SoundHandler
Input #22, mov,mp4,m4a,3gp,3g2,mj2, from 'utv.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.45.100
Duration: 00:00:08.00, start: 0.000000, bitrate: 443 kb/s
Stream #22:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 640x360, 234 kb/s, 60 fps, 60 tbr, 15360 tbn, 120 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #22:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 194 kb/s (default)
Metadata:
handler_name : SoundHandler
Input #23, mov,mp4,m4a,3gp,3g2,mj2, from 'wtv.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.45.100
Duration: 00:00:08.00, start: 0.000000, bitrate: 431 kb/s
Stream #23:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 640x360, 224 kb/s, 60 fps, 60 tbr, 15360 tbn, 120 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #23:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 194 kb/s (default)
Metadata:
handler_name : SoundHandler
Input #24, mov,mp4,m4a,3gp,3g2,mj2, from 'ytv.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.45.100
Duration: 00:00:08.00, start: 0.000000, bitrate: 332 kb/s
Stream #24:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 640x360, 123 kb/s, 60 fps, 60 tbr, 15360 tbn, 120 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #24:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 195 kb/s (default)
Metadata:
handler_name : SoundHandler
[AVFilterGraph @ 0x55ad3b4d4a00] No such filter: ' '
Error initializing complex filters.
Invalid argument
layout
代码现在变得极其复杂,但我已经仔细按照手册中给出的 4x4 示例进行操作 here,我认为我没有做错什么。分解并重新排序我上面使用的 layout
代码如下所示:
input1(0, 0) | input6 (w0, 0) | input11(w0+w4, 0) | input16(w0+w4+w8, 0) | input21(w0+w4+w8+w12, 0)
input2(0, h0) | input7 (w0, h0) | input12(w0+w4, h0) | input17(w0+w4+w8, h0) | input22(w0+w4+w8+w12, h0)
input3(0, h0+h1) | input8 (w0, h0+h1) | input13(w0+w4, h0+h1) | input18(w0+w4+w8, h0+h1) | input23(w0+w4+w8+w12, h0+h1)
input4(0, h0+h1+h2) | input9 (w0, h0+h1+h2) | input14(w0+w4, h0+h1+h2) | input19(w0+w4+w8, h0+h1+h2) | input24(w0+w4+w8+w12, h0+h1+h2)
input5(0, h0+h1+h2+h3)| input10(w0, h0+h1+h2+h3) | input15(w0+w4, h0+h1+h2+h3)| input20(w0+w4+w8, h0+h1+h2+h3)| input25(w0+w4+w8+w12, h0+h1+h2+h3)
在我看来,w12
和 h3
逻辑上将是下一组要添加的宽度和高度参数,以使网格从 4x4 扩展到 5x5 有效。这就是导致代码窒息的原因吗?如果不是这个,我就不太清楚它可能是什么,因为我已经尽可能彻底地检查了整个代码。
再次感谢您的帮助。
非常感谢,克莱夫
No such filter: ' '
您的某些反斜杠 (\
) 后面有空格。删除空格:
ffmpeg -i a.mp4 -i b.mp4 -i c.mp4 -i d.mp4 -i e.mp4 -i f.mp4 -i g.mp4 -i h.mp4 -i i.mp4 -i j.mp4 -i k.mp4 -i l.mp4 -i m.mp4 -i n.mp4 -i o.mp4 -i p.mp4 -i q.mp4 -i r.mp4 -i s.mp4 -i t.mp4 -i u.mp4 -i v.mp4 -i w.mp4 -i x.mp4 -i y.mp4 \
-filter_complex \
"[0:v]scale=iw/5:-1[v0];[1:v]scale=iw/5:-1[v1];[2:v]scale=iw/5:-1[v2]; \
[3:v]scale=iw/5:-1[v3];[4:v]scale=iw/5:-1[v4];[5:v]scale=iw/5:-1[v5]; \
[6:v]scale=iw/5:-1[v6];[7:v]scale=iw/5:-1[v7];[8:v]scale=iw/5:-1[v8]; \
[9:v]scale=iw/5:-1[v9];[10:v]scale=iw/5:-1[v10];[11:v]scale=iw/5:-1[v11]; \
[12:v]scale=iw/5:-1[v12];[13:v]scale=iw/5:-1[v13];[14:v]scale=iw/5:-1[v14]; \
[15:v]scale=iw/5:-1[v15];[16:v]scale=iw/5:-1[v16];[17:v]scale=iw/5:-1[v17]; \
[18:v]scale=iw/5:-1[v18];[19:v]scale=iw/5:-1[v19];[20:v]scale=iw/5:-1[v20]; \
[21:v]scale=iw/5:-1[v21];[22:v]scale=iw/5:-1[v22];[23:v]scale=iw/5:-1[v23]; \
[24:v]scale=iw/5:-1[v24]; \
[v0][v1][v2][v3][v4][v5][v6][v7][v8][v9][v10][v11][v12][v13][v14][v15][v16][v17][v18][v19][v20][v21][v22][v23][v24]xstack=inputs=25:layout=0_0|0_h0|0_h0+h1|0_h0+h1+h2|0_h0+h1+h2+h3|w0_0|w0_h0|w0_h0+h1|w0_h0+h1+h2|w0_h0+h1+h2+h3|w0+w4_0|w0+w4_h0|w0+w4_h0+h1|w0+w4_h0+h1+h2|w0+w4_h0+h1+h2+h3|w0+w4+w8_0|w0+w4+w8_h0|w0+w4+w8_h0+h1|w0+w4+w8_h0+h1+h2|w0+w4+w8_h0+h1+h2+h3|w0+w4+w8+w12_0|w0+w4+w8+w12_h0|w0+w4+w8+w12_h0+h1|w0+w4+w8+w12_h0+h1+h2|w0+w4+w8+w12_h0+h1+h2+h3; \
[0:a][1:a][2:a][3:a][4:a][5:a][6:a][7:a][8:a][9:a][10:a][11:a][12:a][13:a][14:a][15:a][16:a][17:a][18:a][19:a][20:a][21:a][22:a][23:a][24:a]amix=inputs=25" \
output.mp4
或者把命令写成一长行:
ffmpeg -i a.mp4 -i b.mp4 -i c.mp4 -i d.mp4 -i e.mp4 -i f.mp4 -i g.mp4 -i h.mp4 -i i.mp4 -i j.mp4 -i k.mp4 -i l.mp4 -i m.mp4 -i n.mp4 -i o.mp4 -i p.mp4 -i q.mp4 -i r.mp4 -i s.mp4 -i t.mp4 -i u.mp4 -i v.mp4 -i w.mp4 -i x.mp4 -i y.mp4 -filter_complex "[0:v]scale=iw/5:-1[v0];[1:v]scale=iw/5:-1[v1];[2:v]scale=iw/5:-1[v2];[3:v]scale=iw/5:-1[v3];[4:v]scale=iw/5:-1[v4];[5:v]scale=iw/5:-1[v5];[6:v]scale=iw/5:-1[v6];[7:v]scale=iw/5:-1[v7];[8:v]scale=iw/5:-1[v8];[9:v]scale=iw/5:-1[v9];[10:v]scale=iw/5:-1[v10];[11:v]scale=iw/5:-1[v11];[12:v]scale=iw/5:-1[v12];[13:v]scale=iw/5:-1[v13];[14:v]scale=iw/5:-1[v14];[15:v]scale=iw/5:-1[v15];[16:v]scale=iw/5:-1[v16];[17:v]scale=iw/5:-1[v17];[18:v]scale=iw/5:-1[v18];[19:v]scale=iw/5:-1[v19];[20:v]scale=iw/5:-1[v20];[21:v]scale=iw/5:-1[v21];[22:v]scale=iw/5:-1[v22];[23:v]scale=iw/5:-1[v23];[24:v]scale=iw/5:-1[v24];[v0][v1][v2][v3][v4][v5][v6][v7][v8][v9][v10][v11][v12][v13][v14][v15][v16][v17][v18][v19][v20][v21][v22][v23][v24]xstack=inputs=25:layout=0_0|0_h0|0_h0+h1|0_h0+h1+h2|0_h0+h1+h2+h3|w0_0|w0_h0|w0_h0+h1|w0_h0+h1+h2|w0_h0+h1+h2+h3|w0+w4_0|w0+w4_h0|w0+w4_h0+h1|w0+w4_h0+h1+h2|w0+w4_h0+h1+h2+h3|w0+w4+w8_0|w0+w4+w8_h0|w0+w4+w8_h0+h1|w0+w4+w8_h0+h1+h2|w0+w4+w8_h0+h1+h2+h3|w0+w4+w8+w12_0|w0+w4+w8+w12_h0|w0+w4+w8+w12_h0+h1|w0+w4+w8+w12_h0+h1+h2|w0+w4+w8+w12_h0+h1+h2+h3;[0:a][1:a][2:a][3:a][4:a][5:a][6:a][7:a][8:a][9:a][10:a][11:a][12:a][13:a][14:a][15:a][16:a][17:a][18:a][19:a][20:a][21:a][22:a][23:a][24:a]amix=inputs=25" output.mp4
我现在正在寻求将
ffmpeg -i a.mp4 -i b.mp4 -i c.mp4 -i d.mp4 -i e.mp4 -i f.mp4 -i g.mp4 -i h.mp4 -i i.mp4 -i j.mp4 -i k.mp4 -i l.mp4 -i m.mp4 -i n.mp4 -i o.mp4 -i p.mp4 -i q.mp4 -i r.mp4 -i s.mp4 -i t.mp4 -i u.mp4 -i v.mp4 -i w.mp4 -i x.mp4 -i y.mp4 \
-filter_complex \
"[0:v]scale=iw/5:-1[v0];[1:v]scale=iw/5:-1[v1];[2:v]scale=iw/5:-1[v2]; \
[3:v]scale=iw/5:-1[v3];[4:v]scale=iw/5:-1[v4];[5:v]scale=iw/5:-1[v5]; \
[6:v]scale=iw/5:-1[v6];[7:v]scale=iw/5:-1[v7];[8:v]scale=iw/5:-1[v8]; \
[9:v]scale=iw/5:-1[v9];[10:v]scale=iw/5:-1[v10];[11:v]scale=iw/5:-1[v11]; \
[12:v]scale=iw/5:-1[v12];[13:v]scale=iw/5:-1[v13];[14:v]scale=iw/5:-1[v14]; \
[15:v]scale=iw/5:-1[v15];[16:v]scale=iw/5:-1[v16];[17:v]scale=iw/5:-1[v17]; \
[18:v]scale=iw/5:-1[v18];[19:v]scale=iw/5:-1[v19];[20:v]scale=iw/5:-1[v20]; \
[21:v]scale=iw/5:-1[v21];[22:v]scale=iw/5:-1[v22];[23:v]scale=iw/5:-1[v23]; \
[24:v]scale=iw/5:-1[v24]; \
[v0][v1][v2][v3][v4][v5][v6][v7][v8][v9][v10][v11][v12][v13][v14][v15][v16][v17][v18][v19][v20][v21][v22][v23][v24]xstack=inputs=25:layout=0_0|0_h0|0_h0+h1|0_h0+h1+h2|0_h0+h1+h2+h3|w0_0|w0_h0|w0_h0+h1|w0_h0+h1+h2|w0_h0+h1+h2+h3|w0+w4_0|w0+w4_h0|w0+w4_h0+h1|w0+w4_h0+h1+h2|w0+w4_h0+h1+h2+h3|w0+w4+w8_0|w0+w4+w8_h0|w0+w4+w8_h0+h1|w0+w4+w8_h0+h1+h2|w0+w4+w8_h0+h1+h2+h3|w0+w4+w8+w12_0|w0+w4+w8+w12_h0|w0+w4+w8+w12_h0+h1|w0+w4+w8+w12_h0+h1+h2|w0+w4+w8+w12_h0+h1+h2+h3; \
[0:a][1:a][2:a][3:a][4:a][5:a][6:a][7:a][8:a][9:a][10:a][11:a][12:a][13:a][14:a][15:a][16:a][17:a][18:a][19:a][20:a][21:a][22:a][23:a][24:a]amix=inputs=25" \
output.mp4
不幸的是,这会产生错误:
ffmpeg version 4.3.2-0+deb11u1ubuntu1 Copyright (c) 2000-2021 the FFmpeg developers
built with gcc 10 (Ubuntu 10.2.1-20ubuntu1)
configuration: --prefix=/usr --extra-version=0+deb11u1ubuntu1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-pocketsphinx --enable-libmfx --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-nvenc --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
WARNING: library configuration mismatch
avcodec configuration: --prefix=/usr --extra-version=0+deb11u1ubuntu1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-pocketsphinx --enable-libmfx --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-nvenc --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared --enable-version3 --disable-doc --disable-programs --enable-libaribb24 --enable-liblensfun --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libtesseract --enable-libvo_amrwbenc
libavutil 56. 51.100 / 56. 51.100
libavcodec 58. 91.100 / 58. 91.100
libavformat 58. 45.100 / 58. 45.100
libavdevice 58. 10.100 / 58. 10.100
libavfilter 7. 85.100 / 7. 85.100
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 7.100 / 5. 7.100
libswresample 3. 7.100 / 3. 7.100
libpostproc 55. 7.100 / 55. 7.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'abc.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.45.100
Duration: 00:00:08.00, start: 0.000000, bitrate: 248 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 640x360, 41 kb/s, 60 fps, 60 tbr, 15360 tbn, 120 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 193 kb/s (default)
Metadata:
handler_name : SoundHandler
Input #1, mov,mp4,m4a,3gp,3g2,mj2, from 'ang.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.45.100
Duration: 00:00:10.00, start: 0.000000, bitrate: 480 kb/s
Stream #1:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 640x360, 271 kb/s, 60 fps, 60 tbr, 15360 tbn, 120 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #1:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 194 kb/s (default)
Metadata:
handler_name : SoundHandler
Input #2, mov,mp4,m4a,3gp,3g2,mj2, from 'ard.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.45.100
Duration: 00:00:09.00, start: 0.000000, bitrate: 256 kb/s
Stream #2:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 640x360, 49 kb/s, 60 fps, 60 tbr, 15360 tbn, 120 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #2:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 193 kb/s (default)
Metadata:
handler_name : SoundHandler
Input #3, mov,mp4,m4a,3gp,3g2,mj2, from 'atv.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.45.100
Duration: 00:00:17.00, start: 0.000000, bitrate: 259 kb/s
Stream #3:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 640x360, 53 kb/s, 60 fps, 60 tbr, 15360 tbn, 120 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #3:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 193 kb/s (default)
Metadata:
handler_name : SoundHandler
Input #4, mov,mp4,m4a,3gp,3g2,mj2, from 'bor.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.45.100
Duration: 00:00:09.00, start: 0.000000, bitrate: 255 kb/s
Stream #4:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 640x360, 48 kb/s, 60 fps, 60 tbr, 15360 tbn, 120 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #4:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 192 kb/s (default)
Metadata:
handler_name : SoundHandler
Input #5, mov,mp4,m4a,3gp,3g2,mj2, from 'cen.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.45.100
Duration: 00:00:07.00, start: 0.000000, bitrate: 461 kb/s
Stream #5:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 640x360, 250 kb/s, 60 fps, 60 tbr, 15360 tbn, 120 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #5:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 196 kb/s (default)
Metadata:
handler_name : SoundHandler
Input #6, mov,mp4,m4a,3gp,3g2,mj2, from 'cha.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.45.100
Duration: 00:00:05.00, start: 0.000000, bitrate: 267 kb/s
Stream #6:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 640x360, 59 kb/s, 60 fps, 60 tbr, 15360 tbn, 120 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #6:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 194 kb/s (default)
Metadata:
handler_name : SoundHandler
Input #7, mov,mp4,m4a,3gp,3g2,mj2, from 'grad.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.45.100
Duration: 00:00:05.01, start: 0.000000, bitrate: 246 kb/s
Stream #7:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 640x360, 39 kb/s, 60 fps, 60 tbr, 15360 tbn, 120 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #7:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 192 kb/s (default)
Metadata:
handler_name : SoundHandler
Input #8, mov,mp4,m4a,3gp,3g2,mj2, from 'gram.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.45.100
Duration: 00:00:09.00, start: 0.000000, bitrate: 294 kb/s
Stream #8:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 640x360, 86 kb/s, 60 fps, 60 tbr, 15360 tbn, 120 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #8:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 195 kb/s (default)
Metadata:
handler_name : SoundHandler
Input #9, mov,mp4,m4a,3gp,3g2,mj2, from 'htv.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.45.100
Duration: 00:00:12.01, start: 0.000000, bitrate: 238 kb/s
Stream #9:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 640x360, 29 kb/s, 60 fps, 60 tbr, 15360 tbn, 120 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #9:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 196 kb/s (default)
Metadata:
handler_name : SoundHandler
Input #10, mov,mp4,m4a,3gp,3g2,mj2, from 'its1.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.45.100
Duration: 00:00:07.00, start: 0.000000, bitrate: 238 kb/s
Stream #10:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 640x360, 31 kb/s, 60 fps, 60 tbr, 15360 tbn, 120 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #10:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 192 kb/s (default)
Metadata:
handler_name : SoundHandler
Input #11, mov,mp4,m4a,3gp,3g2,mj2, from 'its2.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.45.100
Duration: 00:00:08.00, start: 0.000000, bitrate: 241 kb/s
Stream #11:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 640x360, 34 kb/s, 60 fps, 60 tbr, 15360 tbn, 120 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #11:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 192 kb/s (default)
Metadata:
handler_name : SoundHandler
Input #12, mov,mp4,m4a,3gp,3g2,mj2, from 'lwt.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.45.100
Duration: 00:00:10.00, start: 0.000000, bitrate: 239 kb/s
Stream #12:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 640x360, 30 kb/s, 60 fps, 60 tbr, 15360 tbn, 120 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #12:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 195 kb/s (default)
Metadata:
handler_name : SoundHandler
Input #13, mov,mp4,m4a,3gp,3g2,mj2, from 'sou.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.45.100
Duration: 00:00:08.00, start: 0.000000, bitrate: 247 kb/s
Stream #13:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 640x360, 39 kb/s, 60 fps, 60 tbr, 15360 tbn, 120 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #13:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 194 kb/s (default)
Metadata:
handler_name : SoundHandler
Input #14, mov,mp4,m4a,3gp,3g2,mj2, from 'stv.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.45.100
Duration: 00:00:09.00, start: 0.000000, bitrate: 257 kb/s
Stream #14:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 640x360, 51 kb/s, 60 fps, 60 tbr, 15360 tbn, 120 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #14:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 192 kb/s (default)
Metadata:
handler_name : SoundHandler
Input #15, mov,mp4,m4a,3gp,3g2,mj2, from 'tha.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.45.100
Duration: 00:00:06.00, start: 0.000000, bitrate: 454 kb/s
Stream #15:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 640x360, 245 kb/s, 60 fps, 60 tbr, 15360 tbn, 120 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #15:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 194 kb/s (default)
Metadata:
handler_name : SoundHandler
Input #16, mov,mp4,m4a,3gp,3g2,mj2, from 'tlc.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.45.100
Duration: 00:00:09.00, start: 0.000000, bitrate: 275 kb/s
Stream #16:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 640x360, 67 kb/s, 60 fps, 60 tbr, 15360 tbn, 120 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #16:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 194 kb/s (default)
Metadata:
handler_name : SoundHandler
Input #17, mov,mp4,m4a,3gp,3g2,mj2, from 'tsw.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.45.100
Duration: 00:00:11.00, start: 0.000000, bitrate: 457 kb/s
Stream #17:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 640x360, 251 kb/s, 60 fps, 60 tbr, 15360 tbn, 120 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #17:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 192 kb/s (default)
Metadata:
handler_name : SoundHandler
Input #18, mov,mp4,m4a,3gp,3g2,mj2, from 'ttt.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.45.100
Duration: 00:00:10.01, start: 0.000000, bitrate: 258 kb/s
Stream #18:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 640x360, 51 kb/s, 60 fps, 60 tbr, 15360 tbn, 120 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #18:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 193 kb/s (default)
Metadata:
handler_name : SoundHandler
Input #19, mov,mp4,m4a,3gp,3g2,mj2, from 'tvam.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf57.82.100
Duration: 00:00:11.31, start: 0.000000, bitrate: 383 kb/s
Stream #19:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 352x288 [SAR 178:163 DAR 1958:1467], 251 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #19:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 125 kb/s (default)
Metadata:
handler_name : SoundHandler
Input #20, mov,mp4,m4a,3gp,3g2,mj2, from 'tvs.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.45.100
Duration: 00:00:10.01, start: 0.000000, bitrate: 252 kb/s
Stream #20:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 640x360, 44 kb/s, 60 fps, 60 tbr, 15360 tbn, 120 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #20:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 194 kb/s (default)
Metadata:
handler_name : SoundHandler
Input #21, mov,mp4,m4a,3gp,3g2,mj2, from 'tww.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.45.100
Duration: 00:00:09.00, start: 0.000000, bitrate: 277 kb/s
Stream #21:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 640x360, 69 kb/s, 60 fps, 60 tbr, 15360 tbn, 120 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #21:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 194 kb/s (default)
Metadata:
handler_name : SoundHandler
Input #22, mov,mp4,m4a,3gp,3g2,mj2, from 'utv.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.45.100
Duration: 00:00:08.00, start: 0.000000, bitrate: 443 kb/s
Stream #22:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 640x360, 234 kb/s, 60 fps, 60 tbr, 15360 tbn, 120 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #22:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 194 kb/s (default)
Metadata:
handler_name : SoundHandler
Input #23, mov,mp4,m4a,3gp,3g2,mj2, from 'wtv.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.45.100
Duration: 00:00:08.00, start: 0.000000, bitrate: 431 kb/s
Stream #23:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 640x360, 224 kb/s, 60 fps, 60 tbr, 15360 tbn, 120 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #23:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 194 kb/s (default)
Metadata:
handler_name : SoundHandler
Input #24, mov,mp4,m4a,3gp,3g2,mj2, from 'ytv.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.45.100
Duration: 00:00:08.00, start: 0.000000, bitrate: 332 kb/s
Stream #24:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 640x360, 123 kb/s, 60 fps, 60 tbr, 15360 tbn, 120 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #24:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 195 kb/s (default)
Metadata:
handler_name : SoundHandler
[AVFilterGraph @ 0x55ad3b4d4a00] No such filter: ' '
Error initializing complex filters.
Invalid argument
layout
代码现在变得极其复杂,但我已经仔细按照手册中给出的 4x4 示例进行操作 here,我认为我没有做错什么。分解并重新排序我上面使用的 layout
代码如下所示:
input1(0, 0) | input6 (w0, 0) | input11(w0+w4, 0) | input16(w0+w4+w8, 0) | input21(w0+w4+w8+w12, 0)
input2(0, h0) | input7 (w0, h0) | input12(w0+w4, h0) | input17(w0+w4+w8, h0) | input22(w0+w4+w8+w12, h0)
input3(0, h0+h1) | input8 (w0, h0+h1) | input13(w0+w4, h0+h1) | input18(w0+w4+w8, h0+h1) | input23(w0+w4+w8+w12, h0+h1)
input4(0, h0+h1+h2) | input9 (w0, h0+h1+h2) | input14(w0+w4, h0+h1+h2) | input19(w0+w4+w8, h0+h1+h2) | input24(w0+w4+w8+w12, h0+h1+h2)
input5(0, h0+h1+h2+h3)| input10(w0, h0+h1+h2+h3) | input15(w0+w4, h0+h1+h2+h3)| input20(w0+w4+w8, h0+h1+h2+h3)| input25(w0+w4+w8+w12, h0+h1+h2+h3)
在我看来,w12
和 h3
逻辑上将是下一组要添加的宽度和高度参数,以使网格从 4x4 扩展到 5x5 有效。这就是导致代码窒息的原因吗?如果不是这个,我就不太清楚它可能是什么,因为我已经尽可能彻底地检查了整个代码。
再次感谢您的帮助。
非常感谢,克莱夫
No such filter: ' '
您的某些反斜杠 (\
) 后面有空格。删除空格:
ffmpeg -i a.mp4 -i b.mp4 -i c.mp4 -i d.mp4 -i e.mp4 -i f.mp4 -i g.mp4 -i h.mp4 -i i.mp4 -i j.mp4 -i k.mp4 -i l.mp4 -i m.mp4 -i n.mp4 -i o.mp4 -i p.mp4 -i q.mp4 -i r.mp4 -i s.mp4 -i t.mp4 -i u.mp4 -i v.mp4 -i w.mp4 -i x.mp4 -i y.mp4 \
-filter_complex \
"[0:v]scale=iw/5:-1[v0];[1:v]scale=iw/5:-1[v1];[2:v]scale=iw/5:-1[v2]; \
[3:v]scale=iw/5:-1[v3];[4:v]scale=iw/5:-1[v4];[5:v]scale=iw/5:-1[v5]; \
[6:v]scale=iw/5:-1[v6];[7:v]scale=iw/5:-1[v7];[8:v]scale=iw/5:-1[v8]; \
[9:v]scale=iw/5:-1[v9];[10:v]scale=iw/5:-1[v10];[11:v]scale=iw/5:-1[v11]; \
[12:v]scale=iw/5:-1[v12];[13:v]scale=iw/5:-1[v13];[14:v]scale=iw/5:-1[v14]; \
[15:v]scale=iw/5:-1[v15];[16:v]scale=iw/5:-1[v16];[17:v]scale=iw/5:-1[v17]; \
[18:v]scale=iw/5:-1[v18];[19:v]scale=iw/5:-1[v19];[20:v]scale=iw/5:-1[v20]; \
[21:v]scale=iw/5:-1[v21];[22:v]scale=iw/5:-1[v22];[23:v]scale=iw/5:-1[v23]; \
[24:v]scale=iw/5:-1[v24]; \
[v0][v1][v2][v3][v4][v5][v6][v7][v8][v9][v10][v11][v12][v13][v14][v15][v16][v17][v18][v19][v20][v21][v22][v23][v24]xstack=inputs=25:layout=0_0|0_h0|0_h0+h1|0_h0+h1+h2|0_h0+h1+h2+h3|w0_0|w0_h0|w0_h0+h1|w0_h0+h1+h2|w0_h0+h1+h2+h3|w0+w4_0|w0+w4_h0|w0+w4_h0+h1|w0+w4_h0+h1+h2|w0+w4_h0+h1+h2+h3|w0+w4+w8_0|w0+w4+w8_h0|w0+w4+w8_h0+h1|w0+w4+w8_h0+h1+h2|w0+w4+w8_h0+h1+h2+h3|w0+w4+w8+w12_0|w0+w4+w8+w12_h0|w0+w4+w8+w12_h0+h1|w0+w4+w8+w12_h0+h1+h2|w0+w4+w8+w12_h0+h1+h2+h3; \
[0:a][1:a][2:a][3:a][4:a][5:a][6:a][7:a][8:a][9:a][10:a][11:a][12:a][13:a][14:a][15:a][16:a][17:a][18:a][19:a][20:a][21:a][22:a][23:a][24:a]amix=inputs=25" \
output.mp4
或者把命令写成一长行:
ffmpeg -i a.mp4 -i b.mp4 -i c.mp4 -i d.mp4 -i e.mp4 -i f.mp4 -i g.mp4 -i h.mp4 -i i.mp4 -i j.mp4 -i k.mp4 -i l.mp4 -i m.mp4 -i n.mp4 -i o.mp4 -i p.mp4 -i q.mp4 -i r.mp4 -i s.mp4 -i t.mp4 -i u.mp4 -i v.mp4 -i w.mp4 -i x.mp4 -i y.mp4 -filter_complex "[0:v]scale=iw/5:-1[v0];[1:v]scale=iw/5:-1[v1];[2:v]scale=iw/5:-1[v2];[3:v]scale=iw/5:-1[v3];[4:v]scale=iw/5:-1[v4];[5:v]scale=iw/5:-1[v5];[6:v]scale=iw/5:-1[v6];[7:v]scale=iw/5:-1[v7];[8:v]scale=iw/5:-1[v8];[9:v]scale=iw/5:-1[v9];[10:v]scale=iw/5:-1[v10];[11:v]scale=iw/5:-1[v11];[12:v]scale=iw/5:-1[v12];[13:v]scale=iw/5:-1[v13];[14:v]scale=iw/5:-1[v14];[15:v]scale=iw/5:-1[v15];[16:v]scale=iw/5:-1[v16];[17:v]scale=iw/5:-1[v17];[18:v]scale=iw/5:-1[v18];[19:v]scale=iw/5:-1[v19];[20:v]scale=iw/5:-1[v20];[21:v]scale=iw/5:-1[v21];[22:v]scale=iw/5:-1[v22];[23:v]scale=iw/5:-1[v23];[24:v]scale=iw/5:-1[v24];[v0][v1][v2][v3][v4][v5][v6][v7][v8][v9][v10][v11][v12][v13][v14][v15][v16][v17][v18][v19][v20][v21][v22][v23][v24]xstack=inputs=25:layout=0_0|0_h0|0_h0+h1|0_h0+h1+h2|0_h0+h1+h2+h3|w0_0|w0_h0|w0_h0+h1|w0_h0+h1+h2|w0_h0+h1+h2+h3|w0+w4_0|w0+w4_h0|w0+w4_h0+h1|w0+w4_h0+h1+h2|w0+w4_h0+h1+h2+h3|w0+w4+w8_0|w0+w4+w8_h0|w0+w4+w8_h0+h1|w0+w4+w8_h0+h1+h2|w0+w4+w8_h0+h1+h2+h3|w0+w4+w8+w12_0|w0+w4+w8+w12_h0|w0+w4+w8+w12_h0+h1|w0+w4+w8+w12_h0+h1+h2|w0+w4+w8+w12_h0+h1+h2+h3;[0:a][1:a][2:a][3:a][4:a][5:a][6:a][7:a][8:a][9:a][10:a][11:a][12:a][13:a][14:a][15:a][16:a][17:a][18:a][19:a][20:a][21:a][22:a][23:a][24:a]amix=inputs=25" output.mp4