ffmpeginteropx / FFmpegInteropX

FFmpeg decoding library for Windows 10 UWP and WinUI 3 Apps
Apache License 2.0
212 stars 53 forks source link

Insane memory useage when using loop filter #307

Open lukasf opened 2 years ago

lukasf commented 2 years ago

I saw memory usage skyrocketing when using loop video filter (#304):

loop=loop=-1:size=1:start=0

Not sure what is going on. Buffers are allocated and freed, looks normal to me, but something is wrong. Need to investigate with memory profiler.

brabebhin commented 2 years ago

I had some pc issues this week, I'll take a look in the weekend.

brabebhin commented 2 years ago

As a side note i encountered a similar issue with regular playback as well, on w11.

Sometimes video would stop rendering while audio and subs would still go on. Memory would go up over time as video frames are buffered, as well as disk usage going up (probably to fetch said frames).

I guess you are on w11 as well? I don't have a w10 machine anymore.

brabebhin commented 2 years ago

This seems to be because of timestamps. FFMpeg loop filter seems to actually loop timestamps as well. Using your example someplace in the file I keep getting the same timestamp for the video sample

35201833

This will cause them to buffer very quickly and memory does go up spectacularly.