Estou tentando usar o ffmpeg para importar três arquivos, dois vídeos e um áudio. Quero reduzir o primeiro vídeo, substituir o áudio pelo arquivo de áudio e adicionar um vídeo ao final do resultado.
Aqui está o que eu tenho até agora, e definitivamente não funciona. Estou tendo dificuldade em usar dois filtros para obter minha câmera lenta e concatenar juntos.
ffmpeg -i /Users/dailyops/Desktop/source0.mp4 -i /Users/dailyops/Desktop/music.m4a -i /Users/dailyops/Desktop/outro.mp4 -vf [0:v]setpts=3*PTS [v0] -filter_complex [v0][1:a:0][2:v:0][2:a:0]concat=n=2:v=1:a=1[v1][a] -map [v1] -map [a] -shortest -vcodec libx264 -preset ultrafast -crf 22 -pix_fmt yuv420p -r 29.97 /Users/dailyops/Desktop/output1.mp4
Isso está perto de ser viável?
O comando resulta no seguinte:
ffmpeg version 3.3.2 Copyright (c) 2000-2017 the FFmpeg developers
built with Apple LLVM version 8.1.0 (clang-802.0.42)
configuration: --prefix=/usr/local/Cellar/ffmpeg/3.3.2 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxvid --enable-opencl --disable-lzma --enable-nonfree --enable-vda
libavutil 55. 58.100 / 55. 58.100
libavcodec 57. 89.100 / 57. 89.100
libavformat 57. 71.100 / 57. 71.100
libavdevice 57. 6.100 / 57. 6.100
libavfilter 6. 82.100 / 6. 82.100
libavresample 3. 5. 0 / 3. 5. 0
libswscale 4. 6.100 / 4. 6.100
libswresample 2. 7.100 / 2. 7.100
libpostproc 54. 5.100 / 54. 5.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/Users/dailyops/Desktop/source0.mp4':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: isommp42
creation_time : 2017-04-15T07:07:08.000000Z
Duration: 00:03:20.81, start: 0.000000, bitrate: 1081 kb/s
Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709), 1280x720 [SAR 1:1 DAR 16:9], 951 kb/s, 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc (default)
Metadata:
creation_time : 2017-04-15T07:07:08.000000Z
handler_name : ISO Media file produced by Google Inc.
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 125 kb/s (default)
Metadata:
creation_time : 2017-04-15T07:07:08.000000Z
handler_name : ISO Media file produced by Google Inc.
[aac @ 0x7fb2718a9800] Assuming an incorrectly encoded 7.1 channel layout instead of a spec-compliant 7.1(wide) layout, use -strict 1 to decode according to the specification instead.
Input #1, mov,mp4,m4a,3gp,3g2,mj2, from '/Users/dailyops/Desktop/music.m4a':
Metadata:
major_brand : M4A
minor_version : 0
compatible_brands: M4A mp42isom
creation_time : 2015-12-16T22:35:44.000000Z
iTunSMPB : 00000000 00000DFD 0000034B 00000000000B0EB8 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
Duration: 00:00:16.53, start: 0.081202, bitrate: 243 kb/s
Stream #1:0(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, 7.1, fltp, 241 kb/s (default)
Metadata:
creation_time : 2015-12-16T22:35:44.000000Z
handler_name : Core Media Audio
Input #2, mov,mp4,m4a,3gp,3g2,mj2, from '/Users/dailyops/Desktop/outro.mp4':
Metadata:
major_brand : mp42
minor_version : 512
compatible_brands: isomiso2avc1mp41
creation_time : 2017-07-04T19:21:14.000000Z
encoder : HandBrake 1.0.7 2017040900
Duration: 00:00:06.06, start: 0.000000, bitrate: 1153 kb/s
Stream #2:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709), 1280x720 [SAR 1:1 DAR 16:9], 1036 kb/s, 29.97 fps, 29.97 tbr, 90k tbn, 180k tbc (default)
Metadata:
creation_time : 2017-07-04T19:21:14.000000Z
handler_name : VideoHandler
Stream #2:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 112 kb/s (default)
Metadata:
creation_time : 2017-07-04T19:21:14.000000Z
handler_name : Stereo
[NULL @ 0x7fb272000000] Unable to find a suitable output format for '[v0]'
[v0]: Invalid argument