FFmpeg 命令:从入门到精通 | ffmpeg 命令视频录制

1 FFmpeg从入门到精通-FFmpeg简介 1.FFmpeg简介 1.1 FFmpeg的定义 1.2 FFmpeg的历史 1.3 FFmpeg的基本组成 1.4 FFmpeg的编解码工具ffmpeg 1.5 FFmpeg的播放器ffplay 1.6 FFmpeg的多媒体分析器ffprobe 1.7 FFmpeg编译(1)FFmpeg之Windows平台编译(2)FFmpeg之Linux平台编译(3)FFmpeg之OS X平台编译 1.8 FFmpeg编码支持与定制(1)FFmpeg的编码器支持(2)FFmpe 阅读详情
AI摘要

本文详细介绍了如何使用FFmpeg命令进行音视频录制,包括安装ScreenCapturerRecorder,查看可用设备,以及指定参数如视频分辨率、编码格式和帧率等。,

FFmpeg 命令:从入门到精通 | ffmpeg 命令视频录制

本节主要介绍了ffmpeg 命令进行音视频录制的方法,并列举了一些例子。

安装软件:Screen Capturer Recorder

项目地址:on screen capture recorder to video free Files

安装最新版本:

在这里插入图片描述

安装软件:

在这里插入图片描述

查看可用设备名字

完成安装后,我们可以在命令行输入以下命令查看电脑的可用设备名字:

ffmpeg -list_devices true -f dshow -i dummy

输出以下结果:

[dshow @ 000001e3fded3800] "Integrated Camera" (video)
[dshow @ 000001e3fded3800]   Alternative name "@device_pnp_\\?\usb#vid_13d3&pid_56a6&mi_00#6&1c1093a4&1&0000#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\global"
[dshow @ 000001e3fded3800] "screen-capture-recorder" (video)
[dshow @ 000001e3fded3800]   Alternative name "@device_sw_{860BB310-5D01-11D0-BD3B-00A0C911CE86}\{4EA69364-2C8A-4AE6-A561-56E4B5044439}"
[dshow @ 000001e3fded3800] "OBS Virtual Camera" (video)
[dshow @ 000001e3fded3800]   Alternative name "@device_sw_{860BB310-5D01-11D0-BD3B-00A0C911CE86}\{A3FCE0F5-3493-419F-958A-ABA1250EC20B}"
[dshow @ 000001e3fded3800] "麦克风 (Realtek(R) Audio)" (audio)
[dshow @ 000001e3fded3800]   Alternative name "@device_cm_{33D9A762-90C8-11D0-BD43-00A0C911CE86}\wave_{E35D34C8-3763-4470-BDFF-5999B6DB4347}"
[dshow @ 000001e3fded3800] "virtual-audio-capturer" (audio)
[dshow @ 000001e3fded3800]   Alternative name "@device_sw_{33D9A762-90C8-11D0-BD43-00A0C911CE86}\{8E146464-DB61-4309-AFA1-3578E927E935}"
[dshow @ 000001e3fded3800] "立体声混音 (Realtek(R) Audio)" (audio)
[dshow @ 000001e3fded3800]   Alternative name "@device_cm_{33D9A762-90C8-11D0-BD43-00A0C911CE86}\wave_{159589C7-204D-4C6C-8804-B576E8B7DC6C}"
dummy: Immediate exit requested

其中:

  • “Integrated Camera”:笔记本摄像头
  • “screen-capture-recorder”:录制桌面的设备
  • “麦克风 (Realtek® Audio)”:麦克风
  • “virtual-audio-capturer”:录制系统声音的设备

音视频录制

录制视频(默认参数)

桌面:

ffmpeg -f dshow -i video="screen-capture-recorder" v-out.mp4 

摄像头:

ffmpeg -f dshow -i video="Integrated Camera" -y v-out2.flv

注:要根据自己摄像头名称。

录制声音(默认参数)

系统声音:

ffmpeg -f dshow -i audio="virtual-audio-capturer" a-out.aac

注:Ctrl + C 退出录制。

系统 + 麦克风声音:

