FFMPEG视频开发:Window系统下载部署FFMPEG库并获取摄像头数据保存为MP4文件存放到本地(使用FFMPEG本身接口获取摄像头数据)

简介: FFMPEG视频开发:Window系统下载部署FFMPEG库并获取摄像头数据保存为MP4文件存放到本地(使用FFMPEG本身接口获取摄像头数据)

一、环境介绍

操作系统:win10  64位


FFMPEG版本:  4.2.2


QT版本:  5.12  


摄像头:笔记本电脑自带摄像头



win32下使用FFMPEG 4.2.2库下载地址:https://download.csdn.net/download/xiaolong1126626497/12321684

二、工程介绍

工程使用 QT Creator 创建,选择控制台模板,没有使用QT的UI框架。

image.png

三、下载FFMPEG库

下载地址:http://ffmpeg.org/

image.png

选择windows版本下载:

image.png

根据自己的编译器位数下载,我这里使用的minigw32位编译器,分别下载Shared+Dev两个包,待用。

其中Shared目录里包含的是程序运行时需要的库。

Dev目录里包含的是程序编译时需要的库和头文件。

image.png

下载之后解压,将要使用的库加入到系统环境变量里,方便程序运行时能找到库。

image.png

image.png

将bin目录加到系统环境变量里。

image.png

四、FFMPEG在MinGW编译报错解决

image.png

image.png

/新增
#ifndef INT64_C
#define INT64_C(c) (c ## LL)
#define UINT64_C(c) (c ## ULL)
#endif
#if defined __cplusplus
#define __STDC_CONSTANT_MACROS  //common.h中的错误
#define __STDC_FORMAT_MACROS    //timestamp.h中的错误
#endif

五、核心代码

代码里选择当前笔记本电脑的自带摄像头进行录制10秒的视频保存在当前目录下。名称为:  123.mp4

image.png

image.png

image.png

#include <QCoreApplication>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <QDebug>
//声明引用C的头文件
extern "C"
{
    #include <stdlib.h>
    #include <stdio.h>
    #include <string.h>
    #include <math.h>
    #include <libavutil/avassert.h>
    #include <libavutil/channel_layout.h>
    #include <libavutil/opt.h>
    #include <libavutil/mathematics.h>
    #include <libavutil/timestamp.h>
    #include <libavutil/imgutils.h>
    #include <libavformat/avformat.h>
    #include <libswscale/swscale.h>
    #include <libswresample/swresample.h>
    #include "libavfilter/avfilter.h"
    #include <libavdevice/avdevice.h>
    #include "libavutil/avassert.h"
    #include "libavutil/channel_layout.h"
    #include "libavutil/common.h"
    #include "libavutil/opt.h"
}
#define STREAM_DURATION   10.0 /*录制视频的持续时间  秒*/
#define STREAM_FRAME_RATE 15  /* images/s  这里可以根据摄像头的采集速度来设置帧率 */
#define STREAM_PIX_FMT    AV_PIX_FMT_YUV420P /* default pix_fmt */
#define SCALE_FLAGS SWS_BICUBIC
//存放视频的宽度和高度
int video_width;
int video_height;
// 单个输出AVStream的包装器
typedef struct OutputStream
{
    AVStream *st;
    AVCodecContext *enc;
    /*下一帧的点数*/
    int64_t next_pts;
    int samples_count;
    AVFrame *frame;
    AVFrame *tmp_frame;
    float t, tincr, tincr2;
    struct SwsContext *sws_ctx;
    struct SwrContext *swr_ctx;
}OutputStream;
typedef struct IntputDev
{
    AVCodecContext  *pCodecCtx;
    AVCodec         *pCodec;
    AVFormatContext *v_ifmtCtx;
    int  videoindex;
    struct SwsContext *img_convert_ctx;
    AVPacket *in_packet;
    AVFrame *pFrame,*pFrameYUV;
}IntputDev;
static int write_frame(AVFormatContext *fmt_ctx, const AVRational *time_base, AVStream *st, AVPacket *pkt)
{
    /* 将输出数据包时间戳值从编解码器重新调整为流时基 */
    av_packet_rescale_ts(pkt, *time_base, st->time_base);
    pkt->stream_index = st->index;
    /*将压缩的帧写入媒体文件。*/
    return av_interleaved_write_frame(fmt_ctx, pkt);
}
/*添加输出流。 */
static void add_stream(OutputStream *ost, AVFormatContext *oc,AVCodec **codec,enum AVCodecID codec_id)
{
    AVCodecContext *c;
    int i;
    /* find the encoder */
    *codec = avcodec_find_encoder(codec_id);
    if (!(*codec))
    {
        qDebug()<<"avcodec_find_encoder error.";
        exit(1);
    }
    ost->st = avformat_new_stream(oc, nullptr);
    if (!ost->st)
    {
        qDebug()<<"Could not allocate stream.";
        exit(1);
    }
    ost->st->id = oc->nb_streams-1;
    c = avcodec_alloc_context3(*codec);
    if (!c)
    {
        qDebug()<<"Could not alloc an encoding context";
        exit(1);
    }
    ost->enc = c;
    switch((*codec)->type)
    {
        case AVMEDIA_TYPE_AUDIO:
            c->sample_fmt  = (*codec)->sample_fmts ?
                (*codec)->sample_fmts[0] : AV_SAMPLE_FMT_FLTP;
            c->bit_rate    = 64000;
            c->sample_rate = 44100;
            if ((*codec)->supported_samplerates) {
                c->sample_rate = (*codec)->supported_samplerates[0];
                for (i = 0; (*codec)->supported_samplerates[i]; i++) {
                    if ((*codec)->supported_samplerates[i] == 44100)
                        c->sample_rate = 44100;
                }
            }
            c->channels        = av_get_channel_layout_nb_channels(c->channel_layout);
            c->channel_layout = AV_CH_LAYOUT_STEREO;
            if ((*codec)->channel_layouts) {
                c->channel_layout = (*codec)->channel_layouts[0];
                for (i = 0; (*codec)->channel_layouts[i]; i++) {
                    if ((*codec)->channel_layouts[i] == AV_CH_LAYOUT_STEREO)
                        c->channel_layout = AV_CH_LAYOUT_STEREO;
                }
            }
            c->channels        = av_get_channel_layout_nb_channels(c->channel_layout);
            ost->st->time_base = (AVRational){ 1, c->sample_rate };
            break;
        case AVMEDIA_TYPE_VIDEO:
            c->codec_id = codec_id;
            c->bit_rate = 2500000;  //平均比特率,例子代码默认值是400000
            /* 分辨率必须是2的倍数。*/
            c->width=video_width;
            c->height=video_height;
            /*时基:这是基本的时间单位(以秒为单位)
             *表示其中的帧时间戳。 对于固定fps内容,
             *时基应为1 /framerate,时间戳增量应为
             *等于1。*/
            ost->st->time_base = (AVRational){1,STREAM_FRAME_RATE};  //帧率设置
            c->time_base       = ost->st->time_base;
            c->gop_size      = 12; /* 最多每十二帧发射一帧内帧 */
            c->pix_fmt       = STREAM_PIX_FMT;
            if(c->codec_id == AV_CODEC_ID_MPEG2VIDEO)
            {
                /* 只是为了测试,我们还添加了B帧 */
                c->max_b_frames = 2;
            }
            if(c->codec_id == AV_CODEC_ID_MPEG1VIDEO)
            {
                /*需要避免使用其中一些系数溢出的宏块。
                 *普通视频不会发生这种情况,因为
                 *色度平面的运动与亮度平面不匹配。 */
                c->mb_decision = 2;
            }
        break;
        default:
            break;
    }
    /* 某些格式希望流头分开。 */
    if (oc->oformat->flags & AVFMT_GLOBALHEADER)
        c->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;
}
static AVFrame *alloc_picture(enum AVPixelFormat pix_fmt, int width, int height)
{
    AVFrame *picture;
    int ret;
    picture = av_frame_alloc();
    if (!picture)
        return nullptr;
    picture->format = pix_fmt;
    picture->width  = width;
    picture->height = height;
    /* 为帧数据分配缓冲区 */
    ret = av_frame_get_buffer(picture, 32);
    if(ret<0)
    {
        qDebug()<<"为帧数据分配缓冲区错误.";
        exit(1);
    }
    return picture;
}
static void open_video(AVFormatContext *oc, AVCodec *codec, OutputStream *ost, AVDictionary *opt_arg)
{
    int ret;
    AVCodecContext *c = ost->enc;
    AVDictionary *opt = nullptr;
    av_dict_copy(&opt, opt_arg, 0);
    /* open the codec */
    ret = avcodec_open2(c, codec, &opt);
    av_dict_free(&opt);
    if (ret < 0)
    {
        exit(1);
    }
    /* 分配并初始化可重用框架 */
    ost->frame = alloc_picture(c->pix_fmt, c->width, c->height);
    if (!ost->frame)
    {
        qDebug()<<"Could not allocate video frame";
        exit(1);
    }
    printf("ost->frame alloc success fmt=%d w=%d h=%d\n",c->pix_fmt,c->width, c->height);
    /*如果输出格式不是YUV420P,则为临时YUV420P
    *也需要图片。 然后将其转换为所需的
    *输出格式。 */
    ost->tmp_frame = nullptr;
    if(c->pix_fmt != AV_PIX_FMT_YUV420P)
    {
        ost->tmp_frame = alloc_picture(AV_PIX_FMT_YUV420P, c->width, c->height);
        if (!ost->tmp_frame)
        {
            fprintf(stderr, "Could not allocate temporary picture\n");
            exit(1);
        }
    }
    /* 将流参数复制到多路复用器*/
    ret=avcodec_parameters_from_context(ost->st->codecpar, c);
    if(ret<0)
    {
        fprintf(stderr, "Could not copy the stream parameters\n");
        exit(1);
    }
}
/*
  *编码一个视频帧
  *编码完成后返回1,否则返回0
  */
