I'm having problems with transitions. To be sure I am not making something
wrong, I simply copy/paste the example shown in
https://ffmpeg.org/ffmpeg-filters.html#xfade, adjusted my two video file
names to comply with the example, and got the same problems as with my own
commands.

 

The example on the site shows this: ffmpeg -i first.mp4 -i second.mp4
-filter_complex xfade=transition=fade:duration=2:offset=5 output.mp4

My first and second files have 1 min each.

 

First I run the command without any change; obviously offset 5 isn't
appropriate but I gave it a try.

Second I adjusted duration to 10 and offset to 55 to be appropriate with my
two mp4 files. The result was the same:

The final output.mp4 has the right duration (1:55) but it is totally black.

 

What I see during execution is that the first video is read/copied to
output.mp4 quite fast. After that it starts reading second.mp4 and works a
very long time on it, probably close to one minute.

 

Attached are the two console outputs. Transition_01 has duration=2 and
offset=5 while transition_02 has duration=10 and offset=55. Unfortunately I
don't have the knowledge to find out if this output provides any hint of
what is wrong. Any help is appreciated.

 

Thanks

D:\99_FFMpeg>D:\01_Apl\ffmpeg\bin\ffmpeg.exe -i first.mp4 -i second.mp4 
-filter_complex xfade=transition=fade:duration=2:offset=5 output.mp4
ffmpeg version 2021-03-14-git-1d61a31497-essentials_build-www.gyan.dev 
Copyright (c) 2000-2021 the FFmpeg developers
  built with gcc 10.2.0 (Rev6, Built by MSYS2 project)
  configuration: --enable-gpl --enable-version3 --enable-static 
--disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv 
--enable-gnutls --enable-libxml2 --enable-gmp --enable-lzma --enable-zlib 
--enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-sdl2 
--enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid 
--enable-libaom --enable-libopenjpeg --enable-libvpx --enable-libass 
--enable-libfreetype --enable-libfribidi --enable-libvidstab --enable-libvmaf 
--enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid 
--enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va 
--enable-dxva2 --enable-libmfx --enable-libgme --enable-libopenmpt 
--enable-libopencore-amrwb --enable-libmp3lame --enable-libtheora 
--enable-libvo-amrwbenc --enable-libgsm --enable-libopencore-amrnb 
--enable-libopus --enable-libspeex --enable-libvorbis --enable-librubberband
  libavutil      56. 68.100 / 56. 68.100
  libavcodec     58.131.100 / 58.131.100
  libavformat    58. 74.100 / 58. 74.100
  libavdevice    58. 12.100 / 58. 12.100
  libavfilter     7.109.100 /  7.109.100
  libswscale      5.  8.100 /  5.  8.100
  libswresample   3.  8.100 /  3.  8.100
  libpostproc    55.  8.100 / 55.  8.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'first.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf58.74.100
  Duration: 00:01:00.08, start: 0.000000, bitrate: 3818 kb/s
  Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1080 
[SAR 1:1 DAR 16:9], 3622 kb/s, 60 fps, 60 tbr, 90k tbn, 120 tbc (default)
    Metadata:
      handler_name    : VideoHandler
      vendor_id       : [0][0][0][0]
  Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, 
fltp, 181 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
      vendor_id       : [0][0][0][0]
Input #1, mov,mp4,m4a,3gp,3g2,mj2, from 'second.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf58.74.100
  Duration: 00:01:00.08, start: 0.000000, bitrate: 3274 kb/s
  Stream #1:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1080 
[SAR 1:1 DAR 16:9], 3063 kb/s, 60 fps, 60 tbr, 90k tbn, 120 tbc (default)
    Metadata:
      handler_name    : VideoHandler
      vendor_id       : [0][0][0][0]
  Stream #1:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, 
fltp, 193 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
      vendor_id       : [0][0][0][0]
Stream mapping:
  Stream #0:0 (h264) -> xfade:main (graph 0)
  Stream #1:0 (h264) -> xfade:xfade (graph 0)
  xfade (graph 0) -> Stream #0:0 (libx264)
  Stream #0:1 -> #0:1 (aac (native) -> aac (native))
Press [q] to stop, [?] for help
[libx264 @ 000001d2e9bdfa80] using SAR=1/1
[libx264 @ 000001d2e9bdfa80] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 
AVX FMA3 BMI2 AVX2
[libx264 @ 000001d2e9bdfa80] profile High 4:4:4 Predictive, level 4.2, 4:4:4, 
8-bit
[libx264 @ 000001d2e9bdfa80] 264 - core 161 r3048 b86ae3c - H.264/MPEG-4 AVC 
codec - Copyleft 2003-2021 - 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=4 threads=9 lookahead_threads=1 
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
Output #0, mp4, to 'output.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf58.74.100
  Stream #0:0: Video: h264 (avc1 / 0x31637661), yuv444p(tv, progressive), 
