音视频
Up to the mountain
用爱发电,独一无二的原创解决方案
展开
-
ffmpeg采集摄像头,h264压缩,保存为mp4文件
接上篇:ffmpeg采集摄像头保存为h264裸流文件,可以用potplayer、VLC播放我们更进一步,保存为更通用的mp4文件#define CODEC_FLAG_GLOBAL_HEADER (1 << 22)static void encodeMP4(AVCodecContext* enc_ctx, AVFormatContext* inFmtCtx, AVFormatContext* outFmtCtx, AVFrame* frame,原创 2020-11-12 16:55:28 · 5372 阅读 · 1 评论 -
ffmpeg采集摄像头保存为h264裸流文件,可以用potplayer、VLC播放
网上根本没这方面的代码,要不就是opencv的,要不就是保存yuv的,或者mp4/avi的,不多说了,直接上代码,懒:)#include <iostream>using namespace std;#include <cstdlib>#include <cstdio>#include <string>#include <Windows.h>#include <thread>#include <mutex>..原创 2020-11-06 16:02:15 · 3120 阅读 · 1 评论