Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

While we're here, I'm looking for a decent .NET Core library for wrapping or p/invoking FFMpeg. Preferably the latter, because I'd like to operate on .NET IO streams to be able to fit it into my general media decoding pipeline.

Unfortunately, all the ones I've found so far have their own, mostly-undocumented abstractions and they only operate on files on disk. The only input parameter they provide is file path as a string, and I'd rather not have to round trip a temporary file. It's all through static methods on a static class, so I can't even create an extension method to accept a FileInfo object.

Maybe I just need to use the CLI tool and pipe standard IO.



Jellyfin also uses it that way as far as I know. I think the reason a lot of projects opt to just invoke the CLI is two-fold: licensing and installation (if dynamic linking).

I recently wrote a TV show intro detection CLI tool in Rust and the FFmpeg library was fairly painless to use (thanks to [1]). Documentation for the library is lacking, though.

[1] https://github.com/zmwangx/rust-ffmpeg


I'd recommend subprocess execution for being able to monitor progress and abort early alone. You can't cleanly kill a thread in a process, but killing a whole process is bread and butter to an OS.

In production scenarios you'd want that process to run in an isolated jail. Video formats are very complex and I don't have faith that fuzzers have found every exploit.


This would be for transcoding of input design assets to suitable web-standard output formats in a trusted environment, i.e. not a public user-facing tool, and I'm actually only really using it for audio, but I think your point still makes sense.


I am using CliWrap to create my own wrapper for the functionality I need from FFmpeg. Works pretty well!

https://github.com/Tyrrrz/CliWrap


  I'd rather not have to round trip a temporary file
  I just need to use the CLI tool and pipe standard IO
Or use Process substitution

https://en.wikipedia.org/wiki/Process_substitution




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: