• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/ap/gpl/minidlna/ffmpeg-2.3.4/

Lines Matching defs:ost

122 static void do_video_stats(OutputStream *ost, int frame_size);
469 OutputStream *ost = output_streams[i];
470 AVBitStreamFilterContext *bsfc = ost->bitstream_filters;
476 ost->bitstream_filters = NULL;
477 av_frame_free(&ost->filtered_frame);
479 av_parser_close(ost->parser);
481 av_freep(&ost->forced_keyframes);
482 av_expr_free(ost->forced_keyframes_pexpr);
483 av_freep(&ost->avfilter);
484 av_freep(&ost->logfile_prefix);
486 avcodec_free_context(&ost->enc_ctx);
566 static void close_all_output_streams(OutputStream *ost, OSTFinished this_stream, OSTFinished others)
571 ost2->finished |= ost == ost2 ? this_stream : others;
575 static void write_frame(AVFormatContext *s, AVPacket *pkt, OutputStream *ost)
577 AVBitStreamFilterContext *bsfc = ost->bitstream_filters;
578 AVCodecContext *avctx = ost->st->codec;
593 if (ost->frame_number >= ost->max_frames) {
597 ost->frame_number++;
643 ost->last_mux_dts != AV_NOPTS_VALUE) {
644 int64_t max = ost->last_mux_dts + !(s->oformat->flags & AVFMT_TS_NONSTRICT);
649 ost->file_index, ost->st->index, ost->last_mux_dts, pkt->dts);
667 ost->file_index, ost->st->index);
672 ost->last_mux_dts = pkt->dts;
674 ost->data_size += pkt->size;
675 ost->packets_written++;
677 pkt->stream_index = ost->index;
682 av_get_media_type_string(ost->enc_ctx->codec_type),
683 av_ts2str(pkt->pts), av_ts2timestr(pkt->pts, &ost->st->time_base),
684 av_ts2str(pkt->dts), av_ts2timestr(pkt->dts, &ost->st->time_base),
693 close_all_output_streams(ost, MUXER_FINISHED | ENCODER_FINISHED, ENCODER_FINISHED);
698 static void close_output_stream(OutputStream *ost)
700 OutputFile *of = output_files[ost->file_index];
702 ost->finished |= ENCODER_FINISHED;
704 int64_t end = av_rescale_q(ost->sync_opts - ost->first_pts, ost->enc_ctx->time_base, AV_TIME_BASE_Q);
709 static int check_recording_time(OutputStream *ost)
711 OutputFile *of = output_files[ost->file_index];
714 av_compare_ts(ost->sync_opts - ost->first_pts, ost->enc_ctx->time_base, of->recording_time,
716 close_output_stream(ost);
722 static void do_audio_out(AVFormatContext *s, OutputStream *ost,
725 AVCodecContext *enc = ost->enc_ctx;
733 if (!check_recording_time(ost))
737 frame->pts = ost->sync_opts;
738 ost->sync_opts = frame->pts + frame->nb_samples;
739 ost->samples_encoded += frame->nb_samples;
740 ost->frames_encoded++;
755 update_benchmark("encode_audio %d.%d", ost->file_index, ost->index);
758 av_packet_rescale_ts(&pkt, enc->time_base, ost->st->time_base);
763 av_ts2str(pkt.pts), av_ts2timestr(pkt.pts, &ost->st->time_base),
764 av_ts2str(pkt.dts), av_ts2timestr(pkt.dts, &ost->st->time_base));
767 write_frame(s, &pkt, ost);
772 OutputStream *ost,
789 enc = ost->enc_ctx;
805 if (output_files[ost->file_index]->start_time != AV_NOPTS_VALUE)
806 pts -= output_files[ost->file_index]->start_time;
810 ost->sync_opts = av_rescale_q(pts, AV_TIME_BASE_Q, enc->time_base);
811 if (!check_recording_time(ost))
822 ost->frames_encoded++;
836 pkt.pts = av_rescale_q(sub->pts, AV_TIME_BASE_Q, ost->st->time_base);
837 pkt.duration = av_rescale_q(sub->end_display_time, (AVRational){ 1, 1000 }, ost->st->time_base);
847 write_frame(s, &pkt, ost);
852 OutputStream *ost,
857 AVCodecContext *enc = ost->enc_ctx;
858 AVCodecContext *mux_enc = ost->st->codec;
865 if (ost->source_index >= 0)
866 ist = input_streams[ost->source_index];
868 if(ist && ist->st->start_time != AV_NOPTS_VALUE && ist->st->first_dts != AV_NOPTS_VALUE && ost->frame_rate.num)
869 duration = 1/(av_q2d(ost->frame_rate) * av_q2d(enc->time_base));
872 delta = sync_ipts - ost->sync_opts + duration;
896 if (ost->frame_number == 0 && delta - duration >= 0.5) {
899 ost->sync_opts = lrint(sync_ipts);
912 ost->sync_opts = lrint(sync_ipts);
916 ost->sync_opts = lrint(sync_ipts);
922 nb_frames = FFMIN(nb_frames, ost->max_frames - ost->frame_number);
927 ost->frame_number, ost->st->index, in_picture->pts);
945 in_picture->pts = ost->sync_opts;
948 if (!check_recording_time(ost))
950 if (ost->frame_number >= ost->max_frames)
967 pkt.pts = av_rescale_q(in_picture->pts, enc->time_base, ost->st->time_base);
970 write_frame(s, &pkt, ost);
976 ost->top_field_first >= 0)
977 in_picture->top_field_first = !!ost->top_field_first;
993 if (ost->forced_kf_index < ost->forced_kf_count &&
994 in_picture->pts >= ost->forced_kf_pts[ost->forced_kf_index]) {
995 ost->forced_kf_index++;
997 } else if (ost->forced_keyframes_pexpr) {
999 ost->forced_keyframes_expr_const_values[FKF_T] = pts_time;
1000 res = av_expr_eval(ost->forced_keyframes_pexpr,
1001 ost->forced_keyframes_expr_const_values, NULL);
1003 ost->forced_keyframes_expr_const_values[FKF_N],
1004 ost->forced_keyframes_expr_const_values[FKF_N_FORCED],
1005 ost->forced_keyframes_expr_const_values[FKF_PREV_FORCED_N],
1006 ost->forced_keyframes_expr_const_values[FKF_T],
1007 ost->forced_keyframes_expr_const_values[FKF_PREV_FORCED_T],
1011 ost->forced_keyframes_expr_const_values[FKF_PREV_FORCED_N] =
1012 ost->forced_keyframes_expr_const_values[FKF_N];
1013 ost->forced_keyframes_expr_const_values[FKF_PREV_FORCED_T] =
1014 ost->forced_keyframes_expr_const_values[FKF_T];
1015 ost->forced_keyframes_expr_const_values[FKF_N_FORCED] += 1;
1018 ost->forced_keyframes_expr_const_values[FKF_N] += 1;
1034 ost->frames_encoded++;
1037 update_benchmark("encode_video %d.%d", ost->file_index, ost->index);
1052 pkt.pts = ost->sync_opts;
1054 av_packet_rescale_ts(&pkt, enc->time_base, ost->st->time_base);
1059 av_ts2str(pkt.pts), av_ts2timestr(pkt.pts, &ost->st->time_base),
1060 av_ts2str(pkt.dts), av_ts2timestr(pkt.dts, &ost->st->time_base));
1064 write_frame(s, &pkt, ost);
1067 if (ost->logfile && enc->stats_out) {
1068 fprintf(ost->logfile, "%s", enc->stats_out);
1072 ost->sync_opts++;
1078 ost->frame_number++;
1081 do_video_stats(ost, frame_size);
1090 static void do_video_stats(OutputStream *ost, int frame_size)
1105 enc = ost->enc_ctx;
1107 frame_number = ost->st->nb_frames;
1114 ti1 = av_stream_get_end_pts(ost->st) * av_q2d(ost->st->time_base);
1119 avg_bitrate = (double)(ost->data_size * 8) / ti1 / 1000.0;
1121 (double)ost->data_size / 1024, ti1, bitrate, avg_bitrate);
1126 static void finish_output_stream(OutputStream *ost)
1128 OutputFile *of = output_files[ost->file_index];
1131 ost->finished = ENCODER_FINISHED | MUXER_FINISHED;
1153 OutputStream *ost = output_streams[i];
1154 OutputFile *of = output_files[ost->file_index];
1156 AVCodecContext *enc = ost->enc_ctx;
1159 if (!ost->filter)
1161 filter = ost->filter->filter;
1163 if (!ost->filtered_frame && !(ost->filtered_frame = av_frame_alloc())) {
1166 filtered_frame = ost->filtered_frame;
1178 if (ost->finished) {
1189 //if (ost->source_index >= 0)
1190 // *filtered_frame= *input_streams[ost->source_index]->decoded_frame; //for me_threshold
1195 if (!ost->frame_aspect_ratio.num)
1204 do_video_out(of->ctx, ost, filtered_frame);
1214 do_audio_out(of->ctx, ost, filtered_frame);
1237 OutputStream *ost = output_streams[i];
1238 switch (ost->enc_ctx->codec_type) {
1239 case AVMEDIA_TYPE_VIDEO: video_size += ost->data_size; break;
1240 case AVMEDIA_TYPE_AUDIO: audio_size += ost->data_size; break;
1241 case AVMEDIA_TYPE_SUBTITLE: subtitle_size += ost->data_size; break;
1242 default: other_size += ost->data_size; break;
1244 extra_size += ost->enc_ctx->extradata_size;
1245 data_size += ost->data_size;
1307 OutputStream *ost = output_streams[of->ost_index + j];
1308 enum AVMediaType type = ost->enc_ctx->codec_type;
1310 total_size += ost->data_size;
1311 total_packets += ost->packets_written;
1315 if (ost->encoding_needed) {
1317 ost->frames_encoded);
1319 av_log(NULL, AV_LOG_VERBOSE, " (%"PRIu64" samples)", ost->samples_encoded);
1324 ost->packets_written, ost->data_size);
1341 OutputStream *ost;
1377 ost = output_streams[i];
1378 enc = ost->enc_ctx;
1379 if (!ost->stream_copy && enc->coded_frame)
1384 ost->file_index, ost->index, q);
1389 frame_number = ost->frame_number;
1396 ost->file_index, ost->index, q);
1429 ost->file_index, ost->index, type[j] | 32, p);
1434 ost->file_index, ost->index, p);
1439 if (av_stream_get_end_pts(ost->st) != AV_NOPTS_VALUE)
1440 pts = FFMAX(pts, av_rescale_q(av_stream_get_end_pts(ost->st),
1441 ost->st->time_base, AV_TIME_BASE_Q));
1507 OutputStream *ost = output_streams[i];
1508 AVCodecContext *enc = ost->enc_ctx;
1509 AVFormatContext *os = output_files[ost->file_index]->ctx;
1512 if (!ost->encoding_needed)
1547 update_benchmark("flush %s %d.%d", desc, ost->file_index, ost->index);
1552 if (ost->logfile && enc->stats_out) {
1553 fprintf(ost->logfile, "%s", enc->stats_out);
1559 if (ost->finished & MUXER_FINISHED) {
1563 av_packet_rescale_ts(&pkt, enc->time_base, ost->st->time_base);
1565 write_frame(os, &pkt, ost);
1566 if (ost->enc_ctx->codec_type == AVMEDIA_TYPE_VIDEO && vstats_filename) {
1567 do_video_stats(ost, pkt_size);
1578 * Check whether a packet from ist should be written into ost at this time
1580 static int check_output_constraints(InputStream *ist, OutputStream *ost)
1582 OutputFile *of = output_files[ost->file_index];
1585 if (ost->source_index != ist_index)
1588 if (ost->finished)
1597 static void do_streamcopy(InputStream *ist, OutputStream *ost, const AVPacket *pkt)
1599 OutputFile *of = output_files[ost->file_index];
1602 int64_t ost_tb_start_time = av_rescale_q(start_time, AV_TIME_BASE_Q, ost->st->time_base);
1609 if ((!ost->frame_number && !(pkt->flags & AV_PKT_FLAG_KEY)) &&
1610 !ost->copy_initial_nonkeyframes)
1614 if (!ost->frame_number && ist->pts < start_time &&
1615 !ost->copy_prior_start)
1618 if (!ost->frame_number && pkt->pts < ist_tb_start_time &&
1619 !ost->copy_prior_start)
1625 close_output_stream(ost);
1634 close_output_stream(ost);
1640 if (ost->enc_ctx->codec_type == AVMEDIA_TYPE_VIDEO)
1641 ost->sync_opts++;
1644 opkt.pts = av_rescale_q(pkt->pts, ist->st->time_base, ost->st->time_base) - ost_tb_start_time;
1649 opkt.dts = av_rescale_q(ist->dts, AV_TIME_BASE_Q, ost->st->time_base);
1651 opkt.dts = av_rescale_q(pkt->dts, ist->st->time_base, ost->st->time_base);
1654 if (ost->st->codec->codec_type == AVMEDIA_TYPE_AUDIO && pkt->dts != AV_NOPTS_VALUE) {
1660 ost->st->time_base) - ost_tb_start_time;
1663 opkt.duration = av_rescale_q(pkt->duration, ist->st->time_base, ost->st->time_base);
1667 if ( ost->enc_ctx->codec_id != AV_CODEC_ID_H264
1668 && ost->enc_ctx->codec_id != AV_CODEC_ID_MPEG1VIDEO
1669 && ost->enc_ctx->codec_id != AV_CODEC_ID_MPEG2VIDEO
1670 && ost->enc_ctx->codec_id != AV_CODEC_ID_VC1
1672 if (av_parser_change(ost->parser, ost->st->codec,
1686 if (ost->st->codec->codec_type == AVMEDIA_TYPE_VIDEO && (of->ctx->oformat->flags & AVFMT_RAWPICTURE)) {
1688 avpicture_fill(&pict, opkt.data, ost->st->codec->pix_fmt, ost->st->codec->width, ost->st->codec->height);
1694 write_frame(of->ctx, &opkt, ost);
2028 OutputStream *ost = output_streams[i];
2030 if (!check_output_constraints(ist, ost) || !ost->encoding_needed
2031 || ost->enc->type != AVMEDIA_TYPE_SUBTITLE)
2034 do_subtitle_out(output_files[ost->file_index]->ctx, ost, ist, &subtitle);
2174 OutputStream *ost = output_streams[i];
2176 if (!check_output_constraints(ist, ost) || ost->encoding_needed)
2179 do_streamcopy(ist, ost, pkt);
2302 static InputStream *get_input_stream(OutputStream *ost)
2304 if (ost->source_index >= 0)
2305 return input_streams[ost->source_index];
2315 static void parse_forced_key_frames(char *kf, OutputStream *ost,
2341 AVFormatContext *avf = output_files[ost->file_index]->ctx;
2374 ost->forced_kf_count = size;
2375 ost->forced_kf_pts = pts;
2393 static void set_encoder_id(OutputFile *of, OutputStream *ost)
2402 if (av_dict_get(ost->st->metadata, "encoder", NULL, 0))
2412 e = av_dict_get(ost->encoder_opts, "flags", NULL, 0);
2414 const AVOption *o = av_opt_find(ost->enc_ctx, "flags", NULL, 0, 0);
2417 av_opt_eval_flags(ost->enc_ctx, o, e->value, &codec_flags);
2420 encoder_string_len = sizeof(LIBAVCODEC_IDENT) + strlen(ost->enc->name) + 2;
2429 av_strlcat(encoder_string, ost->enc->name, encoder_string_len);
2430 av_dict_set(&ost->st->metadata, "encoder", encoder_string,
2438 OutputStream *ost;
2447 if (!ofilter->ost || ofilter->ost->source_index >= 0)
2454 ofilter->ost->source_index = k;
2485 ost = output_streams[i];
2486 oc = output_files[ost->file_index]->ctx;
2487 ist = get_input_stream(ost);
2489 if (ost->attachment_filename)
2492 enc_ctx = ost->enc_ctx;
2497 ost->st->disposition = ist->st->disposition;
2503 if (st != ost->st && st->codec->codec_type == enc_ctx->codec_type)
2508 ost->st->disposition = AV_DISPOSITION_DEFAULT;
2511 if (ost->stream_copy) {
2515 av_assert0(ist && !ost->filter);
2590 if (ist && !ost->frame_rate.num)
2591 ost->frame_rate = ist->framerate;
2592 if(ost->frame_rate.num)
2593 enc_ctx->time_base = av_inv_q(ost->frame_rate);
2598 ost->parser = av_parser_init(enc_ctx->codec_id);
2623 if (ost->frame_aspect_ratio.num) { // overridden by the -aspect cli option
2625 av_mul_q(ost->frame_aspect_ratio,
2634 ost->st->sample_aspect_ratio = enc_ctx->sample_aspect_ratio = sar;
2635 ost->st->avg_frame_rate = ist->st->avg_frame_rate;
2648 if (!ost->enc)
2649 ost->enc = avcodec_find_encoder(enc_ctx->codec_id);
2650 if (!ost->enc) {
2653 avcodec_get_name(ost->st->codec->codec_id), ost->file_index, ost->index);
2660 ost->encoding_needed = 1;
2662 set_encoder_id(output_files[ost->file_index], ost);
2664 if (!ost->filter &&
2668 fg = init_simple_filtergraph(ist, ost);
2676 if (ost->filter && !ost->frame_rate.num)
2677 ost->frame_rate = av_buffersink_get_frame_rate(ost->filter->filter);
2678 if (ist && !ost->frame_rate.num)
2679 ost->frame_rate = ist->framerate;
2680 if (ist && !ost->frame_rate.num)
2681 ost->frame_rate = ist->st->r_frame_rate;
2682 if (ist && !ost->frame_rate.num) {
2683 ost->frame_rate = (AVRational){25, 1};
2689 ost->file_index, ost->index);
2691 // ost->frame_rate = ist->st->avg_frame_rate.num ? ist->st->avg_frame_rate : (AVRational){25, 1};
2692 if (ost->enc && ost->enc->supported_framerates && !ost->force_fps) {
2693 int idx = av_find_nearest_q_idx(ost->frame_rate, ost->enc->supported_framerates);
2694 ost->frame_rate = ost->enc->supported_framerates[idx];
2697 av_reduce(&ost->frame_rate.num, &ost->frame_rate.den,
2698 ost->frame_rate.num, ost->frame_rate.den, 65535);
2704 enc_ctx->sample_fmt = ost->filter->filter->inputs[0]->format;
2705 enc_ctx->sample_rate = ost->filter->filter->inputs[0]->sample_rate;
2706 enc_ctx->channel_layout = ost->filter->filter->inputs[0]->channel_layout;
2707 enc_ctx->channels = avfilter_link_get_channels(ost->filter->filter->inputs[0]);
2711 enc_ctx->time_base = av_inv_q(ost->frame_rate);
2712 if (ost->filter && !(enc_ctx->time_base.num && enc_ctx->time_base.den))
2713 enc_ctx->time_base = ost->filter->filter->inputs[0]->time_base;
2719 for (j = 0; j < ost->forced_kf_count; j++)
2720 ost->forced_kf_pts[j] = av_rescale_q(ost->forced_kf_pts[j],
2724 enc_ctx->width = ost->filter->filter->inputs[0]->w;
2725 enc_ctx->height = ost->filter->filter->inputs[0]->h;
2726 enc_ctx->sample_aspect_ratio = ost->st->sample_aspect_ratio =
2727 ost->frame_aspect_ratio.num ? // overridden by the -aspect cli option
2728 av_mul_q(ost->frame_aspect_ratio, (AVRational){ enc_ctx->height, enc_ctx->width }) :
2729 ost->filter->filter->inputs[0]->sample_aspect_ratio;
2730 if (!strncmp(ost->enc->name, "libx264", 7) &&
2732 ost->filter->filter->inputs[0]->format != AV_PIX_FMT_YUV420P)
2736 av_get_pix_fmt_name(ost->filter->filter->inputs[0]->format));
2737 if (!strncmp(ost->enc->name, "mpeg2video", 10) &&
2739 ost->filter->filter->inputs[0]->format != AV_PIX_FMT_YUV420P)
2743 av_get_pix_fmt_name(ost->filter->filter->inputs[0]->format));
2744 enc_ctx->pix_fmt = ost->filter->filter->inputs[0]->format;
2746 ost->st->avg_frame_rate = ost->frame_rate;
2755 if (ost->forced_keyframes) {
2756 if (!strncmp(ost->forced_keyframes, "expr:", 5)) {
2757 ret = av_expr_parse(&ost->forced_keyframes_pexpr, ost->forced_keyframes+5,
2761 "Invalid force_key_frames expression '%s'\n", ost->forced_keyframes+5);
2764 ost->forced_keyframes_expr_const_values[FKF_N] = 0;
2765 ost->forced_keyframes_expr_const_values[FKF_N_FORCED] = 0;
2766 ost->forced_keyframes_expr_const_values[FKF_PREV_FORCED_N] = NAN;
2767 ost->forced_keyframes_expr_const_values[FKF_PREV_FORCED_T] = NAN;
2769 parse_forced_key_frames(ost->forced_keyframes, ost, ost->enc_ctx);
2776 enc_ctx->width = input_streams[ost->source_index]->st->codec->width;
2777 enc_ctx->height = input_streams[ost->source_index]->st->codec->height;
2790 ost->logfile_prefix ? ost->logfile_prefix :
2793 if (!strcmp(ost->enc->name, "libx264")) {
2794 av_dict_set(&ost->encoder_opts, "stats", logfilename, AV_DICT_DONT_OVERWRITE);
2813 ost->logfile = f;
2822 ost = output_streams[i];
2823 if (ost->encoding_needed) {
2824 AVCodec *codec = ost->enc;
2827 if ((ist = get_input_stream(ost)))
2831 ost->enc_ctx->subtitle_header = av_mallocz(dec->subtitle_header_size + 1);
2832 if (!ost->enc_ctx->subtitle_header) {
2836 memcpy(ost->enc_ctx->subtitle_header, dec->subtitle_header, dec->subtitle_header_size);
2837 ost->enc_ctx->subtitle_header_size = dec->subtitle_header_size;
2839 if (!av_dict_get(ost->encoder_opts, "threads", NULL, 0))
2840 av_dict_set(&ost->encoder_opts, "threads", "auto", 0);
2841 av_dict_set(&ost->encoder_opts, "side_data_only_packets", "1", 0);
2843 if ((ret = avcodec_open2(ost->enc_ctx, codec, &ost->encoder_opts)) < 0) {
2847 ost->file_index, ost->index);
2850 if (ost->enc->type == AVMEDIA_TYPE_AUDIO &&
2851 !(ost->enc->capabilities & CODEC_CAP_VARIABLE_FRAME_SIZE))
2852 av_buffersink_set_frame_size(ost->filter->filter,
2853 ost->enc_ctx->frame_size);
2854 assert_avoptions(ost->encoder_opts);
2855 if (ost->enc_ctx->bit_rate && ost->enc_ctx->bit_rate < 1000)
2859 if (av_opt_set_dict(ost->enc_ctx, &ost->encoder_opts) < 0) {
2866 ret = avcodec_copy_context(ost->st->codec, ost->enc_ctx);
2872 ost->st->codec->codec= ost->enc_ctx->codec;
2875 ost->st->time_base = av_add_q(ost->enc_ctx->time_base, (AVRational){0, 1});
2882 ost = output_streams[i];
2883 avcodec_close(ost->enc_ctx);
2947 ost = output_streams[i];
2949 if (ost->attachment_filename) {
2952 ost->attachment_filename, ost->file_index, ost->index);
2956 if (ost->filter && ost->filter->graph->graph_desc) {
2958 av_log(NULL, AV_LOG_INFO, " %s", ost->filter->name);
2960 av_log(NULL, AV_LOG_INFO, " (graph %d)", ost->filter->graph->index);
2962 av_log(NULL, AV_LOG_INFO, " -> Stream #%d:%d (%s)\n", ost->file_index,
2963 ost->index, ost->enc ? ost->enc->name : "?");
2968 input_streams[ost->source_index]->file_index,
2969 input_streams[ost->source_index]->st->index,
2970 ost->file_index,
2971 ost->index);
2972 if (ost->sync_ist != input_streams[ost->source_index])
2974 ost->sync_ist->file_index,
2975 ost->sync_ist->st->index);
2976 if (ost->stream_copy)
2979 const AVCodec *in_codec = input_streams[ost->source_index]->dec;
2980 const AVCodec *out_codec = ost->enc;
3027 OutputStream *ost = output_streams[i];
3028 OutputFile *of = output_files[ost->file_index];
3029 AVFormatContext *os = output_files[ost->file_index]->ctx;
3031 if (ost->finished ||
3034 if (ost->frame_number >= ost->max_frames) {
3059 OutputStream *ost = output_streams[i];
3060 int64_t opts = av_rescale_q(ost->st->cur_dts, ost->st->time_base,
3062 if (!ost->unavailable && !ost->finished && opts < opts_min) {
3064 ost_min = ost;
3145 OutputStream *ost = output_streams[i];
3146 ost->enc_ctx->debug = debug;
3333 OutputStream *ost = output_streams[j];
3335 if (ost->source_index == ifile->ist_index + i &&
3336 (ost->stream_copy || ost->enc->type == AVMEDIA_TYPE_SUBTITLE))
3337 finish_output_stream(ost);
3544 close_output_stream(graph->outputs[i]->ost);
3565 graph->outputs[i]->ost->unavailable = 1;
3577 OutputStream *ost;
3581 ost = choose_output();
3582 if (!ost) {
3592 if (ost->filter) {
3593 if ((ret = transcode_from_filter(ost->filter->graph, &ist)) < 0)
3598 av_assert0(ost->source_index >= 0);
3599 ist = input_streams[ost->source_index];
3605 ost->unavailable = 1;
3621 OutputStream *ost;
3692 ost = output_streams[i];
3693 if (ost->encoding_needed) {
3694 av_freep(&ost->enc_ctx->stats_in);
3718 ost = output_streams[i];
3719 if (ost) {
3720 if (ost->logfile) {
3721 fclose(ost->logfile);
3722 ost->logfile = NULL;
3724 av_freep(&ost->forced_kf_pts);
3725 av_freep(&ost->apad);
3726 av_dict_free(&ost->encoder_opts);
3727 av_dict_free(&ost->swr_opts);
3728 av_dict_free(&ost->resample_opts);