ビデオに画像をオーバーレイしています。多くのリンクを通過しましたが、試した結果が得られません。
frame0.jpg frame1.jpgframe2.jpgなどの名前の複数の画像があります
だから私はこのコマンドで試してみます
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
出力:ビデオに単一の画像を正常にオーバーレイします
1秒あたりの画像をビデオにオーバーレイする必要があり、画像シーケンスはframe1.jpg、frame2.jpgなどです。
出力の試行は、ビデオに追加される1秒ごとの新しいフレームです。
例:
2番目の1:frame1.jpg
2番目の2:frame2.jpg
2番目の3:frame3.jpg
2番目の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
これは作成されたファイルです
/storage/emulated/0/Pictures/Video/frame1.jpg
/storage/emulated/0/Pictures/Video/frame2.jpg
/storage/emulated/0/Pictures/Video/frame3.jpg
画像にシーケンスとして名前が付けられている場合は、次を使用できます
ffmpeg -y -i /storage/emulated/0/DCIM/Camera/VID_20171211_105946.3gp -framerate 1 -i
/storage/emulated/0/Pictures/Video/frame%d.jpg -filter_complex
[1][0]scale2ref[i][m];[i]fps=25[i];[m][i]overlay[v] -map [v] -map 0:a? -ac 2
/storage/emulated/0/Pictures/Video/out.mp4
この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]
コメントを追加