3 ms·
I've been struggling with exactly this, setting up ffmpeg to work with buffers instead of files. I'm about ready to just write frames to /tmp or maybe /dev/shm
by bick_nyers 5y ago
I've been struggling with exactly this, setting up ffmpeg to work with buffers instead of files. I'm about ready to just write frames to /tmp or maybe /dev/shm and invoke the CLI. I work with a lot of weirdly encoded media, so I'm thinking that for long-term maintainability it might be better to use the CLI anyways, as you can iterate significantly faster at the cost of control.
I'm just not sure what kind of performance overhead it will have writing to a ramdisk vs. using a buffer, as it's a non-negligible amount of memory to read/write so many extra times.
- charcircuit 5y ago>setting up ffmpeg to work with buffers instead of files I'd take a look at https://github.com/FFmpeg/FFmpeg/blob/master/tools/target_dem_fuzzer.c https://github.com/FFmpeg/FFmpeg/blob/master/tools/target_de... In io_seek I'd also clamp pos at the end to be between 0 and the filesize. That might be needed for some files. It doesn't hurt though. >I'm thinking that for long-term maintainability it might be better to use the CLI anyways It's definitely easier that way. You don't have to deal with gotchas like having to set some random flags or needing to specify a filename. It's just so easy to write code that fails on 1% of files which ffmpeg can actually decode.