ffmpeg -f dshow -i audio="麦克风 (Realtek(R) Audio)" -f dshow -i audio="virtual-audio-capturer" -filter_complex amix=inputs=2:duration=first:dropout_transition=2  a-out2.aac

注:要根据自己麦克风名称。

同时录制系统 + 麦克风声音和视频(默认参数)

ffmpeg -f dshow -i audio="麦克风 (Realtek(R) Audio)" -f dshow -i audio="virtual-audio-capturer" -filter_complex amix=inputs=2:duration=first:dropout_transition=2 -f dshow -i video="screen-capture-recorder"  -y av-out.flv

查看视频录制的可选参数

查看 screen-capture-recorder 相关参数:

ffmpeg -f dshow -list_options true -i video="screen-capture-recorder"

输出:

[dshow @ 0000023f4f3a3740] DirectShow video device options (from video devices)
[dshow @ 0000023f4f3a3740]  Pin "Capture" (alternative pin name "1")
[dshow @ 0000023f4f3a3740]   pixel_format=bgr0  min s=1x1 fps=0.02 max s=1920x1080 fps=30
[dshow @ 0000023f4f3a3740]   pixel_format=bgr0  min s=1x1 fps=0.02 max s=1920x1080 fps=30
[dshow @ 0000023f4f3a3740]   pixel_format=bgr24  min s=1x1 fps=0.02 max s=1920x1080 fps=30
[dshow @ 0000023f4f3a3740]   pixel_format=rgb555le  min s=1x1 fps=0.02 max s=1920x1080 fps=30
[dshow @ 0000023f4f3a3740]   pixel_format=rgb555le  min s=1x1 fps=0.02 max s=1920x1080 fps=30
[dshow @ 0000023f4f3a3740]   pixel_format=rgb8  min s=1x1 fps=0.02 max s=1920x1080 fps=30
[dshow @ 0000023f4f3a3740]   pixel_format=yuv420p  min s=1x1 fps=0.02 max s=1920x1080 fps=30
[dshow @ 0000023f4f3a3740] Could not find output pin from video capture device.
video=screen-capture-recorder: I/O error

查看音频录制的可选参数

查看 virtual-audio-capturer 相关参数:

ffmpeg -f dshow -list_options true -i audio="virtual-audio-capturer"

输出:

[dshow @ 0000024b7e113740] DirectShow audio only device options (from audio devices)
[dshow @ 0000024b7e113740]  Pin "Capture Virtual Audio Pin" (alternative pin name "1")
[dshow @ 0000024b7e113740]   ch= 2, bits=16, rate= 48000
audio=virtual-audio-capturer: Immediate exit requested

查看 麦克风 (Realtek(R) Audio) 相关参数:

ffmpeg -f dshow -list_options true -i audio="麦克风 (Realtek(R) Audio)"

输出:

[dshow @ 00000260768b3700] DirectShow audio only device options (from audio devices)
[dshow @ 00000260768b3700]  Pin "Capture" (alternative pin name "Capture")
[dshow @ 00000260768b3700]   ch= 2, bits=16, rate= 44100
    Last message repeated 1 times
[dshow @ 00000260768b3700]   ch= 1, bits=16, rate= 44100
[dshow @ 00000260768b3700]   ch= 2, bits=16, rate= 32000
[dshow @ 00000260768b3700]   ch= 1, bits=16, rate= 32000
[dshow @ 00000260768b3700]   ch= 2, bits=16, rate= 22050
[dshow @ 00000260768b3700]   ch= 1, bits=16, rate= 22050
[dshow @ 00000260768b3700]   ch= 2, bits=16, rate= 11025
[dshow @ 00000260768b3700]   ch= 1, bits=16, rate= 11025
[dshow @ 00000260768b3700]   ch= 2, bits=16, rate=  8000
[dshow @ 00000260768b3700]   ch= 1, bits=16, rate=  8000
[dshow @ 00000260768b3700]   ch= 2, bits= 8, rate= 44100
[dshow @ 00000260768b3700]   ch= 1, bits= 8, rate= 44100
[dshow @ 00000260768b3700]   ch= 2, bits= 8, rate= 22050
[dshow @ 00000260768b3700]   ch= 1, bits= 8, rate= 22050
[dshow @ 00000260768b3700]   ch= 2, bits= 8, rate= 11025
[dshow @ 00000260768b3700]   ch= 1, bits= 8, rate= 11025
[dshow @ 00000260768b3700]   ch= 2, bits= 8, rate=  8000
[dshow @ 00000260768b3700]   ch= 1, bits= 8, rate=  8000
[dshow @ 00000260768b3700]   ch= 2, bits=16, rate= 48000
[dshow @ 00000260768b3700]   ch= 1, bits=16, rate= 48000
[dshow @ 00000260768b3700]   ch= 2, bits=16, rate= 96000
[dshow @ 00000260768b3700]   ch= 1, bits=16, rate= 96000
audio=麦克风 (Realtek(R) Audio): Immediate exit requested