static int write_video_frame(AVFormatContext *oc, OutputStream *ost,AVFrame *frame)
{
    int ret;
    AVCodecContext *c;
    int got_packet=0;
    AVPacket pkt={0};
    if(frame==nullptr)
        return 1;
    c = ost->enc;
    av_init_packet(&pkt);
    /* 编码图像*/
    ret = avcodec_encode_video2(c, &pkt, frame, &got_packet);
    if(ret<0)
    {
        exit(1);
    }
    if(got_packet)
    {
        ret = write_frame(oc, &c->time_base, ost->st, &pkt);
    }else
    {
        ret = 0;
    }
    if(ret<0)
    {
        exit(1);
    }
    return (frame || got_packet) ? 0 : 1;
}
static AVFrame *get_video_frame(OutputStream *ost,IntputDev* input,int *got_pic)
{
    int ret, got_picture;
    AVCodecContext *c = ost->enc;
    AVFrame * ret_frame=nullptr;
    if(av_compare_ts(ost->next_pts, c->time_base,STREAM_DURATION, (AVRational){1,1})>=0)
        return nullptr;
    /*当我们将帧传递给编码器时,它可能会保留对它的引用
    *内部,确保我们在这里不覆盖它*/
    if (av_frame_make_writable(ost->frame)<0)
        exit(1);
    if(av_read_frame(input->v_ifmtCtx, input->in_packet)>=0)
    {
        if(input->in_packet->stream_index==input->videoindex)
        {
            ret = avcodec_decode_video2(input->pCodecCtx, input->pFrame, &got_picture, input->in_packet);
            *got_pic=got_picture;
            if(ret<0)
            {
                printf("Decode Error.\n");
                av_packet_unref(input->in_packet);
                return nullptr;
            }
            if(got_picture)
            {
                sws_scale(input->img_convert_ctx, (const unsigned char* const*)input->pFrame->data, input->pFrame->linesize, 0, input->pCodecCtx->height, ost->frame->data,  ost->frame->linesize);
                ost->frame->pts =ost->next_pts++;
                ret_frame= ost->frame;
            }
        }
        av_packet_unref(input->in_packet);
    }
    return ret_frame;
}
static void close_stream(AVFormatContext *oc, OutputStream *ost)
{
    avcodec_free_context(&ost->enc);
    av_frame_free(&ost->frame);
    av_frame_free(&ost->tmp_frame);
    sws_freeContext(ost->sws_ctx);
    swr_free(&ost->swr_ctx);
}
//显示当前电脑上的摄像头设备
void show_dshow_device()
{
    AVFormatContext *pFormatCtx = avformat_alloc_context();
    AVDictionary* options = nullptr;
    av_dict_set(&options,"list_devices","true",0);
    AVInputFormat *iformat = av_find_input_format("dshow");
    printf("Device Info=============\n");
    avformat_open_input(&pFormatCtx,"video=dummy",iformat,&options);
    printf("========================\n");
}
//Show VFW Device
void show_vfw_device()
{
    AVFormatContext *pFormatCtx = avformat_alloc_context();
    AVInputFormat *iformat = av_find_input_format("vfwcap");
    printf("========VFW Device Info======\n");
    avformat_open_input(&pFormatCtx,"list",iformat,NULL);
    printf("=============================\n");
}
/*
采集摄像头数据编码成MP4视频
*/
int Save_Video()
{
    OutputStream video_st = { 0 }, audio_st = { 0 };
    const char *filename;
    AVOutputFormat *fmt;
    AVFormatContext *oc;
    AVCodec *audio_codec, *video_codec;
    int ret;
    int have_video = 0, have_audio = 0;
    int encode_video = 0, encode_audio = 0;
    AVDictionary *opt = nullptr;
    int i;
    filename = "123.mp4";
    printf("当前存储的视频文件名称:%s\n",filename);
    /*分配输出媒体环境*/
    avformat_alloc_output_context2(&oc, nullptr, nullptr, filename);
    if(!oc)
    {
        printf("无法从文件扩展名推断出输出格式:使用MPEG。\n");
        avformat_alloc_output_context2(&oc, nullptr, "mpeg", filename);
    }
    if(!oc)return 1;
    //添加摄像头----------------------------------
    IntputDev video_input;
    AVCodecContext  *pCodecCtx;
    AVCodec         *pCodec;
    AVFormatContext *v_ifmtCtx;
    avdevice_register_all(); //注册输入设备
    avcodec_register_all();
    v_ifmtCtx = avformat_alloc_context();
    show_dshow_device();
   // show_vfw_device();
    //windows下指定摄像头信息
    AVInputFormat *ifmt=av_find_input_format("dshow");
    if(ifmt==nullptr)
    {
        printf("输入格式查找失败.\n");
        return 0;
    }
    /*
        windows下输入
        ffmpeg -list_devices true -f dshow -i dummy
        命令查询可用的输入设备
        这里的摄像头的名称要根据自己电脑上的名称进行修改.
    */
    if(avformat_open_input(&v_ifmtCtx,"video=Integrated Camera",ifmt,nullptr)!=0)
    {
        printf("无法打开输入流.\n");
        return -1;
    }
    if(avformat_find_stream_info(v_ifmtCtx,nullptr)<0)
    {
        printf("找不到流信息.\n");
        return -1;
    }
    int videoindex=-1;
    for(i=0; i<v_ifmtCtx->nb_streams; i++)
    if(v_ifmtCtx->streams[i]->codec->codec_type==AVMEDIA_TYPE_VIDEO)
    {
        videoindex=i;
        printf("videoindex=%d\n",videoindex);
        break;
    }
    if(videoindex==-1)
    {
        printf("找不到视频流。\n");
        return -1;
    }
    pCodecCtx=v_ifmtCtx->streams[videoindex]->codec;
    pCodec=avcodec_find_decoder(pCodecCtx->codec_id);
    if(pCodec==nullptr)
    {
        printf("找不到编解码器。\n");
        return -1;
    }
    if(avcodec_open2(pCodecCtx, pCodec,nullptr)<0)
    {
        printf("无法打开编解码器。\n");
        return -1;
    }
    AVFrame *pFrame,*pFrameYUV;
    pFrame=av_frame_alloc();
    pFrameYUV=av_frame_alloc();
    unsigned char *out_buffer=(unsigned char *)av_malloc(av_image_get_buffer_size(AV_PIX_FMT_YUV420P, pCodecCtx->width, pCodecCtx->height,16));
    av_image_fill_arrays(pFrameYUV->data,
                         pFrameYUV->linesize,
                         out_buffer,
                         AV_PIX_FMT_YUV420P,
                         pCodecCtx->width,
                         pCodecCtx->height,
                         16);
    printf("摄像头尺寸(WxH): %d x %d \n",pCodecCtx->width, pCodecCtx->height);
    video_width=pCodecCtx->width;
    video_height=pCodecCtx->height;
    struct SwsContext *img_convert_ctx;
    img_convert_ctx = sws_getContext(pCodecCtx->width, pCodecCtx->height, pCodecCtx->pix_fmt, pCodecCtx->width, pCodecCtx->height, AV_PIX_FMT_YUV420P, SWS_BICUBIC, NULL, NULL, NULL);
    AVPacket *in_packet=(AVPacket *)av_malloc(sizeof(AVPacket));
    video_input.img_convert_ctx=img_convert_ctx;
    video_input.in_packet=in_packet;
    video_input.pCodecCtx=pCodecCtx;
    video_input.pCodec=pCodec;
    video_input.v_ifmtCtx=v_ifmtCtx;
    video_input.videoindex=videoindex;
    video_input.pFrame=pFrame;
    video_input.pFrameYUV=pFrameYUV;
    //-----------------------------添加摄像头结束
    fmt=oc->oformat;
    /*使用默认格式的编解码器添加音频和视频流并初始化编解码器。*/
    printf("fmt->video_codec = %d\n", fmt->video_codec);
    if(fmt->video_codec != AV_CODEC_ID_NONE)
    {
        add_stream(&video_st,oc,&video_codec,fmt->video_codec);
        have_video=1;
        encode_video=1;
    }
    /*现在已经设置了所有参数,可以打开音频并视频编解码器,并分配必要的编码缓冲区。*/
    if(have_video)open_video(oc, video_codec, &video_st, opt);
    av_dump_format(oc,0,filename,1);
    /* 打开输出文件(如果需要) */
    if(!(fmt->flags & AVFMT_NOFILE))
    {
        ret=avio_open(&oc->pb,filename,AVIO_FLAG_WRITE);
        if(ret<0)
        {
           // fprintf(stderr, "打不开'%s': %s\n", filename,av_err2str(ret));
            return 1;
        }
    }
    /* 编写流头(如果有)*/
    ret=avformat_write_header(oc, &opt);
    if(ret<0)
    {
        //fprintf(stderr, "打开输出文件时发生错误: %s\n",av_err2str(ret));
        return 1;
    }
    int got_pic;
    while(encode_video)
    {
        /*选择要编码的流*/
        AVFrame *frame=get_video_frame(&video_st,&video_input,&got_pic);
        if(!got_pic)
        {
            continue;
        }
        encode_video=!write_video_frame(oc,&video_st,frame);
    }
    av_write_trailer(oc);
    sws_freeContext(video_input.img_convert_ctx);
    avcodec_close(video_input.pCodecCtx);
    av_free(video_input.pFrameYUV);
    av_free(video_input.pFrame);
    avformat_close_input(&video_input.v_ifmtCtx);
    /*关闭每个编解码器*/
    if (have_video)close_stream(oc, &video_st);
    /*关闭输出文件*/
    if (!(fmt->flags & AVFMT_NOFILE))avio_closep(&oc->pb);
    /*释放流*/
    avformat_free_context(oc);
    return 0;
}
int main(int argc, char *argv[])
{
    QCoreApplication a(argc, argv);
    Save_Video();
    return a.exec();
}

