Comments (4)
I've run the code through valgrind, and this is the output:
http://dream-code.se/temp/valgrind.txt
==8789== LEAK SUMMARY:
==8789== definitely lost: 52 bytes in 4 blocks
==8789== indirectly lost: 352 bytes in 8 blocks
==8789== possibly lost: 2,992 bytes in 11 blocks
==8789== still reachable: 12,059,503 bytes in 1,396 blocks
==8789== suppressed: 0 bytes in 0 blocks
The problem here is: "still reachable". The program I'm writing is giving the option to select between many different tutorial movies, However, for this to work smoothly, the "still reachable" memory has to be freed, or else the user will be out of memory after playing only a few video files.
If someone could help fix this problem I would be very grateful!
from ffmpeg-tutorial.
Is this a problem with the tutorials or with the ffmpeg library itself?
Speaking of which, which version of ffmpeg are you using?
On 27 February 2014 18:24, solarstrings [email protected] wrote:
I've run the code through valgrind, and this is the output:
http://dream-code.se/temp/valgrind.txt
==8789== LEAK SUMMARY:
==8789== definitely lost: 52 bytes in 4 blocks
==8789== indirectly lost: 352 bytes in 8 blocks
==8789== possibly lost: 2,992 bytes in 11 blocks
==8789== still reachable: 12,059,503 bytes in 1,396 blocks
==8789== suppressed: 0 bytes in 0 blocksThe problem here is: "still reachable". The program I'm writing is giving
the option to select between many different tutorial movies, However, for
this to work smoothly, the "still reachable" memory has to be freed, or
else the user will be out of memory after playing only a few video files.If someone could help fix this problem I would be very grateful!
Reply to this email directly or view it on GitHubhttps://github.com//issues/22#issuecomment-36224036
.
from ffmpeg-tutorial.
which version of ffmpeg are you using?
I'm trying with different builds, both latest and the older one which comes with Enlightenment OS Luna (basically Ubuntu 12.04). Installed from repository.
Both latest build and the old one results in memory leak, try it with valgrind yourself.
Anyway!
I've been reading up on things, and one thing that needs to be added to the code is:
SDL_WaitThread.
Quoted from: http://wiki.libsdl.org/SDL_WaitThread
"Remarks
Wait for a thread to finish. Threads that haven't been detached will remain (as a "zombie") until this function cleans them up. Not doing so is a resource leak. "
There are two SDL_CreateThreads in the code, but SDL_WaitThread is not called, thus resulting in resource leak.
I played a 25 min long anime episode, and the allocated memory constantly kept growing. It started at about 70MB of allcoated memory and grew to 90+ MB. The same thing does not happen with ffplay.
//-------------
Is this a problem with the tutorials or with the ffmpeg library itself?
It's the tutorials, because ffplay doesn't leak memory. Sure, for a "command-line" player which plays one video file, it's somewhat "ok"... the "still reachable memory" will be free for access again once the program closes (handled by the OS), but if you want to play many different videos, in a row, it's not acceptable.
from ffmpeg-tutorial.
Can you confirm that calling SDL_WaitThread resolves the problem?
On 28 February 2014 05:04, solarstrings [email protected] wrote:
I'm trying with different builds, both latest and the older one which
comes with Enlightenment OS Luna (basically Ubuntu 12.04). Installed from
repository.
Both latest build and the old one results in memory leak, try it with
valgrind yourself.Anyway!
I've been reading up on things, and one thing that needs to be added to
the code is:
SDL_WaitThread.Quoted from: http://wiki.libsdl.org/SDL_WaitThread
"Remarks
Wait for a thread to finish. Threads that haven't been detached will
remain (as a "zombie") until this function cleans them up. Not doing so is
a resource leak. "There are two SDL_CreateThreads in the code, but SDL_WaitThread is not
called, thus resulting resource leak.I played a 25 min long anime episode, and the allocated memory constantly
kept growing. It started at about 70MB of allcoated memory and grew to 90+
MB. The same thing happens with ffplay.Is this a problem with the tutorials or with the ffmpeg library itself?
It's the tutorials, because they are based upon the code of ffplay, which
also doesn't free the allocate memory in the end. Sure, for a
"command-line" player, its ok... the "still reachable memory" will be free
for access again once the program closes (handled by the OS), but if you
want to play many different videos, in a row, it's not acceptable.Reply to this email directly or view it on GitHubhttps://github.com//issues/22#issuecomment-36284994
.
from ffmpeg-tutorial.
Related Issues (20)
- sdl and PKG_CONFIG_PATH environment variable HOT 2
- Audio broken HOT 18
- Update
- AVCODEC_MAX_AUDIO_FRAME_SIZE macro undeclared HOT 1
- tutorial7 - synchronize_audio
- Streaming Tutorial? HOT 1
- Why tutorial01 produce twice less frames than ffmpeg? HOT 1
- Audio not working HOT 20
- Simplifying SaveFrame function HOT 2
- tutorial03.c line 194 should exchange len1 and len HOT 1
- segmentation fault when running tutorial4 or any other after that HOT 3
- Tuto7 : Async after seeking backwards HOT 2
- libavcodec/avcodec.h not found HOT 1
- hi,when I compile the tutorial05.c, I get a problem. HOT 2
- Hey getting this error: stream.c:65:14: warning: implicit declaration of function 'av_image_get_buffer_size' is invalid in C99 [-Wimplicit-function-declaration] HOT 1
- which version of ffmpeg should i use? HOT 2
- unable to compile ffmpeg with gpu support
- AVCodecContext release_buffer
- dl
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ffmpeg-tutorial.