[FFmpeg-devel] [PATCH] avfillter/buffersrc: activate and EOF fix
Jan Ekström
jeebjp at gmail.com
Wed Nov 1 15:48:20 EET 2023
On Tue, Oct 31, 2023 at 12:55 PM Nicolas George <george at nsup.org> wrote:
>
> Paul B Mahol (12023-10-27):
> > Both patches are required to fix out of memory scenario with this use case:
>
> I checked. The OOM still happens with these two patches => they do not
> fix the issue => rejected.
So for me I have the following memory ballooning test case:
1. build FFmpeg with libx264 (I just haven't had the time to minimize
the test case to test other video formats)
2. Check that you have /usr/bin/time (it outputs "Maximum resident set
size" when called with -v argument)
3. Create test input with `ffmpeg -v verbose -filter_complex
'testsrc2=r=25:s=640x480:d=470[out]' -map '[out]' -c:v libx264 -preset
superfast test_clip.mp4`
4. Run the test case `/usr/bin/time -v ffmpeg -y -v verbose -i
test_clip.mp4 -c copy -map 0 -t 470 test_clip.mp4_copy.mp4
-filter_complex
"[0:0]split=1[thumb_in];[thumb_in]trim=start=420:end=421,scale=720:-2:threads=1,setsar=1/1,hqdn3d,unsharp[thumb_out]"
-map "[thumb_out]" -vframes 1 -f image2 test_clip.mp4_img2.jpg`
If the result for this is a maximum resident set size of about 60MiB
(f.ex. Maximum resident set size (kbytes): 62752), then things are how
they were before trim was switched to activate. If it is closer to
500MiB+ (f.ex. Maximum resident set size (kbytes): 609744), then that
is the memory ballooning behavior in action.
Results:
For current master the result is: bad (over 500MiB and would have kept
growing without the time limiting)
After applying the two patches: good (back to closer to 50MiB than 500MiB)
Exact steps to apply patches:
curl -L "https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20231027/8bf21777/attachment.bin"
| git am
curl -L "https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20231027/8bf21777/attachment-0001.bin"
| git am
I was planning to make a ticket for this, but Paul was too quick to
fix this so there is no trac ticket yet.
So my question is: Does this test case not improve for you after you
have applied these patches? Or are you speaking of a separate problem
which is bad both in master as well as after these patches have been
applied?
Regards,
Jan
More information about the ffmpeg-devel
mailing list