在windows下要记得把摄像头名称换成自己电脑的名称。

image.png

xxx.pro文件:

#win32---mingw32
INCLUDEPATH += C:/FFMPEG_WIN32_LIB_4.2.2/include
#win32---mingw32
LIBS += C:/FFMPEG_WIN32_LIB_4.2.2/lib/avcodec.lib \
        C:/FFMPEG_WIN32_LIB_4.2.2/lib/avdevice.lib \
        C:/FFMPEG_WIN32_LIB_4.2.2/lib/avfilter.lib \
        C:/FFMPEG_WIN32_LIB_4.2.2/lib/avformat.lib \
        C:/FFMPEG_WIN32_LIB_4.2.2/lib/avutil.lib \
        C:/FFMPEG_WIN32_LIB_4.2.2/lib/postproc.lib \
        C:/FFMPEG_WIN32_LIB_4.2.2/lib/swresample.lib \
        C:/FFMPEG_WIN32_LIB_4.2.2/lib/swscale.lib


目录
相关文章
|
23天前
|
Linux 编译器 Android开发
FFmpeg开发笔记(九)Linux交叉编译Android的x265库
在Linux环境下,本文指导如何交叉编译x265的so库以适应Android。首先,需安装cmake和下载android-ndk-r21e。接着,下载x265源码,修改crosscompile.cmake的编译器设置。配置x265源码,使用指定的NDK路径,并在配置界面修改相关选项。随后,修改编译规则,编译并安装x265,调整pc描述文件并更新PKG_CONFIG_PATH。最后,修改FFmpeg配置脚本启用x265支持,编译安装FFmpeg,将生成的so文件导入Android工程,调整gradle配置以确保顺利运行。
FFmpeg开发笔记(九)Linux交叉编译Android的x265库
|
2月前
|
算法 数据处理 开发者
FFmpeg库的使用与深度解析:解码音频流流程
FFmpeg库的使用与深度解析:解码音频流流程
43 0
|
24天前
|
Unix Linux Shell
FFmpeg开发笔记(八)Linux交叉编译Android的FFmpeg库
在Linux环境下交叉编译Android所需的FFmpeg so库,首先下载`android-ndk-r21e`,然后解压。接着,上传FFmpeg及相关库(如x264、freetype、lame)源码,修改相关sh文件,将`SYSTEM=windows-x86_64`改为`SYSTEM=linux-x86_64`并删除回车符。对x264的configure文件进行修改,然后编译x264。同样编译其他第三方库。设置环境变量`PKG_CONFIG_PATH`,最后在FFmpeg源码目录执行配置、编译和安装命令,生成的so文件复制到App工程指定目录。
FFmpeg开发笔记(八)Linux交叉编译Android的FFmpeg库
|
3天前
|
算法 Linux Windows
FFmpeg开发笔记(十七)Windows环境给FFmpeg集成字幕库libass
在Windows环境下为FFmpeg集成字幕渲染库libass涉及多个步骤,包括安装freetype、libxml2、gperf、fontconfig、fribidi、harfbuzz和libass。每个库的安装都需要下载源码、配置、编译和安装,并更新PKG_CONFIG_PATH环境变量。最后,重新配置并编译FFmpeg以启用libass及相关依赖。完成上述步骤后,通过`ffmpeg -version`确认libass已成功集成。
FFmpeg开发笔记(十七)Windows环境给FFmpeg集成字幕库libass
|
9天前
|
安全 Linux Android开发
FFmpeg开发笔记(十六)Linux交叉编译Android的OpenSSL库
该文介绍了如何在Linux服务器上交叉编译Android的FFmpeg库以支持HTTPS视频播放。首先,从GitHub下载openssl源码,解压后通过编译脚本`build_openssl.sh`生成64位静态库。接着,更新环境变量加载openssl,并编辑FFmpeg配置脚本`config_ffmpeg_openssl.sh`启用openssl支持。然后,编译安装FFmpeg。最后,将编译好的库文件导入App工程的相应目录,修改视频链接为HTTPS,App即可播放HTTPS在线视频。
FFmpeg开发笔记(十六)Linux交叉编译Android的OpenSSL库
|
1月前
|
Linux Android开发 iOS开发
FFmpeg开发笔记(七)欧拉系统编译安装FFmpeg
FFmpeg跨平台支持多系统,包括Linux、macOS、Windows和Android。官方提供[编译指南](https://trac.ffmpeg.org/wiki/CompilationGuide)。在CentOS上,编译涉及安装多个依赖,如NASM、Yasm、libx264、libx265、libfdk_aac等。同样,在EulerOS上,需安装相关工具并分别编译x264、x265和FFmpeg。详细FFmpeg开发内容可参考《FFmpeg开发实战:从零基础到短视频上线》。
FFmpeg开发笔记(七)欧拉系统编译安装FFmpeg
|
1月前
|
缓存 网络协议 Windows
FFmpeg开发笔记(六)如何访问Github下载FFmpeg源码
在国内访问GitHub不稳定时,可以采取三种解决方法。首先,通过网站(<https://ping.chinaz.com/github.com>)找到快速响应的GitHub IP,将其添加到本地hosts文件,然后刷新DNS缓存以正常访问。其次,使用代下载网站如(<https://d.serctl.com/>)下载GitHub上的压缩包。最后,可从国内镜像站点,如码云(<https://gitee.com/mirrors/ffmpeg>),下载FFmpeg等开源代码。这些方法有助于绕过访问限制,确保FFmpeg学习与开发的顺利进行。
FFmpeg开发笔记(六)如何访问Github下载FFmpeg源码
|
1月前
|
编解码 计算机视觉 索引
使用ffmpeg MP4转 m3u8并播放 实测!!
使用ffmpeg MP4转 m3u8并播放 实测!!
35 1
|
1月前
|
编解码 缓存 算法
FFmpeg开发笔记(四)FFmpeg的动态链接库介绍
FFmpeg是一个强大的多媒体处理框架,提供ffmpeg、ffplay和ffprobe工具及八个库:avcodec(编解码)、avdevice(设备输入输出)、avfilter(音视频滤镜)、avformat(格式处理)、avutil(通用工具和算法)、postproc(后期效果)、swresample(音频重采样)和swscale(视频图像转换)。这些库支持定制化开发,涵盖了从采集、编码、过滤到输出的全过程。了解详细FFmpeg开发信息,可参考《FFmpeg开发实战:从零基础到短视频上线》。
FFmpeg开发笔记(四)FFmpeg的动态链接库介绍
|
1月前
|
Linux 编译器 C语言
FFmpeg开发笔记(二)搭建Windows系统的开发环境
在Windows上学习FFmpeg通常较困难,但通过安装预编译的FFmpeg开发包可以简化流程。首先需要安装MSYS2来模拟Linux环境。下载并执行MSYS2安装包,然后修改msys2_shell.cmd以继承Windows的Path变量。使用pacman安装必要的编译工具。接着,下载预编译的FFmpeg Windows包,解压并配置系统Path。最后,在MSYS2环境中运行`ffmpeg -version`确认安装成功。欲深入学习FFmpeg开发,推荐阅读《FFmpeg开发实战:从零基础到短视频上线》。
FFmpeg开发笔记(二)搭建Windows系统的开发环境