-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
std::bad_alloc #5
Comments
Hi, |
Hi @vadimkantorov I find that in mpegflow.cpp line 303 there is a static variable prev, since it is a vector, so pre.clear() cannot release its memory, as discussed in: I wonder wether we can use two variables prev1 and prev2 to replace vector in line 356? I hope |
Hello, |
@ZhichenZhao I'll take a look this wekend to avoid doing clear on a statically allocated vector. @Al-Bas Could you identify which line / code piece causes the crash? Is it the same issue @ghost has reported? Can you send me to [email protected] your video and ffmpeg libraries / includes? |
Many thanks - Sent an email containing all the details. Please let me know if you'd like me to run any tests on my machine or send extra info etc -- |
The following is the back trace log:
So it is crashing when calling output_vectors_std -- Apologies about the confusion earlier.. |
@Al-Bas Hi, Thanks, I received your e-mail with video. I'll take a look at it tomorrow. Meanwhile, does the problem go away if you replace the line https://github.com/vadimkantorov/mpegflow/blob/master/mpegflow.cpp#L366 to say |
@Al-Bas also, could you put a Basically in that piece of code I'm adding dummy frames for non-existent PTS. There could be a problem if timestamps in the video frames differ by gigantic amounts. |
Hello @vadimkantorov,
That's true enough ! I've been testing it on a bunch of h264 .mp4 videos from the recent Sports video dataset compiled by Andrej Karpathy found in: https://github.com/gtoderici/sports-1m-dataset/ The program crashed randomly for most videos, but seems to work for a very modest few.
I have edited the code to skip appending dummies to the prev vector and it seems to completely fix the issue on the videos I have tested so far. Is adding these dummies necessary in anyway ? Since you have two indices (frameIndex and PTS) already, what information do the dummies hold ? I will test this edit on more videos and update the fork if it helps anyone else. Many thanks Vlad ! Cheers -- |
@Al-Bas The dummies not hold any information, I introduced them in the first place to hide the complexity of video stream (missing frames, reordered frames) from the consumer. P.S. also, my name is Vadim, not Vlad |
@vadimkantorov Thanks, I tested it on 100 .mp4 contained videos pulled from different sources and all seems to be working well. Cheers -- |
@Al-Bas can you please explain more in details, how did you edit your code. is it just commenting this if section part https://github.com/vadimkantorov/mpegflow/blob/master/mpegflow.cpp#L310 ? |
@ichraf Yes just removing line 310 to 323 solves the issue. |
@Al-Bas Thank you. For me, it doesn't always solve the problem. I had two sequences: |
Yeah, there is some skipping happening in between. |
Hi. I tried to run mpegflow on Ubuntu 14.04 (clean) with *.mp4 file (h264 video) as in example:
./mpegflow filename.mp4 > filename.txt
But it consumed all available RAM (72 GB) and then showed bad_alloc error.
Did I do something wrong? Using of mpegflow with other arguments gave the same results.
The text was updated successfully, but these errors were encountered: