1:安装完ffmpeg后,检测是否安装ffmpeg

执行:ffmpeg

如下是说明没问题

root@hroot-virtual-machine:~/ffmpeg-4.2.2# ffmpeg
ffmpeg version 4.2.2 Copyright (c) 2000-2019 the FFmpeg developersbuilt with gcc 9 (Ubuntu 9.3.0-17ubuntu1~20.04)configuration: --enable-libx264 --enable-libx265 --enable-libvpx --enable-libfdk-aac --enable-libmp3lame --enable-libopus --enable-nonfree --enable-gpl --enable-opengl --enable-filter=gltransition --extra-libs='-lGLEW -lglfw -ldl'libavutil      56. 31.100 / 56. 31.100libavcodec     58. 54.100 / 58. 54.100libavformat    58. 29.100 / 58. 29.100libavdevice    58.  8.100 / 58.  8.100libavfilter     7. 57.100 /  7. 57.100libswscale      5.  5.100 /  5.  5.100libswresample   3.  5.100 /  3.  5.100libpostproc    55.  5.100 / 55.  5.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'

检测是否安装配置gltransition

root@hroot-virtual-machine:~/ffmpeg-4.2.2# ffmpeg -v 0 -filters | grep gltransitionT.. gltransition      VV->V      OpenGL blend transitions

测试gltransition是否运转成功

//创建一个文件存放素材
# cd /
# mkdir img
# cd img

root@hroot-virtual-machine:/img# ll
总用量 1248
drwxr-xr-x  2 root root   4096 7月   2 11:38 ./
drwxr-xr-x 21 root root   4096 7月   2 10:05 ../
-rw-r--r--  1 root root 185169 7月   2 10:05 1.jpg
-rw-r--r--  1 root root  67524 7月   2 10:05 2.jpg
-rw-r--r--  1 root root 149603 7月   2 10:05 3.jpg
-rw-r--r--  1 root root 188339 7月   2 10:05 4.jpg
-rw-r--r--  1 root root 176810 7月   2 10:05 5.jpg
-rw-r--r--  1 root root 487613 7月   2 10:53 bgm.m4a

查看我们下载的特效文件

