Coder Social home page Coder Social logo

ffmpeg-gl-transition's Introduction

ffmpeg-gl-transition

FFmpeg filter for applying GLSL transitions between video streams (gl-transitions).

(example crosswarp transition)

Note

If you want an easier solution, I recommend checking out ffmpeg-concat, an npm module and CLI that allows you to concat a list of videos together using a standard build of ffmpeg along with the same sexy OpenGL transitions.

Intro

FFmpeg is the defacto standard in command-line video editing, but it is really difficult to concatenate videos together using non-trivial transitions. Here are some convoluted examples of a simple cross-fade between two videos. FFmpeg filter graphs are extremely powerful, but for implementing transitions, they are just too complicated and error-prone.

GL Transitions, on the other hand, is a great open source initiative spearheaded by Gaëtan Renaudeau that is aimed at using GLSL to establish a universal collection of transitions. Its extremely simple spec makes it really easy to customize existing transitions or write your own as opposed to struggling with complex ffmpeg filter graphs.

This library is an ffmpeg extension that makes it easy to use gl-transitions in ffmpeg filter graphs.

Building

Since this library exports a native ffmpeg filter, you are required to build ffmpeg from source. Don't worry, though -- it's surprisingly straightforward.

Dependencies

First, you need to install a few dependencies. Mac OS is very straightforward. On Linux and Windows, there are two options, either using EGL or not using EGL. The main advantage of using EGL is that it is easier to run in headless environments.

Mac OS

GLEW + glfw3

brew install glew glfw

Mac OS users should follow instructions for not using EGL.

Linux with EGL

We default to EGL rather than GLX on Linux to make it easier to run headless, so xvfb is no longer needed.

glvnd1.0 building from source

mesaGL>=1.7 mesaGLU>=1.7

yum install mesa-libGLU mesa-libGLU-devel

GLEW >=2.0 building from source

Linux without EGL

If you don't want to use EGL, just comment out this line in vf_gltransition.c

#ifndef __APPLE__
# define GL_TRANSITION_USING_EGL // remove this line if you don't want to use EGL
#endif

GLEW

yum install glew glew-devel

glfw building from source

On headless environments without EGL, you'll also need to install xvfb.

pkg install xorg-vfbserver (FreeBSD)
apt install xvfb (Ubuntu)

Xvfb :1 -screen 0 1280x1024x16
export DISPLAY=:99

Building ffmpeg

git clone http://source.ffmpeg.org/git/ffmpeg.git ffmpeg
cd ffmpeg

cp ~/ffmpeg-gl-transition/vf_gltransition.c libavfilter/
git apply ~/ffmpeg-gl-transition/ffmpeg.diff

Non-EGL:

./configure --enable-libx264 --enable-gpl --enable-opengl \
            --enable-filter=gltransition --extra-libs='-lGLEW -lglfw'
make

EGL:

./configure ... --extra-libs='-lGLEW -lEGL'
make

Notes:

  • See the official ffmpeg compilation guide for help building ffmpeg on your platform. I've thoroughly tested this filter on macOS Sierra (macOS compilation guide).
  • Depending on your platform, there may be slight variations in how GLEW and glfw are named (with regard to --extra-libs, above), e.g. -lglew or -lglfw3 - check pkg-config.
  • The above example builds a minimal ffmpeg binary with libx264, but there's nothing codec-specific about the filter itself, so feel free to add or remove any of ffmpeg's bells and whistles.

Here's an example of a more full-featured build configuration:

./configure --prefix=/usr/local --enable-gpl --enable-nonfree --enable-libass \
  --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libtheora \
  --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 \
  --enable-libopus --enable-libxvid \
  --enable-opengl --enable-filter=gltransition --extra-libs='-lGLEW -lglfw'

You can verify that the gltransition filter is available via:

./ffmpeg -v 0 -filters | grep gltransition

Usage

Default Options:

./ffmpeg -i media/0.mp4 -i media/1.mp4 -filter_complex gltransition -y out.mp4

Custom Options:

./ffmpeg -i media/0.mp4 -i media/1.mp4 -filter_complex "gltransition=duration=4:offset=1.5:source=crosswarp.glsl" -y out.mp4

Params:

  • duration (optional float; default=1) length in seconds for the transition to last. Any frames outputted after this point will pass through the second video stream untouched.
  • offset (optional float; default=0) length in seconds to wait before beginning the transition. Any frames outputted before this point will pass through the first video stream untouched.
  • source (optional string; defaults to a basic crossfade transition) path to the gl-transition source file. This text file must be a valid gl-transition filter, exposing a transition function. See here for a list of glsl source transitions or the gallery for a visual list of examples.

Note that both duration and offset are relative to the start of this filter invocation, not global time values.

Examples

See concat.sh for a more complex example of concatenating three mp4s together with unique transitions between them.

For any non-trivial concatenation, you'll likely want to make a filter chain comprised of split, trim + setpts, and concat (with the v for video option) filters in addition to the gltransition filter itself. If you want to concat audio streams in the same pass, you'll need to additionally make use of the asplit, atrim + asetpts, and concat (with the a for audio option) filters.

There is no limit to the number of video streams you can concat together in one filter graph, but beyond a couple of streams, you'll likely want to write a wrapper script as the required stream preprocessing gets unwieldly very fast. See here for a more understandable example of concatenating two, 5-second videos together with a 1s fade inbetween. See here for a more complex example including audio stream concatenation.

Todo

  • simplify filter graph required to achieve multi-file concat in concat.sh
  • support default values for gl-transition uniforms
    • this is the reason a lot of gl-transitions currently appear to not function properly
  • remove restriction that both inputs be the same size
  • support general gl-transition uniforms
  • add gl-transition logic for aspect ratios and resize mode
  • transpile webgl glsl to opengl glsl via angle

Related

  • ffmpeg-concat - Concats a list of videos together using ffmpeg with sexy OpenGL transitions. This module and CLI are easier to use than the lower-level custom filter provided by this library.
  • Excellent example ffmpeg filter for applying a GLSL shader to each frame of a video stream. Related blog post and follow-up post.
  • gl-transitions and original github issue.
  • Similar project that attempts to use frei0r and MLT instead of extending ffmpeg directly.
  • FFmpeg filter guide.
  • awesome-ffmpeg - A curated list of awesome ffmpeg resources with a focus on JavaScript.

License

MIT © Travis Fischer

Support my open source work by following me on twitter twitter

ffmpeg-gl-transition's People

Contributors

4n70w4 avatar jviney avatar minhazur-piash avatar taylorlu avatar transitive-bullshit avatar turengege avatar wojtow 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

ffmpeg-gl-transition's Issues

iOS compatibility

Hi, I'm using react-native-ffmpeg. Do you think there's any way of building ffmpeg for iOS with gl-transition filter? If so, can you point me in the direction of how to do it?

linux,centos 7.3 ,fatal error: EGL/egl.h: No such file or directory

----------------- -lGLEW -lEGL ----------------------------
1.
yum install mesa-libGLU mesa-libGLU-devel
2.
building from source GLEW >=2.0
3.
yum install glew glew-devel

git clone http://source.ffmpeg.org/git/ffmpeg.git ffmpeg
cd ffmpeg
ln -s ~/ffmpeg-gl-transition/vf_gltransition.c libavfilter/
git apply ~/ffmpeg-gl-transition/ffmpeg.diff

// ./configure .....
fatal error: EGL/egl.h: No such file or directory
! can‘t continue

----------------- -lGLEW -lglfw ----------------------------
1.
define GL_TRANSITION_USING_EGL // remove this line
2.
yum -y install glew glew-devel glfw glfw-devel

configure && make && make install success!

Xvfb :99 -screen 0 1280x1024x16
export DISPLAY=:99

ffmpeg -i test1.mp4 -i test2.mp4 -filter_complex gltransition out.mp4

got this Error :
segmentation fault :


only work on macos high sierra , i wanna install gltansition on remote linux server
help ! pls

Porting to emscripten

Hello Guys

Need a quick help here.

I have build this to be used in js environment.

emcc build/ffmpeg/ffmpeg.bc build/lame/dist/lib/libmp3lame.so build/x264/dist/lib/libx264.so \
	--post-js build/post-sync.js \
	--closure 1 -s USE_GLFW=3 -s TOTAL_MEMORY=67108864 -s OUTLINING_LIMIT=20000 -O3 --memory-init-file 0 --pre-js build/pre.js -o ffmpeg-mp4.js

But on runtime I am getting error as
glReadPixels: format and type incompatible with the current read framebuffer

How can I debug it?

Black output video

I use linux/Ubuntu system with EGL.
I ran the given example./ffmpeg -i media/0.mp4 -i media/1.mp4 -filter_complex gltransition -y out.mp4.
Though voice could be saved, output.mp4 shown nothing but black screen.
Would you mind help me to solve this problem?3q

Error initializing filter 'gltransition'

I've managed to build ffmpeg with gltransition and I get the right ffmpeg header

ffmpeg version N-89657-g51027d0 Copyright (c) 2000-2017 the FFmpeg developers
  built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.4) 20160609
  configuration: --prefix=/home/ubuntu/ffmpeg_build --pkg-config-flags=--static --extra-cflags=-I/home/ubuntu/ffmpeg_build/include --extra-ldflags=-L/home/ubuntu/ffmpeg_build/lib --extra-libs='-lpthread -lm' --bindir=/home/ubuntu/bin --enable-gpl --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-gnutls --enable-libfribidi --enable-libspeex --enable-opengl --enable-filter=gltransition --extra-libs='-lGLEW -lglfw' --enable-nonfree
  libavutil      56.  7.100 / 56.  7.100
  libavcodec     58.  9.100 / 58.  9.100
  libavformat    58.  3.100 / 58.  3.100
  libavdevice    58.  0.100 / 58.  0.100
  libavfilter     7.  8.100 /  7.  8.100
  libswscale      5.  0.101 /  5.  0.101
  libswresample   3.  0.101 /  3.  0.101
  libpostproc    55.  0.100 / 55.  0.100
Hyper fast Audio and Video encoder

The problem is that when I run your examples I get

Error initializing filter 'gltransition' Error initializing complex filters. Operation not permitted

Any ideas what's wrong?

Ffmpeg fails with "Segmentation fault (core dumped)"

I followed your instruction and build the ffmpeg in my Ubuntu 16.04 server. I used "Linux with EGL" option. Everything went well and the build was successful.

Then I ran this command with the sample file you gave,

ffmpeg -loglevel debug -i media/0.mp4 -i media/1.mp4 -filter_complex gltransition -y out.mp4

It failed with "Segmentation fault (core dumped)" error and here is the debug log,

ffmpeg version N-91545-gd36b839 Copyright (c) 2000-2018 the FFmpeg developers
  built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.10) 20160609
  configuration: --prefix=/home/calicomadmin/ffmpeg_build --pkg-config-flags=--static --extra-cflags=-I/home/calicomadmin/ffmpeg_build/include --extra-ldflags=-L/home/calicomadmin/ffmpeg_build/lib --extra-libs='-lpthread -lm -lGLEW -lEGL' --bindir=/home/calicomadmin/bin --enable-cuda --enable-cuvid --enable-libnpp --extra-cflags=-I/usr/local/cuda/include/ --extra-ldflags=-L/usr/local/cuda/lib64/ --nvccflags='-gencode arch=compute_52,code=sm_52 -O2' --enable-gpl --enable-opengl --enable-libaom --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-filter=gltransition --enable-nonfree
  libavutil      56. 18.102 / 56. 18.102
  libavcodec     58. 22.100 / 58. 22.100
  libavformat    58. 17.101 / 58. 17.101
  libavdevice    58.  4.101 / 58.  4.101
  libavfilter     7. 26.100 /  7. 26.100
  libswscale      5.  2.100 /  5.  2.100
  libswresample   3.  2.100 /  3.  2.100
  libpostproc    55.  2.100 / 55.  2.100
