Git Product home page Git Product logo

numberwolf / ffmpeg-plusplus Goto Github PK

View Code? Open in Web Editor NEW
403.0 24.0 72.0 50.84 MB

🔥 FFmpeg扩展版本,1.支持OpenGL图形渲染,自定义着色器 滤镜、特效、转场。2.支持FLV+HEVC/AV1/Opus编码解码 🔥 FFmpeg Extension: 1.Support GLSL OpenGL(Filter/Effect/Transition/Shaders); 2. And Transcode FLV with HEVC/AV1/Opus Codec

Home Page: https://www.zzsin.com/shaderplus.html

License: MIT License

Shell 0.12% C 91.46% Makefile 1.30% GLSL 0.03% C++ 0.17% Perl 0.04% Assembly 6.68% Verilog 0.01% Objective-C 0.12% SourcePawn 0.01% Cuda 0.04% Roff 0.01% Awk 0.01% HTML 0.01% Ruby 0.01% Python 0.02%
ffmpeg opengl shader ffmpeg-opengl filter ffmpeg-filter-opengl effects transition-animation transition glsl

ffmpeg-plusplus's Introduction

FFmpeg++ (FFmpeg-Plus-Plus) Base on 4.2.4

中文 | English

  • OpenGL Filter for FFmpeg: Support Effects/Transition/Picture-in-Picture/LUT, Render video by your shaders(GLSL)
  • Support Transcode FLV with HEVC/AV1/Opus

Contact

0. Feature

1. Build

1.1 FFmpeg + OpenGL + FLV(265/AV1/Opus)

  • FLV HEVC CodecID = 12 FLV_CODECID_HEVC
  • FLV AV1 CodecID = 13 FLV_CODECID_AV1
  • FLV Opus CodecID = 13 FLV_CODECID_OPUS
bash build-all.sh

1.2 FFmpeg + OpenGL

bash build-only-opengl.sh

1.3 FFmpeg + FLV(265/AV1/Opus)

bash build-with-flv_265-flv_av1_opus.sh

2.Use

2.1 FFmpeg + OpenGL

How to use FFmpeg + OpenGL Filter/Effects/Transition?

2.2 FFmpeg + FLV(265/AV1/Opus)

Test FFmpeg H.265

  • Execute Command
ffmpeg -i hevctest.flv
  • Output
Input #0, flv, from 'hevctest.flv':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2mp41
    encoder         : Lavf58.29.100
  Duration: 00:00:05.10, start: 0.059000, bitrate: 855 kb/s
    Stream #0:0: Video: hevc (Main), yuv420p(tv), 1280x720, 25 fps, 25 tbr, 1k tbn, 25 tbc
    Stream #0:1: Audio: aac (LC), 48000 Hz, stereo, fltp, 128 kb/s

Test FFmpeg Av1+Opus

  • Execute Command
ffmpeg -i av1test_opus.flv
  • Output
[libaom-av1 @ 0x7fdbf0814600] dimension change! 0x0 -> 1280x720
Input #0, flv, from 'av1test_opus.flv':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2mp41
    encoder         : Lavf58.29.100
  Duration: 00:00:05.01, start: 0.000000, bitrate: 331 kb/s
    Stream #0:0: Video: av1 (Main), yuv420p(tv), 1280x720, 256 kb/s, 25 fps, 25 tbr, 1k tbn
    Stream #0:1: Audio: opus, 48000 Hz, stereo, fltp, 96 kb/s
[libaom-av1 @ 0x7fdbf1808000] 2.0.0

ffmpeg-plusplus's People

Contributors

girlbymirror avatar numberwolf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ffmpeg-plusplus's Issues

/usr/bin/xvfb-run: line 181: 46303 Segmentation fault

[Environment]
1,OS: centos 8
2,vf_plusglshader has successfully installed.
3,No video card and installed xvfb

[Command]
$ xvfb-run -a --server-args="-screen 0 1280x720x24 -ac -nolisten tcp -dpi 96 +extension RANDR" \ ./ffmpeg -v debug \ -i 0.mp4 \ -vf plusglshader \ -y output.mp4

[Output]
image

[Question]
Why the transcode failed?

mac os Conversion failed!

