發表文章

目前顯示的是有「Windows」標籤的文章

Screen Recorder C++ FFmpeg 4.2 on Windows

Screen Recorder C++ FFmpeg 4.2 on Windows 螢幕錄影並儲存為 .mp4 檔案 (使用 Visual Studio 2019) 一. 編譯器設定 1.專案屬性 -> C\C++ -> 一般 -> 其他 Include 目錄 : D:\Dev\ffmpeg-4.2.2-win32-dev\include 2.專案屬性 -> 連結器 -> 輸入 -> 其他相依性 :在最前面加入 D:\Dev\ffmpeg-4.2.2-win32-dev\lib\*.lib;Winmm.lib 3. 專案屬性 -> 連結器 -> 進階 -> SAFESEH : NO 二.------------------------------------Source.cpp------------------------------- #include <stdlib.h> #include <stdio.h> #include <string.h> #include <math.h> #include <thread> #include<time.h> #include <iostream> using namespace std; #define __STDC_CONSTANT_MACROS extern "C" { #include <libavutil/avassert.h> #include <libavutil/channel_layout.h> #include <libavutil/opt.h> #include <libavutil/mathematics.h> #include <libavutil/timestamp.h> #include <libavformat/avformat.h> #include "libavutil/imgutils.h" #include <libswscale/swscale.h> #in...
Capture Screen and store it in a buffer C++ on Windows ----------------------------------Source.cpp---------------------- #include <Windows.h> #include <iostream> #include <math.h> #include <stdio.h> using namespace std; HBITMAP GetScreenBmp(HDC hdc) {     // Get screen dimensions     int nScreenWidth = GetSystemMetrics(SM_CXSCREEN);     int nScreenHeight = GetSystemMetrics(SM_CYSCREEN);     // Create compatible DC, create a compatible bitmap and copy the screen using BitBlt()     HDC hCaptureDC = CreateCompatibleDC(hdc);     HBITMAP hBitmap = CreateCompatibleBitmap(hdc, nScreenWidth, nScreenHeight);     HGDIOBJ hOld = SelectObject(hCaptureDC, hBitmap);     BOOL bOK = BitBlt(hCaptureDC, 0, 0, nScreenWidth, nScreenHeight, hdc, 0, 0, SRCCOPY | CAPTUREBLT);     SelectObject(hCaptureDC, hOld); // always select the previously selec...
Capture Screen C++ on Windows Capture Screen and store it as a .bmp file 1.----------------------------Source.cpp------------------------ #include<iostream> #include<Windows.h> using namespace std; // file size = sizeof(BITMAPFILEHEADER) + (DWORD)sizeof(BITMAPINFOHEADER) + dwPaletteSize + dwBmBitsSize BOOL SaveBitmapToFile(HBITMAP   hBitmap, LPCSTR szfilename) {     HDC     hDC;     //当前分辨率下每象素所占字节数              int     iBits;     //位图中每象素所占字节数              WORD     wBitCount;     //定义调色板大小,     位图中像素字节大小     ,位图文件大小     ,     写入文件字节数                  ...
Audio Recorder C++ FFmpeg 4.2 on Windows using Visual Studio 2019 1.Install VBCable Set up reference: https://mediarealm.com.au/articles/stereo-mix-setup-windows-10/ 2.Set up C++ property & Linker property in project property (Linker : add Winmm.lib; in somewhere) 3.-----------------------------Souce.cpp--------------------------- #define _CRT_SECURE_NO_WARNINGS //#include <QDebug> //#include <QByteArray> #include <stdio.h> #include <iostream> #define __STDC_CONSTANT_MACROS extern "C" { #include <libavutil/avassert.h> #include <libavutil/channel_layout.h> #include <libavutil/opt.h> #include <libavutil/mathematics.h> #include <libavutil/timestamp.h> #include <libavformat/avformat.h> //#include "libavutil/imgutils.h" #include <libswscale/swscale.h> #include <libswresample/swresample.h> } #include <windows.h> using namespace std; const int NUMPTS = 44100 * 5; int sampleRate ...
錄製 從音效卡 播放出來的聲音 (Windows 10) Record sound from your sound card on Windows 10 1.Download  VBCable : https://www.vb-audio.com/Cable/index.htm Install it and then reboot When you set the VB Audio Cable as your new Default Playback Device, you won’t be able to hear the audio through the speakers. Thankfully, Windows 10 comes with an easy solution. Open up the Sound Control Panel again, go to the “Recording” tab, and select “Properties”. In the “Listen” tab is a checkbox called “Listen to this device”. 2.Download Audacity 3.open Audacity 編輯 -> 編號設定 -> 裝置 -> 播放 選擇  CABLE Input (...) 編輯 -> 編號設定 -> 裝置 -> 錄製 選擇  CABLE Output (...) 4.Enjoy Reference: https://mediarealm.com.au/articles/stereo-mix-setup-windows-10/ https://www.tenforums.com/drivers-hardware/111899-stereo-mix-no-longer-appears.html#post1389803
Windows 技巧 熱鍵: [windows] + E => 開啟檔案總管 [windows] + R => 執行 [Ctrl] + [Shift] + [Esc] : 開啟 工作管理員 (taskmgr.exe) [Ctrl] + [Space] : 切換字寬 常用設定程式: msinfo32.exe => 系統資訊 msconfig.exe => 系統設定 control.exe => 控制台 compmgmt.mcs => 電腦管理 執行: "shell:startup" => 特定使用者 啟動程式資料夾 "shell:common startup" => 啟動程式資料夾 Command Prompt * where [程式] * chcp 65001 => UTF8 * MakeDir * md 查詢占用阜: * netstat EX: netstat -anop TCP           -a -> All           -n -> number           -o -> 顯示 PID           -p [protocol] -> 特定協定       netstat -ano (|find "ESTABLISH") 列出 physicaldrive: wmic diskdrive list Power Shell Get-WmiObject Win32_DiskDrive 列出物理磁碟 右鍵資料夾選單新增"命令提示字元": HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell\命令提示字元\command 預設值: "C:\Windows\System32\cmd.exe" /k "cd %L" 右鍵新增"命令提示字元": 新增檔案 : OpenCmdHer...