[FFmpeg-trac] #11203(avformat:new): Broken input duration may cause unnecessarily hang

FFmpeg trac at avcodec.org
Sat Sep 28 16:42:28 EEST 2024


#11203: Broken input duration may cause unnecessarily hang
----------------------------------+------------------------------------
             Reporter:  milahu    |                    Owner:  (none)
                 Type:  defect    |                   Status:  new
             Priority:  normal    |                Component:  avformat
              Version:  6.1.1     |               Resolution:
             Keywords:  matroska  |               Blocked By:
             Blocking:            |  Reproduced by developer:  0
Analyzed by developer:  0         |
----------------------------------+------------------------------------
Comment (by milahu):

 minimal reproducer

 {{{
 #!/bin/sh
 # make ffmpeg hang with "-resampler soxr"
 set -eu
 i=anullsrc=channel_layout=mono:sample_rate=48000
 o=silence.wav
 if ! [ -e "$o" ]; then
   ffmpeg -f lavfi -i "$i" -t 30 -f wav "$o"
 fi
 i="$o"
 o=-
 # many other "to" values make ffmpeg hang, but not all
 # 3.$RANDOM 4.$RANDOM 5.$RANDOM ...
 to=3.1001
 a=(
   ffmpeg -hide_banner -nostdin
   -to $to # input "to" breaks
   -i "$i"
 #  -to $to # output "to" works
   -af loudnorm=i=-23.0
   -resampler soxr
   -ar 48000
   -f wav
   "$o"
 )
 "${a[@]}" >/dev/null
 }}}

 by fuzzing, i found some other bad `to` values
 all are greater than 3 seconds

 my first 100 `to` values:

 3.0004 3.0007 3.0011 3.0013 3.0016 3.0021 3.0030 3.0033 3.0036 3.1001
 3.1002 3.1003 3.1004 3.1005 3.1006 3.1007 3.1008 3.1009 3.1010 3.1011
 3.1012 3.1013 3.1014 3.1015 3.1016 3.1017 3.1018 3.1019 3.1020 3.1021
 3.1022 3.1023 3.1024 3.1025 3.1026 3.1027 3.1028 3.1029 3.1030 3.1031
 3.1032 3.1033 3.1034 3.1035 3.1036 3.1037 3.1038 3.1039 3.1040 3.1041
 3.1042 3.1043 3.1044 3.1045 3.1046 3.1047 3.1048 3.1049 3.1050 3.1051
 3.1052 3.1053 3.1054 3.1055 3.1056 3.1057 3.1058 3.1059 3.1060 3.1061
 3.1062 3.1063 3.1064 3.1065 3.1066 3.1067 3.1068 3.1069 3.1070 3.1071
 3.1072 3.2001 3.2002 3.2003 3.2004 3.2005 3.2006 3.2007 3.2008 3.2009
 3.2010 3.2011 3.2012 3.2013 3.2014 3.2015 3.2016 3.2017 3.2018 3.2019

 all `to` values smaller than 0.019284 make ffmpeg hang
 and when i kill ffmpeg, it says
 "Nothing was written into output file, because at least one of its streams
 received no packets."

 some `to` values make ffmpeg hang at time=00:00:00.00
-- 
Ticket URL: <https://trac.ffmpeg.org/ticket/11203#comment:5>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list