#include <libavutil/opt.h>\r
#include <libavutil/pixdesc.h>\r
#include <libavutil/parseutils.h>\r
+ #include <libavutil/samplefmt.h>\r
}\r
#if defined(_MSC_VER)\r
#pragma warning (pop)\r
\r
oc_->oformat = output_format_.format;\r
\r
- THROW_ON_ERROR2(av_set_parameters(oc_.get(), nullptr), "[ffmpeg_consumer]");\r
-\r
strcpy_s(oc_->filename, filename_.c_str());\r
\r
// Add the audio and video streams using the default format codecs and initialize the codecs.\r
video_st_ = add_video_stream(options2);\r
audio_st_ = add_audio_stream(options);\r
\r
- dump_format(oc_.get(), 0, filename_.c_str(), 1);\r
+ av_dump_format(oc_.get(), 0, filename_.c_str(), 1);\r
\r
// Open the output ffmpeg, if needed.\r
if (!(oc_->oformat->flags & AVFMT_NOFILE)) \r
- THROW_ON_ERROR2(avio_open(&oc_->pb, filename_.c_str(), URL_WRONLY), "[ffmpeg_consumer]");\r
+ THROW_ON_ERROR2(avio_open(&oc_->pb, filename.c_str(), AVIO_FLAG_WRITE), "[ffmpeg_consumer]");\r
\r
- THROW_ON_ERROR2(av_write_header(oc_.get()), "[ffmpeg_consumer]");\r
+ THROW_ON_ERROR2(avformat_write_header(oc_.get(), nullptr), "[ffmpeg_consumer]");\r
\r
if(options.size() > 0)\r
{\r
c->codec_type = AVMEDIA_TYPE_AUDIO;\r
c->sample_rate = 48000;\r
c->channels = 2;\r
- c->sample_fmt = SAMPLE_FMT_S16;\r
+ c->sample_fmt = AV_SAMPLE_FMT_S16;\r
\r
if(output_format_.vcodec == CODEC_ID_FLV1) \r
c->sample_rate = 44100; \r