Lines Matching refs:ofmt_ctx
49 AVFormatContext *ifmt_ctx = NULL, *ofmt_ctx = NULL;
79 avformat_alloc_output_context2(&ofmt_ctx, NULL, NULL, out_filename);
80 if (!ofmt_ctx) {
86 ofmt = ofmt_ctx->oformat;
90 AVStream *out_stream = avformat_new_stream(ofmt_ctx, in_stream->codec->codec);
103 if (ofmt_ctx->oformat->flags & AVFMT_GLOBALHEADER)
106 av_dump_format(ofmt_ctx, 0, out_filename, 1);
109 ret = avio_open(&ofmt_ctx->pb, out_filename, AVIO_FLAG_WRITE);
116 ret = avformat_write_header(ofmt_ctx, NULL);
130 out_stream = ofmt_ctx->streams[pkt.stream_index];
139 log_packet(ofmt_ctx, &pkt, "out");
141 ret = av_interleaved_write_frame(ofmt_ctx, &pkt);
149 av_write_trailer(ofmt_ctx);
155 if (ofmt_ctx && !(ofmt->flags & AVFMT_NOFILE))
156 avio_close(ofmt_ctx->pb);
157 avformat_free_context(ofmt_ctx);