指定参数录制音视频

ffmpeg -f dshow -i audio="麦克风 (Realtek(R) Audio)" -f dshow -i audio="virtual-audio-capturer" -filter_complex amix=inputs=2:duration=first:dropout_transition=2 -f dshow -video_size 1920x1080 -framerate 15 -pixel_format yuv420p  -i video="screen-capture-recorder" -vcodec h264_qsv  -b:v 3M  -y av-out.flv
ffmpeg -f dshow -i audio="麦克风 (Realtek(R) Audio)" -f dshow -i audio="virtual-audio-capturer" -filter_complex amix=inputs=2:duration=first:dropout_transition=2 -f dshow -i video="screen-capture-recorder" -vcodec h264_qsv  -b:v 3M -r 15 -y av-out2.mp4
ffmpeg -f dshow -i audio="麦克风 (Realtek(R) Audio)" -f dshow -i audio="virtual-audio-capturer" -filter_complex amix=inputs=2:duration=first:dropout_transition=2 -f dshow -framerate 15 -pixel_format yuv420p -i video="screen-capture-recorder" -vcodec h264_qsv  -b:v 3M -r 15 -y av-out3.mp4

参数:

  • -video_size:视频大小
  • -vcodec:视频编码格式
  • -framerate:视频帧率
  • -pixel_format:视频像素格式
  • -b:v:视频码率
  • -r:帧率
ffmpeg录屏命令 同时录制系统声音+麦克风时会有回音,因为同样的系统音频在外放后被录制了两次。“麦克风 Realtek High Definition Au” 麦克风。参数调整视频质量,取值范围是0.01-255,设置的数值越小,则越清晰。“virtual-audio-capturer” 系统声音。“screen-capture-recorder” 屏幕。“USB Camera” 显然是我的摄像头。缺点只能录制视频,不能录制音频。录制屏幕+系统声音+麦克风。1.gdigrab抓屏。 阅读详情

相关推荐

基于FFmpeg和Screen Capturer Recorder实现屏幕和声音的录制

当我们看到一些精彩的视频画面,但无法下载时,可以通过录屏的方式将视频和音频录制下来。 这个时候我们需要安装采集视频和音频的工具screen-capture-recorder。 以下是在windows10环境下,基于FFmpeg和Screen Capturer Recorder实现屏幕和声音的同步录制。

sinat_37967865的博客 3172

FFmpeg功能命令集合(超详细)

参考ffmpeg常用命令ffmpeg参数中文详细解释[总结]FFMPEG视音频编解码零基础学习方法 一、安装 打开https://ffmpeg.zeranoe.com/builds/,该网站中的FFMPEG分为3个版本:Static,Shared,Dev。 前两个版本可以直接在命令行中使用,他们的区别在于:Static里面只有3个应用程序:ffmpeg.exe,ffplay.exe,ffpr...

hopelgl的博客 1万+

ffmpeg录制屏幕和截屏

录制屏幕和截屏

水w的博客 7034

ffmpeg录屏

ffmpeg命令录屏

daqinzl的专栏 2384

使用ffmpeg命令实现录制摄像头和麦克风

