# learn_ffmpeg **Repository Path**: hanyijing/learn_ffmpeg ## Basic Information - **Project Name**: learn_ffmpeg - **Description**: 音视频编码 ffmpeg 学习 - **Primary Language**: C - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-08-24 - **Last Updated**: 2021-09-02 ## Categories & Tags **Categories**: Uncategorized **Tags**: Go语言, C语言 ## README # learn_ffmpeg #### 介绍 音视频编码 ffmpeg 学习,测试环境为 Win10. #### 软件架构 1. 用 Golang 生成壳子,C 写录制编码部分 #### 说明 1. 我的电脑不用重采样,我的主要问题是编码器的 frame_size (2048) 比 nb_samples (22050 = 88200/2/2) 大 :more samples than frame size。 借助 AVAudioFifo 解决这个问题。 #### ffmpeg Win10 编译 1. 下载源码 2. 安装 mingw64 3. 安装依赖 ``` pacman -S make gcc diffutils pkg-config nasm pacman -S mingw-w64-x86_64-nasm mingw-w64-x86_64-gcc mingw-w64-x86_64-SDL2 pacman -S mingw-w64-x86_64-x264 ``` 4. 编译 ``` cd ffmpeg ./configure --prefix=/usr/local/ffmpeg --enable-shared --enable-libfdk-aac --enable-nonfree --enable-gpl --enable-libx264 make -j 4 make install ``` 如果 ffmpeg make 报错: (1) libavdevice/gdigrab.c:252:12: error: implicit declaration of function ‘utf8towchar’ [-Werror=implicit-function-declaration] 我的解决方式:找到那几行注释掉 (2) /usr/include/w32api/strsafe.h:1859:11: error: ‘WEOF’ undeclared (first use in this function); did you mean ‘EOF’? 我的解决方式:strsafe.h 头文件里增加 #include (应该不算好的解决方法) 5. 设置环境变量,比如 D:\msys64\usr\local\ffmpeg\bin