ffmpeg:如何从/dev/video0接收原始图像并将其存储在pi上

ffmpeg:如何从/dev/video0接收原始图像并将其存储在pi上,ffmpeg,Ffmpeg,我正在制作一个连接USB摄像头的覆盆子Pi 我正在尝试从/dev/video0接收流 #include <libavcodec/avcodec.h> #include <libavformat/avformat.h> #include <libswscale/swscale.h int main() { AVFormatContext *pFormatCtx = NULL; av_register_all(); avdevice_

我正在制作一个连接USB摄像头的覆盆子Pi

我正在尝试从
/dev/video0
接收流

#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
#include <libswscale/swscale.h

int main() {

    AVFormatContext   *pFormatCtx = NULL;

    av_register_all();

    avdevice_register_all();

    AVInputFormat *inputFormat = av_find_input_format("v4l2");

    AVDictionary *options = NULL;

    av_dict_set(&options, "framerate", "25", 0);

    printf("%d\n",avformat_open_input(&pFormatCtx, "/dev/video0 ", inputFormat, &options));

    retrun 0;
}
#包括
#包括
#包括