# FrameCapture **Repository Path**: AndroidCoderPeng/FrameCapture ## Basic Information - **Project Name**: FrameCapture - **Description**: 画面采集+FFmpeg编码,Tcp传输 - **Primary Language**: C++ - **License**: MulanPSL-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-02-08 - **Last Updated**: 2026-03-16 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # FrameCapture A screen frame capture and H.264 encoding transmission system based on Qt and OpenCV. ## Project Overview FrameCapture is a real-time solution for screen frame capture, encoding, and transmission. This project uses the Qt framework to build a graphical interface, combines OpenCV for image processing, and transmits video streams to TCP clients via a custom H.264 encoder. ## Features - **Real-time Frame Capture**: Supports both continuous capture and single-frame capture modes - **H.264 Video Encoding**: Efficient H.264 video compression - **TCP Data Transmission**: Supports TCP server mode to transmit encoded video streams to clients - **Real-time Preview**: Displays captured frames in the main window - **Flexible Control**: Supports starting and stopping frame capture operations ## System Architecture ### Core Components 1. **FrameCapture** (`framecapture.cpp/hpp`) - Core frame capture class - Provides methods `start()`, `captureOnce()`, and `stop()` to control the capture process - Responsible for acquiring image frames from the source 2. **FrameEncoder** (`frameencoder.cpp/hpp`) - H.264 video encoder - Receives raw frames and performs H.264 encoding - Handles video compression and packaging 3. **MainWindow** (`mainwindow.cpp/hpp`) - Main window interface - Manages TCP server connections - Handles client connections and video stream transmission - Integrates real-time preview functionality 4. **PreviewWorker** (`previewworker.cpp/hpp`) - Preview image processing worker class - Responsible for rendering preview of frame data ## System Requirements - Qt 5.x or higher - OpenCV library - C++11-compatible compiler - CMake or qmake build system ## Build Instructions 1. Ensure that Qt and OpenCV development environments are installed 2. Generate the project file using qmake: ```bash qmake FrameCapture.pro ``` 3. Compile the project: ```bash make ``` ## Usage 1. After launching the application, the main window will display the preview interface 2. Click the "Start Listening" button to start the TCP server 3. Once a client connects to the server, video stream transmission begins automatically 4. Use control buttons to manage frame capture operations ## File Overview | File | Description | |------|-------------| | `main.cpp` | Program entry point | | `mainwindow.ui` | Qt Designer interface file | | `framecapture.cpp/hpp` | Frame capture implementation | | `frameencoder.cpp/hpp` | Encoder implementation | | `previewworker.cpp/hpp` | Preview worker class | | `mainwindow.cpp/hpp` | Main window implementation | ## License This project is licensed under the open-source license specified in the LICENSE file.