I'm writing some tools to capture video streams, doing demuxing/muxing, decoding, etc. All of the libraries that do these things are written in C.
Using another language, aside from c++, would involve using some kind of ffi mapping, made by me or someone else. So now I not only have to understand the semantics of c and the libraries I'm using I have to understand the semantics of the ffi mapping.
Using the ffmpeg libraries I've had to dig into the source to figure out what it's doing[0]. If I'm using python(or whatever) now I have to do that and figure out what the mapping is doing. And I'm still not safe from segfaults and memory leaks, they're just harder to find and understand.
Soft realtime is trivial in C. If I'm capturing a video stream at 10fps I have about 100ms to do everything to handle a frame. This is very easy to do in c. If I'm using a garbage collected language I have 100ms-X, where X is the longest garbage collection pause.
I tried doing a similar project in java and found it very difficult. Using any library, for example to output a jpeg, created tons of garbage, resulting in long gc pauses. I tried a bunch of different -XXasdf options that helped but to really solving the problem would involve reimplementing a bunch of stuff to reuse buffers and avoid garbage. I freely admit this may be because of my ignorance of how to do it correctly but again it's trivial to avoid these pauses in c.
So I ask sincerely what should I do? I'll gladly throw out the years of painfully acquired c knowledge if you have a better solution for me today.
[0] I wonder why avformat_find_stream_info is detecting the from framerate? Good luck :)
http://ffmpeg.org/doxygen/trunk/libavformat_2utils_8c_source...