Samples - adding a sample to illustrate StreamProvider for demuxer (#99)
* mem sample * changes to match c++ style * ffmpeg log * readme update * readme clean up
This commit is contained in:
@@ -152,6 +152,7 @@ bool VideoDemuxer::Demux(uint8_t **video, int *video_size, int64_t *pts) {
|
||||
}
|
||||
|
||||
VideoDemuxer::VideoDemuxer(AVFormatContext *av_fmt_input_ctx) : av_fmt_input_ctx_(av_fmt_input_ctx) {
|
||||
av_log_set_level(AV_LOG_QUIET);
|
||||
if (!av_fmt_input_ctx_) {
|
||||
std::cerr << "ERROR: av_fmt_input_ctx_ is not vaild!" << std::endl;
|
||||
return;
|
||||
@@ -255,7 +256,6 @@ AVFormatContext *VideoDemuxer::CreateFmtContextUtil(StreamProvider *stream_provi
|
||||
|
||||
AVFormatContext *VideoDemuxer::CreateFmtContextUtil(const char *input_file_path) {
|
||||
avformat_network_init();
|
||||
av_log_set_level(AV_LOG_QUIET);
|
||||
AVFormatContext *ctx = nullptr;
|
||||
if (avformat_open_input(&ctx, input_file_path, nullptr, nullptr) != 0 ) {
|
||||
std::cerr << "ERROR: avformat_open_input failed!" << std::endl;
|
||||
|
||||
مرجع در شماره جدید
Block a user