Splitting the commandline.
Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument 'debug'.
Reading option '-i' ... matched as input url with argument 'media/0.mp4'.
Reading option '-i' ... matched as input url with argument 'media/1.mp4'.
Reading option '-filter_complex' ... matched as option 'filter_complex' (create a complex filtergraph) with argument 'gltransition'.
Reading option '-y' ... matched as option 'y' (overwrite output files) with argument '1'.
Reading option 'out.mp4' ... matched as output url.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option loglevel (set logging level) with argument debug.
Applying option filter_complex (create a complex filtergraph) with argument gltransition.
Applying option y (overwrite output files) with argument 1.
Successfully parsed a group of options.
Parsing a group of options: input url media/0.mp4.
Successfully parsed a group of options.
Opening an input file: media/0.mp4.
[NULL @ 0x3cb17c0] Opening 'media/0.mp4' for reading
[file @ 0x3cb20c0] Setting default whitelist 'file,crypto'
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x3cb17c0] Format mov,mp4,m4a,3gp,3g2,mj2 probed with size=2048 and score=100
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x3cb17c0] ISO: File Type Major Brand: isom
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x3cb17c0] Unknown dref type 0x206c7275 size 12
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x3cb17c0] Processing st: 0, edit list 0 - media time: 0, duration: 51200
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x3cb17c0] Before avformat_find_stream_info() pos: 1234 bytes read:32768 seeks:0 nb_streams:1[h264 @ 0x3cb3280] nal_unit_type: 7(SPS), nal_ref_idc: 3
[h264 @ 0x3cb3280] nal_unit_type: 8(PPS), nal_ref_idc: 3
[h264 @ 0x3cb3280] nal_unit_type: 6(SEI), nal_ref_idc: 0
[h264 @ 0x3cb3280] nal_unit_type: 5(IDR), nal_ref_idc: 3
[h264 @ 0x3cb3280] Format yuv420p chosen by get_format().
[h264 @ 0x3cb3280] Reinit context to 640x368, pix_fmt: yuv420p
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x3cb17c0] All info found
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x3cb17c0] After avformat_find_stream_info() pos: 7467 bytes read:32768 seeks:0 frames:1
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'media/0.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf57.83.100
  Duration: 00:00:04.00, start: 0.000000, bitrate: 454 kb/s
    Stream #0:0(und), 1, 1/12800: Video: h264 (Constrained Baseline), 1 reference frame (avc1 / 0x31637661), yuv420p(left), 640x360 (640x368) [SAR 1:1 DAR 16:9], 0/1, 452 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
    Metadata:
      handler_name    : VideoHandler
Successfully opened the file.
Parsing a group of options: input url media/1.mp4.
Successfully parsed a group of options.
Opening an input file: media/1.mp4.
[NULL @ 0x3cdb500] Opening 'media/1.mp4' for reading
[file @ 0x3cb9bc0] Setting default whitelist 'file,crypto'
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x3cdb500] Format mov,mp4,m4a,3gp,3g2,mj2 probed with size=2048 and score=100
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x3cdb500] ISO: File Type Major Brand: isom
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x3cdb500] Unknown dref type 0x206c7275 size 12
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x3cdb500] Processing st: 0, edit list 0 - media time: 0, duration: 51200
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x3cdb500] Before avformat_find_stream_info() pos: 1217 bytes read:32768 seeks:0 nb_streams:1[h264 @ 0x3cdc800] nal_unit_type: 7(SPS), nal_ref_idc: 3
[h264 @ 0x3cdc800] nal_unit_type: 8(PPS), nal_ref_idc: 3
[h264 @ 0x3cdc800] nal_unit_type: 6(SEI), nal_ref_idc: 0
[h264 @ 0x3cdc800] nal_unit_type: 5(IDR), nal_ref_idc: 3
[h264 @ 0x3cdc800] Format yuv420p chosen by get_format().
[h264 @ 0x3cdc800] Reinit context to 640x368, pix_fmt: yuv420p
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x3cdb500] All info found
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x3cdb500] After avformat_find_stream_info() pos: 16010 bytes read:32768 seeks:0 frames:1
Input #1, mov,mp4,m4a,3gp,3g2,mj2, from 'media/1.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf57.83.100
  Duration: 00:00:04.00, start: 0.000000, bitrate: 530 kb/s
    Stream #1:0(eng), 1, 1/12800: Video: h264 (Constrained Baseline), 1 reference frame (avc1 / 0x31637661), yuv420p(left), 640x360 (640x368), 0/1, 528 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
    Metadata:
      handler_name    : VideoHandler
Successfully opened the file.
Parsing a group of options: output url out.mp4.
Successfully parsed a group of options.
Opening an output file: out.mp4.
[file @ 0x3cd2b40] Setting default whitelist 'file,crypto'
Successfully opened the file.
detected 6 logical cores
[h264 @ 0x3cd11c0] nal_unit_type: 7(SPS), nal_ref_idc: 3
[h264 @ 0x3cd11c0] nal_unit_type: 8(PPS), nal_ref_idc: 3
[h264 @ 0x3e16f80] nal_unit_type: 7(SPS), nal_ref_idc: 3
[h264 @ 0x3e16f80] nal_unit_type: 8(PPS), nal_ref_idc: 3
Stream mapping:
  Stream #0:0 (h264) -> gltransition:from
  Stream #1:0 (h264) -> gltransition:to
  gltransition -> Stream #0:0 (libx264)
Press [q] to stop, [?] for help
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
    Last message repeated 1 times
[h264 @ 0x3cd11c0] nal_unit_type: 6(SEI), nal_ref_idc: 0
[h264 @ 0x3cd11c0] nal_unit_type: 5(IDR), nal_ref_idc: 3
[h264 @ 0x3cd11c0] Format yuv420p chosen by get_format().
[h264 @ 0x3cd11c0] Reinit context to 640x368, pix_fmt: yuv420p
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
[h264 @ 0x3cd8a00] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
[h264 @ 0x3d19680] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
[h264 @ 0x3da3e80] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
[h264 @ 0x3dc02c0] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
[h264 @ 0x3ddca00] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
    Last message repeated 1 times
[h264 @ 0x3df9200] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2
[h264 @ 0x3e16f80] nal_unit_type: 6(SEI), nal_ref_idc: 0
[h264 @ 0x3e16f80] nal_unit_type: 5(IDR), nal_ref_idc: 3
[h264 @ 0x3e16f80] Format yuv420p chosen by get_format().
[h264 @ 0x3e16f80] Reinit context to 640x368, pix_fmt: yuv420p
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
[h264 @ 0x3e29100] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
[h264 @ 0x3e6f240] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
[h264 @ 0x3e8b8c0] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
[h264 @ 0x3ea8040] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
[h264 @ 0x3ec4780] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2
[h264 @ 0x3ee0f00] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2
[graph 0 input from stream 0:0 @ 0x4030c40] Setting 'video_size' to value '640x360'
[graph 0 input from stream 0:0 @ 0x4030c40] Setting 'pix_fmt' to value '0'
[graph 0 input from stream 0:0 @ 0x4030c40] Setting 'time_base' to value '1/12800'
[graph 0 input from stream 0:0 @ 0x4030c40] Setting 'pixel_aspect' to value '1/1'
[graph 0 input from stream 0:0 @ 0x4030c40] Setting 'sws_param' to value 'flags=2'
[graph 0 input from stream 0:0 @ 0x4030c40] Setting 'frame_rate' to value '25/1'
[graph 0 input from stream 0:0 @ 0x4030c40] w:640 h:360 pixfmt:yuv420p tb:1/12800 fr:25/1 sar:1/1 sws_param:flags=2
[graph 0 input from stream 1:0 @ 0x402ef40] Setting 'video_size' to value '640x360'
[graph 0 input from stream 1:0 @ 0x402ef40] Setting 'pix_fmt' to value '0'
[graph 0 input from stream 1:0 @ 0x402ef40] Setting 'time_base' to value '1/12800'
[graph 0 input from stream 1:0 @ 0x402ef40] Setting 'pixel_aspect' to value '0/1'
[graph 0 input from stream 1:0 @ 0x402ef40] Setting 'sws_param' to value 'flags=2'
[graph 0 input from stream 1:0 @ 0x402ef40] Setting 'frame_rate' to value '25/1'
[graph 0 input from stream 1:0 @ 0x402ef40] w:640 h:360 pixfmt:yuv420p tb:1/12800 fr:25/1 sar:0/1 sws_param:flags=2
[format @ 0x402f4c0] Setting 'pix_fmts' to value 'yuv420p|yuvj420p|yuv422p|yuvj422p|yuv444p|yuvj444p|nv12|nv16|nv21'
[auto_scaler_0 @ 0x40318c0] w:iw h:ih flags:'bilinear' interl:0
[Parsed_gltransition_0 @ 0x4030380] auto-inserting filter 'auto_scaler_0' between the filter 'graph 0 input from stream 0:0' and the filter 'Parsed_gltransition_0'
[auto_scaler_1 @ 0x4031dc0] w:iw h:ih flags:'bilinear' interl:0
[Parsed_gltransition_0 @ 0x4030380] auto-inserting filter 'auto_scaler_1' between the filter 'graph 0 input from stream 1:0' and the filter 'Parsed_gltransition_0'
[auto_scaler_2 @ 0x40316c0] w:iw h:ih flags:'bilinear' interl:0
[format @ 0x402f4c0] auto-inserting filter 'auto_scaler_2' between the filter 'Parsed_gltransition_0' and the filter 'format'
[AVFilterGraph @ 0x402f3c0] query_formats: 5 queried, 1 merged, 3 already done, 0 delayed
[auto_scaler_2 @ 0x40316c0] picking yuv444p out of 8 ref:rgb24 alpha:0
[auto_scaler_0 @ 0x40318c0] w:640 h:360 fmt:yuv420p sar:1/1 -> w:640 h:360 fmt:rgb24 sar:1/1 flags:0x2
[Parsed_gltransition_0 @ 0x4030380] 673005440Segmentation fault (core dumped)

How to build ffmpeg-gl-transition on Windown 10

Am build without gl-transition filtter done work well.

am ready comment line:

define GL_TRANSITION_USING_EGL // remove this line if you don't want to use EGL

How to install glfw, GLEW and EGL
When add gl-transition and build again have error:

C:\ffnew\ffmpeg_github_1\libavcodec/avcodec.h(4178): note: see declaration of 'avcodec_copy_context'
LD ffmpeg_g.exe
libavfilter.a(vf_gltransition.o) : error LNK2019: unresolved external symbol __imp__glBindTexture@8 referenced in function _apply_transition
libavfilter.a(vf_gltransition.o) : error LNK2019: unresolved external symbol __imp__glDeleteTextures@8 referenced in function _uninit
libavfilter.a(vf_gltransition.o) : error LNK2019: unresolved external symbol __imp__glDrawArrays@12 referenced in function _apply_transition
libavfilter.a(vf_gltransition.o) : error LNK2019: unresolved external symbol __imp__glGenTextures@8 referenced in function _setup_tex
libavfilter.a(vf_gltransition.o) : error LNK2019: unresolved external symbol __imp__glReadPixels@28 referenced in function _apply_transition
libavfilter.a(vf_gltransition.o) : error LNK2019: unresolved external symbol __imp__glTexImage2D@36 referenced in function _apply_transition
libavfilter.a(vf_gltransition.o) : error LNK2019: unresolved external symbol __imp__glTexParameteri@12 referenced in function _setup_tex
libavfilter.a(vf_gltransition.o) : error LNK2019: unresolved external symbol __imp__glViewport@16 referenced in function _setup_gl
libavfilter.a(vf_gltransition.o) : error LNK2019: unresolved external symbol __imp__glewInit@0 referenced in function _setup_gl
libavfilter.a(vf_gltransition.o) : error LNK2019: unresolved external symbol _glfwInit referenced in function _init
libavfilter.a(vf_gltransition.o) : error LNK2019: unresolved external symbol _glfwWindowHint referenced in function _setup_gl
libavfilter.a(vf_gltransition.o) : error LNK2019: unresolved external symbol _glfwCreateWindow referenced in function _setup_gl
libavfilter.a(vf_gltransition.o) : error LNK2019: unresolved external symbol _glfwDestroyWindow referenced in function _uninit
libavfilter.a(vf_gltransition.o) : error LNK2019: unresolved external symbol _glfwMakeContextCurrent referenced in function _setup_gl
libavfilter.a(vf_gltransition.o) : error LNK2001: unresolved external symbol __imp____glewActiveTexture
libavfilter.a(vf_gltransition.o) : error LNK2001: unresolved external symbol __imp____glewBindBuffer
libavfilter.a(vf_gltransition.o) : error LNK2001: unresolved external symbol __imp____glewBufferData
libavfilter.a(vf_gltransition.o) : error LNK2001: unresolved external symbol __imp____glewDeleteBuffers
libavfilter.a(vf_gltransition.o) : error LNK2001: unresolved external symbol __imp____glewGenBuffers
libavfilter.a(vf_gltransition.o) : error LNK2001: unresolved external symbol __imp____glewAttachShader
libavfilter.a(vf_gltransition.o) : error LNK2001: unresolved external symbol __imp____glewCompileShader
libavfilter.a(vf_gltransition.o) : error LNK2001: unresolved external symbol __imp____glewCreateProgram
libavfilter.a(vf_gltransition.o) : error LNK2001: unresolved external symbol __imp____glewCreateShader
libavfilter.a(vf_gltransition.o) : error LNK2001: unresolved external symbol __imp____glewDeleteProgram
libavfilter.a(vf_gltransition.o) : error LNK2001: unresolved external symbol __imp____glewEnableVertexAttribArray
libavfilter.a(vf_gltransition.o) : error LNK2001: unresolved external symbol __imp____glewGetAttribLocation
libavfilter.a(vf_gltransition.o) : error LNK2001: unresolved external symbol __imp____glewGetProgramiv
libavfilter.a(vf_gltransition.o) : error LNK2001: unresolved external symbol __imp____glewGetShaderiv
libavfilter.a(vf_gltransition.o) : error LNK2001: unresolved external symbol __imp____glewGetUniformLocation
libavfilter.a(vf_gltransition.o) : error LNK2001: unresolved external symbol __imp____glewIsShader
libavfilter.a(vf_gltransition.o) : error LNK2001: unresolved external symbol __imp____glewLinkProgram
libavfilter.a(vf_gltransition.o) : error LNK2001: unresolved external symbol __imp____glewShaderSource
libavfilter.a(vf_gltransition.o) : error LNK2001: unresolved external symbol __imp____glewUniform1f
libavfilter.a(vf_gltransition.o) : error LNK2001: unresolved external symbol __imp____glewUniform1i
libavfilter.a(vf_gltransition.o) : error LNK2001: unresolved external symbol __imp____glewUseProgram
libavfilter.a(vf_gltransition.o) : error LNK2001: unresolved external symbol __imp____glewVertexAttribPointer
libavfilter.a(vf_gltransition.o) : error LNK2001: unresolved external symbol __imp__glewExperimental
ffmpeg_g.exe : fatal error LNK1120: 37 unresolved externals
make: *** [Makefile:108: ffmpeg_g.exe] Error 96

Please help me build ffmpeg with fillter gl-transition on Windown

Thanks.

No such filter: 'gltransition'

I installed the dependencies for FFMPEG build(GLU,GLFW,GLVND & GLEW libs) and configured it with EGL.

My configured command is:

./configure --enable-gpl --enable-opengl --enable-filter=gltransition --extra-ldflags="-L/usr/lib/x86_64-linux-gnu -L/usr/local" --extra-libs='-lGLEW -lglfw3 -lEGL -lGLU' --enable-shared --enable-static

After executing this command in Enabled Filter log GLTransition filter is there.
Then I checked for GLTransition filter using command:

./ffmpeg -v 0 -filters | grep gltransition
but it shows nothing.

Then also cross checked using ffmpeg command below:

./ffmpeg -i media/0.mp4 -i media/1.mp4 -filter_complex gltransition -y out.mp4

but it shows error like,

	[AVFilterGraph @ 0x1febe80] No such filter: 'gltransition'
	Error initializing complex filters.
	Invalid argument.

Am I missed something?

ffmpeg compilation error

Hi,

Following your instructions on how to build ffmpeg I have encountered an error while running the ./configure command I am getting the following error.

./configure --enable-libx264 --enable-gpl --enable-opengl --enable-filter=gltransition --extra-libs='-

lGLEW -lglfw'
gcc is unable to create an executable file.
If gcc is a cross-compiler, use the --enable-cross-compile option.
Only do this if you know what cross compiling means.
C compiler test failed.

If you think configure made a mistake, make sure you are using the latest
version from Git. If the latest version fails, report the problem to the
[email protected] mailing list or IRC #ffmpeg on irc.freenode.net.
Include the log file "ffbuild/config.log" produced by configure as this will help
solve the problem.

I am running the build from Windows os, my c compiler is configured and present on PATH, I am able to run ./configure successfully without the parameters.

Compile Error With Debian Stretch

My configure string :

PATH="$HOME/bin:$PATH" PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./configure
--prefix="$HOME/ffmpeg_build"
--pkg-config-flags="--static"
--extra-cflags="-I$HOME/ffmpeg_build/include"
--extra-ldflags="-L$HOME/ffmpeg_build/lib"
--extra-libs="-lpthread -lm"
--bindir="$HOME/bin"
--enable-gpl
--enable-libass
--enable-libfdk-aac
--enable-libfreetype
--enable-libmp3lame
--enable-libopus
--enable-libvorbis
--enable-libvpx
--enable-libx264
--enable-libx265
--enable-filter=gltransition
--enable-libtheora
--disable-x86asm
--enable-libxvid
--enable-opengl
--enable-cross-compile
--enable-nonfree &&
PATH="$HOME/bin:$PATH" make clean && make

============================

My error starts with.

libavfilter/libavfilter.a(vf_gltransition.o): In function apply_transition': /home/lex/share/ff2/ffmpeg/libavfilter/vf_gltransition.c:368: undefined reference to eglMakeCurrent'
/home/lex/share/ff2/ffmpeg/libavfilter/vf_gltransition.c:373: undefined reference to __glewUseProgram' /home/lex/share/ff2/ffmpeg/libavfilter/vf_gltransition.c:378: undefined reference to __glewUniform1f'
/home/lex/share/ff2/ffmpeg/libavfilter/vf_gltransition.c:382: undefined reference to __glewActiveTexture' /home/lex/share/ff2/ffmpeg/libavfilter/vf_gltransition.c:387: undefined reference to __glewActiveTexture'
libavfilter/libavfilter.a(vf_gltransition.o): In function setup_gl': /home/lex/share/ff2/ffmpeg/libavfilter/vf_gltransition.c:294: undefined reference to eglGetDisplay'
/home/lex/share/ff2/ffmpeg/libavfilter/vf_gltransition.c:296: undefined reference to eglInitialize' /home/lex/share/ff2/ffmpeg/libavfilter/vf_gltransition.c:307: undefined reference to eglChooseConfig'
/home/lex/share/ff2/ffmpeg/libavfilter/vf_gltransition.c:309: undefined reference to eglCreatePbufferSurface' /home/lex/share/ff2/ffmpeg/libavfilter/vf_gltransition.c:312: undefined reference to eglBindAPI'
/home/lex/share/ff2/ffmpeg/libavfilter/vf_gltransition.c:314: undefined reference to eglCreateContext' /home/lex/share/ff2/ffmpeg/libavfilter/vf_gltransition.c:315: undefined reference to eglMakeCurrent'
/home/lex/share/ff2/ffmpeg/libavfilter/vf_gltransition.c:330: undefined reference to glewExperimental' /home/lex/share/ff2/ffmpeg/libavfilter/vf_gltransition.c:331: undefined reference to glewInit'
libavfilter/libavfilter.a(vf_gltransition.o): In function build_shader': /home/lex/share/ff2/ffmpeg/libavfilter/vf_gltransition.c:142: undefined reference to __glewCreateShader'
...

Packages I Installed :

apt-get update -qq && apt-get -y install
autoconf
automake
build-essential
cmake
git-core
libass-dev
libfreetype6-dev
libsdl2-dev
libtool
libva-dev
libvdpau-dev
libvorbis-dev
libxcb1-dev
libxcb-shm0-dev
libxcb-xfixes0-dev
pkg-config
texinfo
wget
zlib1g-dev
libx264-dev
libx265-dev
libnuma-dev
libvpx-dev
libfdk-aac-dev
libmp3lame-dev
libopus-dev
libglew-dev
libao-dev
libgcrypt11-dev
libfaad-dev
libmad0-dev\
make
pkg-config
libtheora-dev
libxvidcore-dev
libglfw3-dev
nasm

[bug] multiple transitions not taking effect in single filter chain

I would like to patch together three segments, and use one type of transition between the first and the second, and another one between the second and the third.

This appears to be impossible. The last "source=" command determines the transition being used for each occurrence of the filter.

EXAMPLE:

ffmpeg
-i file1.mp4
-i file2.mp4
-filter_complex "
[0:v]split=4[v000][v010][v020][v030];
[0:a]asplit=2[a000][a020];
[v000]trim=27.2:28.55[v001t];
[a000]atrim=27.2:28.55[a001t];
[v001t]setpts=PTS-STARTPTS[v001];
[a001t]asetpts=PTS-STARTPTS[a001];
[v010]trim=28.55:29.55[v011t];
[v011t]setpts=PTS-STARTPTS[v011]; \
[v020]trim=33:34.35[v021t]; \
[a020]atrim=33:34.35[a021t];
[v021t]setpts=PTS-STARTPTS[v021];
[a021t]asetpts=PTS-STARTPTS[a021];
[v030]trim=34.35:34.75[v031t];
[v031t]setpts=PTS-STARTPTS[v031];
[1:v]trim=0:8[v100t];
[1:a]atrim=0:8[a100t];
[v100t]setpts=PTS-STARTPTS[v100];
[a100t]asetpts=PTS-STARTPTS[a100]; \
[v011][v021]gltransition=duration=0.15:source=transitions/fade.glsl[vt1];
[v031][v100]gltransition=duration=0.35:source=transitions/luma.glsl[vt2];
[v001][vt1][vt2]concat=n=3[outv];
[a001][a021][a100]concat=n=3:v=0:a=1[outa]"
-map "[outv]"
-map "[outa]"
-y -q:v 1 tmp/out.mp4

This code will result in luma.glsl being applied to both transitions.

Audio not hearing in output file while Concatenation two files,

Hi guys,

I am trying to concatenate two files for one video file. For that, it's working fine and i got output video file. But i can't hearing audio on output video file. It's issue please anyone help me.

Here is tested command,

../ffmpeg
-i video1.mp4
-i video2.mp4
-y -filter_complex "
[0:v]split[v000][v010];
[1:v]split[v100][v110];
[v000]trim=0:39[v001];
[v010]trim=39:40[v011t];
[v011t]setpts=PTS-STARTPTS[v011];
[v100]trim=0:4[v101];
[v110]trim=4:5[v112t];
[v112t]setpts=PTS-STARTPTS[v112];
[v011][v101]gltransition=duration=1:source=/home/procserverjh/opengl/gl-transitions-master/transitions/crosswarp.glsl[vt0];
[v001][vt0][v112]concat=n=3[outv];[0:a][1:a]amix=inputs=2[ad]"
-map "[outv]" -map "[ad]?" -vcodec h264_nvenc -acodec aac -strict experimental -ac 2 -ar 44100 -ab 128k
output.mp4

Thanks,
R.Elavarasan

[bug] error when applying the patch

I am getting an error when applying the patch:

error: patch failed: Makefile:352
error: Makefile: patch does not apply
error: allfilters.c: No such file or directory

Here is the verbose output

Checking patch Makefile...
error: while searching for:
OBJS-$(CONFIG_ZMQ_FILTER)                    += f_zmq.o
OBJS-$(CONFIG_ZOOMPAN_FILTER)                += vf_zoompan.o
OBJS-$(CONFIG_ZSCALE_FILTER)                 += vf_zscale.o

OBJS-$(CONFIG_ALLRGB_FILTER)                 += vsrc_testsrc.o
OBJS-$(CONFIG_ALLYUV_FILTER)                 += vsrc_testsrc.o

error: patch failed: Makefile:352
error: Makefile: patch does not apply
Checking patch allfilters.c...
error: allfilters.c: No such file or directory

The libavfilter/allfilters.c is there, so I am not sure what the problem is here.
I am new to patching with git... any advice?

Mac compilation problem

I use MAC notebook
Execute the following code

./configure --prefix=/usr/local --enable-gpl --enable-nonfree --enable-libass \
  --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libtheora \
  --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 \
  --enable-libopus --enable-libxvid \
  --enable-opengl --enable-filter=gltransition --extra-libs='-lGLEW -lglfw'
make

Result

