editly icon indicating copy to clipboard operation
editly copied to clipboard

Simple filtering

Open mifi opened this issue 4 years ago • 12 comments

  • LUT
  • Color filter GLSL
  • blending layers https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/globalCompositeOperation
  • reverse clip
  • crop

mifi avatar Apr 22 '20 14:04 mifi

The CLI could give warnings if the input files have different color space.

https://youtu.be/DGY14ygjpLU?t=81

chapmanjacobd avatar Apr 27 '20 09:04 chapmanjacobd

I'm not too experienced with color spaces, but we would need to figure out how to get this data from ffprobe

mifi avatar Apr 28 '20 07:04 mifi

https://trac.ffmpeg.org/wiki/colorspace https://kdenlive.org/en/project/color-hell-ffmpeg-transcoding-and-preserving-bt-601/

for me colorspace is very low priority. not many consumer-grade cameras record that information. but it is an interesting problem space.

I think more central to editly is the compositing features: https://stackoverflow.com/questions/45869889/ffmpeg-move-overlay-from-point-a-to-b-to-c-to-d

chapmanjacobd avatar Apr 28 '20 07:04 chapmanjacobd

maybe some sort of automatic color enhancement or passing through ffmpeg options for filters would be more beneficial to the average person than LUT conversion

for example, desaturate:

-vf hue=s=0

chapmanjacobd avatar Apr 28 '20 08:04 chapmanjacobd

you can get colorspace like this:

ffprobe -v quiet -print_format json -show_format -show_streams videofile.mp4 | jq .streams[].color_space

chapmanjacobd avatar Apr 28 '20 08:04 chapmanjacobd

I think more central to editly is the compositing features: https://stackoverflow.com/questions/45869889/ffmpeg-move-overlay-from-point-a-to-b-to-c-to-d

I have been experimenting with allowing compositing of arbitrary layers. I made a simple implementation which would allow separately filtering and scaling layers, however rendering became a lot slower than it is now. Will have to research more.

maybe some sort of automatic color enhancement or passing through ffmpeg options for filters would be more beneficial to the average person than LUT conversion

Yea ffmpeg can do a lot, also LUT, but it is quite slow because software rendered. However with WebGL there are possibilities for higher performance LUT conversion and common image operations like brightness/contrast etc.

I think LUTs are getting more and more popular because so many "influencers" are selling their LUT packs and presets on instagram and youtube these days.

mifi avatar Apr 28 '20 09:04 mifi

WebGL there are possibilities for higher performance LUT conversion and common image operations

this is way cool. I'm all for it because it should mean higher performance of image modification but still have the same quality. I wonder if any of this is relevant:

https://eklitzke.org/rendering-videos-from-opengl (the HTML5 video section)

https://discourse.threejs.org/t/attempting-to-make-universal-rendering-thingy-for-webgl-canvas2d-with-ffmpeg/11126 https://github.com/wonglok/rendering-garden/blob/master/src/encoder/vid.encoder.js https://github.com/wonglok/rendering-garden/blob/master/src/gl-api/graphics.js https://github.com/wonglok/rendering-garden/blob/master/src/gl-api/front-sdk.js https://github.com/wonglok/rendering-garden/blob/master/src/gl-api/adapter-front-end.js https://github.com/wonglok/rendering-garden/blob/master/src/gl-api/adapter-back-end.js

https://stackoverflow.com/questions/31499717/best-way-to-record-a-html-canvas-webgl-animation-server-side-into-a-video https://stackoverflow.com/questions/48011613/rendering-webgl-image-in-headless-chrome-without-a-gpu

chapmanjacobd avatar Apr 28 '20 12:04 chapmanjacobd

I also found some cool things:

  • https://gl-react-cookbook.surge.sh/blurvideo
  • http://evanw.github.io/glfx.js/demo/
  • http://fabricjs.com/image-filters
  • https://github.com/couleurs/glsl-sharpen

mifi avatar May 06 '20 09:05 mifi

woah glfx lens blur effect is really good. the perspective filter is really cool too even though the quality isn't very high it renders really quickly

chapmanjacobd avatar May 06 '20 11:05 chapmanjacobd

Hi @mifi thanks so much for this awesome peace of art, the framework is really great! One question, I'd like to add vignette effect to a video, what is the best way to go about it? Thank you!

timurguseynov avatar Dec 02 '20 12:12 timurguseynov

There is no vignette filter in editly, but it could possibly be achieved with an image containing a transparent SVG/PNG that has a vignette

I added an example: https://github.com/mifi/editly/blob/master/examples/vignette.json5

mifi avatar Dec 07 '20 17:12 mifi

Wow, thanks @mifi, it works 👍

timurguseynov avatar Dec 08 '20 22:12 timurguseynov