1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 60 fps, 15360 tbn (default)
    Metadata:
      encoder         : Lavc58.131.100 libx264
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A
  Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, 
fltp, 128 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
      vendor_id       : [0][0][0][0]
      encoder         : Lavc58.131.100 aac
frame= 3905 fps= 64 q=-1.0 Lsize=   15919kB time=00:01:05.03 
bitrate=2005.3kbits/s dup=3 drop=0 speed=1.06x
video:14926kB audio:881kB subtitle:0kB other streams:0kB global headers:0kB 
muxing overhead: 0.714643%
[libx264 @ 000001d2e9bdfa80] frame I:18    Avg QP:17.32  size: 66334
[libx264 @ 000001d2e9bdfa80] frame P:1072  Avg QP:19.60  size: 10334
[libx264 @ 000001d2e9bdfa80] frame B:2815  Avg QP:23.36  size:  1070
[libx264 @ 000001d2e9bdfa80] consecutive B-frames:  0.9%  7.8%  2.9% 88.3%
[libx264 @ 000001d2e9bdfa80] mb I  I16..4: 39.6% 49.7% 10.7%
[libx264 @ 000001d2e9bdfa80] mb P  I16..4:  3.6%  3.1%  0.3%  P16..4: 12.8%  
3.0%  1.2%  0.0%  0.0%    skip:75.9%
[libx264 @ 000001d2e9bdfa80] mb B  I16..4:  0.1%  0.1%  0.0%  B16..8:  6.9%  
0.2%  0.0%  direct: 0.1%  skip:92.7%  L0:40.5% L1:57.9% BI: 1.6%
[libx264 @ 000001d2e9bdfa80] 8x8 transform intra:44.8% inter:82.5%
[libx264 @ 000001d2e9bdfa80] coded y,u,v intra: 17.4% 10.6% 11.7% inter: 1.5% 
0.8% 0.8%
[libx264 @ 000001d2e9bdfa80] i16 v,h,dc,p: 60% 25%  8%  7%
[libx264 @ 000001d2e9bdfa80] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 23% 12% 52%  2%  2% 
 3%  2%  2%  2%
[libx264 @ 000001d2e9bdfa80] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 31% 35% 14%  3%  4% 
 4%  3%  3%  3%
[libx264 @ 000001d2e9bdfa80] Weighted P-Frames: Y:0.3% UV:0.1%
[libx264 @ 000001d2e9bdfa80] ref P L0: 67.0% 11.5% 15.1%  6.4%  0.0%
[libx264 @ 000001d2e9bdfa80] ref B L0: 91.3%  7.2%  1.6%
[libx264 @ 000001d2e9bdfa80] ref B L1: 98.1%  1.9%
[libx264 @ 000001d2e9bdfa80] kb/s:1878.64
[aac @ 000001d2e9ba4dc0] Qavg: 4635.114

D:\99_FFMpeg>
D:\99_FFMpeg>D:\01_Apl\ffmpeg\bin\ffmpeg.exe -i first.mp4 -i second.mp4 
-filter_complex xfade=transition=fade:duration=10:offset=55 output.mp4
ffmpeg version 2021-03-14-git-1d61a31497-essentials_build-www.gyan.dev 
Copyright (c) 2000-2021 the FFmpeg developers
  built with gcc 10.2.0 (Rev6, Built by MSYS2 project)
  configuration: --enable-gpl --enable-version3 --enable-static 
--disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv 
--enable-gnutls --enable-libxml2 --enable-gmp --enable-lzma --enable-zlib 
--enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-sdl2 
--enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid 
--enable-libaom --enable-libopenjpeg --enable-libvpx --enable-libass 
--enable-libfreetype --enable-libfribidi --enable-libvidstab --enable-libvmaf 
--enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid 
--enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va 
--enable-dxva2 --enable-libmfx --enable-libgme --enable-libopenmpt 
--enable-libopencore-amrwb --enable-libmp3lame --enable-libtheora 
--enable-libvo-amrwbenc --enable-libgsm --enable-libopencore-amrnb 
--enable-libopus --enable-libspeex --enable-libvorbis --enable-librubberband
  libavutil      56. 68.100 / 56. 68.100
  libavcodec     58.131.100 / 58.131.100
  libavformat    58. 74.100 / 58. 74.100
  libavdevice    58. 12.100 / 58. 12.100
  libavfilter     7.109.100 /  7.109.100
  libswscale      5.  8.100 /  5.  8.100
  libswresample   3.  8.100 /  3.  8.100
  libpostproc    55.  8.100 / 55.  8.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'first.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf58.74.100
  Duration: 00:01:00.08, start: 0.000000, bitrate: 3818 kb/s
  Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1080 
