發表文章

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

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...
圖片
FFmpeg 4.2 Muxing C++ 已成功編譯 ffmpeg-4.2.2-win32-dev\examples 裡的 muxing.c (用 Visual Studio 2019) 見以下源碼 (修改一些) -----------------------------Source.cpp------------------------ #include <stdlib.h> #include <stdio.h> #include <string.h> #include <math.h> #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 <libswscale/swscale.h> #include <libswresample/swresample.h> } #define STREAM_DURATION   10.0 #define STREAM_FRAME_RATE 25 /* 25 images/s */ #define STREAM_PIX_FMT    AV_PIX_FMT_YUV420P /* default pix_fmt */ #define SCALE_FLAGS SWS_BICUBIC // a wrapper around a single output AVStream typedef struct OutputStream {     AVStream* st;     ...
FFmpeg 4.2 Hello World C++ FFmpeg : Extract Image (.BMP) from Video (.mp4) 從 視頻 (.mp4) 擷取 圖像 (.bmp) using Visual Studio 2019 參考 : https://github.com/leandromoreira/ffmpeg-libav-tutorial 1. Download include / lib / dll file from https://ffmpeg.zeranoe.com/builds/ Architecture option choose Windows 32-bit ,  Linking option choose Dev & Shared (Dev option has include & lib files , Shared option has dll files) 2.Set up C++ property  and  Linker property in project property (Note : Set Linker option SAFESEH:NO) 3. ---------------------------Source.cpp-------------------------------- #define _CRT_SECURE_NO_WARNINGS extern "C" { #include"libavcodec/avcodec.h" #include"libavformat/avformat.h" #include "libswscale/swscale.h" #include "libavutil/imgutils.h" } #include <stdio.h> #include <stdarg.h> #include <stdlib.h> #include <string.h> #include <inttypes.h> #include<Windo...