FFMPEGは音声のない2つのビデオを結合します

FFMPEGは音声のない2つのビデオを結合します

複数の画像をビデオに組み合わせて作成された 2 つの異なるビデオを作成しました。以下はそのコマンドです。

"-f","concat","-safe", "0","-i",path,"-vsync","vfr","-pix_fmt","yuv420p",Environment.getExternalStorageDirectory().path+"/output1.mp4"

ここで、パスは、結合する必要があるすべての画像のパスを指定したテキスト ファイルの入力パスです。

今、私はこれら 2 つのビデオを 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;[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]、838 kb/s、0.83 fps、1 tbr、12800 tbn、50 tbc (デフォルト)

両方のビデオの詳細は次のとおりです。

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

関連情報