GithubHelp home page GithubHelp logo

onlyet / nanarecorder Goto Github PK

View Code? Open in Web Editor NEW
74.0 3.0 30.0 114.89 MB

A screen recorder based on Qt and FFmpeg(基于Qt+FFmpeg的录屏软件)

License: MIT License

C++ 5.22% C 94.55% Batchfile 0.01% CMake 0.23%
ffmpeg qt screen-recorder cpp vs linux windows screen-capture video-recording

nanarecorder's Introduction

English version

基于Qt+FFmpeg的录屏软件NanaRecorder

UI

QQ截图20230119022010

录制流程

flowchart

主线程:UI线程,调用Recorder接口
采集线程:采集到帧后->格式转换/重采样->写进FIFO
编码复用线程:循环从FIFO读取帧->编码->写进文件

环境依赖

windows

VS:推荐VS2017以后的版本
Qt:推荐Qt5.12以后的版本
FFmpeg5.1(项目已包含,生成项目后dll会自动拷贝到exe目录)

我的开发环境

  • VS2022
  • Qt5.12.9

解决方案支持Debug/Release和Win32/x64

VS+Qt开发环境配置

linux

我的开发环境

  • Qt6.2.4
  • FFmpeg5.1.2

注意: 目前linux下录音用到了PulseAudio,ffmpeg默认是不支持PulseAudio的,所以要手动编译ffmpeg,./configure时添加--enable-libpulse,具体编译参考如下文档
ffmpeg build reference

需要在CMakeLists.txt里修改Qt和FFmpeg的依赖路径

  • QT_PATH
  • FFMPEG_ROOT_DIR(你编译的ffmpeg根目录)

构建

mkdir build && cd build
cmake ..
make -j4

运行app

  1. 直接用Qt Creator运行
  2. 命令行启动:../bin/NanaRecorder

TODO

  • 画质高,文件小,码率低
  • flush编码器
  • 支持同时录制扬声器和麦克风
  • 支持硬编码

nanarecorder's People

Contributors

onlyet 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

Watchers

 avatar  avatar  avatar

nanarecorder's Issues

Please add license information

Please add license information for the source code.
Without a license, the default copyright laws apply, meaning that you retain all rights to your source code and no one may reproduce, distribute, or create derivative works from your work.

没有音频啊

//vCurPts = pkt.pts; 这句取消注释后,视频的帧率就有问题,期待回复

Project could not opened with visual studio。

here is the log :
RecordCore\RecordCore.vcxproj : error : 找不到导入的项目“.\Compressed\ScreenCapture-1-master\RecordCore\QtMsBuild\Qt.props”。请确认 Import 声明“.\Compressed\ScreenCapture-1-master\RecordCore\QtMsBuild\Qt.props”中的表达式正确,且文件位于磁盘上。 .\Compressed\ScreenCapture-1-master\RecordCore\RecordCore.vcxproj

please help to fix it!

使用摄像头录制视频音频不同步

发现录制视频音频不同步后,尝试使用:
if (av_compare_ts(m_vCurPts, m_vEncodeCtx->time_base,
m_aCurPts, m_aEncodeCtx->time_base) <= 0)对比时间戳的方法进行同步。

其中:m_vCurPts和m_aCurPts在将pts从编码层的timebase转成复用层的timebase前进行赋值操作。

依然出现视频音频不同步的问题。

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.