*** No rule to make target `libavfilter/vf_gltransition.c', needed by `libavfilter/vf_gltransition.o'.  Stop.

C compiler test failed

I have installed FFmpeg in Ubuntu system by building from source and the version installed is

ffmpeg version 3.2.2-2~16.04.york0 Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 5.4.1 (Ubuntu 5.4.1-4ubuntu1~16.04.york1) 20161202

I tried installing this library from the beginning as given in the instruction by cloning FFmpeg from git and all.

While running

./configure --enable-libx264 --enable-gpl --enable-opengl \
            --enable-filter=gltransition --extra-libs='-lGLEW -lglfw'

I'm getting the error as C compiler test failed

gcc is unable to create an executable file.
If gcc is a cross-compiler, use the --enable-cross-compile option.
Only do this if you know what cross compiling means.
C compiler test failed.

If you think configure made a mistake, make sure you are using the latest
version from Git.  If the latest version fails, report the problem to the
[email protected] mailing list or IRC #ffmpeg on irc.freenode.net.
Include the log file "ffbuild/config.log" produced by configure as this will help
solve the problem.

How to solve this problem?

Dockerile build fail

no editing, Dockerfile just build fail. It's seems like ffmpeg complie error.

I tried to modify the Dockerfile to the following version. and it build succeed.
But when I run ffmpeg -v 0 -filters | grep gltransition
returned T.. gltransition VV->V (null). Seems different from others.
and run ffmpeg -i pic.jpg -filter_complex gltransition -y out.mp4
returned

[AVFilterGraph @ 0x55f6264ddac0] Error initializing filter 'gltransition' with args 'offset=0.5:duration=0.5:source=/tmp/gl-transition/ffmpeg-gl-transition/gl-transitions/transitions/burn.glsl'
Error reinitializing filters!
Failed to inject frame into filter network: Operation not permitted
Error while processing the decoded data for stream #1:0

I followed this issue, but it's not work.

Dockerfile

FROM python:3.6.7

MAINTAINER shize "[email protected]"

## replace source list
RUN     sed -i "s/deb.debian.org/mirrors.aliyun.com/g" /etc/apt/sources.list && \
        sed -i "s/security.debian.org/mirrors.aliyun.com/g" /etc/apt/sources.list

## set pip origin
RUN     echo '[global]\ntrusted-host=mirrors.aliyun.com\nindex-url=https://mirrors.aliyun.com/pypi/simple' > /etc/pip.conf

## 设置时区
RUN     /bin/cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \echo 'Asia/Shanghai' > /etc/timezone

WORKDIR     /tmp/workdir

ENV        PKG_CONFIG_PATH=/opt/ffmpeg/lib/pkgconfig \
           LD_LIBRARY_PATH=/opt/ffmpeg/lib \
           PREFIX=/opt/ffmpeg \
           MAKEFLAGS="-j2"

ENV         FDKAAC_VERSION=0.1.5 \
            FONTCONFIG_VERSION=2.12.4 \
            FREETYPE_VERSION=2.5.5 \
            FRIBIDI_VERSION=0.19.7 \
            KVAZAAR_VERSION=1.2.0 \
            LIBASS_VERSION=0.13.7 \
            LIBVIDSTAB_VERSION=1.1.0 \
            OGG_VERSION=1.3.2 \
            OPENJPEG_VERSION=2.1.2 \
            VORBIS_VERSION=1.3.5 \
            WEBP_VERSION=1.0.2 \
            XVID_VERSION=1.3.4 \
            SRC=/usr/local

ENV         FREETYPE_SHA256SUM="5d03dd76c2171a7601e9ce10551d52d4471cf92cd205948e60289251daddffa8 freetype-2.5.5.tar.gz" \
            FRIBIDI_SHA256SUM="3fc96fa9473bd31dcb5500bdf1aa78b337ba13eb8c301e7c28923fea982453a8 0.19.7.tar.gz" \
            LIBASS_SHA256SUM="8fadf294bf701300d4605e6f1d92929304187fca4b8d8a47889315526adbafd7 0.13.7.tar.gz" \
            LIBVIDSTAB_SHA256SUM="14d2a053e56edad4f397be0cb3ef8eb1ec3150404ce99a426c4eb641861dc0bb v1.1.0.tar.gz" \
            OGG_SHA256SUM="e19ee34711d7af328cb26287f4137e70630e7261b17cbe3cd41011d73a654692 libogg-1.3.2.tar.gz" \
            VORBIS_SHA256SUM="6efbcecdd3e5dfbf090341b485da9d176eb250d893e3eb378c428a2db38301ce libvorbis-1.3.5.tar.gz" \
            XVID_SHA256SUM="4e9fd62728885855bc5007fe1be58df42e5e274497591fec37249e1052ae316f xvidcore-1.3.4.tar.gz"


RUN      buildDeps="autoconf \
                    automake \
                    cmake \
                    curl \
                    bzip2 \
                    libexpat1-dev \
                    g++ \
                    gcc \
                    git \
                    gperf \
                    libtool \
                    make \
                    nasm \
                    perl \
                    pkg-config \
                    yasm \
                    libssl-dev \
                    zlib1g-dev \
                    xorg-dev \
                    libglew2.0 \
                    libglew-dev \
                    libglfw3-dev \
                    libx264-dev \
                    libx265-dev \
                    libvpx-dev \
                    libglu1-mesa-dev \
                    libmp3lame-dev \
                    libopus-dev \
                    libgomp1 \
                    ca-certificates \
                    expat \
                    build-essential \
                    libssl1.0.2 \
                    libasound2 " && \
        apt-get -yqq update && \
        apt-get install -yq --no-install-recommends ${buildDeps}

### libogg https://www.xiph.org/ogg/
RUN \
        DIR=/tmp/ogg && \
        mkdir -p ${DIR} && \
        cd ${DIR} && \
        curl -sLO http://downloads.xiph.org/releases/ogg/libogg-${OGG_VERSION}.tar.gz && \
        echo ${OGG_SHA256SUM} | sha256sum --check && \
        tar -zx --strip-components=1 -f libogg-${OGG_VERSION}.tar.gz && \
        ./configure --prefix="${PREFIX}" --enable-shared  && \
        make && \
        make install && \
        rm -rf ${DIR}

### libvorbis https://xiph.org/vorbis/
RUN \
        DIR=/tmp/vorbis && \
        mkdir -p ${DIR} && \
        cd ${DIR} && \
        curl -sLO http://downloads.xiph.org/releases/vorbis/libvorbis-${VORBIS_VERSION}.tar.gz && \
        echo ${VORBIS_SHA256SUM} | sha256sum --check && \
        tar -zx --strip-components=1 -f libvorbis-${VORBIS_VERSION}.tar.gz && \
        ./configure --prefix="${PREFIX}" --with-ogg="${PREFIX}" --enable-shared && \
        make && \
        make install && \
        rm -rf ${DIR}

### libwebp https://developers.google.com/speed/webp/
RUN \
        DIR=/tmp/vebp && \
        mkdir -p ${DIR} && \
        cd ${DIR} && \
        curl -sL https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-${WEBP_VERSION}.tar.gz | \
        tar -zx --strip-components=1 && \
        ./configure --prefix="${PREFIX}" --enable-shared  && \
        make && \
        make install && \
        rm -rf ${DIR}

### xvid https://www.xvid.com/
RUN \
        DIR=/tmp/xvid && \
        mkdir -p ${DIR} && \
        cd ${DIR} && \
        curl -sLO http://downloads.xvid.org/downloads/xvidcore-${XVID_VERSION}.tar.gz && \
        echo ${XVID_SHA256SUM} | sha256sum --check && \
        tar -zx -f xvidcore-${XVID_VERSION}.tar.gz && \
        cd xvidcore/build/generic && \
        ./configure --prefix="${PREFIX}" --bindir="${PREFIX}/bin" --datadir="${DIR}" --enable-shared --enable-shared && \
        make && \
        make install && \
        rm -rf ${DIR}

### fdk-aac https://github.com/mstorsjo/fdk-aac
RUN \
        DIR=/tmp/fdk-aac && \
        mkdir -p ${DIR} && \
        cd ${DIR} && \
        curl -sL https://github.com/mstorsjo/fdk-aac/archive/v${FDKAAC_VERSION}.tar.gz | \
        tar -zx --strip-components=1 && \
        autoreconf -fiv && \
        ./configure --prefix="${PREFIX}" --enable-shared --datadir="${DIR}" && \
        make && \
        make install && \
        rm -rf ${DIR}

## openjpeg https://github.com/uclouvain/openjpeg
RUN \
        DIR=/tmp/openjpeg && \
        mkdir -p ${DIR} && \
        cd ${DIR} && \
        curl -sL https://github.com/uclouvain/openjpeg/archive/v${OPENJPEG_VERSION}.tar.gz | \
        tar -zx --strip-components=1 && \
        cmake -DBUILD_THIRDPARTY:BOOL=ON -DCMAKE_INSTALL_PREFIX="${PREFIX}" . && \
        make && \
        make install && \
        rm -rf ${DIR}
## freetype https://www.freetype.org/
RUN  \
        DIR=/tmp/freetype && \
        mkdir -p ${DIR} && \
        cd ${DIR} && \
        curl -sLO https://download.savannah.gnu.org/releases/freetype/freetype-${FREETYPE_VERSION}.tar.gz && \
        echo ${FREETYPE_SHA256SUM} | sha256sum --check && \
        tar -zx --strip-components=1 -f freetype-${FREETYPE_VERSION}.tar.gz && \
        ./configure --prefix="${PREFIX}" --disable-static --enable-shared && \
        make && \
        make install && \
        rm -rf ${DIR}
## libvstab https://github.com/georgmartius/vid.stab
RUN  \
        DIR=/tmp/vid.stab && \
        mkdir -p ${DIR} && \
        cd ${DIR} && \
        curl -sLO https://github.com/georgmartius/vid.stab/archive/v${LIBVIDSTAB_VERSION}.tar.gz &&\
        echo ${LIBVIDSTAB_SHA256SUM} | sha256sum --check && \
        tar -zx --strip-components=1 -f v${LIBVIDSTAB_VERSION}.tar.gz && \
        cmake -DCMAKE_INSTALL_PREFIX="${PREFIX}" . && \
        make && \
        make install && \
        rm -rf ${DIR}
## fridibi https://www.fribidi.org/
# + https://github.com/fribidi/fribidi/issues/8
RUN  \
        DIR=/tmp/fribidi && \
        mkdir -p ${DIR} && \
        cd ${DIR} && \
        curl -sLO https://github.com/fribidi/fribidi/archive/${FRIBIDI_VERSION}.tar.gz && \
        echo ${FRIBIDI_SHA256SUM} | sha256sum --check && \
        tar -zx --strip-components=1 -f ${FRIBIDI_VERSION}.tar.gz && \
        sed -i 's/^SUBDIRS =.*/SUBDIRS=gen.tab charset lib/' Makefile.am && \
        ./bootstrap --no-config && \
        ./configure -prefix="${PREFIX}" --disable-static --enable-shared && \
        make -j 1 && \
        make install && \
        rm -rf ${DIR}
## fontconfig https://www.freedesktop.org/wiki/Software/fontconfig/
RUN  \
        DIR=/tmp/fontconfig && \
        mkdir -p ${DIR} && \
        cd ${DIR} && \
        curl -sLO https://www.freedesktop.org/software/fontconfig/release/fontconfig-${FONTCONFIG_VERSION}.tar.bz2 &&\
        tar -jx --strip-components=1 -f fontconfig-${FONTCONFIG_VERSION}.tar.bz2 && \
        ./configure -prefix="${PREFIX}" --disable-static --enable-shared && \
        make && \
        make install && \
        rm -rf ${DIR}
## libass https://github.com/libass/libass
RUN  \
        DIR=/tmp/libass && \
        mkdir -p ${DIR} && \
        cd ${DIR} && \
        curl -sLO https://github.com/libass/libass/archive/${LIBASS_VERSION}.tar.gz &&\
        echo ${LIBASS_SHA256SUM} | sha256sum --check && \
        tar -zx --strip-components=1 -f ${LIBASS_VERSION}.tar.gz && \
        ./autogen.sh && \
        ./configure -prefix="${PREFIX}" --disable-static --enable-shared && \
        make && \
        make install && \
        rm -rf ${DIR}