root@hroot-virtual-machine:~/ffmpeg-gl-transition/gl-transitions/transitions# ll
总用量 320
drwxr-xr-x 2 root root 4096 7月   1 18:22 ./
drwxr-xr-x 6 root root 4096 7月   1 18:22 ../
-rw-r--r-- 1 root root  462 7月   1 18:22 angular.glsl
-rw-r--r-- 1 root root  752 7月   1 18:22 Bounce.glsl
-rw-r--r-- 1 root root 2593 7月   1 18:22 BowTieHorizontal.glsl
-rw-r--r-- 1 root root 2541 7月   1 18:22 BowTieVertical.glsl
-rw-r--r-- 1 root root 1908 7月   1 18:22 BowTieWithParameter.glsl
-rw-r--r-- 1 root root  245 7月   1 18:22 burn.glsl
-rw-r--r-- 1 root root  981 7月   1 18:22 ButterflyWaveScrawler.glsl
-rw-r--r-- 1 root root  485 7月   1 18:22 cannabisleaf.glsl
-rw-r--r-- 1 root root  550 7月   1 18:22 CircleCrop.glsl
-rw-r--r-- 1 root root  422 7月   1 18:22 circle.glsl
-rw-r--r-- 1 root root  408 7月   1 18:22 circleopen.glsl
-rw-r--r-- 1 root root  392 7月   1 18:22 colorphase.glsl
-rw-r--r-- 1 root root  364 7月   1 18:22 ColourDistance.glsl
-rw-r--r-- 1 root root  627 7月   1 18:22 CrazyParametricFun.glsl
-rw-r--r-- 1 root root  623 7月   1 18:22 crosshatch.glsl
-rw-r--r-- 1 root root  228 7月   1 18:22 crosswarp.glsl
-rw-r--r-- 1 root root 2396 7月   1 18:22 CrossZoom.glsl
-rw-r--r-- 1 root root 1738 7月   1 18:22 cube.glsl
-rw-r--r-- 1 root root  361 7月   1 18:22 directional-easing.glsl
-rw-r--r-- 1 root root  315 7月   1 18:22 Directional.glsl
-rw-r--r-- 1 root root  498 7月   1 18:22 directionalwarp.glsl
-rw-r--r-- 1 root root  577 7月   1 18:22 directionalwipe.glsl
-rw-r--r-- 1 root root  533 7月   1 18:22 displacement.glsl
-rw-r--r-- 1 root root 1627 7月   1 18:22 DoomScreenTransition.glsl
-rw-r--r-- 1 root root 1221 7月   1 18:22 doorway.glsl
-rw-r--r-- 1 root root  378 7月   1 18:22 Dreamy.glsl
-rw-r--r-- 1 root root 1163 7月   1 18:22 DreamyZoom.glsl
-rw-r--r-- 1 root root  413 7月   1 18:22 fadecolor.glsl
-rw-r--r-- 1 root root  136 7月   1 18:22 fade.glsl
-rw-r--r-- 1 root root  558 7月   1 18:22 fadegrayscale.glsl
-rw-r--r-- 1 root root 2231 7月   1 18:22 FilmBurn.glsl
-rw-r--r-- 1 root root  522 7月   1 18:22 flyeye.glsl
-rw-r--r-- 1 root root 2242 7月   1 18:22 GlitchDisplace.glsl
-rw-r--r-- 1 root root  607 7月   1 18:22 GlitchMemories.glsl
-rw-r--r-- 1 root root 2300 7月   1 18:22 GridFlip.glsl
-rw-r--r-- 1 root root  356 7月   1 18:22 heart.glsl
-rw-r--r-- 1 root root 1644 7月   1 18:22 hexagonalize.glsl
-rw-r--r-- 1 root root 7518 7月   1 18:22 InvertedPageCurl.glsl
-rw-r--r-- 1 root root  585 7月   1 18:22 kaleidoscope.glsl
-rw-r--r-- 1 root root  647 7月   1 18:22 LeftRight.glsl
-rw-r--r-- 1 root root  682 7月   1 18:22 LinearBlur.glsl
-rw-r--r-- 1 root root  189 7月   1 18:22 luma.glsl
-rw-r--r-- 1 root root 3812 7月   1 18:22 luminance_melt.glsl
-rw-r--r-- 1 root root  390 7月   1 18:22 morph.glsl
-rw-r--r-- 1 root root 1127 7月   1 18:22 Mosaic.glsl
-rw-r--r-- 1 root root  339 7月   1 18:22 multiply_blend.glsl
-rw-r--r-- 1 root root 1444 7月   1 18:22 perlin.glsl
-rw-r--r-- 1 root root  361 7月   1 18:22 pinwheel.glsl
-rw-r--r-- 1 root root  584 7月   1 18:22 pixelize.glsl
-rw-r--r-- 1 root root  464 7月   1 18:22 polar_function.glsl
-rw-r--r-- 1 root root  326 7月   1 18:22 PolkaDotsCurtain.glsl
-rw-r--r-- 1 root root  364 7月   1 18:22 Radial.glsl
-rw-r--r-- 1 root root  444 7月   1 18:22 randomNoisex.glsl
-rw-r--r-- 1 root root  399 7月   1 18:22 randomsquares.glsl
-rw-r--r-- 1 root root  378 7月   1 18:22 ripple.glsl
-rw-r--r-- 1 root root  878 7月   1 18:22 rotate_scale_fade.glsl
-rw-r--r-- 1 root root  348 7月   1 18:22 rotateTransition.glsl
-rw-r--r-- 1 root root  376 7月   1 18:22 SimpleZoom.glsl
-rw-r--r-- 1 root root  771 7月   1 18:22 squareswire.glsl
-rw-r--r-- 1 root root  455 7月   1 18:22 squeeze.glsl
-rw-r--r-- 1 root root 8015 7月   1 18:22 StereoViewer.glsl
-rw-r--r-- 1 root root 1539 7月   1 18:22 swap.glsl
-rw-r--r-- 1 root root  715 7月   1 18:22 Swirl.glsl
-rw-r--r-- 1 root root 4051 7月   1 18:22 tangentMotionBlur.glsl
-rw-r--r-- 1 root root  650 7月   1 18:22 TopBottom.glsl
-rw-r--r-- 1 root root  651 7月   1 18:22 TVStatic.glsl
-rw-r--r-- 1 root root 1399 7月   1 18:22 undulatingBurnOut.glsl
-rw-r--r-- 1 root root  429 7月   1 18:22 WaterDrop.glsl
-rw-r--r-- 1 root root  397 7月   1 18:22 wind.glsl
-rw-r--r-- 1 root root  274 7月   1 18:22 windowblinds.glsl
-rw-r--r-- 1 root root  299 7月   1 18:22 windowslice.glsl
-rw-r--r-- 1 root root  192 7月   1 18:22 wipeDown.glsl
-rw-r--r-- 1 root root  192 7月   1 18:22 wipeLeft.glsl
-rw-r--r-- 1 root root  192 7月   1 18:22 wipeRight.glsl
-rw-r--r-- 1 root root  192 7月   1 18:22 wipeUp.glsl
-rw-r--r-- 1 root root 1073 7月   1 18:22 ZoomInCircles.glsl

