[FFmpeg-devel] [FFmpeg-cvslog] fftools/ffmpeg: convert to a threaded architecture

Michael Niedermayer michael at niedermayer.cc
Wed Mar 27 19:49:42 EET 2024


On Tue, Dec 12, 2023 at 07:41:18AM +0000, Anton Khirnov wrote:
> ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Tue Jul 18 16:37:52 2023 +0200| [d119ae2fd82a494d9430ff4d4fc262961a68c598] | committer: Anton Khirnov
> 
> fftools/ffmpeg: convert to a threaded architecture
> 
> Change the main loop and every component (demuxers, decoders, filters,
> encoders, muxers) to use the previously added transcode scheduler. Every
> instance of every such component was already running in a separate
> thread, but now they can actually run in parallel.
> 
> Changes the results of ffmpeg-fix_sub_duration_heartbeat - tested by
> JEEB to be more correct and deterministic.
> 
> > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d119ae2fd82a494d9430ff4d4fc262961a68c598
> ---
> 
>  Changelog                                        |   2 +
>  fftools/ffmpeg.c                                 | 374 +-----------
>  fftools/ffmpeg.h                                 |  97 +--
>  fftools/ffmpeg_dec.c                             | 313 +++-------
>  fftools/ffmpeg_demux.c                           | 268 ++++-----
>  fftools/ffmpeg_enc.c                             | 377 ++----------
>  fftools/ffmpeg_filter.c                          | 714 ++++++-----------------
>  fftools/ffmpeg_mux.c                             | 324 ++--------
>  fftools/ffmpeg_mux.h                             |  24 +-
>  fftools/ffmpeg_mux_init.c                        |  88 +--
>  fftools/ffmpeg_opt.c                             |   6 +-
>  tests/ref/fate/ffmpeg-fix_sub_duration_heartbeat |  34 +-
>  12 files changed, 600 insertions(+), 2021 deletions(-)

breaks: (races, violates bitexact)

for i in `seq 50` ; do ./ffmpeg -v 0 -i ~/tickets/4003/mp3_demuxer_EOI.mp3 -bitexact -vframes 1 -y /tmp/file-4003.avi ; md5sum /tmp/file-4003.avi

before:
db7ad90e0e02af90e98e09c9b0158124  /tmp/file-4003.avi
db7ad90e0e02af90e98e09c9b0158124  /tmp/file-4003.avi
db7ad90e0e02af90e98e09c9b0158124  /tmp/file-4003.avi
db7ad90e0e02af90e98e09c9b0158124  /tmp/file-4003.avi
db7ad90e0e02af90e98e09c9b0158124  /tmp/file-4003.avi
db7ad90e0e02af90e98e09c9b0158124  /tmp/file-4003.avi
db7ad90e0e02af90e98e09c9b0158124  /tmp/file-4003.avi
db7ad90e0e02af90e98e09c9b0158124  /tmp/file-4003.avi
db7ad90e0e02af90e98e09c9b0158124  /tmp/file-4003.avi
db7ad90e0e02af90e98e09c9b0158124  /tmp/file-4003.avi
db7ad90e0e02af90e98e09c9b0158124  /tmp/file-4003.avi
db7ad90e0e02af90e98e09c9b0158124  /tmp/file-4003.avi
db7ad90e0e02af90e98e09c9b0158124  /tmp/file-4003.avi
db7ad90e0e02af90e98e09c9b0158124  /tmp/file-4003.avi
db7ad90e0e02af90e98e09c9b0158124  /tmp/file-4003.avi
db7ad90e0e02af90e98e09c9b0158124  /tmp/file-4003.avi
db7ad90e0e02af90e98e09c9b0158124  /tmp/file-4003.avi
db7ad90e0e02af90e98e09c9b0158124  /tmp/file-4003.avi
db7ad90e0e02af90e98e09c9b0158124  /tmp/file-4003.avi
db7ad90e0e02af90e98e09c9b0158124  /tmp/file-4003.avi
db7ad90e0e02af90e98e09c9b0158124  /tmp/file-4003.avi
db7ad90e0e02af90e98e09c9b0158124  /tmp/file-4003.avi
db7ad90e0e02af90e98e09c9b0158124  /tmp/file-4003.avi
db7ad90e0e02af90e98e09c9b0158124  /tmp/file-4003.avi
db7ad90e0e02af90e98e09c9b0158124  /tmp/file-4003.avi
db7ad90e0e02af90e98e09c9b0158124  /tmp/file-4003.avi
db7ad90e0e02af90e98e09c9b0158124  /tmp/file-4003.avi
db7ad90e0e02af90e98e09c9b0158124  /tmp/file-4003.avi
db7ad90e0e02af90e98e09c9b0158124  /tmp/file-4003.avi
db7ad90e0e02af90e98e09c9b0158124  /tmp/file-4003.avi
db7ad90e0e02af90e98e09c9b0158124  /tmp/file-4003.avi
db7ad90e0e02af90e98e09c9b0158124  /tmp/file-4003.avi
db7ad90e0e02af90e98e09c9b0158124  /tmp/file-4003.avi
db7ad90e0e02af90e98e09c9b0158124  /tmp/file-4003.avi
db7ad90e0e02af90e98e09c9b0158124  /tmp/file-4003.avi
db7ad90e0e02af90e98e09c9b0158124  /tmp/file-4003.avi
db7ad90e0e02af90e98e09c9b0158124  /tmp/file-4003.avi
db7ad90e0e02af90e98e09c9b0158124  /tmp/file-4003.avi
db7ad90e0e02af90e98e09c9b0158124  /tmp/file-4003.avi
db7ad90e0e02af90e98e09c9b0158124  /tmp/file-4003.avi
db7ad90e0e02af90e98e09c9b0158124  /tmp/file-4003.avi
db7ad90e0e02af90e98e09c9b0158124  /tmp/file-4003.avi
db7ad90e0e02af90e98e09c9b0158124  /tmp/file-4003.avi
db7ad90e0e02af90e98e09c9b0158124  /tmp/file-4003.avi
db7ad90e0e02af90e98e09c9b0158124  /tmp/file-4003.avi
db7ad90e0e02af90e98e09c9b0158124  /tmp/file-4003.avi
db7ad90e0e02af90e98e09c9b0158124  /tmp/file-4003.avi
db7ad90e0e02af90e98e09c9b0158124  /tmp/file-4003.avi
db7ad90e0e02af90e98e09c9b0158124  /tmp/file-4003.avi
db7ad90e0e02af90e98e09c9b0158124  /tmp/file-4003.avi