因为我的业务中面对用户比较复杂,摄像头也是五花八门,有4k的、有1080p的、还有更低的或者更高分辨率的,我拿了一个4K的摄像头录制了一下,发现录制的文件大小差不多将近1秒1M,如果时间长很占硬盘存储,于是我决定优化一下,我的想法就是我默认设定最大就是1920*1080分辨率,可以比1920*1080小但是不能超过,添加了。但是和上次一样,不知道其他博主有没有亲自尝试过还是直接复制过来的,复制到我的设备基本上没有能用得,接下来我就把我得经验给大家分享一下,大家共同努力共同进步!0x80004005。

Delevy的博客 1959

Ubuntu系统腾讯会议使用ffmpeg屏幕录制+声音录制

1.腾讯会议for Linux简介 经过一段时间的开发,腾讯终于搞定了Linux系统下的腾讯会议,腾讯会议目前可以进行远程视频对话,桌面远程展示等等功能,与Windows差异并无两样。但是也存在着一些问题。腾讯会议并没有录制视频的功能。所以对于Linux系统我们采用另外的一种方式进行录制. 2.录制方法 使用ffmpeg库首先需要安装对应的软件.可以从Ubuntu 软件源下载对应所需要的软件包 apt search ffmpeg 找到对应的libffmpeg库以及ffmpeg使用软件就可以下载了 sudo

MobtgZhang的博客 5417

【FFmpeg】音视频录制 ① ( 查询系统中 ffmpeg 可录制的音视频输入设备 | 使用 ffmpeg 命令录制音视频数据 | 录制视频数据命令 |录制音频数据| 同时录制音频和视频数据命令 )

一、查询系统中 ffmpeg 可录制的音视频输入设备 二、使用 ffmpeg 命令录制音视频数据 1、录制视频数据命令 2、录制音频数据命令 3、同时录制音频和视频数据命令

让 学习 成为一种 习惯 ( 韩曙亮 の 技术博客 ) 7023

FFmpeg视频录制详解

以上对象初始化完成后,需要将codec的信息拷贝到AVFormatContext对象中,以便与将编码器信息存储到文件中,这个操作可以通过avcodec_parameters_from_context操作。注意,有些编码器只支持一些固定的帧率,对于这样的编码器,AVCodecContext中的time_base是不能随便设置的,当写文件头失败时,可以检查一下这一点。(1).初始化ffmpeg的基本对象,并将这些对象关联起来,然后打开文件并写入文件头。av_write_frame用于将编码后的数据写入文件。

程序猿老樊的博客 1929

ffmpeg 录制屏幕

ffmpeg 录制屏幕步骤1、ffmpeg 下载2、screen capture recorder 下载3、ffmpeg 录屏命令4、ffmpeg 其他命令后续 1、ffmpeg 下载 简介: FFmpeg是一套可以用来记录、转换数字音频、视频,并能将其转化为流的开源计算机程序。它包括了目前领先的音/视频编码库libavcodec。 FFmpeg是在 Linux 下开发出来的,但它可以在包括 Windows 在内的大多数操作系统中编译。这个项目是由 Fabrice Bellard 发起的,现在由 Mic

爱看书的小沐 1万+

rk3399 hdmi HDCP key烧录

1.key转换 使用 hdcp\ProvisioningTool_20170526\KeyConverterV2.02 目录下的KeyConvertor.exe工具将1.4key进行转换 转换后得到 TX00000001.skf 文件,将 TX00000001.skf 文件烧录到开发板上,烧录方式: 打开文件 hdcp\ProvisioningTool_20170526\ProvisioningTool20170526\ProvisioningTool.exe 选择烧录方式与烧录路...

qq_32645109的博客 3874

单细胞分析(五)——使用Harmony进行数据整合和去批次

为了保证单细胞RNA测序数据的准确性和可靠性,需要对数据进行样本去批次处理。去批次的方法包括Harmony,SeuratV3等,这些方法可以有效地消除批次效应和技术噪声,并提高单细胞RNA测序数据的质量,为后续的数据分析提供更加可靠的基础。

阅读文献,记录学习笔记 3万+

【FFmpeg】音视频录制 ③ ( 使用 ffmpeg 录制 Screen Capturer Recorder 软件生成的虚拟音视频设备 | 录制桌面 | 录制音频 | 同时录制 音频和视频数据 )

