请选择 进入手机版 | 继续访问电脑版

ChinaFFmpeg

 找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 10752|回复: 3

[Windows] ffmpeg的overlay做画中画问题

[复制链接]
发表于 2020-5-13 02:03:22 | 显示全部楼层 |阅读模式
现在有两个视频要做画中画,一个时长10分钟,一个时长10秒,我叠加完发现短的视频最后一帧被当做图片持续输出到视频,直到长视频结束,我现在的需求是,怎样让短视频在10秒处直接停止,输出完成。
回复

使用道具 举报

发表于 2020-5-13 10:11:42 | 显示全部楼层
overlay=x=xxxx:y=xxxx:eof_action=endall
回复 支持 反对

使用道具 举报

 楼主| 发表于 2020-5-13 10:18:44 | 显示全部楼层
ffmpeg  -i input.mp4 -i sub.mp4   -filter_complex  overlay=x=320:y=240:eof_action=endall  output1.mp4大师兄帮看下哪里问题
回复 支持 反对

使用道具 举报

发表于 2020-5-13 11:58:28 | 显示全部楼层
  1. (base) liuqi05:dash liuqi$ ffmpeg -v quiet -f lavfi -i testsrc2=s=1280x720:r=25 -t 10  a.mp4
  2. File 'a.mp4' already exists. Overwrite ? [y/N] y
  3. (base) liuqi05:dash liuqi$ ffmpeg -v quiet -f lavfi -i testsrc2=s=276x144:r=25 -t 5 -y b.mp4
  4. (base) liuqi05:dash liuqi$ ./ffmpeg -hide_banner  -i a.mp4 -i b.mp4   -filter_complex  overlay=x=320:y=240:eof_action=endall  output1.mp4
  5. Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'a.mp4':
  6.   Metadata:
  7.     major_brand     : isom
  8.     minor_version   : 512
  9.     compatible_brands: isomiso2avc1mp41
  10.     encoder         : Lavf58.29.100
  11.   Duration: 00:00:10.00, start: 0.000000, bitrate: 2798 kb/s
  12.     Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 2795 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
  13.     Metadata:
  14.       handler_name    : VideoHandler
  15. Input #1, mov,mp4,m4a,3gp,3g2,mj2, from 'b.mp4':
  16.   Metadata:
  17.     major_brand     : isom
  18.     minor_version   : 512
  19.     compatible_brands: isomiso2avc1mp41
  20.     encoder         : Lavf58.29.100
  21.   Duration: 00:00:05.00, start: 0.000000, bitrate: 213 kb/s
  22.     Stream #1:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 276x144 [SAR 1:1 DAR 23:12], 209 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
  23.     Metadata:
  24.       handler_name    : VideoHandler
  25. File 'output1.mp4' already exists. Overwrite? [y/N] y
  26. Stream mapping:
  27.   Stream #0:0 (h264) -> overlay:main
  28.   Stream #1:0 (h264) -> overlay:overlay
  29.   overlay -> Stream #0:0 (libx264)
  30. Press [q] to stop, [?] for help
  31. [libx264 @ 0x7fedae807600] using SAR=1/1
  32. [libx264 @ 0x7fedae807600] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
  33. [libx264 @ 0x7fedae807600] profile High, level 3.1, 4:2:0, 8-bit
  34. [libx264 @ 0x7fedae807600] 264 - core 159 r2991 1771b55 - H.264/MPEG-4 AVC codec - Copyleft 2003-2019 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=18 lookahead_threads=3 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
  35. Output #0, mp4, to 'output1.mp4':
  36.   Metadata:
  37.     major_brand     : isom
  38.     minor_version   : 512
  39.     compatible_brands: isomiso2avc1mp41
  40.     encoder         : Lavf58.43.100
  41.     Stream #0:0: Video: h264 (libx264) (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], q=-1--1, 25 fps, 12800 tbn, 25 tbc (default)
  42.     Metadata:
  43.       encoder         : Lavc58.84.100 libx264
  44.     Side data:
  45.       cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A
  46. frame=  125 fps=0.0 q=-1.0 Lsize=    1739kB time=00:00:04.88 bitrate=2919.2kbits/s speed=6.44x
  47. video:1737kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.129384%
  48. [libx264 @ 0x7fedae807600] frame I:1     Avg QP:18.93  size: 28067
  49. [libx264 @ 0x7fedae807600] frame P:50    Avg QP:24.78  size: 17228
  50. [libx264 @ 0x7fedae807600] frame B:74    Avg QP:29.74  size: 12003
  51. [libx264 @ 0x7fedae807600] consecutive B-frames:  7.2% 35.2% 19.2% 38.4%
  52. [libx264 @ 0x7fedae807600] mb I  I16..4: 41.0% 48.7% 10.3%
  53. [libx264 @ 0x7fedae807600] mb P  I16..4:  0.8%  4.5%  1.2%  P16..4:  8.2%  4.6%  2.5%  0.0%  0.0%    skip:78.2%
  54. [libx264 @ 0x7fedae807600] mb B  I16..4:  0.1%  0.6%  0.6%  B16..8: 11.1%  3.0%  0.8%  direct: 1.3%  skip:82.5%  L0:48.3% L1:42.9% BI: 8.7%
  55. [libx264 @ 0x7fedae807600] 8x8 transform intra:60.5% inter:31.6%
  56. [libx264 @ 0x7fedae807600] coded y,uvDC,uvAC intra: 26.3% 37.8% 36.8% inter: 3.8% 7.9% 6.9%
  57. [libx264 @ 0x7fedae807600] i16 v,h,dc,p: 77% 20%  2%  1%
  58. [libx264 @ 0x7fedae807600] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 10% 13% 70%  2%  1%  1%  1%  1%  2%
  59. [libx264 @ 0x7fedae807600] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 21% 24% 32%  5%  3%  3%  4%  4%  5%
  60. [libx264 @ 0x7fedae807600] i8c dc,h,v,p: 73% 13% 11%  4%
  61. [libx264 @ 0x7fedae807600] Weighted P-Frames: Y:0.0% UV:0.0%
  62. [libx264 @ 0x7fedae807600] ref P L0: 50.7%  7.9% 26.6% 14.8%
  63. [libx264 @ 0x7fedae807600] ref B L0: 76.1% 19.7%  4.2%
  64. [libx264 @ 0x7fedae807600] ref B L1: 96.9%  3.1%
  65. [libx264 @ 0x7fedae807600] kb/s:2844.38
  66. (base) liuqi05:dash liuqi$
复制代码
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|Archiver|ChinaFFmpeg

GMT+8, 2024-3-29 20:10 , Processed in 0.048727 second(s), 14 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表