获取到绝对路径

root@hroot-virtual-machine:~/ffmpeg-gl-transition/gl-transitions/transitions# pwd
/root/ffmpeg-gl-transition/gl-transitions/transitions--------然后回到素材文件夹哪里
cd /img

开始执行测试

ffmpeg \
-t 1 -loop 1 -i 1.jpg \
-t 1 -loop 1 -i 2.jpg \
-filter_complex \
"gltransition=offset=0.5:duration=0.5:source=/root/ffmpeg-gl-transition/gl-transitions/transitions/crosswarp.glsl" \
-y out.mp4

source:后面是特效文件的绝对路径

结果发现:

root@hroot-virtual-machine:/img# ffmpeg \
> -t 1 -loop 1 -i 1.jpg \
> -t 1 -loop 1 -i 2.jpg \
> -filter_complex \
> "gltransition=offset=0.5:duration=0.5:source=/root/ffmpeg-gl-transition/gl-transitions/transitions/crosswarp.glsl" \
> -y out.mp4
ffmpeg version 4.2.2 Copyright (c) 2000-2019 the FFmpeg developersbuilt with gcc 9 (Ubuntu 9.3.0-17ubuntu1~20.04)configuration: --enable-libx264 --enable-libx265 --enable-libvpx --enable-libfdk-aac --enable-libmp3lame --enable-libopus --enable-nonfree --enable-gpl --enable-opengl --enable-filter=gltransition --extra-libs='-lGLEW -lglfw -ldl'libavutil      56. 31.100 / 56. 31.100libavcodec     58. 54.100 / 58. 54.100libavformat    58. 29.100 / 58. 29.100libavdevice    58.  8.100 / 58.  8.100libavfilter     7. 57.100 /  7. 57.100libswscale      5.  5.100 /  5.  5.100libswresample   3.  5.100 /  3.  5.100libpostproc    55.  5.100 / 55.  5.100
Input #0, image2, from '1.jpg':Duration: 00:00:00.04, start: 0.000000, bitrate: 37033 kb/sStream #0:0: Video: mjpeg (Baseline), yuvj444p(pc, bt470bg/unknown/unknown), 400x400 [SAR 1:1 DAR 1:1], 25 fps, 25 tbr, 25 tbn, 25 tbc
Input #1, image2, from '2.jpg':Duration: 00:00:00.04, start: 0.000000, bitrate: 13504 kb/sStream #1:0: Video: mjpeg (Baseline), yuvj444p(pc, bt470bg/unknown/unknown), 400x400 [SAR 1:1 DAR 1:1], 25 fps, 25 tbr, 25 tbn, 25 tbc
[AVFilterGraph @ 0x565112acce40] Error initializing filter 'gltransition' with args 'offset=0.5:duration=0.5:source=/root/ffmpeg-gl-transition/gl-transitions/transitions/crosswarp.glsl'
Error initializing complex filters.
Operation not permitted

报Error initializing filter 'gltransition'这个有问题

解决方法如下:

安装xvfb(安装过了直接跳过)

sudo apt-get -y install xvfb

然后启动xvfb(线程阻塞)

Xvfb :1 -screen 0 1280x1024x16

接着调用xvfb执行特效

env DISPLAY=:1  ffmpeg 命令

例如刚刚报错的那句:

env DISPLAY=:1 ffmpeg \-t 1 -loop 1 -i 1.jpg \-t 1 -loop 1 -i 2.jpg \-filter_complex \"gltransition=offset=0.5:duration=0.5:source=/root/ffmpeg-gl-transition/gl-transitions/transitions/crosswarp.glsl" \-y out1.mp4

执行完没有保存说明成功了,我们查看一下:

root@hroot-virtual-machine:/img# ll总用量 1336drwxr-xr-x  2 root root   4096 7月   2 11:49 ./drwxr-xr-x 21 root root   4096 7月   2 10:05 ../-rw-r--r--  1 root root 185169 7月   2 10:05 1.jpg-rw-r--r--  1 root root  67524 7月   2 10:05 2.jpg-rw-r--r--  1 root root 149603 7月   2 10:05 3.jpg-rw-r--r--  1 root root 188339 7月   2 10:05 4.jpg-rw-r--r--  1 root root 176810 7月   2 10:05 5.jpg-rw-r--r--  1 root root 487613 7月   2 10:53 bgm.m4a-rw-r--r--  1 root root  89138 7月   2 11:49 out1.mp4    (我们图片加特效合成的视频)

视频添加特效,没有EGL的一定要安装xvfb,用xvfb来添加特效

