我试图在第一个视频上叠加第二个视频(在圆圈上)。我试过了,但我的视频有问题!
command = "-i " + this.video1Path.getPath() + " -i " + this.video2Path.getPath() + " -filter_complex [1]trim=end_frame=1,geq=lum_expr='st(3,pow(X-(W/2),2)+pow(Y-(H/2),2));if(lte(ld(3),"
+ (this.mZoomLayout.getZoomedWidth()/2) + "*" + (this.mZoomLayout.getZoomedWidth()/2) + "),255,0)':128:128,format=gray,loop=-1:1,setpts=N/FRAME_RATE/TB[mask];[1][mask]alphamerge,format=rgba,lutrgb=a=if(gte(val\\,16)\\,val)[cutout];[0][cutout]overlay="
+ this.mZoomLayout.getCircleX() + ":" + this.mZoomLayout.getCircleY() + ":enable='between(t,0," + this.videoTwoDuration + ") -c:v libx264 -crf 24 -preset ultrafast " + videoPath.getPath();
我想要这样
我正在使用ffmpeg android库:-
https://github.com/bravobit/FFmpeg-Android
注:
https://stackoverflow.com/questions/42518592/circular-movie-overlay-in-ffmpeg
FFMPEG日志
11-04 19:56:37.505 28420-28420/app.kdblue.com.ffmpegdemo E/ffmpeg Success: ffmpeg version n4.0-39-gda39990 Copyright (c) 2000-2018 the FFmpeg developers
built with gcc 4.9.x (GCC) 20150123 (prerelease)
configuration:
libavutil 56. 14.100 / 56. 14.100
libavcodec 58. 18.100 / 58. 18.100
libavformat 58. 12.100 / 58. 12.100
libavdevice 58. 3.100 / 58. 3.100
libavfilter 7. 16.100 / 7. 16.100
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 1.100 / 5. 1.100
libswresample 3. 1.100 / 3. 1.100
libpostproc 55. 1.100 / 55. 1.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/storage/emulated/0/MixVideos/video1_1541341464579.mp4':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: isommp42
creation_time : 2018-11-04T14:24:29.000000Z
com.android.version: 8.1.0
com.android.manufacturer: OnePlus
com.android.model: ONE A2003
Duration: 00:00:04.15, start: 0.000000, bitrate: 9983 kb/s
Stream #0:0(eng): Video: h264 (avc1 / 0x31637661), yuv420p(tv, bt709), 1920x1080, 9978 kb/s, SAR 1:1 DAR 16:9, 29.39 fps, 30 tbr, 90k tbn, 180k tbc (default)
Metadata:
rotate : 90
creation_time : 2018-11-04T14:24:29.000000Z
handler_name : VideoHandle
Side data:
displaymatrix: rotation of -90.00 degrees
Input #1, mov,mp4,m4a,3gp,3g2,mj2, from '/storage/emulated/0/MixVideos/video2_1541341478507.mp4':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: isommp42
creation_time : 2018-11-04T14:24:42.000000Z
com.android.version: 8.1.0
com.android.manufacturer: OnePlus
com.android.model: ONE A2003
Duration: 00:00:02.62, start: 0.000000, bitrate: 9833 kb/s
Stream #1:0(eng): Video: h264 (avc1 / 0x31637661), yuv420p(tv, bt709), 1920x1080, 9824 kb/s, SAR 1:1 DAR 16:9, 29.73 fps, 30 tbr, 90k tbn, 180k tbc (default)
Metadata:
rotate : 90
creation_time : 2018-11-04T14:24:42.000000Z
handler_name : VideoHandle
Side data:
displaymatrix: rotation of -90.00 degrees
Stream mapping:
Stream #0:0 (h264) -> overlay:main
Stream #1:0 (h264) -> trim
Stream #1:0 (h264) -> alphamerge:main
overlay -> Stream #0:0 (libx264)
Press [q] to stop, [?] for help
[swscaler @ 0xed8a7000] No accelerated colorspace conversion found from yuv420p to rgba.
[libx264 @ 0xf2016c00] using SAR=1/1
[libx264 @ 0xf2016c00] using cpu capabilities: ARMv6 NEON
[libx264 @ 0xf2016c00] profile Constrained Baseline, level 4.0
[libx264 @ 0xf2016c00] 264 - core 152 r2851M ba24899 - H.264/MPEG-4 AVC codec - Copyleft 2003-2017 - http://www.videolan.org/x264.html - options: cabac=0 ref=1 deblock=0:0:0 analyse=0:0 me=dia subme=0 psy=1 psy_rd=1.00:0.00 mixed_ref=0 me_range=16 chroma_me=1 trellis=0 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=0 threads=12 lo