[FFmpeg-trac] #9545(undetermined:new): xfade does not work depending on audio duration

FFmpeg trac at avcodec.org
Fri Dec 3 15:54:25 EET 2021


#9545: xfade does not work depending on audio duration
-------------------------------------+-------------------------------------
             Reporter:  slhck        |                    Owner:  (none)
                 Type:  defect       |                   Status:  new
             Priority:  normal       |                Component:
                                     |  undetermined
              Version:  git-master   |               Resolution:
             Keywords:  xfade        |               Blocked By:
             Blocking:               |  Reproduced by developer:  0
Analyzed by developer:  0            |
-------------------------------------+-------------------------------------
Comment (by slhck):

 With the help of Paul Mahol I was able to work around it by using the
 movie filter:

 {{{
 ➜ ffmpeg \
   -y \
   -i chunks/53456-IMAGE_SLIDE.mp4 \
   -filter_complex "
   movie=chunks/53473-VIDEO_SLIDE.mp4:streams=dv+da[v0][a0];
   [a0]atrim=0:5[audio];
   [v0][0:v]xfade=transition=fade:duration=1:offset=5[video]
   " \
   -ac 2 \
   -map "[video]" -map "[audio]" \
   -pix_fmt yuv420p \
   -s:v 320x240 \
   -crf 28 \
   segments/segment-fixed.mp4
 ffmpeg version 4.4.1 Copyright (c) 2000-2021 the FFmpeg developers
   built with Apple clang version 13.0.0 (clang-1300.0.29.3)
   configuration: --prefix=/opt/homebrew/Cellar/ffmpeg/4.4.1_3 --enable-
 shared --enable-pthreads --enable-version3 --cc=clang --host-cflags=
 --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-
 libaom --enable-libbluray --enable-libdav1d --enable-libmp3lame --enable-
 libopus --enable-librav1e --enable-librist --enable-librubberband
 --enable-libsnappy --enable-libsrt --enable-libtesseract --enable-
 libtheora --enable-libvidstab --enable-libvmaf --enable-libvorbis
 --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265
 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig
 --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-
 amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libspeex
 --enable-libsoxr --enable-libzmq --enable-libzimg --disable-libjack
 --disable-indev=jack --enable-avresample --enable-videotoolbox
   libavutil      56. 70.100 / 56. 70.100
   libavcodec     58.134.100 / 58.134.100
   libavformat    58. 76.100 / 58. 76.100
   libavdevice    58. 13.100 / 58. 13.100
   libavfilter     7.110.100 /  7.110.100
   libavresample   4.  0.  0 /  4.  0.  0
   libswscale      5.  9.100 /  5.  9.100
   libswresample   3.  9.100 /  3.  9.100
   libpostproc    55.  9.100 / 55.  9.100
 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'chunks/53456-IMAGE_SLIDE.mp4':
   Metadata:
     major_brand     : isom
     minor_version   : 512
     compatible_brands: isomiso2avc1mp41
     encoder         : Lavf58.76.100
   Duration: 00:00:07.00, start: 0.000000, bitrate: 580 kb/s
   Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p,
 1280x720 [SAR 1:1 DAR 16:9], 576 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc
 (default)
     Metadata:
       handler_name    : VideoHandler
       vendor_id       : [0][0][0][0]
 Stream mapping:
   Stream #0:0 (h264) -> xfade:xfade
   xfade -> Stream #0:0 (libx264)
   atrim -> Stream #0:1 (aac)
 Press [q] to stop, [?] for help
 [libx264 @ 0x15a019e00] using SAR=4/3
 [libx264 @ 0x15a019e00] using cpu capabilities: ARMv8 NEON
 [libx264 @ 0x15a019e00] profile High, level 1.3, 4:2:0, 8-bit
 [libx264 @ 0x15a019e00] 264 - core 163 r3060 5db6aa6 - 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=-2 threads=7
 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=28.0
 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
 Output #0, mp4, to 'segments/segment-fixed.mp4':
   Metadata:
     major_brand     : isom
     minor_version   : 512
     compatible_brands: isomiso2avc1mp41
     encoder         : Lavf58.76.100
   Stream #0:0: Video: h264 (avc1 / 0x31637661), yuv420p(tv, progressive),
 320x240 [SAR 4:3 DAR 16:9], q=2-31, 30 fps, 15360 tbn (default)
     Metadata:
       encoder         : Lavc58.134.100 libx264
     Side data:
       cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A
   Stream #0:1: Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp
 (8 bit), 128 kb/s (default)
     Metadata:
       encoder         : Lavc58.134.100 aac
 [Parsed_movie_0 @ 0x159e69a30] EOF timestamp not reliable0 bitrate=N/A
 speed=   0x
 [Parsed_movie_0 @ 0x159e69a30] EOF timestamp not reliable94 bitrate=
 0.1kbits/s speed= 9.4x
 frame=  360 fps=0.0 q=-1.0 Lsize=     239kB time=00:00:11.90 bitrate=
 164.7kbits/s speed=12.3x
 video:153kB audio:78kB subtitle:0kB other streams:0kB global headers:0kB
 muxing overhead: 3.631726%
 [libx264 @ 0x15a019e00] frame I:2     Avg QP:27.27  size:  9910
 [libx264 @ 0x15a019e00] frame P:207   Avg QP:29.01  size:   582
 [libx264 @ 0x15a019e00] frame B:151   Avg QP:29.25  size:   102
 [libx264 @ 0x15a019e00] consecutive B-frames: 39.2% 13.9%  2.5% 44.4%
 [libx264 @ 0x15a019e00] mb I  I16..4:  3.2% 69.0% 27.8%
 [libx264 @ 0x15a019e00] mb P  I16..4:  0.6%  0.8%  0.1%  P16..4: 31.6%
 7.0%  4.9%  0.0%  0.0%    skip:55.0%
 [libx264 @ 0x15a019e00] mb B  I16..4:  0.1%  0.0%  0.0%  B16..8: 23.8%
 0.7%  0.2%  direct: 0.2%  skip:75.0%  L0:45.9% L1:52.5% BI: 1.7%
 [libx264 @ 0x15a019e00] 8x8 transform intra:58.3% inter:71.4%
 [libx264 @ 0x15a019e00] coded y,uvDC,uvAC intra: 45.9% 54.9% 28.2% inter:
 7.6% 6.1% 0.4%
 [libx264 @ 0x15a019e00] i16 v,h,dc,p: 48% 21% 23%  9%
 [libx264 @ 0x15a019e00] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 19% 11% 39%  4%  6%
 6%  5%  5%  5%
 [libx264 @ 0x15a019e00] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 22% 16% 16%  5% 11%
 9%  8%  7%  6%
 [libx264 @ 0x15a019e00] i8c dc,h,v,p: 58% 14% 23%  5%
 [libx264 @ 0x15a019e00] Weighted P-Frames: Y:14.5% UV:14.5%
 [libx264 @ 0x15a019e00] ref P L0: 53.9% 22.8% 16.5%  6.8%  0.0%
 [libx264 @ 0x15a019e00] ref B L0: 86.9%  9.5%  3.6%
 [libx264 @ 0x15a019e00] ref B L1: 96.6%  3.4%
 [libx264 @ 0x15a019e00] kb/s:103.73
 [aac @ 0x15a01b800] Qavg: 433.766
 }}}


 What would be causing this problem?
-- 
Ticket URL: <https://trac.ffmpeg.org/ticket/9545#comment:1>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list