SHARE
TWEET

FFmpeg (How to join two videos with a cross-fade effect)

a guest Jan 8th, 2015 184 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. >ffmpeg -i e:/ffmpeg/part1.mp4 -i e:/ffmpeg/part2.mp4 -f lavfi -i color=black:s=19
  2. 20x1080 -filter_complex "[0:v]format=pix_fmts=yuva420p,fade=t=out:st=10:d=1:alpha=1,setpts=PTS-START
  3. PTS[va0];[1:v]format=pix_fmts=yuva420p,fade=t=in:st=0:d=1:alpha=1,setpts=PTS-STARTPTS+10/TB[va1];[2:
  4. v]trim=duration=18[over];[over][va0]overlay[over1];[over1][va1]overlay=format=yuv420[outv]" -vcodec
  5. libx264 -map [outv] e:/ffmpeg/output.mp4
  6. ffmpeg version N-66278-g91459bd Copyright (c) 2000-2014 the FFmpeg developers
  7.   built on Sep 14 2014 22:14:38 with gcc 4.8.3 (GCC)
  8.   configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzli
  9. b --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libblu
  10. ray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-
  11. libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrw
  12. b --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr -
  13. -enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aacenc --
  14. enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enab
  15. le-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-decklink --enable-zlib
  16.   libavutil      54.  7.100 / 54.  7.100
  17.   libavcodec     56.  1.100 / 56.  1.100
  18.   libavformat    56.  4.101 / 56.  4.101
  19.   libavdevice    56.  0.100 / 56.  0.100
  20.   libavfilter     5.  1.100 /  5.  1.100
  21.   libswscale      3.  0.100 /  3.  0.100
  22.   libswresample   1.  1.100 /  1.  1.100
  23.   libpostproc    53.  0.100 / 53.  0.100
  24. Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'e:/ffmpeg/part1.mp4':
  25.   Metadata:
  26.     major_brand     : mp42
  27.     minor_version   : 0
  28.     compatible_brands: mp41isom
  29.   Duration: 00:00:11.24, start: 0.000000, bitrate: 19916 kb/s
  30.     Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9],
  31.  19768 kb/s, 29.65 fps, 30 tbr, 30k tbn, 60k tbc (default)
  32.     Metadata:
  33.       handler_name    : VideoHandler
  34.       encoder         : AVC Coding
  35.     Stream #0:1(und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 97 kb/s (default)
  36.     Metadata:
  37.       handler_name    : SoundHandler
  38. Input #1, mov,mp4,m4a,3gp,3g2,mj2, from 'e:/ffmpeg/part2.mp4':
  39.   Metadata:
  40.     major_brand     : mp42
  41.     minor_version   : 0
  42.     compatible_brands: mp41isom
  43.   Duration: 00:00:08.23, start: 0.000000, bitrate: 19795 kb/s
  44.     Stream #1:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9],
  45.  19670 kb/s, 29.50 fps, 30 tbr, 30k tbn, 60k tbc (default)
  46.     Metadata:
  47.       handler_name    : VideoHandler
  48.       encoder         : AVC Coding
  49.     Stream #1:1(und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 97 kb/s (default)
  50.     Metadata:
  51.       handler_name    : SoundHandler
  52. Input #2, lavfi, from 'color=black:s=1920x1080':
  53.   Duration: N/A, start: 0.000000, bitrate: N/A
  54.     Stream #2:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 25 tbr,
  55.  25 tbn, 25 tbc
  56. [libx264 @ 0000000004330980] using SAR=1/1
  57. [libx264 @ 0000000004330980] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.1 Cache64
  58. [libx264 @ 0000000004330980] profile High, level 4.0
  59. [libx264 @ 0000000004330980] 264 - core 142 r2479 dd79a61 - H.264/MPEG-4 AVC codec - Copyleft 2003-2
  60. 014 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=
  61. 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 dead
  62. zone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=3 lookahead_threads=1 sliced_threads=0 nr=0 deci
  63. mate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 dir
  64. ect=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahe
  65. ad=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
  66. Output #0, mp4, to 'e:/ffmpeg/output.mp4':
  67.   Metadata:
  68.     major_brand     : mp42
  69.     minor_version   : 0
  70.     compatible_brands: mp41isom
  71.     encoder         : Lavf56.4.101
  72.     Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 1920x1080 [SAR 1:1 DAR 16:
  73. 9], q=-1--1, 25 fps, 12800 tbn, 25 tbc (default)
  74.     Metadata:
  75.       encoder         : Lavc56.1.100 libx264
  76. Stream mapping:
  77.   Stream #0:0 (h264) -> format
  78.   Stream #1:0 (h264) -> format
  79.   Stream #2:0 (rawvideo) -> trim
  80.   overlay -> Stream #0:0 (libx264)
  81. Press [q] to stop, [?] for help
  82. frame=  451 fps=4.5 q=-1.0 Lsize=   11032kB time=00:00:17.96 bitrate=5031.9kbits/s dup=0 drop=7
  83. video:11028kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.036493%
  84.  
  85. [libx264 @ 0000000004330980] frame I:11    Avg QP:20.72  size: 63930
  86. [libx264 @ 0000000004330980] frame P:368   Avg QP:23.84  size: 26880
  87. [libx264 @ 0000000004330980] frame B:72    Avg QP:25.29  size:  9679
  88. [libx264 @ 0000000004330980] consecutive B-frames: 69.0% 28.8%  1.3%  0.9%
  89. [libx264 @ 0000000004330980] mb I  I16..4: 16.7% 70.0% 13.3%
  90. [libx264 @ 0000000004330980] mb P  I16..4:  4.6% 10.7%  0.5%  P16..4: 56.9%  7.8%  5.4%  0.0%  0.0%
  91.    skip:14.2%
  92. [libx264 @ 0000000004330980] mb B  I16..4:  0.2%  0.4%  0.0%  B16..8: 42.9%  1.8%  0.2%  direct: 3.3
  93. %  skip:51.3%  L0:39.3% L1:59.7% BI: 0.9%
  94. [libx264 @ 0000000004330980] 8x8 transform intra:68.1% inter:89.7%
  95. [libx264 @ 0000000004330980] coded y,uvDC,uvAC intra: 43.7% 66.3% 4.2% inter: 21.4% 52.4% 0.0%
  96. [libx264 @ 0000000004330980] i16 v,h,dc,p: 38% 17% 10% 35%
  97. [libx264 @ 0000000004330980] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 29% 16% 28%  4%  5%  5%  5%  5%  4%
  98. [libx264 @ 0000000004330980] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 35% 23% 15%  4%  6%  5%  5%  4%  3%
  99. [libx264 @ 0000000004330980] i8c dc,h,v,p: 51% 18% 25%  6%
  100. [libx264 @ 0000000004330980] Weighted P-Frames: Y:3.5% UV:2.7%
  101. [libx264 @ 0000000004330980] ref P L0: 76.4%  9.8% 10.4%  3.3%  0.1%
  102. [libx264 @ 0000000004330980] ref B L0: 91.4%  8.5%  0.0%
  103. [libx264 @ 0000000004330980] ref B L1: 99.6%  0.4%
  104. [libx264 @ 0000000004330980] kb/s:5007.46
  105.  
  106. >CMD /F:ON /Q /K
  107. >
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top