[Parsed_fadeglshader_1 @ 0x7fce67f6e4c0] doing vf_fadeglshader build_shader
[Parsed_fadeglshader_1 @ 0x7fce67f6e4c0] doing vf_fadeglshader build_shader glCreateShader glIsShader FAILED!
[Parsed_fadeglshader_1 @ 0x7fce67f6e4c0] doing vf_fadeglshader update_program failed!
[Parsed_fadeglshader_1 @ 0x7fce67f6e4c0] Failed to configure input pad on Parsed_fadeglshader_1
[Parsed_fadeglshader_1 @ 0x7fce67f6e4c0] start vf_fadeglshader uninit action
[Parsed_fadeglshader_1 @ 0x7fce67f6e4c0] doing vf_fadeglshader check window
[Parsed_fadeglshader_1 @ 0x7fce67f6e4c0] doing vf_fadeglshader gl delete operations
[Parsed_fadeglshader_1 @ 0x7fce67f6e4c0] finished vf_fadeglshader
Error reinitializing filters!
Failed to inject frame into filter network: Operation not permitted
Error while processing the decoded data for stream #0:0
[AVIOContext @ 0x7fce67f12300] Statistics: 0 seeks, 0 writeouts
[AVIOContext @ 0x7fce67f060c0] Statistics: 262144 bytes read, 0 seeks
Conversion failed!

视频转场导出视频的长度的疑问

sudo xvfb-run -a --server-args="-screen 0 1280x720x24 -ac -nolisten tcp -dpi 96 +extension RANDR" /home/abc/FFmpeg-PlusPlus/ffmpeg -v debug -ss 0 -t 6 -i 0.mp4 -filter_complex "[0:v]scale=2560:1600[scale0];[scale0]fadeglshader=offset=3:fade_duration=1:ext_source=./1.mp4:vxsource=gl_fade/fade_vertex.gl:sdsource=gl_fade/fade_shader.gl[effects];[effects]scale=1000:1000" -vcodec libx264 -an -pix_fmt yuv420p -y f1.mp4
我使用了以上命令想给0.mp4和1.mp4之间加个转场,我发现正常导出了,视频也确实可以播放。但是两个都是3秒长的视频出来为什么不是6秒长的视频,而只有4秒呢呢?麻烦解惑一下,谢谢!!

Resolution Mismatch

Hello Sir,

I'm working with this repo and i'm stuck on the following:

If i use input-resolutions with dar 16:9 on 1920x1080 or below like 1280x720 or 640x360 the pipglshader works fine.
But if i have other resolutions the texture(s) is/are screwed up.

I've put a sample into my repo on: SAMPLE

I've looked into the source and tried some stuff but i can't get it right.

I've patched FFmpeg-n4.3.1 with your code. (SOURCES)

I would like to use different (full) resolutions that i can use in the GPU shaders so i can zoom in on them....
Maybe you got a fix?

Thanks for reading, have a nice day.
Gerard W.

使用plusglshader滤镜为分辨率9:16的视频添加特效,效果异常

问题描述

使用plusglshader对视频进行特效处理时,当原始视频为9:16分辨率格式时,结果视频的显示效果异常
在其他分辨率如3:4、4:3、16:9等尺寸时,效果正常展示。

执行参数

测试资源地址

链接: https://pan.baidu.com/s/1JrrnFPbhRERs53hb-VWABA 密码: snuj

git apply 失败了

error: patch failed: libavfilter/allfilters.c:444
error: libavfilter/allfilters.c: patch does not apply

Usage with ffmpeg 6.0

Can it be used with ffmpeg 6.0? I try to compile it, but getting next error:

#0 50.03 CC     libavfilter/vf_extractplanes.o
#0 50.14 CC     libavfilter/vf_fade.o
#0 50.22 CC     libavfilter/vf_fadeglshader.o
#0 50.36 libavfilter/vf_fadeglshader.c:41: warning: "TS2T" redefined
#0 50.36    41 | #define TS2T(ts, tb) ((ts) == AV_NOPTS_VALUE ? NAN : (double)(ts)*av_q2d(tb))
#0 50.36       |
#0 50.36 In file included from libavfilter/vf_fadeglshader.c:18:
#0 50.36 libavfilter/internal.h:255: note: this is the location of the previous definition
#0 50.36   255 | #define TS2T(ts, tb) ((ts) == AV_NOPTS_VALUE ? NAN : (double)(ts) * av_q2d(tb))
#0 50.36       |
#0 50.36 libavfilter/vf_fadeglshader.c: In function 'build_shader':
#0 50.36 libavfilter/vf_fadeglshader.c:197:5: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
#0 50.36   197 |     GLuint shader = glCreateShader(type);
#0 50.36       |     ^~~~~~
#0 50.36 libavfilter/vf_fadeglshader.c:204:5: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
#0 50.36   204 |     GLint status;
#0 50.36       |     ^~~~~
#0 50.36 libavfilter/vf_fadeglshader.c:208:5: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
#0 50.36   208 |     int InfoLogLength = 0;
#0 50.36       |     ^~~
#0 50.36 libavfilter/vf_fadeglshader.c:214:57: warning: passing argument 4 of '__glewGetShaderInfoLog' from incompatible pointer type [-Wincompatible-pointer-types]
#0 50.36   214 |         glGetShaderInfoLog(shader, InfoLogLength, NULL, &ShaderErrorMessage);
#0 50.36       |                                                         ^~~~~~~~~~~~~~~~~~~
#0 50.36       |                                                         |
#0 50.36       |                                                         char **
#0 50.36 libavfilter/vf_fadeglshader.c:214:57: note: expected 'GLchar *' {aka 'char *'} but argument is of type 'char **'
#0 50.36 libavfilter/vf_fadeglshader.c:215:79: warning: format '%s' expects argument of type 'char *', but argument 4 has type 'char **' [-Wformat=]
#0 50.36   215 |         av_log(ctx, AV_LOG_ERROR, "doing vf_fadeglshader build_shader ERROR: %s\n", &ShaderErrorMessage);
#0 50.36       |                                                                              ~^     ~~~~~~~~~~~~~~~~~~~
#0 50.36       |                                                                               |     |
#0 50.36       |                                                                               |     char **     
#0 50.36       |                                                                               char *
#0 50.36 libavfilter/vf_fadeglshader.c:218:5: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
#0 50.36   218 |     GLuint ret = status == GL_TRUE ? shader : 0;
#0 50.36       |     ^~~~~~
#0 50.36 libavfilter/vf_fadeglshader.c: In function 'vbo_setup':
#0 50.36 libavfilter/vf_fadeglshader.c:227:5: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
#0 50.36   227 |     GLint loc = glGetAttribLocation(gs->program, "position");
#0 50.36       |     ^~~~~
#0 50.36 libavfilter/vf_fadeglshader.c: In function 'open_ext_source':
#0 50.36 libavfilter/vf_fadeglshader.c:319:5: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
#0 50.36   319 |     int vIndex = -1;
#0 50.36       |     ^~~
#0 50.37 libavfilter/vf_fadeglshader.c:358:32: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
#0 50.37   358 |                 AVCodec *dec = avcodec_find_decoder(codecId);
#0 50.37       |                                ^~~~~~~~~~~~~~~~~~~~
#0 50.37 libavfilter/vf_fadeglshader.c:358:17: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
#0 50.37   358 |                 AVCodec *dec = avcodec_find_decoder(codecId);
#0 50.37       |                 ^~~~~~~
#0 50.37 libavfilter/vf_fadeglshader.c:407:17: warning: 'av_init_packet' is deprecated [-Wdeprecated-declarations]
#0 50.37   407 |                 av_init_packet(gs->extAvMediaContext.m_decPacket);
#0 50.37       |                 ^~~~~~~~~~~~~~
#0 50.37 In file included from ./libavcodec/avcodec.h:44,
#0 50.37                  from libavfilter/vf_fadeglshader.c:10:
#0 50.37 ./libavcodec/packet.h:629:6: note: declared here
#0 50.37   629 | void av_init_packet(AVPacket *pkt);
#0 50.37       |      ^~~~~~~~~~~~~~
#0 50.37 libavfilter/vf_fadeglshader.c: In function 'render_rgba_frame':
#0 50.37 libavfilter/vf_fadeglshader.c:463:9: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
#0 50.37   463 |         float scaleRatio = 1.0;
#0 50.37       |         ^~~~~
#0 50.37 libavfilter/vf_fadeglshader.c:481:5: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
#0 50.37   481 |     int ret = 0;
#0 50.37       |     ^~~
#0 50.37 libavfilter/vf_fadeglshader.c:499:5: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
#0 50.37   499 |     GLuint textureTemp = 0;
#0 50.37       |     ^~~~~~
#0 50.37 libavfilter/vf_fadeglshader.c:499:12: warning: unused variable 'textureTemp' [-Wunused-variable]        
#0 50.37   499 |     GLuint textureTemp = 0;
#0 50.37       |            ^~~~~~~~~~~
#0 50.37 libavfilter/vf_fadeglshader.c: In function 'ext_get_frame':
#0 50.37 libavfilter/vf_fadeglshader.c:613:21: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
#0 50.37   613 |                     int rgb24size = gs->extAvMediaContext.m_ext_width * gs->extAvMediaContext.m_frame->height * 4;
#0 50.37       |                     ^~~
#0 50.37 libavfilter/vf_fadeglshader.c:561:14: warning: unused variable 'szError' [-Wunused-variable]
#0 50.37   561 |         char szError[256] = {0};
#0 50.37       |              ^~~~~~~
#0 50.37 libavfilter/vf_fadeglshader.c: In function 'ext_source_prepare':
#0 50.37 libavfilter/vf_fadeglshader.c:706:5: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
#0 50.37   706 |     int ret = open_ext_source(inlink);
#0 50.37       |     ^~~
#0 50.37 libavfilter/vf_fadeglshader.c: In function 'update_program':
#0 50.37 libavfilter/vf_fadeglshader.c:729:5: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
#0 50.37   729 |     GLuint v_shader, f_shader;
#0 50.37       |     ^~~~~~
#0 50.37 libavfilter/vf_fadeglshader.c:744:5: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
#0 50.37   744 |     GLint status;
#0 50.37       |     ^~~~~
#0 50.37 libavfilter/vf_fadeglshader.c: In function 'build_program':
#0 50.37 libavfilter/vf_fadeglshader.c:762:5: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
#0 50.37   762 |     FadeGLShaderContext *gs = ctx->priv;
#0 50.37       |     ^~~~~~~~~~~~~~~~~~~
#0 50.37 libavfilter/vf_fadeglshader.c:774:9: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
#0 50.37   774 |         FILE *f = fopen(gs->sdsource, "rb");
#0 50.37       |         ^~~~
#0 50.37 libavfilter/vf_fadeglshader.c:783:9: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
#0 50.37   783 |         unsigned long fsize = ftell(f);
#0 50.37       |         ^~~~~~~~
#0 50.37 libavfilter/vf_fadeglshader.c:801:9: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
#0 50.37   801 |         FILE *f = fopen(gs->vxsource, "rb");
#0 50.37       |         ^~~~
#0 50.37 libavfilter/vf_fadeglshader.c:810:9: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
#0 50.37   810 |         unsigned long fsize = ftell(f);
#0 50.37       |         ^~~~~~~~
#0 50.37 libavfilter/vf_fadeglshader.c:824:5: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
#0 50.37   824 |     const char *gl_sdsource_dst = gs->sdsource_data ? gs->sdsource_data : f_shader_source;      
#0 50.37       |     ^~~~~
#0 50.38 libavfilter/vf_fadeglshader.c: In function 'config_props':
#0 50.38 libavfilter/vf_fadeglshader.c:895:84: warning: format '%d' expects argument of type 'int', but argument 4 has type 'int64_t' {aka 'long int'} [-Wformat=]
#0 50.38   895 |     av_log(ctx, AV_LOG_DEBUG, "doing vf_fadeglshader config_props total frames in:%d out:%d\n", 
#0 50.38       |                                                                                   ~^
#0 50.38       |                                                                                    |
#0 50.38       |                                                                                    int
#0 50.38       |                                                                                   %ld
#0 50.38   896 |            inlink->frame_count_in, inlink->frame_count_out);
#0 50.38       |            ~~~~~~~~~~~~~~~~~~~~~~
#0 50.38       |                  |
#0 50.38       |                  int64_t {aka long int}
#0 50.38 libavfilter/vf_fadeglshader.c:895:91: warning: format '%d' expects argument of type 'int', but argument 5 has type 'int64_t' {aka 'long int'} [-Wformat=]
#0 50.38   895 |     av_log(ctx, AV_LOG_DEBUG, "doing vf_fadeglshader config_props total frames in:%d out:%d\n", 
#0 50.38       |                                                                                          ~^     
#0 50.38       |                                                                                           |     
#0 50.38       |                                                                                           int   
#0 50.38       |                                                                                          %ld    
#0 50.38   896 |            inlink->frame_count_in, inlink->frame_count_out);
#0 50.38       |                                    ~~~~~~~~~~~~~~~~~~~~~~~
#0 50.38       |                                          |
#0 50.38       |                                          int64_t {aka long int}
#0 50.38 libavfilter/vf_fadeglshader.c:956:5: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
#0 50.38   956 |     int ret;
#0 50.38       |     ^~~
#0 50.38 libavfilter/vf_fadeglshader.c: In function 'config_props_external':
#0 50.38 libavfilter/vf_fadeglshader.c:976:26: warning: unused variable 'gs' [-Wunused-variable]
#0 50.38   976 |     FadeGLShaderContext *gs      = ctx->priv;
#0 50.38       |                          ^~
#0 50.38 libavfilter/vf_fadeglshader.c: In function 'config_output':
#0 50.38 libavfilter/vf_fadeglshader.c:987:9: warning: unused variable 'ret' [-Wunused-variable]
#0 50.38   987 |     int ret;
#0 50.38       |         ^~~
#0 50.38 libavfilter/vf_fadeglshader.c:986:26: warning: unused variable 's' [-Wunused-variable]
#0 50.38   986 |     FadeGLShaderContext *s  = ctx->priv;
#0 50.38       |                          ^
#0 50.38 libavfilter/vf_fadeglshader.c: In function 'render_first':
#0 50.38 libavfilter/vf_fadeglshader.c:1007:19: warning: unused variable 'outlink' [-Wunused-variable]
#0 50.38  1007 |     AVFilterLink *outlink   = ctx->outputs[0];
#0 50.38       |                   ^~~~~~~
#0 50.42 libavfilter/vf_fadeglshader.c: In function 'filter_frame':
#0 50.42 libavfilter/vf_fadeglshader.c:1054:20: error: implicit declaration of function 'ff_get_video_buffer' [-Werror=implicit-function-declaration]
#0 50.42  1054 |     AVFrame *out = ff_get_video_buffer(outlink, outlink->w, outlink->h);
#0 50.42       |                    ^~~~~~~~~~~~~~~~~~~
#0 50.42 libavfilter/vf_fadeglshader.c:1054:20: warning: initialization of 'AVFrame *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
#0 50.42 libavfilter/vf_fadeglshader.c:1054:5: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
#0 50.42  1054 |     AVFrame *out = ff_get_video_buffer(outlink, outlink->w, outlink->h);
#0 50.42       |     ^~~~~~~
#0 50.42 libavfilter/vf_fadeglshader.c:1060:5: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
#0 50.42  1060 |     int copy_props_ret = av_frame_copy_props(out, in);
#0 50.42       |     ^~~
#0 50.42 libavfilter/vf_fadeglshader.c:1074:5: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
#0 50.42  1074 |     double timeProgress = MAX_DEF(MIN_DEF((gs->playTime_ft - gs->r_offset_time_ft) / gs->fade_duration_ft, 1.0), 0.0);
#0 50.42       |     ^~~~~~
#0 50.42 libavfilter/vf_fadeglshader.c: In function 'uninit':
#0 50.42 libavfilter/vf_fadeglshader.c:1129:5: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
#0 50.42  1129 |     FadeGLShaderContext *c = ctx->priv;
#0 50.42       |     ^~~~~~~~~~~~~~~~~~~
#0 50.46 CC     libavfilter/vf_feedback.o
#0 50.46 libavfilter/vf_fadeglshader.c: In function 'query_formats':
#0 50.46 libavfilter/vf_fadeglshader.c:1177:12: error: implicit declaration of function 'ff_set_common_formats' [-Werror=implicit-function-declaration]
#0 50.46  1177 |     return ff_set_common_formats(ctx, ff_make_format_list(formats));
#0 50.46       |            ^~~~~~~~~~~~~~~~~~~~~
#0 50.49 libavfilter/vf_fadeglshader.c:1177:39: error: implicit declaration of function 'ff_make_format_list' [-Werror=implicit-function-declaration]
#0 50.49  1177 |     return ff_set_common_formats(ctx, ff_make_format_list(formats));
#0 50.49       |                                       ^~~~~~~~~~~~~~~~~~~
#0 50.49 libavfilter/vf_fadeglshader.c: At top level:
#0 50.49 libavfilter/vf_fadeglshader.c:1218:10: error: 'AVFilter' has no member named 'query_formats'
#0 50.49  1218 |         .query_formats = query_formats,
#0 50.49       |          ^~~~~~~~~~~~~
#0 50.49 libavfilter/vf_fadeglshader.c:1212:31: warning: missing braces around initializer [-Wmissing-braces]    
#0 50.49  1212 | AVFilter ff_vf_fadeglshader = {
#0 50.49       |                               ^
#0 50.49 ......
#0 50.49  1218 |         .query_formats = query_formats,
#0 50.49       |                          {            }
#0 50.50 libavfilter/vf_fadeglshader.c:983:12: warning: 'config_output' defined but not used [-Wunused-function] 
#0 50.50   983 | static int config_output(AVFilterLink *outlink)
#0 50.50       |            ^~~~~~~~~~~~~
#0 50.50 libavfilter/vf_fadeglshader.c:974:12: warning: 'config_props_external' defined but not used [-Wunused-function]
#0 50.50   974 | static int config_props_external(AVFilterLink *inlink) {
#0 50.50       |            ^~~~~~~~~~~~~~~~~~~~~
#0 50.50 cc1: some warnings being treated as errors
#0 50.50 make: *** [ffbuild/common.mak:81: libavfilter/vf_fadeglshader.o] Error 1
#0 50.50 make: *** Waiting for unfinished jobs....
`

suggest add `duration` param?

i found it support playTime param in GLSL files. i don't known how to add duration param on ffmpeg filters param;
one way, use enable ffmpeg filters?

About headless(ssh remote login) run environment

There is another solution:
1 EXPORT DISPLAY=.0:0
2 init ogl render to off-screen buffer (MAYBE optional)
3 call ffmpeg transcode command as usually.

test passed on ubuntu18.04 x64

int no_window_init()
{
    glXCreateContextAttribsARBProc glXCreateContextAttribs = NULL;
    glXCreateContextAttribs = 
        (glXCreateContextAttribsARBProc)glXGetProcAddressARB(
            (const GLubyte *)"glXCreateContextAttribsARB");

    const char *displayName = NULL;
    Display *display;
    display = XOpenDisplay(displayName);

    static int visualAttribs[] = {
        GLX_SAMPLE_BUFFERS, 1, GLX_SAMPLES, 4
    };
    int numberOfFramebufferConfigurations = 0;
    GLXFBConfig *fbConfigs;
    fbConfigs = glXChooseFBConfig(
        display, DefaultScreen(display), visualAttribs, &numberOfFramebufferConfigurations);

    int context_attribs[] = {
        GLX_CONTEXT_MAJOR_VERSION_ARB, 3,
        GLX_CONTEXT_MINOR_VERSION_ARB, 0,
        GLX_CONTEXT_FLAGS_ARB, GLX_CONTEXT_DEBUG_BIT_ARB,
        GLX_CONTEXT_PROFILE_MASK_ARB, GLX_CONTEXT_CORE_PROFILE_BIT_ARB,
        None};
    GLXContext glContext[NUM];
    glContext[0] = glXCreateContextAttribs(display, fbConfigs[0], 0, 1, context_attribs);

    GLXPbuffer pbuffer;
    int pbufferAttribs[] = {
        GLX_PBUFFER_WIDTH, 32,
        GLX_PBUFFER_HEIGHT, 32,
        None
    };
    pbuffer = glXCreatePbuffer(display, fbConfigs[0], pbufferAttribs);
    XFree(fbConfigs);
    XSync(display, False);
    glXMakeContextCurrent(display, pbuffer, pbuffer, glContext[0]);

    return 0;
}

static av_cold int init(AVFilterContext *ctx)
{
    GlMirrorContext *gs = ctx->priv;
    if (gs->no_window) {
        av_log(NULL, AV_LOG_ERROR, "open gl no window init ON\n");
        no_window_init();
    }
    
    return glfwInit() ? 0 : -1;
}


patch error

哥们,我在执行git apply的时候报了错误:
error: patch failed: libavfilter/allfilters.c:444
error: libavfilter/allfilters.c: patch does not apply
你看能告诉我下解决办法吗 macos系统

Still questions on windows

I reopened the issue in your project from this. I still have some problems:

  • on Ubuntu I was able to compile the code and run some of your shaders. Then I tried with these and I got error. I've pasted and copied the ACNet.glsl code in the shader compiler on your website, I've built it and got error array constructor supported in GLSL ES 3.00 and above only , so I suppose your code works for OpenGl < 3? Are you going to implement this?

  • always on ubuntu I was trying to compile the code for windows, but following your instructions, with --enable-cross-compile I don't get .exe. So I followed this, testing it first with normal ffmpeg and it worked. Then I tried with your code and i got

BEGIN /tmp/ffconf.cgAgGwtf/test.c

    1	int main(void){ return 0; }

END /tmp/ffconf.cgAgGwtf/test.c
i686-w64-mingw32-gcc -c -o /tmp/ffconf.cgAgGwtf/test.o /tmp/ffconf.cgAgGwtf/test.c
i686-w64-mingw32-gcc -lm -lz -llzma -lpthread -o /tmp/ffconf.cgAgGwtf/test.exe /tmp/ffconf.cgAgGwtf/test.o -lGLEW -lglfw -lm -lpthread
/usr/bin/i686-w64-mingw32-ld: cannot find -lz
/usr/bin/i686-w64-mingw32-ld: cannot find -llzma
/usr/bin/i686-w64-mingw32-ld: cannot find -lGLEW
/usr/bin/i686-w64-mingw32-ld: cannot find -lglfw

Thank you for everything.

Error initializing filter 'plusglshader'

os : Ubuntu 18.04.5

【ffmpeg -help filter=plusglshader】
ffmpeg version N-101720-gdf6dc331dd Copyright (c) 2000-2021 the FFmpeg developers
built with gcc 7 (Ubuntu 7.5.0-3ubuntu1~18.04)
configuration: --enable-cross-compile --pkg-config-flags=--static --extra-libs=-lpthread --extra-libs=-lm --enable-gpl --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libvpx --enable-libx264 --enable-libx265 --enable-libass --enable-libfreetype --enable-libfontconfig --enable-libfribidi --enable-nonfree --disable-shared --enable-static --enable-opengl --extra-libs='-lGLEW -lglfw' --enable-filter=plusglshader
libavutil 56. 72.100 / 56. 72.100
libavcodec 58.135.100 / 58.135.100
libavformat 58. 77.100 / 58. 77.100
libavdevice 58. 14.100 / 58. 14.100
libavfilter 7.111.100 / 7.111.100
libswscale 5. 10.100 / 5. 10.100
libswresample 3. 10.100 / 3. 10.100
libpostproc 55. 10.100 / 55. 10.100
Filter plusglshader
Render Frame by GL shader filters' filter
Inputs:
#0: default (video)
Outputs:
#0: default (video)
plusglshader AVOptions:
sdsource ..FV....... gl fragment shader source path (default is render gray color)
vxsource ..FV....... gl vertex shader source path (default is render gray color)

This filter has support for timeline through the 'enable' option.

Use【plusglshader=sdsource='./test_shader.gl':vxsource='./test_vertex.gl'】

【OUT】
[Parsed_plusglshader_0 @ 0x565553809dc0] doing vf_plusglshader build_program shader: invalid shader source file "./test_shader.gl"
[Parsed_plusglshader_0 @ 0x565553809dc0] Failed to configure input pad on Parsed_plusglshader_0
[Parsed_plusglshader_0 @ 0x565553809dc0] start vf_plusglshader uninit action
[Parsed_plusglshader_0 @ 0x565553809dc0] doing vf_plusglshader check window
[Parsed_plusglshader_0 @ 0x565553809dc0] doing vf_plusglshader gl delete operations
[Parsed_plusglshader_0 @ 0x565553809dc0] finished vf_plusglshader
Error reinitializing filters!
Failed to inject frame into filter network: Operation not permitted
Error while processing the decoded data for stream #0:1

why?

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.