use my own ffmpeg crate

This significantly improves safety of the ffmpeg interface. The complex
ABIs aren't accessed directly from Rust. Instead, I have a small C
wrapper which uses the ffmpeg C API and the C headers at compile-time to
determine the proper ABI in the same way any C program using ffmpeg
would, so that the ABI doesn't have to be duplicated in Rust code.
I've tested with ffmpeg 2.x and ffmpeg 3.x; it seems to work properly
with both where before ffmpeg 3.x caused segfaults.

It still depends on ABI compatibility between the compiled and running
versions. C programs need this, too, and normal shared library
versioning practices provide this guarantee. But log both versions on
startup for diagnosing problems with this.

Fixes #7
This commit is contained in:
Scott Lamb
2017-09-20 21:06:06 -07:00
parent 8ff1d0dcb8
commit 857a66f29c
14 changed files with 768 additions and 170 deletions

View File

@@ -33,8 +33,6 @@
extern crate byteorder;
extern crate core;
extern crate docopt;
#[macro_use] extern crate ffmpeg;
extern crate ffmpeg_sys;
extern crate futures;
extern crate fnv;
extern crate http_entity;
@@ -47,6 +45,7 @@ extern crate reffers;
extern crate rusqlite;
extern crate memmap;
extern crate mime;
extern crate moonfire_ffmpeg;
extern crate mylog;
extern crate openssl;
extern crate parking_lot;