Skip to content

Instantly share code, notes, and snippets.

@kkm
Created March 31, 2015 00:09
Show Gist options
  • Save kkm/343c122f86c3b3e9b51c to your computer and use it in GitHub Desktop.
Save kkm/343c122f86c3b3e9b51c to your computer and use it in GitHub Desktop.
/*
============================================================================
Name : test_ffmpeg.c
Author :
Version :
Copyright : Your copyright notice
Description : Hello World in C, Ansi-style
============================================================================
*/
#include <stdio.h>
#include <stdlib.h>
#include <libavformat/avformat.h>
#include <libavcodec/avcodec.h>
#include <libavdevice/avdevice.h>
#include <libavutil/avutil.h>
int main(void) {
avcodec_register_all();
avdevice_register_all();
//Geht nicht es ist gleiche fehler wie vstudio crash
/*AVDeviceInfoList **device_list = NULL;
AVFormatContext *pAVFormatCtx = avformat_alloc_context();
AVInputFormat *inputFmt = av_find_input_format("dshow");
pAVFormatCtx->iformat = inputFmt;
if (avdevice_list_devices(pAVFormatCtx, device_list) < 0) {
printf("can not list devices\n");
return -1;
}*/
AVFormatContext *formatC = avformat_alloc_context();
AVDictionary* options = NULL;
av_dict_set(&options, "list_devices", "true", 0);
AVInputFormat *iformat = av_find_input_format("dshow");
avformat_open_input(&formatC, "video=dummy", iformat, &options);
puts("!!!Hello World!!!"); /* prints !!!Hello World!!! */
getchar();
return EXIT_SUCCESS;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment