Giter Site home page Giter Site logo

chwjbn / ffmpeg-opengl-effect Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 197.85 MB

ffmpeg effect with opengl,支持ffmpeg7和opengl3.3 core模式的视频滤镜特效,演示抖音灵魂出窍特效

Shell 4.91% GLSL 3.66% C 44.17% Makefile 47.26%
ffmpeg opengl opengl33 ffmpeg7

ffmpeg-opengl-effect's Introduction

ffmpeg-opengl-effect

ffmpeg effect with opengl,支持ffmpeg7和opengl3.3 core模式的视频滤镜特效,演示抖音灵魂出窍特效

编译说明
  • 编译环境:msys2\ffmpeg7,环境准备build-env.sh脚本,编译参数参考build-ffmpeg.sh脚本
  • 复制vf_vernus.c到libavfilter目录下
  • 修改libavfilter目录下Makefile,在 OBJS-$(CONFIG_ZSCALE_FILTER) += vf_zscale.o 下面一行添加 OBJS-$(CONFIG_VERNUS_FILTER) += vf_vernus.o
  • 修改libavfilter目录下allfilters.c文件,在extern const AVFilter ff_vf_zscale;下面一行添加extern const AVFilter ff_vf_vernus;

硬件加速

  • Invidia卡 .\ffmpeg.exe -hwaccel cuda -c:v h264_cuvid -i .\test3.mp4 -c:v h264_nvenc .\test31.mp4
  • Intel卡 .\ffmpeg.exe -hwaccel cuda -c:v h264_qsv -i .\test3.mp4 -c:v h264_qsv .\test31.mp4
使用说明
  • 使用示例:.\ffplay.exe .\test\test.mp4 -vf "vernus=name=soul:start=2:duration=999"
参数说明
  • 过滤器名称: vernus
  • name: 效果名称,如soul,效果是抖音的灵魂出窍,effect目录下soul.vert\soul.frag文件,分别对应顶点着色器\片元着色器代码,具体编写方法参考OpenGL说明文档,目前支持两个变量输入iPlayTime(播放时间),iTexture0(当前帧图片数据,RGBA格式)
  • start: 效果开始时间,相对于开始播放,单位秒
  • duration: 效果持续时间,单位秒

ffmpeg-opengl-effect's People

Contributors

bktnull avatar chwjbn avatar

Stargazers

 avatar Yeauty avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.