## kvazaar https://github.com/ultravideo/kvazaar
RUN \
        DIR=/tmp/kvazaar && \
        mkdir -p ${DIR} && \
        cd ${DIR} && \
        curl -sLO https://github.com/ultravideo/kvazaar/archive/v${KVAZAAR_VERSION}.tar.gz &&\
        tar -zx --strip-components=1 -f v${KVAZAAR_VERSION}.tar.gz && \
        ./autogen.sh && \
        ./configure -prefix="${PREFIX}" --disable-static --enable-shared && \
        make && \
        make install && \
        rm -rf ${DIR}

## ffmpeg https://ffmpeg.org/
RUN  \
        DIR=/tmp && \
        mkdir -p ${DIR} && \
        cd ${DIR} && \
        git clone https://github.com/ZeddShi/ffmpeg-build.git

## ffmpeg-gl-transition
RUN \
        DIR=/tmp && \
        mkdir -p ${DIR} && \
        cd ${DIR} && \
        git clone https://github.com/transitive-bullshit/ffmpeg-gl-transition.git && \
        cd ffmpeg-gl-transition && \
        git clone https://github.com/gl-transitions/gl-transitions.git

## install gl-transition ffmpeg filter
RUN     grep -v "define GL_TRANSITION_USING_EGL" /tmp/ffmpeg-gl-transition/vf_gltransition.c > \
        /tmp/ffmpeg-build/libavfilter/vf_gltransition.c && \
        cd /tmp/ffmpeg-build && \
        git apply /tmp/ffmpeg-gl-transition/ffmpeg.diff

## configure ffmpeg
RUN \
        DIR=/tmp/ffmpeg-build && cd ${DIR} && \
        ./configure \
        --disable-debug \
        --disable-doc \
        --disable-ffplay \
        --enable-shared \
        --enable-avresample \
        --enable-gpl \
        --enable-libass \
        --enable-libfreetype \
        --enable-libvidstab \
        --enable-libmp3lame \
        --enable-libopenjpeg \
        --enable-libopus \
        --enable-libvorbis \
        --enable-libvpx \
        --enable-libx265 \
        --enable-libxvid \
        --enable-libx264 \
        --enable-nonfree \
        --enable-openssl \
        --enable-libfdk_aac \
        --enable-libkvazaar \
        --enable-postproc \
        --enable-small \
        --enable-version3 \
        --enable-opengl \
        --enable-filter=gltransition \
        --extra-cflags="-I${PREFIX}/include" \
        --extra-ldflags="-L${PREFIX}/lib" \
        --extra-libs='-lGLEW -lglfw -ldl' \
        --prefix="${PREFIX}" && \
        make && \
        make install && \
        make distclean && \
        hash -r && \
        cd tools && \
        make qt-faststart && \
        cp qt-faststart ${PREFIX}/bin

RUN     apt-get -y install xvfb