[SAR 1:1 DAR 16:9], 3622 kb/s, 60 fps, 60 tbr, 90k tbn, 120 tbc (default)
    Metadata:
      handler_name    : VideoHandler
      vendor_id       : [0][0][0][0]
  Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, 
fltp, 181 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
      vendor_id       : [0][0][0][0]
Input #1, mov,mp4,m4a,3gp,3g2,mj2, from 'second.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf58.74.100
  Duration: 00:01:00.08, start: 0.000000, bitrate: 3274 kb/s
  Stream #1:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1080 
[SAR 1:1 DAR 16:9], 3063 kb/s, 60 fps, 60 tbr, 90k tbn, 120 tbc (default)
    Metadata:
      handler_name    : VideoHandler
      vendor_id       : [0][0][0][0]
  Stream #1:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, 
fltp, 193 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
      vendor_id       : [0][0][0][0]
Stream mapping:
  Stream #0:0 (h264) -> xfade:main (graph 0)
  Stream #1:0 (h264) -> xfade:xfade (graph 0)
  xfade (graph 0) -> Stream #0:0 (libx264)
  Stream #0:1 -> #0:1 (aac (native) -> aac (native))
Press [q] to stop, [?] for help
[libx264 @ 00000205d144fa80] using SAR=1/1
[libx264 @ 00000205d144fa80] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 
AVX FMA3 BMI2 AVX2
[libx264 @ 00000205d144fa80] profile High 4:4:4 Predictive, level 4.2, 4:4:4, 
8-bit
[libx264 @ 00000205d144fa80] 264 - core 161 r3048 b86ae3c - H.264/MPEG-4 AVC 
codec - Copyleft 2003-2021 - 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=4 threads=9 lookahead_threads=1 
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
Output #0, mp4, to 'output.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf58.74.100
  Stream #0:0: Video: h264 (avc1 / 0x31637661), yuv444p(tv, progressive), 
1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 60 fps, 15360 tbn (default)
    Metadata:
      encoder         : Lavc58.131.100 libx264
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A
  Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, 
fltp, 128 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
      vendor_id       : [0][0][0][0]
      encoder         : Lavc58.131.100 aac
frame= 6908 fps= 91 q=-1.0 Lsize=   31890kB time=00:01:55.08 
bitrate=2270.0kbits/s dup=6 drop=0 speed=1.52x
video:30861kB audio:881kB subtitle:0kB other streams:0kB global headers:0kB 
muxing overhead: 0.466147%
[libx264 @ 00000205d144fa80] frame I:36    Avg QP:17.96  size: 57003
[libx264 @ 00000205d144fa80] frame P:1889  Avg QP:20.32  size: 12279
[libx264 @ 00000205d144fa80] frame B:4983  Avg QP:23.93  size:  1275
[libx264 @ 00000205d144fa80] consecutive B-frames:  1.1%  7.0%  3.5% 88.4%
[libx264 @ 00000205d144fa80] mb I  I16..4: 36.9% 53.9%  9.2%
[libx264 @ 00000205d144fa80] mb P  I16..4:  4.5%  4.1%  0.5%  P16..4: 14.4%  
3.4%  1.4%  0.0%  0.0%    skip:71.6%
[libx264 @ 00000205d144fa80] mb B  I16..4:  0.1%  0.1%  0.0%  B16..8:  7.9%  
0.3%  0.0%  direct: 0.1%  skip:91.5%  L0:42.1% L1:55.9% BI: 2.0%
[libx264 @ 00000205d144fa80] 8x8 transform intra:46.6% inter:82.4%
[libx264 @ 00000205d144fa80] coded y,u,v intra: 20.2% 10.3% 11.9% inter: 1.7% 
0.8% 0.9%
[libx264 @ 00000205d144fa80] i16 v,h,dc,p: 53% 28%  9%  9%
[libx264 @ 00000205d144fa80] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 24% 15% 47%  2%  2% 
 3%  2%  3%  3%
[libx264 @ 00000205d144fa80] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 25% 42% 15%  3%  3% 
 3%  3%  3%  2%
[libx264 @ 00000205d144fa80] Weighted P-Frames: Y:0.2% UV:0.1%
[libx264 @ 00000205d144fa80] ref P L0: 67.1% 11.5% 15.1%  6.3%  0.0%
[libx264 @ 00000205d144fa80] ref B L0: 91.3%  7.1%  1.6%
[libx264 @ 00000205d144fa80] ref B L1: 98.1%  1.9%
[libx264 @ 00000205d144fa80] kb/s:2195.81
[aac @ 00000205d1413b80] Qavg: 4635.114

D:\99_FFMpeg>
_______________________________________________
ffmpeg-user mailing list
[email protected]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[email protected] with subject "unsubscribe".

Reply via email to