一、Screen Capturer Recorder 生成的虚拟音视频设备 1、Screen Capturer Recorder 生成的虚拟音视频设备 2、查看上述虚拟音视频设备 二、使用 ffmpeg 录制 Screen Capturer Recorder 软件生成的虚拟音视频设备 1、录制桌面 2、录制音频 3、录制多路音频 - 配置 filter_complex 混音参数 4、同时录制 系统音频 + 桌面视频 5、同时录制 系统音频 + 麦克风音频 + 桌面视频

让 学习 成为一种 习惯 ( 韩曙亮 の 技术博客 ) 9226

DRAM 埋入式字线(Buried Wordline)技术深度解析:从二维平面到三维凹槽

埋入式字线(bWL)及其核心的埋入式沟道阵列晶体管(BCAT)架构,无疑是 DRAM 发展史上的一次关键性革命。它在约 40nm 技术节点被行业主流采纳,成功地帮助 DRAM 产业克服了传统平面晶体管的物理缩放极限。力挽狂澜的续命技术:bWL 通过引入三维沟道结构,从根本上解决了由短沟道效应和漏电流失控引发的数据保持危机,为经典的 1T1C(单晶体管 - 单电容)DRAM 单元架构延续了超过十年的生命力。协同优化的基石技术。

m0_37606066的博客 3380

FFmpeg视频录制(Windows)

FFmpeg视频录制(Windows)

qq_41682323的博客 1690

IOS APP上架被拒 4.3(a) - Design - Spam,成功

成功解决IOS APP上架被拒 4.3(a) - Design - Spam,本篇博客记录了详细过程

qq_40147106的博客 6938

LangGraph的容错机制:从节点失败到图级回滚

核心概念铺垫:讲解LLM应用容错与事务性的核心概念(幂等性、重试策略、降级策略、快照、回滚、原子性、一致性、隔离性、持久性、最终一致性),对比LangGraph容错机制与传统数据库ACID事务、Apache Airflow/Kubernetes Workflow/Kubeflow Pipelines容错机制的异同;LangGraph容错机制的演进历史:用markdown表格梳理LangGraph从0.0.1到1.5.0(截止202X年X月)的容错机制发展历程;节点级别的容错:重试与降级。

AI Python 编程之道的博客 184

FFmpeg——使用Canvas录制视频尚存问题的解决方案

本文介绍了一个非常强大的多媒体视频处理工具FFmpeg,我们可以使用它解决Canvas录制视频时存在的各种问题...

HuoZhiyan 的博客 3483

claude code desktop中出现Doesn‘t look like an Anthropic model - expected a gateway model route 解决方案

本文主要介绍了claude code desktop中出现Doesn’t look like an Anthropic model - expected a gateway model route referencing an Anthropic model和Server is busy. Retrying的解决方案,希望能对使用claude code desktop的同学们有所帮助。 文章目录 1. 问题描述 2. 解决方案

weixin_43178406的博客 10万+

FFMPEG常用的一些命令介绍:音频录制、视频录制

1.视频和音频单独抓取 如果指定输入格式和设备,则ffmpeg可以直接捕获视频和音频。Linux下捕获摄像头的数据保存成视频文件: 参数介绍:-s 指定摄像头输出的图像尺寸-i 摄像头的设备节点test.mp4 是保存的视频文件名称-f video4linux2是指定框架2. Linux下捕获声卡的数据保存成音频文件: 列出当前主机上的声卡设备: 使用arecord -L命令列出了声卡名字之后,就可以选择指定声卡录制声音,其中front:xxx 就是声卡的名字。选择指定的声卡录制声音示例:

Lce的专栏 5291

IP-Guard分类管理详解

大家都知道在配置IPGUARD策略前需要做分类库进行设置和分类。 1、应用程序:可以分类,例如上班时间只能用OFFICE和WPS,记事本等办公软件,可以在分类里设置一个类 ;办公软件,在未分类里找到OFFICE,WPS等拖入心建的分类里就可以在配置策略里调用。 2、网站分类也不一样,可以按照自己方式自定义。也可以导入厂家已经收集到的网站分类。 3、邮箱分类:可以提前定义好一个或...

