About FFVideoStream::probe
I think I spotted my error, resulting in memory leak.. Try to add av_frame_free(&frame); Just before return ret; line.. { line 1246 currently?} And after this re-enable line disabled in commit eabda9cf447580a974fd3d67a3d0a26f09aeb523 ff->video_probe(1); in fileffmpeg.C And of course re-test ( i probably loaded only very small project or number of files for noticing this.. :/)
Andrew, I am testing this now and will let you know -- I am looking for the original file I tested with which makes it easy to tell if it solves the memory issue. On Mon, May 3, 2021 at 10:09 PM Andrew Randrianasulu via Cin < [email protected]> wrote:
I think I spotted my error, resulting in memory leak..
Try to add
av_frame_free(&frame);
Just before return ret; line.. { line 1246 currently?}
And after this re-enable line disabled in commit eabda9cf447580a974fd3d67a3d0a26f09aeb523
ff->video_probe(1); in fileffmpeg.C
And of course re-test ( i probably loaded only very small project or number of files for noticing this.. :/) -- Cin mailing list [email protected] https://lists.cinelerra-gg.org/mailman/listinfo/cin
Andrew, I AM STUCK ! On Mon, May 3, 2021 at 10:09 PM Andrew Randrianasulu via Cin < [email protected]> wrote:
I think I spotted my error, resulting in memory leak..
Try to add
av_frame_free(&frame);
Just before return ret; line.. { line 1246 currently?}
And after this re-enable line disabled in commit eabda9cf447580a974fd3d67a3d0a26f09aeb523
ff->video_probe(1); in fileffmpeg.C
And of course re-test ( i probably loaded only very small project or number of files for noticing this.. :/)
First, I lost my great test case and have been searching almost daily for that one, but am settling on something that may or may not be a good test. Second, I can not figure out where to put the line:
av_frame_free(&frame); Just before return ret; line.. { line 1246 currently?} There are multiple "return ret:" lines in fileffmpeg.C but the one closest to 1246 is at 1337 but this is just a guess: int FFOptions::update() { int ret = 0; FFOptions &conf = *this; for( int i=0; i<size(); ++i ) { FFOptions_Opt *fopt = conf[i]; char val[BCTEXTLEN], *vp = fopt->get(val, sizeof(val)); if( !vp || !strcmp(val, fopt->item_value->get_text()) ) continue; fopt->item_value->update(val); ++ret; } av_frame_free(&frame); return ret; The problem is then, that it does not compile and I get this error message: fileffmpeg.C:1337:17: error: ‘frame’ was not declared in this scope; did you mean ‘FFrame’? Any ideas? Thanks, Phyllis
Andrew, Also, forgot to mention that the file: 0001-constify-fileffmpeg.C.patch although it includes re-enabled int video_probe line does NOT include the av_frame_free(&frame); line as far as I can tell. On Mon, May 3, 2021 at 10:09 PM Andrew Randrianasulu via Cin < [email protected]> wrote:
I think I spotted my error, resulting in memory leak..
Try to add
av_frame_free(&frame);
Just before return ret; line.. { line 1246 currently?}
And after this re-enable line disabled in commit eabda9cf447580a974fd3d67a3d0a26f09aeb523
ff->video_probe(1); in fileffmpeg.C
And of course re-test ( i probably loaded only very small project or number of files for noticing this.. :/) -- Cin mailing list [email protected] https://lists.cinelerra-gg.org/mailman/listinfo/cin
try this patch? On Friday, May 21, 2021, Phyllis Smith via Cin <[email protected]> wrote:
Andrew, Also, forgot to mention that the file: 0001-constify-fileffmpeg.C.patch although it includes re-enabled int video_probe line does NOT include the av_frame_free(&frame); line as far as I can tell.
On Mon, May 3, 2021 at 10:09 PM Andrew Randrianasulu via Cin < [email protected]> wrote:
I think I spotted my error, resulting in memory leak..
Try to add
av_frame_free(&frame);
Just before return ret; line.. { line 1246 currently?}
And after this re-enable line disabled in commit eabda9cf447580a974fd3d67a3d0a26f09aeb523
ff->video_probe(1); in fileffmpeg.C
And of course re-test ( i probably loaded only very small project or number of files for noticing this.. :/) -- Cin mailing list [email protected] https://lists.cinelerra-gg.org/mailman/listinfo/cin
Andrew,
try this patch?
Thanks for the patch - I should have known the fix went into ffmpeg.C instead of fileffmpeg.C. Sorry for getting it wrong.
BUT, the bad news is that the patch + uncommenting the ff->video_probe(1); line in fileffmpeg.C does not solve the use of extra memory. It seemed like it might have though. I finally found a definitive test case and this time saved it so I could find it again. Bummer. Since I often make mistakes, I ran it several times and verified that I correctly had the lines right. The results were consistent -- as soon as I uncommented "ff->video_probe(1); in fileffmpeg.C" whether or not the patch to ffmpeg.C was in, the memory usage went up about 18%.
On Mon, May 3, 2021 at 10:09 PM Andrew Randrianasulu via Cin <
[email protected]> wrote:
I think I spotted my error, resulting in memory leak..
Try to add
av_frame_free(&frame);
Just before return ret; line.. { line 1246 currently?}
And after this re-enable line disabled in commit eabda9cf447580a974fd3d67a3d0a26f09aeb523
ff->video_probe(1); in fileffmpeg.C
And of course re-test ( i probably loaded only very small project or number of files for noticing this.. :/)
On Monday, May 24, 2021, Phyllis Smith via Cin <[email protected]> wrote:
Andrew,
try this patch?
Thanks for the patch - I should have known the fix went into ffmpeg.C instead of fileffmpeg.C. Sorry for getting it wrong.
BUT, the bad news is that the patch + uncommenting the ff->video_probe(1); line in fileffmpeg.C does not solve the use of extra memory. It seemed like it might have though. I finally found a definitive test case and this time saved it so I could find it again.
cool!
Bummer. Since I often make mistakes, I ran it several times and verified that I correctly had the lines right. The results were consistent -- as soon as I uncommented "ff->video_probe(1); in fileffmpeg.C" whether or not the patch to ffmpeg.C was in, the memory usage went up about 18%.
but does this memory usage increase with each loaded clip/media, or stay the same? does memory actually leak (usage grow, and some memory still not freed after program quit)? 18% sounds a lot (too much for single-frame decoding i was hoping for)
On Mon, May 3, 2021 at 10:09 PM Andrew Randrianasulu via Cin <
[email protected]> wrote:
I think I spotted my error, resulting in memory leak..
Try to add
av_frame_free(&frame);
Just before return ret; line.. { line 1246 currently?}
And after this re-enable line disabled in commit eabda9cf447580a974fd3d67a3d0a26f09aeb523
ff->video_probe(1); in fileffmpeg.C
And of course re-test ( i probably loaded only very small project or number of files for noticing this.. :/)
Andrew,
but does this memory usage increase with each loaded clip/media, or stay the same? does memory actually leak (usage grow, and some memory still not freed after program quit)?
18% sounds a lot (too much for single-frame decoding i was hoping for)
Yes, it gradually increases with each loaded clip/media. The memory is
freed after the program quits. I even tried this line in ffmpeg.C instead as a really wild guess: av_frame_free(&probe_frame); For now, leaving the ff->video_probe(1); line commented out. Someday we can get back to it. Do not worry about it -- something will pop up later. ...Phyllis
participants (2)
-
Andrew Randrianasulu -
Phyllis Smith