Estou sobrepondo imagens em vídeo, passei por muitos links mas não obtive o resultado que estou tentando,
Estou tendo várias imagens com o nome frame0.jpg frame1.jpg frame2.jpg e assim por diante
Então eu tento com esse comando
String[] complexCommand = {"-y", "-i", videoPath, "-i", dir.getAbsolutePath() + "/"
+ filePrefix + "1" + fileExtn ,"-filter_complex", "[1][0]scale2ref[i][m];[m][i]overlay[v]" ,
"-map", "[v]", "-map", "0:a?", "-ac", "2", dir.getAbsolutePath() + "/out.mp4"};
ffmpeg -y -i /storage/emulated/0/DCIM/Camera/VID_20171211_105946.3gp -i
/storage/emulated/0/Pictures/Video/frame1.jpg -filter_complex
[1][0]scale2ref[i][m];[m][i]overlay[v] -map [v] -map 0:a? -ac 2
/storage/emulated/0/Pictures/Video/out.mp4
ouput: Sobreponha uma única imagem em vídeo com êxito
Eu preciso sobrepor a imagem por segundo no vídeo e a minha sequência de imagens é
frame1.jpg, frame2.jpg e assim por diante
Tentando saída é cada segundo novo quadro a ser adicionado no vídeo.
Exemplo:
segundo 1: frame1.jpg
segundo 2: frame2.jpg
segundo 3: frame3.jpg
segundo 4: frame4.jpg
Error Logs:
Metadata:
major_brand : 3gp4
minor_version : 0
compatible_brands: isom3gp4
creation_time : 2017-12-11 05:29:46
com.android.version: 6.0
Duration: 00:00:02.60, start: 0.000000, bitrate: 17382 kb/s
Stream #0:0(eng): Video: h264 (Baseline) (avc1 / 0x31637661), yuv420p, 1920x1080, 17378 kb/s, SAR 1:1 DAR 16:9, 30.01 fps, 30.01 tbr, 90k tbn, 180k tbc (default)
Metadata:
rotate : 90
creation_time : 2017-12-11 05:29:46
handler_name : VideoHandle
Side data:
displaymatrix: rotation of -90.00 degrees
[mjpeg @ 0xf5b03800] bits 95 is invalid
[mjpeg @ 0xf5b03800] bits 200 is invalid
[mjpeg @ 0xf5b03800] Changing bps to 6
[mjpeg @ 0xf5b03800] [IMGUTILS @ 0xff9086a0] Picture size 7168x52505 is invalid
[image2 @ 0xf5b23600] decoding for stream 0 failed
[image2 @ 0xf5b23600] Could not find codec parameters for stream 0 (Video: mjpeg, none(bt470bg/unknown/unknown)): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
/storage/emulated/0/Pictures/Video/frame%d.jpg: could not find codec parameters
Input #1, image2, from '/storage/emulated/0/Pictures/Video/frame%d.jpg':
Duration: 00:00:03.00, start: 0.000000, bitrate: N/A
Stream #1:0: Video: mjpeg, none(bt470bg/unknown/unknown), 1 fps, 1 tbr, 1 tbn, 1 tbc
[buffer @ 0xf5a7a000] Unable to parse option value "0x0" as image size
[buffer @ 0xf5a7a000] Unable to parse option value "-1" as pixel format
[buffer @ 0xf5a7a000] Unable to parse option value "0x0" as image size
[buffer @ 0xf5a7a000] Error setting option video_size to value 0x0.
[graph 0 input from stream 1:0 @ 0xf5b17460] Error applying options to the filter.
Error configuring complex filters.
Invalid argument
12-12 12:21:09.298 22264-22264/com.package E/background: Finished command : ffmpeg
Estes são arquivos criados
/storage/emulated/0/Pictures/Video/frame1.jpg
/storage/emulated/0/Pictures/Video/frame2.jpg
/storage/emulated/0/Pictures/Video/frame3.jpg