
여러 이미지를 비디오로 결합하여 생성된 두 개의 다른 비디오를 만들었습니다. 아래는 이에 대한 명령입니다.
"-f","concat","-safe", "0","-i",path,"-vsync","vfr","-pix_fmt","yuv420p",Environment.getExternalStorageDirectory().path+"/output1.mp4"
여기서 path는 병합해야 하는 모든 이미지의 경로를 지정한 텍스트 파일의 입력 경로입니다.
이제 이 두 비디오를 하나의 비디오로 병합하려고 합니다. 이를 위해 다음 명령을 사용하고 있습니다.
-i, /storage/emulated/0/output.mp4, -i, /storage/emulated/0/output1.mp4, -filter_complex, [1:v][0:v]scale2ref[ua][b];[ua]setsar=1;[0:v][1:v]concat=n=2:v=1:a=0[v], -map, [v], -preset, ultrafast, /storage/emulated/0/output3.mp4
그러나 작동하지 않으며 로그에 오류가 발생하지 않습니다. 그러나 이것은 진행 방식에서 인쇄되는 마지막 명령문이며 나에게는 오류처럼 보입니다.
스트림 #1:0(und): 비디오: h264(avc1 / 0x31637661), yuv420p, 1000x800 [SAR 1:1 DAR 5:4], 838kb/s, 0.83fps, 1tbr, 12800tbn, 50tbc(기본값) )
두 영상의 상세 내용입니다.
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/storage/emulated/0/output.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.12.100
Duration: 00:00:20.04, start: 0.000000, bitrate: 279 kb/s
Stream #0:0(und): Video: h264 (avc1 / 0x31637661), yuv420p, 1280x854 [SAR 1:1 DAR 640:427], 279 kb/s, 0.25 fps, 0.20 tbr, 12800 tbn, 50 tbc (default)
Metadata:
handler_name : VideoHandler
Input #1, mov,mp4,m4a,3gp,3g2,mj2, from '/storage/emulated/0/output1.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.12.100
Duration: 00:00:06.04, start: 0.000000, bitrate: 839 kb/s
Stream #1:0(und): Video: h264 (avc1 / 0x31637661), yuv420p, 1000x800 [SAR 1:1 DAR 5:4], 838 kb/s, 0.83 fps, 1 tbr, 12800 tbn, 50 tbc (default)
Metadata:
handler_name : VideoHandler
Input #2, lavfi, from 'anullsrc':
Duration: N/A, start: 0.000000, bitrate: 705 kb/s
Stream #2:0: Audio: pcm_u8, 44100 Hz, stereo, u8, 705 kb/s
내가 여기서 뭘 잘못하고 있는 거지?
업데이트 답변에서 공유한 명령어를 사용한 후의 로그입니다.
Successfully opened the file.
D/ffmpeg: progress [Parsed_scale2ref_0 @ 0xf16390c0] w:iw h:ih flags:'bilinear' interl:0
D/ffmpeg: progress [Parsed_setsar_1 @ 0xf1639120] Setting 'sar' to value '1'
D/ffmpeg: progress [Parsed_concat_2 @ 0xf1639180] Setting 'n' to value '2'
D/ffmpeg: progress [Parsed_concat_2 @ 0xf1639180] Setting 'v' to value '1'
D/ffmpeg: progress [Parsed_concat_2 @ 0xf1639180] Setting 'a' to value '0'
D/ffmpeg: progress Parsing a group of options: output url /storage/emulated/0/output3.mp4.
D/ffmpeg: progress Applying option map (set input stream mapping) with argument [v].
D/ffmpeg: progress Successfully parsed a group of options.
D/ffmpeg: progress Opening an output file: /storage/emulated/0/output3.mp4.
답변1
사용
-i, /storage/emulated/0/output.mp4, -i, /storage/emulated/0/output1.mp4,
-filter_complex, [1:v][0:v]scale2ref[ua][b];[ua]setsar=1[ua];[b][ua]concat=n=2:v=1:a=0[v],
-map, [v], -preset, ultrafast, /storage/emulated/0/output3.mp4