## cleanup
RUN \
        ldd ${PREFIX}/bin/ffmpeg | grep opt/ffmpeg | cut -d ' ' -f 3 | xargs -i cp {} /usr/local/lib/ && \
        cp ${PREFIX}/bin/* /usr/local/bin/ && \
        cp -r ${PREFIX}/share/ffmpeg /usr/local/share/ && \
        LD_LIBRARY_PATH=/usr/local/lib ffmpeg -buildconf


Crash invalid vertex shader, built for Android

Hello,

Finally, I was able to build the library for Android (I needed to change some includes in the vf_gltransition.c) and using this wrapper I can run the ffmpeg using the command line options.

So before I added this library the FFmpeg was working fine, in fact, the FFmpeg is working fine, but when I try to use some of the Transition features it crashes.

Here the crash for: ffmpeg -i path-to/0.mp4 -i path-to/1.mp4 -filter_complex gltransition -y out.mp4

Press [q] to stop, [?] for help
[swscaler @ 0x77bf6e1000] No accelerated colorspace conversion found from yuv420p to rgb24.
[Parsed_gltransition_0 @ 0x77cebd3ec0] invalid vertex shader
[Parsed_gltransition_0 @ 0x77cebd3ec0] Failed to configure input pad on Parsed_gltransition_0
Error reinitializing filters!
Failed to inject frame into filter network: Operation not permitted
Error while processing the decoded data for stream #1:0
Conversion failed!

Attached you'll find a zip that contains two files:

  • the patch file with the changes applied to the vf_gltransition.c file
  • the script I use to build the FFmpeg library

Note: I just tried to build for arm64-v8a

Thanks

How Modify So Videos Remain Origin Length With Audio?

Using the example ffmpeg from this source. How can I modify it so it does not remove the audio and trim the video file lengths to 3 seconds? I already have the videos at the correct length.

`
./ffmpeg
-i c40.mov
-i c42.mov
-i c44.mov
-filter_complex "
[0:v]split[v000][v010];
[1:v]split[v100][v110];
[2:v]split[v200][v210];
[v000]trim=0:3[v001];
[v010]trim=3:4[v011t];
[v011t]setpts=PTS-STARTPTS[v011];
[v100]trim=0:3[v101];
[v110]trim=3:4[v111t];
[v111t]setpts=PTS-STARTPTS[v111];
[v200]trim=0:3[v201];
[v210]trim=3:4[v211t];
[v211t]setpts=PTS-STARTPTS[v211];
[v011][v101]gltransition=duration=1:source=/home/lex/share/python/ffmpegHelper/gl-transitions/transitions/burn.glsl[vt0];
[v111][v201]gltransition=duration=1[vt1];
[v001][vt0][vt1][v211]concat=n=4[outv]"
-map "[outv]"
-c:v libx264 -profile:v baseline -preset slow -movflags faststart -pix_fmt yuv420p
-y out.mp4

`

arm-linux-androideabi-gcc build fail

i build ffmpeg for android,
first i use gcc build ffmepg successful,
but when i use arm-linux-androideabi-gcc cross-compile,show error "arm-linux-androideabi/bin/ld: error: cannot find -lGLEW"
i don't know why,anybody can tell me,tks very much

problem with gltransition with 480p

hello,
I have a problem with GL Transition while rendering video at 480p, GL EFFECT applies but not as it was but it works fine for 1080P and 720P, here is my command:

ffmpeg -y -loop 1 -t 5 -i /srv/sample/text_images/textimage_bRq4E_1560330312.png -loop 1 -t 8 -i /srv/sample/text_images/textimage_mZPFr_1560330318.png -loop 1 -t 16 -i 'https://pixabay.com/get/52e3d14a4b5ab114a6df8c7ece2a3e7f083edbe35352704f742779.jpg' -loop 1 -t 18 -i 'https://pixabay.com/get/55e6d7424f52b114a6df8c7ece2a3e7f083edbe35352704f742779.jpg' -t 8 -i '/srv/sample/img/image.png' -filter_complex "[2:v]scale=w=2556:h=1440,zoompan=z='zoom+0.001':x='if(gte(zoom,1.5),x,x-1)':y='y':s=852x480:d=180,setsar=1,drawbox=color=black@0:width=iw:height=ih:t=fill[v2];[v2][0:v]overlay=x=(main_w-overlay_w)/2:y=(main_h-overlay_h)/2[v2];[4:v]fps=25,scale=25:25,setsar=1:1[v4];[v2][v4]overlay=x=10:y=(main_h-overlay_h)-10[v2];[3:v]scale=w=2556:h=1440,zoompan=z='zoom+0.001':x='if(gte(zoom,1.5),x,x-1)':y='y':s=852x480:d=240,setsar=1,drawsamplev/sample/fonts/Catamaran/Catamaran-Regular.ttf:text=pixabay.com:fontcolor=white:fontsize=20:x=60:y=(h-text_h)-10,drawbox=color=black@0:width=iw:height=ih:t=fill[v3];[v3][1:v]overlay=x=(main_w-overlay_w)/2:y=(main_h-overlay_h)/2[v3];[4:v]fps=25,scale=25:25,setsar=1:1[v4];[v3][v4]overlay=x=10:y=(main_h-overlay_h)-10[v3];[v2]split[s12][s22];[s12]trim=0:5:start=0:duration=5[s12];[s12]setpts=PTS-STARTPTS[s12];[s22]trim=5:6[s22];[s22]setpts=PTS-STARTPTS[s22];[v3]split[s13][s23];[s13]trim=0:7:start=0:duration=7[s13];[s13]setpts=PTS-STARTPTS[s13];[s23]trim=7:8[s23];[s23]setpts=PTS-STARTPTS[s23];[s22][s13]gltransition=duration=1:source=/filters/CircleCrop.glsl[vt0];[s12][vt0][s23]concat=n=3:v=1:a=0[tmp]" -map '[tmp]' -pix_fmt yuvj444p /srv/sample/rendered/video_h5DjO_1560330312.mp4

what makes to fail, please let me to understand.

i also attach the image, please give me some suggestions

screencapture-test-multimedia5-producedvideo-2019-06-12-14_48_17 (1)

Patch does not apply

Running the command (On OSX) "git apply ~/ffmpeg-gl-transition/ffmpeg.diff" returns this error:

Checking patch libavfilter/Makefile... Hunk #1 succeeded at 367 (offset 15 lines). Checking patch libavfilter/allfilters.c... error: while searching for: REGISTER_FILTER(ZMQ, zmq, vf); REGISTER_FILTER(ZOOMPAN, zoompan, vf); REGISTER_FILTER(ZSCALE, zscale, vf); REGISTER_FILTER(ALLRGB, allrgb, vsrc); REGISTER_FILTER(ALLYUV, allyuv, vsrc); error: patch failed: libavfilter/allfilters.c:360 error: libavfilter/allfilters.c: patch does not apply
*Edited: Verbose version attached.

Is anything up with this plugin and the newst ffmpeg, making this not work anymore?

When trying to build after the command has failed, the follow message appears in the config.log file in ffmpeg.

WARNING: Option --enable-filter=gltransition did not match anything

Simple Concatenation two files

Hi,

I am trying to concatenate two files one file which is already concat using CircleCrop here is he code. After concatenating video length was more than 15 seconds from the actual video length of two files. Last 15 seconds got stuck.

Please looks at the command and if it's wrong correct me.

../ffmpeg -loglevel debug \
  -i /home/procserverjh/opengl/fhd1.mp4 \
  -i /home/procserverjh/opengl/fhd2.mp4 \
  -filter_complex " \
    [0:v]split[v000][v010]; \
    [v010][1:v]gltransition=duration=1:source=/home/procserverjh/opengl/gl-transitions-master/transitions/CircleCrop.glsl[vt0]; \
    [v000][vt0]concat=n=2[outv]" \
  -map "[outv]" \
  -c:v libx264 -profile:v baseline -preset slow -movflags faststart -pix_fmt yuv420p \
  -y /home/procserverjh/opengl/fhdoutcirclecli5.mp4

Segmentation fault (core dumped) again!

Linux with EGL(Ubuntu18.04, docker container)

image

When I run ffmpeg -i media/005.mp4 -i media/006.mp4 -filter_complex "gltransition=duration=4:offset=1.5:source=crosswarp.glsl" -y out.mp4, then I got as follows:

ffmpeg version 4.2.git Copyright (c) 2000-2020 the FFmpeg developers
  built with gcc 7 (Ubuntu 7.4.0-1ubuntu1~18.04.1)
  configuration: --prefix=/usr/local --enable-gpl --enable-nonfree --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-libopus --enable-libxvid --enable-opengl --enable-filter=gltransition --extra-libs='-lGLEW -lEGL'
  libavutil      56. 42.102 / 56. 42.102
  libavcodec     58. 77.101 / 58. 77.101
  libavformat    58. 42.100 / 58. 42.100
  libavdevice    58.  9.103 / 58.  9.103
  libavfilter     7. 77.101 /  7. 77.101
  libswscale      5.  6.101 /  5.  6.101
  libswresample   3.  6.100 /  3.  6.100
  libpostproc    55.  6.100 / 55.  6.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'media/005.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf58.29.100
  Duration: 00:00:05.89, start: 0.000000, bitrate: 185 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x720, 153 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 16000 Hz, mono, fltp, 27 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
Input #1, mov,mp4,m4a,3gp,3g2,mj2, from 'media/006.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf58.29.100
  Duration: 00:00:16.58, start: 0.000000, bitrate: 270 kb/s
    Stream #1:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x720, 197 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #1:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 16000 Hz, mono, fltp, 68 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
Stream mapping:
  Stream #0:0 (h264) -> gltransition:from (graph 0)
  Stream #1:0 (h264) -> gltransition:to (graph 0)
  gltransition (graph 0) -> Stream #0:0 (libx264)
  Stream #0:1 -> #0:1 (aac (native) -> aac (native))
Press [q] to stop, [?] for help
Segmentation fault (core dumped)

Can you help me?

videos not concatinating with transition applied

I need to concatenate two or more videos without clipping them (with full length) and apply transition while changing the video.

I'm trying your example script on my server as

env DISPLAY=:0 ffmpeg -i s1.mp4 -i s2.mp4 -filter_compl
ex "gltransition=duration=4:offset=1.5:source=crosswarp.glsl" -y out1.mp4

Each video is of duration 30 seconds, thus the desired output should be of 60 seconds. But it generates the video of 31 seconds and the transition is applied just after 1.5 seconds of the first video.

I also tried the example from concate.sh file with 3 files having the duration of 10 seconds, 20 seconds and 5 seconds each respectively. But the video produced is of 9 seconds long with one transition applied on first video switching while there is no transition from 2nd to 3rd video switching.

How to concatenate videos with their full length and apply transition while switching/concatenating of videos?

segmentation fault on amazon linux

hey,

I've been trying to install on amazon linux and so far have been unsuccessful.
I'm following the EGL instructions.

From what I understood the requirements are:

  1. glvnd1.0 (from source)
    ./autogen.sh
    ./configure --prefix="$HOME/ffmpeg_build"
    make
    make install

  2. mesaGL>=1.7 mesaGLU>=1.7
    yum install mesa-libGLU mesa-libGLU-devel

  3. GLEW >=2.0 (from source)
    make SYSTEM=linux-egl GLEW_DEST="$HOME/ffmpeg_build"
    make install

For ffmpeg I installed the libs required to build with libx264 (following the steps on https://trac.ffmpeg.org/wiki/CompilationGuide/Centos)

PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./configure --prefix="$HOME/ffmpeg_build" --extra-cflags="-I$HOME/ffmpeg_build/include" --extra-ldflags="-L$HOME/ffmpeg_build/lib" --bindir="$HOME/bin" --enable-libx264 --enable-gpl --enable-opengl --enable-filter=gltransition --extra-libs="-lGLEW -lEGL"

This is the error I get

ffmpeg -i ../ffmpeg-gl-transition/media/0.mp4 -i ../ffmpeg-gl-transition/media/1.mp4 -filter_complex gltransition -y out.mp4


ffmpeg version N-94149-g50e194e6e1 Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 7 (GCC)
  configuration: --prefix=/root/ffmpeg_build --extra-cflags='-I/root/ffmpeg_build/include -Bstatic' --extra-ldflags='-L/root/ffmpeg_build/lib -ldl -Bstatic' --bindir=/root/bin --pkg-config-flags=--static --enable-gpl --enable-nonfree --enable-libfdk_aac --enable-libmp3lame --enable-opengl --enable-filter=gltransition --extra-libs='-lGLEW -lEGL'
  libavutil      56. 30.100 / 56. 30.100
  libavcodec     58. 53.101 / 58. 53.101
  libavformat    58. 28.101 / 58. 28.101
  libavdevice    58.  7.100 / 58.  7.100
  libavfilter     7. 55.100 /  7. 55.100
  libswscale      5.  4.101 /  5.  4.101
  libswresample   3.  4.100 /  3.  4.100
  libpostproc    55.  4.100 / 55.  4.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '../ffmpeg-gl-transition/media/0.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf57.83.100
  Duration: 00:00:04.00, start: 0.000000, bitrate: 454 kb/s
    Stream #0:0(und): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 640x360 [SAR 1:1 DAR 16:9], 452 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
    Metadata:
      handler_name    : VideoHandler
Input #1, mov,mp4,m4a,3gp,3g2,mj2, from '../ffmpeg-gl-transition/media/1.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf57.83.100
  Duration: 00:00:04.00, start: 0.000000, bitrate: 530 kb/s
    Stream #1:0(eng): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 640x360, 528 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
    Metadata:
      handler_name    : VideoHandler
Stream mapping:
  Stream #0:0 (h264) -> gltransition:from
  Stream #1:0 (h264) -> gltransition:to
  gltransition -> Stream #0:0 (mpeg4)
Press [q] to stop, [?] for help
Segmentation fault

And this is a more verbose log

ffmpeg -loglevel debug -i ../ffmpeg-gl-transition/media/0.mp4 -i ../ffmpeg-gl-transition/media/1.mp4 -filter_complex gltransition out.mp4

  built with gcc 7 (GCC)
  configuration: --prefix=/root/ffmpeg_build --extra-cflags='-I/root/ffmpeg_build/include -Bstatic' --extra-ldflags='-L/root/ffmpeg_build/lib -ldl -Bstatic' --bindir=/root/bin --pkg-config-flags=--static --enable-gpl --enable-nonfree --enable-libfdk_aac --enable-libmp3lame --enable-opengl --enable-filter=gltransition --extra-libs='-lGLEW -lEGL'
  libavutil      56. 30.100 / 56. 30.100
  libavcodec     58. 53.101 / 58. 53.101
  libavformat    58. 28.101 / 58. 28.101
  libavdevice    58.  7.100 / 58.  7.100
  libavfilter     7. 55.100 /  7. 55.100
  libswscale      5.  4.101 /  5.  4.101
  libswresample   3.  4.100 /  3.  4.100
  libpostproc    55.  4.100 / 55.  4.100
Splitting the commandline.
Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument 'debug'.
Reading option '-i' ... matched as input url with argument '../ffmpeg-gl-transition/media/0.mp4'.
Reading option '-i' ... matched as input url with argument '../ffmpeg-gl-transition/media/1.mp4'.
Reading option '-filter_complex' ... matched as option 'filter_complex' (create a complex filtergraph) with argument 'gltransition'.
Reading option 'out.mp4' ... matched as output url.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option loglevel (set logging level) with argument debug.
Applying option filter_complex (create a complex filtergraph) with argument gltransition.
Successfully parsed a group of options.
Parsing a group of options: input url ../ffmpeg-gl-transition/media/0.mp4.
Successfully parsed a group of options.
Opening an input file: ../ffmpeg-gl-transition/media/0.mp4.
[NULL @ 0x3b46e00] Opening '../ffmpeg-gl-transition/media/0.mp4' for reading
[file @ 0x3b47540] Setting default whitelist 'file,crypto'
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x3b46e00] Format mov,mp4,m4a,3gp,3g2,mj2 probed with size=2048 and score=100
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x3b46e00] ISO: File Type Major Brand: isom
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x3b46e00] Unknown dref type 0x206c7275 size 12
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x3b46e00] Processing st: 0, edit list 0 - media time: 0, duration: 51200
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x3b46e00] Before avformat_find_stream_info() pos: 1234 bytes read:32768 seeks:0 nb_streams:1
[h264 @ 0x3b48740] nal_unit_type: 7(SPS), nal_ref_idc: 3
[h264 @ 0x3b48740] nal_unit_type: 8(PPS), nal_ref_idc: 3
[h264 @ 0x3b48740] nal_unit_type: 6(SEI), nal_ref_idc: 0
[h264 @ 0x3b48740] nal_unit_type: 5(IDR), nal_ref_idc: 3
[h264 @ 0x3b48740] Format yuv420p chosen by get_format().
[h264 @ 0x3b48740] Reinit context to 640x368, pix_fmt: yuv420p
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x3b46e00] All info found
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x3b46e00] After avformat_find_stream_info() pos: 7467 bytes read:32768 seeks:0 frames:1
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '../ffmpeg-gl-transition/media/0.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf57.83.100
  Duration: 00:00:04.00, start: 0.000000, bitrate: 454 kb/s
    Stream #0:0(und), 1, 1/12800: Video: h264 (Constrained Baseline), 1 reference frame (avc1 / 0x31637661), yuv420p(left), 640x360 (640x368) [SAR 1:1 DAR 16:9], 0/1, 452 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
    Metadata:
      handler_name    : VideoHandler
Successfully opened the file.
Parsing a group of options: input url ../ffmpeg-gl-transition/media/1.mp4.
Successfully parsed a group of options.
Opening an input file: ../ffmpeg-gl-transition/media/1.mp4.
[NULL @ 0x3b4a540] Opening '../ffmpeg-gl-transition/media/1.mp4' for reading
[file @ 0x3b49940] Setting default whitelist 'file,crypto'
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x3b4a540] Format mov,mp4,m4a,3gp,3g2,mj2 probed with size=2048 and score=100
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x3b4a540] ISO: File Type Major Brand: isom
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x3b4a540] Unknown dref type 0x206c7275 size 12
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x3b4a540] Processing st: 0, edit list 0 - media time: 0, duration: 51200
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x3b4a540] Before avformat_find_stream_info() pos: 1217 bytes read:32768 seeks:0 nb_streams:1
[h264 @ 0x3b4b4c0] nal_unit_type: 7(SPS), nal_ref_idc: 3
[h264 @ 0x3b4b4c0] nal_unit_type: 8(PPS), nal_ref_idc: 3
[h264 @ 0x3b4b4c0] nal_unit_type: 6(SEI), nal_ref_idc: 0
[h264 @ 0x3b4b4c0] nal_unit_type: 5(IDR), nal_ref_idc: 3
[h264 @ 0x3b4b4c0] Format yuv420p chosen by get_format().
[h264 @ 0x3b4b4c0] Reinit context to 640x368, pix_fmt: yuv420p
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x3b4a540] All info found
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x3b4a540] After avformat_find_stream_info() pos: 16010 bytes read:32768 seeks:0 frames:1
Input #1, mov,mp4,m4a,3gp,3g2,mj2, from '../ffmpeg-gl-transition/media/1.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf57.83.100
  Duration: 00:00:04.00, start: 0.000000, bitrate: 530 kb/s
    Stream #1:0(eng), 1, 1/12800: Video: h264 (Constrained Baseline), 1 reference frame (avc1 / 0x31637661), yuv420p(left), 640x360 (640x368), 0/1, 528 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
    Metadata:
      handler_name    : VideoHandler
Successfully opened the file.
Parsing a group of options: output url out.mp4.
Successfully parsed a group of options.
Opening an output file: out.mp4.
[file @ 0x3b6b0c0] Setting default whitelist 'file,crypto'
Successfully opened the file.
detected 2 logical cores
[h264 @ 0x3b6ca80] nal_unit_type: 7(SPS), nal_ref_idc: 3
[h264 @ 0x3b6ca80] nal_unit_type: 8(PPS), nal_ref_idc: 3
[h264 @ 0x3bb90c0] nal_unit_type: 7(SPS), nal_ref_idc: 3
[h264 @ 0x3bb90c0] nal_unit_type: 8(PPS), nal_ref_idc: 3
Stream mapping:
  Stream #0:0 (h264) -> gltransition:from
  Stream #1:0 (h264) -> gltransition:to
  gltransition -> Stream #0:0 (mpeg4)
Press [q] to stop, [?] for help
cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
    Last message repeated 1 times
[h264 @ 0x3b6ca80] nal_unit_type: 6(SEI), nal_ref_idc: 0
[h264 @ 0x3b6ca80] nal_unit_type: 5(IDR), nal_ref_idc: 3
[h264 @ 0x3b6ca80] Format yuv420p chosen by get_format().
[h264 @ 0x3b6ca80] Reinit context to 640x368, pix_fmt: yuv420p
cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
[h264 @ 0x3b92bc0] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2
cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
    Last message repeated 1 times
[h264 @ 0x3bb0c80] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2
[h264 @ 0x3bb90c0] nal_unit_type: 6(SEI), nal_ref_idc: 0
[h264 @ 0x3bb90c0] nal_unit_type: 5(IDR), nal_ref_idc: 3
[h264 @ 0x3bb90c0] Format yuv420p chosen by get_format().
[h264 @ 0x3bb90c0] Reinit context to 640x368, pix_fmt: yuv420p
cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
[h264 @ 0x3c4f500] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2
[h264 @ 0x3c95680] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2
[graph 0 input from stream 0:0 @ 0x3d170c0] Setting 'video_size' to value '640x360'
[graph 0 input from stream 0:0 @ 0x3d170c0] Setting 'pix_fmt' to value '0'
[graph 0 input from stream 0:0 @ 0x3d170c0] Setting 'time_base' to value '1/12800'
[graph 0 input from stream 0:0 @ 0x3d170c0] Setting 'pixel_aspect' to value '1/1'
[graph 0 input from stream 0:0 @ 0x3d170c0] Setting 'sws_param' to value 'flags=2'
[graph 0 input from stream 0:0 @ 0x3d170c0] Setting 'frame_rate' to value '25/1'
[graph 0 input from stream 0:0 @ 0x3d170c0] w:640 h:360 pixfmt:yuv420p tb:1/12800 fr:25/1 sar:1/1 sws_param:flags=2
[graph 0 input from stream 1:0 @ 0x3d176c0] Setting 'video_size' to value '640x360'
[graph 0 input from stream 1:0 @ 0x3d176c0] Setting 'pix_fmt' to value '0'
[graph 0 input from stream 1:0 @ 0x3d176c0] Setting 'time_base' to value '1/12800'
[graph 0 input from stream 1:0 @ 0x3d176c0] Setting 'pixel_aspect' to value '0/1'
[graph 0 input from stream 1:0 @ 0x3d176c0] Setting 'sws_param' to value 'flags=2'
[graph 0 input from stream 1:0 @ 0x3d176c0] Setting 'frame_rate' to value '25/1'
[graph 0 input from stream 1:0 @ 0x3d176c0] w:640 h:360 pixfmt:yuv420p tb:1/12800 fr:25/1 sar:0/1 sws_param:flags=2
[format @ 0x3d175c0] Setting 'pix_fmts' to value 'yuv420p'
[auto_scaler_0 @ 0x3d17d40] w:iw h:ih flags:'bilinear' interl:0
[Parsed_gltransition_0 @ 0x3b49740] auto-inserting filter 'auto_scaler_0' between the filter 'graph 0 input from stream 0:0' and the filter 'Parsed_gltransition_0'
[auto_scaler_1 @ 0x3d18b40] w:iw h:ih flags:'bilinear' interl:0
[Parsed_gltransition_0 @ 0x3b49740] auto-inserting filter 'auto_scaler_1' between the filter 'graph 0 input from stream 1:0' and the filter 'Parsed_gltransition_0'
[auto_scaler_2 @ 0x3d17a00] w:iw h:ih flags:'bilinear' interl:0
[format @ 0x3d175c0] auto-inserting filter 'auto_scaler_2' between the filter 'Parsed_gltransition_0' and the filter 'format'
[AVFilterGraph @ 0x3bb8480] query_formats: 5 queried, 1 merged, 3 already done, 0 delayed
[auto_scaler_0 @ 0x3d17d40] w:640 h:360 fmt:yuv420p sar:1/1 -> w:640 h:360 fmt:rgb24 sar:1/1 flags:0x2
[Parsed_gltransition_0 @ 0x3b49740] 00Segmentation fault

Here's output off ldd ffmpeg

	libdl.so.2 => /lib64/libdl.so.2 (0x00007f2090a31000)
	libm.so.6 => /lib64/libm.so.6 (0x00007f209072f000)
	libxcb.so.1 => /usr/lib64/libxcb.so.1 (0x00007f2090511000)
	libxcb-shm.so.0 => /usr/lib64/libxcb-shm.so.0 (0x00007f209030f000)
	libxcb-shape.so.0 => /usr/lib64/libxcb-shape.so.0 (0x00007f209010c000)
	libxcb-xfixes.so.0 => /usr/lib64/libxcb-xfixes.so.0 (0x00007f208ff06000)
	libasound.so.2 => /lib64/libasound.so.2 (0x00007f208fc1b000)
	libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f208f9ff000)
	librt.so.1 => /lib64/librt.so.1 (0x00007f208f7f7000)
	libGL.so.1 => /usr/lib64/libGL.so.1 (0x00007f208f56b000)
	libfreetype.so.6 => /usr/lib64/libfreetype.so.6 (0x00007f208f2cf000)
	libbz2.so.1 => /lib64/libbz2.so.1 (0x00007f208f0be000)
	libz.so.1 => /lib64/libz.so.1 (0x00007f208eea8000)
	libmp3lame.so.0 => /usr/lib64/libmp3lame.so.0 (0x00007f208ec31000)
	libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x00007f208e8ac000)
	libEGL.so.1 => /usr/lib64/libEGL.so.1 (0x00007f208e699000)
	libc.so.6 => /lib64/libc.so.6 (0x00007f208e2cc000)
	/lib64/ld-linux-x86-64.so.2 (0x00007f2090c35000)
	libXau.so.6 => /usr/lib64/libXau.so.6 (0x00007f208e0c9000)
	libGLX.so.0 => /usr/lib64/libGLX.so.0 (0x00007f208de98000)
	libX11.so.6 => /usr/lib64/libX11.so.6 (0x00007f208db5d000)
	libXext.so.6 => /usr/lib64/libXext.so.6 (0x00007f208d94b000)
	libGLdispatch.so.0 => /usr/lib64/libGLdispatch.so.0 (0x00007f208d696000)
	libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f208d480000)```

Any suggestions?

thanks

setup_gl ERRORFailed to configure input pad on Parsed_gltransition_0

install without EGL
have run
Xvfb :1 -screen srcn 1280x1024x16
export DISPLAY=:99

But till have errror

errro12

[auto_scaler_0 @ 0x7fffda741600] w:iw h:ih flags:'bilinear' interl:0
[Parsed_gltransition_0 @ 0x7fffda73db00] auto-inserting filter 'auto_scaler_0' between the filter 'graph 0 input from stream 0:0' and the filter 'Parsed_gltransition_0'
[auto_scaler_1 @ 0x7fffda742600] w:iw h:ih flags:'bilinear' interl:0
[Parsed_gltransition_0 @ 0x7fffda73db00] auto-inserting filter 'auto_scaler_1' between the filter 'graph 0 input from stream 1:0' and the filter 'Parsed_gltransition_0'
[auto_scaler_2 @ 0x7fffda7440c0] w:iw h:ih flags:'bilinear' interl:0
[format @ 0x7fffda73c800] auto-inserting filter 'auto_scaler_2' between the filter 'Parsed_gltransition_0' and the filter 'format'
[AVFilterGraph @ 0x7fffda73cf40] query_formats: 5 queried, 1 merged, 3 already done, 0 delayed
[auto_scaler_2 @ 0x7fffda7440c0] picking yuv444p out of 8 ref:rgb24 alpha:0
[auto_scaler_0 @ 0x7fffda741600] w:640 h:360 fmt:yuv420p sar:1/1 -> w:640 h:360 fmt:rgb24 sar:1/1 flags:0x2
[Parsed_gltransition_0 @ 0x7fffda73db00] setup_gl ERRORFailed to configure input pad on Parsed_gltransition_0
Error reinitializing filters!
Failed to inject frame into filter network: Operation not permitted
Error while processing the decoded data for stream #1:0
[AVIOContext @ 0x7fffda49c600] Statistics: 0 seeks, 0 writeouts
[AVIOContext @ 0x7fffda4790c0] Statistics: 65536 bytes read, 0 seeks
[AVIOContext @ 0x7fffda4990c0] Statistics: 65536 bytes read, 0 seeks
Conversion failed!

INFO ffmpeg

ffmpeg version N-92314-g323c2cf Copyright (c) 2000-2018 the FFmpeg developers
built with gcc 7 (Ubuntu 7.3.0-27ubuntu1~18.04)
configuration: --prefix=/home/noboro/ffmpeg_build --pkg-config-flags=--static --extra-cflags=-I/home/noboro/ffmpeg_build/include --extra-ldflags=-L/home/noboro/ffmpeg_build/lib --extra-libs='-lpthread -lm' --bindir=/home/noboro/bin --enable-gpl --enable-libaom --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-opengl --enable-filter=gltransition --extra-libs='-lGLEW -lglfw' --enable-nonfree
libavutil 56. 21.100 / 56. 21.100
libavcodec 58. 34.100 / 58. 34.100
libavformat 58. 19.102 / 58. 19.102
libavdevice 58. 4.106 / 58. 4.106
libavfilter 7. 39.100 / 7. 39.100
libswscale 5. 2.100 / 5. 2.100
libswresample 3. 2.100 / 3. 2.100
libpostproc 55. 2.100 / 55. 2.100
Hyper fast Audio and Video encoder
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...

Use -h to get full help or, even better, run 'man ffmpeg'

FreeBSD build instructions

Hi,

it's taking me some hours now and I can't get ffmpeg to compile with ffmpeg-gl-transitions on FreeBSD. Did someone succeed and can you share some instructions in what you did?

The duration of generate trans video

/usr/bin/ffmpeg -y -loglevel warning -loop 1 -t 1.5 -i end.png -loop 1 -t 1.5 -i start.png -t 1.5 -i blank.wav -filter_complex gltransition=duration=1.3:offset=0.1:source=LinearBlur.glsl -ac 2 -ar 44100 -b:v 2M -r 24 -pix_fmt yuv420p -strict -2 -preset superfast transition.mp4

I used the code above to generate a transition video(1.5s), however, the ouput video is 1.58s. Is there anything wrong? Please give me some advice to solve this problem, thanks~

rendering bug for some aspect ratios

There's currently an bug where some video dimensions result in warped, funky-looking transitions.

I'm not sure exactly what the bug is, but my best guess is that it has to do with how AVFrame represents its frame data. It seems that AVFrame adds padding to each line to maximize use of SIMD. We're definitely not accounting for this padding, and I think that's what's causing the issue for some video sizes.

Adding this here to track progress.

rending bug for 1080*1920 resolution video

When I use gl-transition for video which ratios is 9:16 (such as 1080x1920, 720x1280, 540x960),glsl filter rending bug,same like issues #7

ffmpeg command:

./ffmpeg \
  -i media/a1.mp4 \
  -i media/a2.mp4 \
  -filter_complex " \
    [0:v]split[v000][v010]; \
    [1:v]split[v100][v110]; \
    [v000]trim=0:2[v001]; \
    [v010]trim=2:3[v011t]; \
    [v011t]setpts=PTS-STARTPTS[v011]; \
    [v100]trim=0:3[v101]; \
    [v110]trim=3:4[v111t]; \
    [v111t]setpts=PTS-STARTPTS[v111]; \
    [v011][v101]gltransition=duration=1:source=./swap.glsl[vt0]; \
    [v001][vt0][v111]concat=n=3[outv]" \
  -map "[outv]" \
  -c:v libx264 -profile:v baseline -preset slow -movflags faststart -pix_fmt yuv420p \
  -y media/out_1.mp4

video info:

➜  ~ ffmpeg -i a1.mp4
ffmpeg version 4.0.2 Copyright (c) 2000-2018 the FFmpeg developers
  built with Apple LLVM version 9.1.0 (clang-902.0.39.2)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/4.0.2 --enable-shared --enable-pthreads --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-gpl --enable-ffplay --enable-libmp3lame --enable-libx264 --enable-libxvid --enable-opencl --enable-videotoolbox --disable-lzma
  libavutil      56. 14.100 / 56. 14.100
  libavcodec     58. 18.100 / 58. 18.100
  libavformat    58. 12.100 / 58. 12.100
  libavdevice    58.  3.100 / 58.  3.100
  libavfilter     7. 16.100 /  7. 16.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  1.100 /  5.  1.100
  libswresample   3.  1.100 /  3.  1.100
  libpostproc    55.  1.100 / 55.  1.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/Users/yehot/Desktop/mgc-ffmpeg-source/media/a1.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: mp42mp41
    creation_time   : 2018-09-21T11:17:21.000000Z
  Duration: 00:00:23.40, start: 0.000000, bitrate: 8414 kb/s
    Stream #0:0(eng): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709), 1080x1920, 8095 kb/s, 25 fps, 25 tbr, 25k tbn, 50 tbc (default)
    Metadata:
      creation_time   : 2018-09-21T11:17:21.000000Z
      handler_name    : Alias Data Handler
      encoder         : AVC Coding
    Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 317 kb/s (default)
    Metadata:
      creation_time   : 2018-09-21T11:17:21.000000Z
      handler_name    : Alias Data Handler

ques for transition

I make the ffmpeg successfully,but I meet the problems "Error initializing filter 'gltransition' Error initializing complex filters. Operation not permitted" when I call the command“./ffmpeg -i media/0.mp4 -i media/1.mp4 -filter_complex gltransition -y out.mp4”.
Then I install the xvfb,export DISPLAY=localhost:1.0,another error occurs when the code call glCreateShader:"X Error of failed request: BadRequest (invalid request code or no such operation)".
I have little experience with OpenGL issues over remote connections.My glxinfo is:
display: localhost:1 screen: 0
direct rendering: No (If you want to find out why, try setting LIBGL_DEBUG=verbose)
server glx vendor string: SGI
server glx version string: 1.4
OpenGL vendor string: Mesa Project
OpenGL renderer string: Software Rasterizer
OpenGL version string: 1.4 (2.1 Mesa 7.11)
Can you give me some help?Thank you!

Problems with alpha channel

I am not sure if alpha channel is not supported or if I am just doing something wrong.

If they are not supported, would it be possible to add support for it into the extension?

It's understandable to omit alpha channel for most use cases, but I would like to be able to use transitions on overlays with alpha channel.

Here's a short example of such command:

ffmpeg -i ./video/logo.png -i ./video/logo2.png -i ./video/image.jpg -filter_complex "\ [0:v]scale=w=320:h=240:force_original_aspect_ratio=1,pad=320:240:(ow-iw)/2:(oh-ih)/2:[email protected],loop=125:1:0,split[logo1_split1][logo1_split2]; \ [1:v]scale=w=320:h=240:force_original_aspect_ratio=1,pad=320:240:(ow-iw)/2:(oh-ih)/2:[email protected],loop=125:1:0,split[logo2_split1][logo2_split2]; \ [2:v]scale=w=640:h=480,setsar=sar=4/3,loop=250:1:0[image]; \ [logo1_split1]trim=1.25,setpts=PTS-STARTPTS[logo1_split1_main]; \ [logo1_split2]trim=0:1.25[logo1_split2_out]; \ [logo2_split1]trim=1.25,setpts=PTS-STARTPTS[logo2_split1_main]; \ [logo2_split2]trim=0:1.25[logo2_split2_in]; \ [logo1_split2_out][logo2_split2_in]gltransition=duration=1.25:source=/filters/crosswarp.glsl[logos_tr]; \ [logo1_split1_main][logos_tr][logo2_split1_main]concat=n=3[logos_concat]; \ [image][logos_concat]overlay " -pix_fmt yuv420p -q:v 2 -y -f mp4 logos.mp4

Using scale and pad to ensure both overlays are the same size, then repeating the process of the example for transition and finally overlaying it over the media file. However, purple from pad was showing, despite the alpha channel being set.

To check if problem is not in something else, like with the padding, I tried simplified transitionless version and it worked, the purple area was now transparent

ffmpeg -i ./video/logo.png -i ./video/logo2.png -i ./video/image.jpg -filter_complex "\ [0:v]scale=w=320:h=240:force_original_aspect_ratio=1,pad=320:240:(ow-iw)/2:(oh-ih)/2:[email protected],loop=125:1:0[logo1]; \ [1:v]scale=w=320:h=240:force_original_aspect_ratio=1,pad=320:240:(ow-iw)/2:(oh-ih)/2:[email protected],loop=125:1:0[logo2]; \ [2:v]scale=w=640:h=480,setsar=sar=4/3,loop=250:1:0[image]; \ [logo1][logo2]concat=n=2[logos_concat]; \ [image][logos_concat]overlay " -pix_fmt yuv420p -q:v 2 -y -f mp4 logos2.mp4

no enabled repos.

If i use the bellow command.
sudo yum install mesa-libGLU mesa-libGLU-devel

I get this error.

There are no enabled repos.
Run "yum repolist all" to see the repos you have.
You can enable repos with yum-config-manager --enable

Please help ,thanks

Undefined symbols for architecture x86_64

I am facing this error while ffmpeg build

Undefined symbols for architecture x86_64:
  "_glfwCreateWindow", referenced from:
      _setup_gl in libavfilter.a(vf_gltransition.o)
  "_glfwDestroyWindow", referenced from:
      _uninit in libavfilter.a(vf_gltransition.o)
  "_glfwInit", referenced from:
      _init in libavfilter.a(vf_gltransition.o)
  "_glfwMakeContextCurrent", referenced from:
      _setup_gl in libavfilter.a(vf_gltransition.o)
      _blend_frame in libavfilter.a(vf_gltransition.o)
  "_glfwWindowHint", referenced from:
      _setup_gl in libavfilter.a(vf_gltransition.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [ffmpeg_g] Error 1

I have added --extra-libs='-lGLEW -lglfw' in .configure file also as suggested in issue #14

after adding this line also I am facing same problem.

Please help

FFmpeg build not successfully

try to build ffmpeg with gt-transition buy got following error.
Undefined symbols for architecture x86_64: "_glfwCreateWindow", referenced from: _setup_gl in libavfilter.a(vf_gltransition.o) "_glfwDestroyWindow", referenced from: _uninit in libavfilter.a(vf_gltransition.o) "_glfwInit", referenced from: _init in libavfilter.a(vf_gltransition.o) "_glfwMakeContextCurrent", referenced from: _setup_gl in libavfilter.a(vf_gltransition.o) _blend_frame in libavfilter.a(vf_gltransition.o) "_glfwWindowHint", referenced from: _setup_gl in libavfilter.a(vf_gltransition.o) ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make: *** [ffmpeg_g] Error 1

want to make a build for mac OS and android.
Is there any better way to make a build or get inbuild gl-transition ffmpeg?

Bug - Segmantation Error with gltransition

Hello,

I have spent several hours working on this now, and each time I rebuild ffmpeg, it results in a segmentation fault when I attempt to use the filter:

root@host:[/usr/local/src/ffmpeg-latest]: /usr/local/bin/ffmpeg -i /home/procserverjh/public_html/videosly/video/ikl3tkm_ez.mp4 -i /home/procserverjh/public_html/videosly/video/u5e9f3y_ez.mp4 -filter_complex gltransition -y /home/procserverjh/public_html/videosly/video/out.mp4
...
Stream mapping:
Stream #0:0 (h264) -> gltransition:from (graph 0)
Stream #1:0 (h264) -> gltransition:to (graph 0)
gltransition (graph 0) -> Stream #0:0 (libx264)
Stream #0:1 -> #0:1 (aac (native) -> aac (native))
Press [q] to stop, [?] for help
Segmentation fault (core dumped)

This only occurs when I use the gltransition filter. If I remove that option from the processing command, or use a different filter, the output completes successfully.

I have tried rebuilding using different versions of the ffmpeg source, as well as installing various different components needed to compile it. At this point, I am unable to determine the cause of the segfault with the gltransition filter.

LD Error

brew install glfw --without-shared-library
./configure --enable-libx264 --enable-gpl --enable-opengl --enable-filter=gltransition --extra-libs='-lGLEW -lglfw3'
make

LD	libavfilter/libavfilter.7.dylib
Undefined symbols for architecture x86_64:
  "_IODisplayCreateInfoDictionary", referenced from:
      __glfwPlatformGetMonitors in libglfw3.a(cocoa_monitor.m.o)
  "_IOHIDDeviceCopyMatchingElements", referenced from:
      _matchCallback in libglfw3.a(cocoa_joystick.m.o)
  "_IOHIDDeviceGetProperty", referenced from:
      _matchCallback in libglfw3.a(cocoa_joystick.m.o)
  "_IOHIDDeviceGetValue", referenced from:
      _getElementValue in libglfw3.a(cocoa_joystick.m.o)
  "_IOHIDElementGetLogicalMax", referenced from:
      _getElementsCFArrayHandler in libglfw3.a(cocoa_joystick.m.o)
  "_IOHIDElementGetLogicalMin", referenced from:
      _getElementsCFArrayHandler in libglfw3.a(cocoa_joystick.m.o)
  "_IOHIDElementGetType", referenced from:
      _getElementsCFArrayHandler in libglfw3.a(cocoa_joystick.m.o)
  "_IOHIDElementGetTypeID", referenced from:
      _getElementsCFArrayHandler in libglfw3.a(cocoa_joystick.m.o)
  "_IOHIDElementGetUsage", referenced from:
      _getElementsCFArrayHandler in libglfw3.a(cocoa_joystick.m.o)
  "_IOHIDElementGetUsagePage", referenced from:
      _getElementsCFArrayHandler in libglfw3.a(cocoa_joystick.m.o)
  "_IOHIDManagerCreate", referenced from:
      __glfwInitJoysticksNS in libglfw3.a(cocoa_joystick.m.o)
  "_IOHIDManagerOpen", referenced from:
      __glfwInitJoysticksNS in libglfw3.a(cocoa_joystick.m.o)
  "_IOHIDManagerRegisterDeviceMatchingCallback", referenced from:
      __glfwInitJoysticksNS in libglfw3.a(cocoa_joystick.m.o)
  "_IOHIDManagerRegisterDeviceRemovalCallback", referenced from:
      __glfwInitJoysticksNS in libglfw3.a(cocoa_joystick.m.o)
  "_IOHIDManagerScheduleWithRunLoop", referenced from:
      __glfwInitJoysticksNS in libglfw3.a(cocoa_joystick.m.o)
  "_IOHIDManagerSetDeviceMatchingMultiple", referenced from:
      __glfwInitJoysticksNS in libglfw3.a(cocoa_joystick.m.o)
  "_IOHIDValueGetIntegerValue", referenced from:
      _getElementValue in libglfw3.a(cocoa_joystick.m.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [libavfilter/libavfilter.7.dylib] Error 1

concat.sh example has a problem

https://github.com/transitive-bullshit/ffmpeg-gl-transition/blob/master/concat.sh

There are 3 input videos, each of them are 4.00 seconds long.
That means we have 2 transitions. And, each transition is set to 1 second.
The total duration of out.mp4 should be (3 videos * 4 seconds) = 12 seconds.

Instead, the output from concat.sh is 10 seconds long, meaning we have shortened the video.
This doesn't make sense -- transitions logically aren't supposed to reduce the video duration.

Ping @transitive-bullshit

Platform:Centos; Error initializing filter 'gltransition' with args

Here's my extra-libs :

--extra-libs='-lpthread -lm -lXrandr -lXinerama -lXi -lXxf86vm -lX11 -lGLEW -lglfw'

I have install xvfb

Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
Package xorg-x11-server-Xvfb-1.20.4-10.el7.x86_64 already installed and latest version

and I am sure filter existed

$ ./bin/ffmpeg -v 0 -filters | grep gltransition
 T.. gltransition      VV->V      OpenGL blend transitions

Here's my ffmpeg cmd:

./bin/ffmpeg -v level+debug \
-i head.mp4 \
-i head.mp4 \
-safe 0 \
-filter_complex "gltransition=offset=0.5:duration=0.5:source=crosswarp.glsl" \
-y out.mp4

output

[debug] Successfully opened the file.
[Parsed_gltransition_0 @ 0x33c8440] [debug] Setting 'offset' to value '0.5'
[Parsed_gltransition_0 @ 0x33c8440] [debug] Setting 'duration' to value '0.5'
[Parsed_gltransition_0 @ 0x33c8440] [debug] Setting 'source' to value 'crosswarp.glsl'
[AVFilterGraph @ 0x33f3440] [error] Error initializing filter 'gltransition' with args 'offset=0.5:duration=0.5:source=crosswarp.glsl'
[fatal] Error initializing complex filters.
[fatal] Operation not permitted
[AVIOContext @ 0x33cd4c0] [verbose] Statistics: 206564 bytes read, 2 seeks
[AVIOContext @ 0x33fb900] [verbose] Statistics: 206564 bytes read, 2 seeks

I have been use chmod setted, but still error

How can I resolve it?

can only use a few GL Transitions

Hi, i successfully managed to use the following transitions:


- crosswarp
- cube
- Butterflywavescrawler
- circlecrop
- circle
- simplezoom
- InvertedPageCurl
- Dreamy
- Mosaic
- DreamyZoom
- doorway
- fadecolor
- rotate_scale_fade
- swap

but if i want to use any others, and i do, the video gets rendered but there is no visual transition, i get back the original video concatenated without effects.
Can you point me in any direction ?
Thank you

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.