[FFmpeg-devel] [PATCH 13/13 v3] fftools/ffmpeg: convert to a threaded architecture

Anton Khirnov anton at khirnov.net
Mon Dec 4 19:07:13 EET 2023


Quoting Nicolas George (2023-12-04 17:37:23)
> Anton Khirnov (12023-12-04):
> > broken. If that extra buffering is an actual problem for someone, it can
> > be easily avoided by opening the file twice.
> 
> Not a solution if the file is streamed or generated.
> 
> > As I said before, your command does NOT work. Its output changes
> > unpredictably depending on unrelated parameters.
> 
> It still produces correct output in most of the cases, which is what
> matters to users.

$ for i in $(seq 1 4 64); do
.   echo -ne "$i\t";
.   ./ffmpeg -v fatal -threads $i -i sub.mkv -preset ultrafast \
.     -lavfi '[0:s]setpts=PTS+60/TB[s] ; [0:v][s]overlay' \
.     -bitexact -y -f matroska md5:
. done
1       287e929cba6c67c6ce8e35954548048d
5       7e234d83cca90d4b0ee4d563e21a8bd8
9       abfd093a36b1661db022616d97c45fad
13      f6be9d63a7dce69cd16581895923b196
17      2c7144c01f6294e65e305f602b58a718
21      99564d81199a1f453ccff24ac2db7eac
25      02ec0aadb03a0205ccacb4c873ee9ad9
29      76643205916887fd444525ea8bb610fb
33      6267a2baeb1554bc5f219890ac8b37aa
37      f955daadf62c91ddce5705561e32804f
41      523c61ebad03b6ba297812cb7939b679
45      96c48966f459442707f29f854aa59c3b
49      ad92b3f79c7bb31fdc272b2a81985334
53      362a7d6c0a681a049adf4802e0dc8771
57      1529ffd4f487ea13b9a37f4f1b9879eb
61      53db192ac534d348b3ed63fdcbac945a

Which of these are you saying is correct?

> > I maintain that your demand to "fix" your testcase (i.e. reduce its
> > memory consumption) is highly unreasonable –
> 
> My demand is not that you REDUCE the memory consumption, my demand is
> that you DO NOT INCREASE IT HUNDREDFOLD.
> 
> That is a perfectly reasonable demand.
> 
> >						unless you specify how
> > exactly that is supposed to be accomplished while preserving
> > determinism.
> 
> Fixing the bugs introduced by threading

The only bug that's been established to exist so far is in your
heartbeat code, which produces random output as per above.

Buffering is by itself not a bug, otherwise you'd have to say the lavf
interleaving queue is a bug.

So for the last time - either suggest a specific and practical way of
reducing memory consumption or stop interfering with my work.

-- 
Anton Khirnov


More information about the ffmpeg-devel mailing list