IP-Guard专栏 598

国科大作业考试资料《人工智能原理与算法》2024新编-第三次作业整理

1. 你的目标是让机器人走出迷宫。机器人面朝北,开始位置在迷宫中间。你可以让机器人转向面朝东、南、西或北。你可以让机器人向前走一段距离,在撞墙之前它会停步。 (1)将问题形式化。状态空间有多大? (2)在迷宫中游走,在两条路或更多路交叉的路口可以转弯。重新形式化这个问题。现在状态空间有多大? (3)从迷宫的任一点出发,我们可以朝四个方向中的任一方向前进直到可以转弯的地方,而且我们只需要这样做。重新对这个问题进行形式化。我们需要记录机器人的方向吗? 2. 传教士和野人问题

MatsumotoChrikk 998

使用ffmpeg调用摄像头录制视频(C#)

本文通过往cmd控制台输入命令的方式实现视频的录制,具体的命令可以参考文章https://blog.csdn.net/zhoubotong2012/article/details/79338093的1前半部分 步骤: 1 下载ffmpeg.exe工具(一定要看准位数,本机测试下载的是64位的) 下载地址:http://www.ffmpeg.org/download.html 然后打开新的界面,如下图: 下载完毕后,找到里面的ffmpeg.exe工具 2 打开cmd窗口,并...

zxy13826134783的博客 6807

LinePhone3.2.7(android端最新版本) sip客户端

SIP客户端For android:LinePhone3.2.7(最新版本),官网地址:http://www.linphone.org/

ffmpeg音视频开发从入门到精通——ffmpeg编译常用目录及命令(二)

map 可用于处理复杂输出,如可以将指定的多路流输出到一个输出文件,也可以指定输出到多个文件。类似地,文件内的流被它们的索引引用。一个复杂的过滤器图的一个简单的例子是覆盖过滤器,它有两个视频输入和一个视频输出,包含一个视频叠加在另一个上面。ffmpeg 通过 -i 选项读取输任意数量的输入“文件”(可以是常规文件,管道,网络流,抓取设备等,并写入任意数量的输出“文件”。简单的过滤器图是那些只有一个输入和输出,都是相同的类型。请注意,此选项是全局性的,因为复杂的过滤器图形本质上不能与单个流或文件明确关联。

swpucwf的博客 1258

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

visio安装包

Microsoft Office Visio 是一款专业的制图软件。利用经过更新的形状、协作工具和数据链接图表,创建专业级图表以简化复杂的信息。

ffmpeg录制视频功能

为什么需要同时用 AVFormatContext 和 AVIOContext虽然 AVFormatContext 和 AVIOContext 都涉及到数据处理,但它们的职责不同,且在数据处理流程中互补:AVFormatContext:管理文件的格式和流信息。它负责描述文件的结构,包括音频、视频、字幕等流的元数据。AVIOContext:处理实际的数据读写操作。它负责将数据从源读取或写入目标。在实际应用中,AVFormatContext 需要一个。

qq_61422622的博客 2416

精雕软件(JDpaint) 5.5 绿色版

精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版

FFmpeg 命令:从入门到精通 | ffmpeg filter(过滤器 / 滤镜)

FFmpeg 命令:从入门到精通 | ffmpeg filter(过滤器 / 滤镜)

ProgramNovice的博客 2642

linux 下 FFmpeg 录制命令

linux 下 FFmpeg 录制命令 转载自:http://blog.topspeedsnail.com/archives/1325 录制屏幕(mkv格式): ffmpeg -f x11grab -r 30 -i :0.0 -f alsa -i hw:0,0 -acodec flac -vcodec ffvhuff out.mkv 1 ffmpeg -f x11grab -r 30 -i :0....

weixin_40702664的博客 2739
上一篇: FFmpeg 命令:从入门到精通 | ffmpeg 命令图片和视频转换
下一篇: FFmpeg 命令:从入门到精通 | ffmpeg 命令直播
UestcXiye
博客等级 码龄8年 9048粉丝 1306原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

UestcXiye

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值