当前位置:网站首页>ffmpeg录制屏幕和截屏
ffmpeg录制屏幕和截屏
2022-07-03 03:23:00 【水w】
本篇是在ffmpeg已经下载安装的前提下,是接着上一篇ffmpeg下载安装教程及介绍_水w的博客-CSDN博客
目录
2、两段视频先后播放拼接:把两个视频文件前后拼接为一个视频文件
1、录制无声音视频
(1)打开cmd,输入命令,
ffmpeg -f gdigrab -i desktop -pix_fmt yuv420p .\out.mp4
(2)命令运行完成之后,我们按照路径找到视频,打开生成的视频,
注意:生成视频的默认保存路径是在命令所在文件夹下,
eg:我是在C:\user\水\下执行的cmd命令,因此视频生成之后就会被保存在该路径下。
2、两段视频先后播放拼接:把两个视频文件前后拼接为一个视频文件
(1)打开记事本,新建一个“videolist.txt”文件,里面要写入将要拼接的视频,
此时文件夹的结构为:
(2) 在文件夹下打开cmd,输入命令,
ffmpeg.exe -f concat -i video/videolist.txt joinoutput.mp4
注意: 我是在D:\ffmpeg-5.0.1-essentials_build文件夹下(将要拼接的视频在该路径下的video文件夹里),打开cmd,输入命令,
(3)命令运行完成之后,我们按照路径找到视频,打开生成的视频,
3、两段视频同时播放,左右同时显示,且中间的分隔为红色背景
(1)打开cmd,输入命令,
ffmpeg -i video\out.mp4 -i video\out1.mp4 -filter_complex "pad=4000:1080:color=red[x0];[0:v]scale=w=1920:h=1080[inn0];[x0][inn0]overlay=0:0[x1];[1:v]scale=w=1920:h=1080[inn1];[x1][inn1]overlay=2000:0" out14.mp4
(2)命令运行完成之后,我们按照路径找到视频,打开生成的视频,
4、两段视频同时播放,上下同时显示
(1)打开cmd,输入命令,
ffmpeg -i video\out.mp4 -i video\out1.mp4 -filter_complex "pad=1920:2160:color=green[x0];[0:v]scale=w=1920:h=1080[inn0];[x0][inn0]overlay=0:0[x1];[1:v]scale=w=1920:h=1080[inn1];[x1][inn1]overlay=0:1080" out15.mp4
(2)命令运行完成之后,我们按照路径找到视频,打开生成的视频,
5、截屏指定区域
(1)打开cmd,输入命令,
ffmpeg -f gdigrab -s 500x500 -offset_x 100 -offset_y 100 -i desktop -frames:v 1 test.png
(2)命令运行完成之后,我们按照路径找到截图,打开生成的截图,
6、录制屏幕 指定桌面区域
(1)打开cmd,输入命令,
ffmpeg.exe -r 1 -f gdigrab -s 500x500 -offset_x 100 -offset_y 100 -i desktop -vcodec libx264 a.mp4
(2)命令运行完成之后,我们按照路径就可以找到生成的视频了,
7、录制屏幕指定区域 裁剪已有视频
思路:将已有的视频文件截取指定区域
(1)打开cmd,输入命令,
ffmpeg -i 0614.mp4 -vf crop=200:200:0:0 0614-1.mp4
(2)命令运行完成之后,我们按照路径就可以找到生成的视频了,
边栏推荐
- Find the storage address of the elements in the two-dimensional array
- 解决高并发下System.currentTimeMillis卡顿
- MySQL practice 45 [global lock and table lock]
- Bid farewell to artificial mental retardation: Mengzi open source project team received RMB 100 million financing to help NLP develop
- 【PyG】理解MessagePassing过程,GCN demo详解
- Small guide for rapid formation of manipulator (VIII): kinematic modeling (standard DH method)
- ffmpeg下载安装教程及介绍
- 从输入URL到页面展示这中间发生了什么?
- 监听对象中值变化及访问
- BigVision代码
猜你喜欢
随机推荐
Limit of one question per day
The difference between static web pages and dynamic web pages & the difference between Web1.0 and Web2.0 & the difference between get and post
UMI route interception (simple and rough)
Mongodb master profile
Limit of one question per day
docker安装及启动mysql服务
Mongodb installation & Deployment
Bigvision code
The calculation of stripe, kernel and padding in CNN
New programmers use the isXXX form to define Boolean types in the morning, and are discouraged in the afternoon?
静态网页 和 动态网页的区别 & WEB1.0和WEB2.0的区别 & GET 和 POST 的区别
Lvgl usage experience
MySql實戰45講【SQL查詢和更新執行流程】
3D drawing example
MySQL Real combat 45 [SQL query and Update Execution Process]
Vs 2019 configuration du moteur de génération de tensorrt
文件重命名
MongoDB簡介
Nasvit: neural architecture search of efficient visual converter with gradient conflict perception hypernetwork training
Pytorch配置