[FFmpeg-trac] #8589(undetermined:new): Concat demuxer is not closing file handles for old playlists
FFmpeg
trac at avcodec.org
Tue Mar 31 10:44:25 EEST 2020
#8589: Concat demuxer is not closing file handles for old playlists
-------------------------------------+-------------------------------------
Reporter: karli2000 | Type: defect
Status: new | Priority: normal
Component: | Version: 4.2
undetermined |
Keywords: concat | Blocked By:
playlist cpu |
Blocking: | Reproduced by developer: 0
Analyzed by developer: 0 |
-------------------------------------+-------------------------------------
== Summary of the bug: ==
on Ubuntu 18.04 (i guess on all linux distributions), when you reference a
new playlist in a concat playlist file and this new playlist is getting
played the file handle of the first playlist is not getting closed, even
when the second playlist has the same name.
== How to reproduce: ==
generate a test-video like this:
{{{
ffmpeg -f lavfi -i testsrc=s=720x576:r=12:d=4 -pix_fmt yuv422p -vf
"drawbox=w=50:h=w:t=w:c=${c:?}" test.mkv
}}}
generate a playlist file called "test.txt" with this content:
{{{
ffconcat version 1.0
file 'test.mkv'
file 'test.txt'
}}}
invoke ffmpeg like this (streaming the file to a local udp port just to
get it going forever):
{{{
ffmpeg -re -f concat -i test.txt -c copy -f rtp rtp://localhost:2000
}}}
Get the process number for ffmpeg (like ps xa|grep ffmpeg)
Check how many file handles this process takes:
{{{
lsof -p <processnumber>
}}}
You will see that over time the "test.txt" playlist file handle will get
more and more, so the concat demuxer is not closing the file handle after
reading the playlist. Same behaviour if you switch between different
playlists or use pipes, even the bash example on
https://trac.ffmpeg.org/wiki/Concatenate has this problem.
Over time this leads to cpu increase of the ffmpeg process until the
machine runs out of file handles.
I tried it with different ffmpeg version from 4.1 to 4.2 (including on
Ubuntu the version from the ppa:jonathonf/ffmpeg-4 repository) every time
the same problem.
--
Ticket URL: <https://trac.ffmpeg.org/ticket/8589>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list