aftre:
db7ad90e0e02af90e98e09c9b0158124  /tmp/file-4003.avi
1508e16c1877abe172173cd1e11f1155  /tmp/file-4003.avi
1508e16c1877abe172173cd1e11f1155  /tmp/file-4003.avi
933c2cc12cda1deac7245ec768f5b35f  /tmp/file-4003.avi
933c2cc12cda1deac7245ec768f5b35f  /tmp/file-4003.avi
db7ad90e0e02af90e98e09c9b0158124  /tmp/file-4003.avi
933c2cc12cda1deac7245ec768f5b35f  /tmp/file-4003.avi
db7ad90e0e02af90e98e09c9b0158124  /tmp/file-4003.avi
1508e16c1877abe172173cd1e11f1155  /tmp/file-4003.avi
1508e16c1877abe172173cd1e11f1155  /tmp/file-4003.avi
933c2cc12cda1deac7245ec768f5b35f  /tmp/file-4003.avi
1508e16c1877abe172173cd1e11f1155  /tmp/file-4003.avi
933c2cc12cda1deac7245ec768f5b35f  /tmp/file-4003.avi
1508e16c1877abe172173cd1e11f1155  /tmp/file-4003.avi
1508e16c1877abe172173cd1e11f1155  /tmp/file-4003.avi
1508e16c1877abe172173cd1e11f1155  /tmp/file-4003.avi
933c2cc12cda1deac7245ec768f5b35f  /tmp/file-4003.avi
1508e16c1877abe172173cd1e11f1155  /tmp/file-4003.avi
db7ad90e0e02af90e98e09c9b0158124  /tmp/file-4003.avi
933c2cc12cda1deac7245ec768f5b35f  /tmp/file-4003.avi
1508e16c1877abe172173cd1e11f1155  /tmp/file-4003.avi
1508e16c1877abe172173cd1e11f1155  /tmp/file-4003.avi
1508e16c1877abe172173cd1e11f1155  /tmp/file-4003.avi
1508e16c1877abe172173cd1e11f1155  /tmp/file-4003.avi
1508e16c1877abe172173cd1e11f1155  /tmp/file-4003.avi
1508e16c1877abe172173cd1e11f1155  /tmp/file-4003.avi
1508e16c1877abe172173cd1e11f1155  /tmp/file-4003.avi
933c2cc12cda1deac7245ec768f5b35f  /tmp/file-4003.avi
1508e16c1877abe172173cd1e11f1155  /tmp/file-4003.avi
1508e16c1877abe172173cd1e11f1155  /tmp/file-4003.avi
1508e16c1877abe172173cd1e11f1155  /tmp/file-4003.avi
933c2cc12cda1deac7245ec768f5b35f  /tmp/file-4003.avi
1508e16c1877abe172173cd1e11f1155  /tmp/file-4003.avi
1508e16c1877abe172173cd1e11f1155  /tmp/file-4003.avi
1508e16c1877abe172173cd1e11f1155  /tmp/file-4003.avi
933c2cc12cda1deac7245ec768f5b35f  /tmp/file-4003.avi
1508e16c1877abe172173cd1e11f1155  /tmp/file-4003.avi
933c2cc12cda1deac7245ec768f5b35f  /tmp/file-4003.avi
933c2cc12cda1deac7245ec768f5b35f  /tmp/file-4003.avi
1508e16c1877abe172173cd1e11f1155  /tmp/file-4003.avi
933c2cc12cda1deac7245ec768f5b35f  /tmp/file-4003.avi
933c2cc12cda1deac7245ec768f5b35f  /tmp/file-4003.avi
1508e16c1877abe172173cd1e11f1155  /tmp/file-4003.avi
1508e16c1877abe172173cd1e11f1155  /tmp/file-4003.avi
db7ad90e0e02af90e98e09c9b0158124  /tmp/file-4003.avi
933c2cc12cda1deac7245ec768f5b35f  /tmp/file-4003.avi
1508e16c1877abe172173cd1e11f1155  /tmp/file-4003.avi
1508e16c1877abe172173cd1e11f1155  /tmp/file-4003.avi
1508e16c1877abe172173cd1e11f1155  /tmp/file-4003.avi
1508e16c1877abe172173cd1e11f1155  /tmp/file-4003.avi


should i open a ticket to track this or someone has time
to look into this ?

thx

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I do not agree with what you have to say, but I'll defend to the death your
right to say it. -- Voltaire
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20240327/82393fe1/attachment.sig>


More information about the ffmpeg-devel mailing list