-
Notifications
You must be signed in to change notification settings - Fork 150
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
crash with ffmpeg 3.x #7
Comments
Thanks for the bug report! I don't recognize the symptoms, so yes, I need some more information. First, what version of ffmpeg are you using? The ffmpeg FFI stuff is the part of the system I know is sketchy right now. I'm using a ffmpeg I installed from source; I'm not at all confident moonfire-nvr currently works with the one built into Raspbian. Looks like the README suggests using
What exactly do you mean by stops working? No more log output, I assume? Does the web interface respond? Could you get stack traces of all threads? I do something like this to save them to
|
With stopping I mean it terminates, which means there is no moonfire-nvr process anymore. The web interface is not available also. I have compiled ffmpeg myself today:
The output of ldd:
I'm using the current master of moonfire. I could not pass a PID to gdb, so I executed it like this (I added your commands to my gbdinit file):
The output ist the following:
Regards |
I don't see the backtrace (you redirected it to a file?) but I see the problem from the ffmpeg command output you quoted (thanks for that). ffmpeg's version numbers seem inscrutable to me, but you wrote:
and ffmpeg.org says that ffmpeg 3.3 has this version:
so you're presumably newer than ffmpeg 3.3. moonfire-nvr is still stuck on ffmpeg 2.x right now. It's frustrating that Moonfire requires a narrow range of ffmpeg versions (the version bundled with Raspbian is too old to work, anything 3.x is too new to work) and that if you violate its (poorly stated) requirements, it just crashes. Rust intends to be a safe language, and for the most part it is, but the FFI is decidedly unsafe, both in general and for moonfire's use of ffmpeg in particular. (I'm using an old version of the rust-ffmpeg bug; I filed a similar bug against that package here.) There's Rust code with structure definitions that have to match the C ones or bad things will happen. And at present, those definitions expect ffmpeg 2.x. I've been tempted to start using rust-bindgen to improve the situation by automatically producing the Rust bindings from the C ones at compile time, so that it should be correct at least if you're running against the same version you compiled against. And then either statically linking against ffmpeg (to guarantee that) or trusting that the underlying C library handled ABI compatibility properly. The downside is that rust-bindgen's installation is another step to do when compiling Moonfire. For Raspbian Jessie, I mean this sentence on their Requirements page:
|
I've been thinking about this problem. I think I can solve it without introducing rust-bindgen into the picture. I can write a small C wrapper around ffmpeg's Rust-unfriendly interface (macros and struct member accesses) that provides a C interface that's both inherently easier to wrap and versioned with the rest of moonfire-nvr, eliminating any unsafety. I'm not quite sure how to do some of the details, though, and asked for help here. |
Should work properly with ffmpeg 3.x now (and still work with ffmpeg 2.x). Let me know if you see otherwise. |
Hello Scott,
first I'd like to thank you for sharing your awesome work!
I have compiled your project on my Raspberry Pi 3 and it starts well but after configuring my first camera, the moonfire-nvr stops working while opening the input stream. Here is the output:
I have tried to configure it for serval RTSP streams but it always stops with the same error (I also tried this one: rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mov)
I'm using version
1.16.0 (30cf806ef 2017-03-10)
of rustc.Do you have any idea? If you need any more information please let me know! Thanks a lot!
Regards
Chris
The text was updated successfully, but these errors were encountered: