imagor icon indicating copy to clipboard operation
imagor copied to clipboard

ffmpeg backend, thoughts?

Open gnat opened this issue 3 years ago • 1 comments

So I've noticed Thumbor has https://github.com/theatlantic/thumbor-video-engine

Was wondering if @cshum has any thoughts on this, or if there is any ongoing effort to add ffmpeg as a backend (or something else that can do video, alongside vips) and/or what steps would be involved to do this?

Would be crazy useful to have the same basic interface with some different options for video.

Could just call whatever version of ffmpeg is on the host to Keep It Simple. :thinking:

Thanks and keep up the amazing work.

gnat avatar Jul 25 '22 07:07 gnat

Hi @gnat nice suggestions! I have actually had some thought on this for a while.

This requires implementing the Processor interface https://github.com/cshum/imagor/blob/master/imagor.go#L41, which the Process method involve taking in the source video Blob and returning the converted image Blob.

Imagor supports stacking multiple backend https://github.com/cshum/imagor/blob/master/imagor.go#L60 by logic. So on paper it should be possible to have ffmpeg backend that converts video to image, then pass to vips backend for all the fancy operations (resize, crop, watermark etc).

Though of course adding a entirely new processing backend still requires significant amount of effort and understanding of ffmpeg. Another concern is the docker image size after ffmpeg is included, and how it should be packaged.

But if anyone is willing to take an initiative on this, via a draft pull request, a separated package or anything similar, I am very keen to help out and collaborate :)

cshum avatar Jul 25 '22 15:07 cshum

@gnat check out imagorvideo!

cshum avatar Sep 09 '22 12:09 cshum

Lets redirect to the imagorvideo repo for further discussions:

https://github.com/cshum/imagorvideo

cshum avatar Sep 09 '22 12:09 cshum

WOW! nice work @cshum :crown:

gnat avatar Sep 09 '22 20:09 gnat

really nice to have an example of such a major imagor extension too!

gnat avatar Sep 09 '22 20:09 gnat