顺利移动叠加层

时间:2017-09-07 21:28:07

标签: ffmpeg

我在背景屏幕上方有一个滑动视频叠加层,并将其从a点移动到b点。

由此产生的视频会产生波动。叠加层一次移动一步而不是一次连续移动。

以下是代码示例:

ffmpeg -y -stream_loop -1 -i b.mpg -i bg.jpg -filter_complex "
[0:v]scale=320:240[vid];[1][vid]overlay=x='(180+(30-180)*(t-
0)/60)*between(t,0,60)+(30+(290-30)*(t-60)/60)*between(t,60,120)':y='(120+
(120-120)*(t-0)/60)*between(t,0,60)+(120+(30-120)*(t-
60)/60)*between(t,60,120)'[out]" -map "[out]" -r 29.97 -aspect 4:3 -b:v 
4000k -minrate 4000k -maxrate 4000k -bufsize 2000k -t 64 t.mpg

Input #0, mpegvideo, from 'b.mpg':
Duration: 00:00:32.34, bitrate: 4000 kb/s
Stream #0:0: Video: mpeg2video (Main), yuv420p(tv, progressive), 720x480 
[SAR 32:27 DAR 16:9], 4000 kb/s, 29.97 fps, 29.97 tbr, 1200k tbn, 59.94 tbc
Input #1, image2, from 'bg.jpg':
Duration: 00:00:00.04, start: 0.000000, bitrate: 19637 kb/s
Stream #1:0: Video: mjpeg, yuvj444p(pc, bt470bg/unknown/unknown), 640x480, 
25 tbr, 25 tbn, 25 tbc
Stream mapping:
Stream #0:0 (mpeg2video) -> scale
Stream #1:0 (mjpeg) -> overlay:main
overlay -> Stream #0:0 (mpeg1video)
Press [q] to stop, [?] for help
[swscaler @ 0000000002adc740] deprecated pixel format used, make sure you 
did set range correctly
Output #0, mpeg, to 't.mpg':
Metadata:
encoder         : Lavf57.73.100
Stream #0:0: Video: mpeg1video, yuv420p, 640x480 [SAR 1:1 DAR 4:3], q=2-31, 
4000 kb/s, 29.97 fps, 90k tbn, 29.97 tbc (default)
Metadata:
encoder         : Lavc57.99.100 mpeg1video
Side data:
cpb: bitrate max/min/avg: 4000000/4000000/4000000 buffer size: 2000000 
vbv_delay: -1
warning, clipping 1 dct coefficients to -255..255repeated 2 timesnter

此处链接到视频:https://youtu.be/EE_hrjy4ilg

0 个答案:

没有答案