Я пытаюсь открыть файл, используя avformat_open_input
, и он сработает, даже если файл существует.Аварийная ошибка avformat_open_input
av_register_all();
AVFormatContext *avFormatContext;
if (avformat_open_input(&avFormatContext, argv[1], NULL, NULL) < 0)
{
av_log(0, AV_LOG_FATAL, "Wasn't possible opening the file: %s", argv[1]);
return -1;
}
[Вы читали документацию] (https://www.ffmpeg.org/doxygen/2.3/group__lavf__decoding.html#ga10a404346c646e4ab58f4ed798baca32)? В нем четко сказано, что «AVFormatContext» является «указателем на предоставленный пользователем« AVFormatContex't (выделен «avformat_alloc_context»). Может быть указателем на «NULL», и в этом случае для этой функции выделяется «AVFormatContext» записанный в 'ps'. – Cornstalks