env DISPLAY=:1 执行命令一定要在前面加这个

Ffmpeg报Error initializing filter ‘gltransition‘这个有问题解决方法相关推荐

  1. IntelliJ IDEA绑定Github报Error 403: Not Authorized没有授权问题解决方法

    IEDA 绑定 GitHub 全过程演示,可以看下面的文章: IntelliJ IDEA 绑定 GitHub 实现代码版本控制实例演示,IDEA 上传.更新.同步项目到 GitHub 演示 IDEA ...

  2. repo: error: no branches ready for upload 问题解决方法

    repo: error: no branches ready for upload 问题解决方式 前两天在使用 #git add . #git commit #repo upload . repo u ...

  3. 【干货】S7-PLCSIM Advanced V3.0 无法启动实例( Error Code:-30,LicenseNotFound)问题解决方法

    问题:S7-PLCSIM Adavanced V3.0 无法启动实例( Error Code:-30,LicenseNotFound) 综合网上所有答案,现将该问题的解决方法总结如下: 1.首先需要确 ...

  4. Message: unknown error: Chrome failed to start: crashed问题解决方法

    在使用selenium自动化工具打开chrome浏览器的时候出现了以下的问题 Message: unknown error: Chrome failed to start: crashed 我的解决方 ...

  5. python pip时遇到ERROR:Cannot unpack file xxx的问题解决方法

    这个问题是因为python的源服务器在国外,下载过慢. 以下载 tensorflow 为例,操作 pip install tensorflow,有可能会出现ERROR:Cannot unpack fi ...

  6. React引入组件并使用 但系统一直报错说引入但没有使用 (问题解决方法)

    先来看一下我遇到的问题 这里明显使用了这个组件 但系统一直报错 说我们没有使用 react应用遇到这种问题 将首字母改成大写就解决了 认真确认后 简单说 就是将首字母改成大写 项目就可以跑起来 挺奇葩 ...

  7. Android studio中R类变成红色且文件报错无法实现最终效果的问题解决方法。

    在Android Studio中java包中,资源编译错误会有时一直存在或莫名其妙地出现.如遇到这种情况,请尝试如下操作.                                       ...

  8. 解决pytorch多进程ValueError: Error initializing torch.distributed using env:// rendezvou...报错

    完整报错为:ValueError: Error initializing torch.distributed using env:// rendezvous: environment variable ...

  9. Windows11 Android Srudio无法连接手机,报错Error initializing ADB: Unable to create Debug Bridge

    1. 问题描述 手机确认开启了开发者模式后,Android Studio设备连接显示不出手机 Android Studio报错: Error initializing ADB: Unable to c ...

最新文章

  1. leetcode--电话号码和字母组合--python
  2. spring外部化配置
  3. Compiling: main.cpp /bin/sh: g++: not found
  4. Git历险记(四)——索引与提交的幕后故事
  5. 数学基础学习随笔--序言
  6. 算法--2016搜狐面试:搜狐员工放假了,都玩什么?
  7. 17 种经典图表总结,轻松玩转数据可视化!
  8. 关于python类的继承正确的说法是_2017美团点评的运维岗校招笔试题,测测你会几题?...
  9. 一个小故事,玩转Python-while循环
  10. 计算机专业应届生年薪30多万,制造焦虑,非广告,请看截图
  11. 怎么打断点_孩子注意力不集中怎么办?7招提升儿童专注力,方法简单效果好...
  12. linux 提取执行命令后的输出 shell脚本
  13. OpenCV2+入门系列(一):OpenCV2.4.9的安装与测试
  14. 《货币金融学》期末复习题
  15. 关于U盘格式化以后容量突然减少很多的解决办法
  16. 卸载office2010后 再安装2013 错误1706 安装程序找不到需要的文件
  17. oracle删除不了同义词,删除同义词,百科如何删除同义词项
  18. 最好用的开源免费笔记软件IdeaNote
  19. 洛谷-P1425-小鱼的游泳时间
  20. 5G时代下催生了云电脑,云电脑带来了什么?

热门文章

  1. Beautifulsoup爬取起点中文网 保存到mysql
  2. I2S音频总线学习(二)I2S总线协议
  3. 删除win10系统默认微软输入法
  4. 台式计算机怎么进入bios,小编告诉大家hp台式机怎么进bios
  5. 热门在线项目管理工具
  6. 【我在异世界学Linux】认识冯诺依曼体系结构
  7. 沪漂程序员的两年,终说再见,你会不会是下一个离开的人?
  8. ## 错误:ora-01922 解决方案
  9. axios下载压缩包的处理方式
  10. 关于传奇皓月GOM引擎登录器配置与生成完整教程