Lines Matching defs:oc
713 static int copy_metadata(char *outspec, char *inspec, AVFormatContext *oc, AVFormatContext *ic, OptionsContext *o)
772 SET_DICT(type_out, meta_out, oc, idx_out);
790 for (i = 0; i < oc->nb_streams; i++) {
791 if ((ret = check_stream_specifier(oc, oc->streams[i], ostream_spec)) > 0) {
792 meta_out = &oc->streams[i]->metadata;
1524 static OutputStream *new_output_stream(OptionsContext *o, AVFormatContext *oc, enum AVMediaType type, int source_index)
1527 AVStream *st = avformat_new_stream(oc, NULL);
1528 int idx = oc->nb_streams - 1, ret = 0;
1539 if (oc->nb_streams - 1 < o->nb_streamid_map)
1540 st->id = o->streamid_map[oc->nb_streams - 1];
1550 ret = choose_encoder(o, oc, ost);
1582 ost->encoder_opts = filter_codec_opts(o->g->codec_opts, ost->enc->id, oc, st, ost->enc);
1584 MATCH_PER_STREAM_OPT(presets, str, preset, oc, st);
1586 MATCH_PER_STREAM_OPT(autoscale, i, ost->autoscale, oc, st);
1612 ost->encoder_opts = filter_codec_opts(o->g->codec_opts, AV_CODEC_ID_NONE, oc, st, NULL);
1619 MATCH_PER_STREAM_OPT(time_bases, str, time_base, oc, st);
1630 MATCH_PER_STREAM_OPT(enc_time_bases, str, time_base, oc, st);
1642 MATCH_PER_STREAM_OPT(max_frames, i64, ost->max_frames, oc, st);
1652 MATCH_PER_STREAM_OPT(copy_prior_start, i, ost->copy_prior_start, oc ,st);
1654 MATCH_PER_STREAM_OPT(bitstream_filters, str, bsfs, oc, st);
1663 MATCH_PER_STREAM_OPT(codec_tags, str, codec_tag, oc, st);
1675 MATCH_PER_STREAM_OPT(qscale, dbl, qscale, oc, st);
1681 MATCH_PER_STREAM_OPT(disposition, str, ost->disposition, oc, st);
1685 MATCH_PER_STREAM_OPT(max_muxing_queue_size, i, ost->max_muxing_queue_size, oc, st);
1690 MATCH_PER_STREAM_OPT(muxing_queue_data_threshold, i, ost->muxing_queue_data_threshold, oc, st);
1693 oc, st);
1695 if (oc->oformat->flags & AVFMT_GLOBALHEADER)
1717 ost->copy_initial_nonkeyframes, oc, st);
1765 static char *get_ost_filters(OptionsContext *o, AVFormatContext *oc,
1785 static void check_streamcopy_filters(OptionsContext *o, AVFormatContext *oc,
1799 static OutputStream *new_video_stream(OptionsContext *o, AVFormatContext *oc, int source_index)
1806 ost = new_output_stream(o, oc, AVMEDIA_TYPE_VIDEO, source_index);
1810 MATCH_PER_STREAM_OPT(frame_rates, str, frame_rate, oc, st);
1816 MATCH_PER_STREAM_OPT(max_frame_rates, str, max_frame_rate, oc, st);
1831 MATCH_PER_STREAM_OPT(frame_aspect_ratios, str, frame_aspect_ratio, oc, st);
1842 MATCH_PER_STREAM_OPT(filter_scripts, str, ost->filters_script, oc, st);
1843 MATCH_PER_STREAM_OPT(filters, str, ost->filters, oc, st);
1854 MATCH_PER_STREAM_OPT(frame_sizes, str, frame_size, oc, st);
1860 MATCH_PER_STREAM_OPT(frame_pix_fmts, str, frame_pix_fmt, oc, st);
1872 MATCH_PER_STREAM_OPT(intra_matrices, str, intra_matrix, oc, st);
1880 MATCH_PER_STREAM_OPT(chroma_intra_matrices, str, chroma_intra_matrix, oc, st);
1890 MATCH_PER_STREAM_OPT(inter_matrices, str, inter_matrix, oc, st);
1899 MATCH_PER_STREAM_OPT(rc_overrides, str, p, oc, st);
1933 MATCH_PER_STREAM_OPT(pass, i, do_pass, oc, st);
1945 MATCH_PER_STREAM_OPT(passlogfiles, str, ost->logfile_prefix, oc, st);
1984 MATCH_PER_STREAM_OPT(forced_key_frames, str, ost->forced_keyframes, oc, st);
1988 MATCH_PER_STREAM_OPT(force_fps, i, ost->force_fps, oc, st);
1991 MATCH_PER_STREAM_OPT(top_field_first, i, ost->top_field_first, oc, st);
1994 MATCH_PER_STREAM_OPT(fps_mode, str, ost->fps_mode, oc, st);
1999 if (!strcmp(oc->oformat->name, "avi")) {
2002 ost->vsync_method = (oc->oformat->flags & AVFMT_VARIABLE_FPS) ?
2003 ((oc->oformat->flags & AVFMT_NOTIMESTAMPS) ?
2022 ost->avfilter = get_ost_filters(o, oc, ost);
2032 check_streamcopy_filters(o, oc, ost, AVMEDIA_TYPE_VIDEO);
2037 static OutputStream *new_audio_stream(OptionsContext *o, AVFormatContext *oc, int source_index)
2044 ost = new_output_stream(o, oc, AVMEDIA_TYPE_AUDIO, source_index);
2050 MATCH_PER_STREAM_OPT(filter_scripts, str, ost->filters_script, oc, st);
2051 MATCH_PER_STREAM_OPT(filters, str, ost->filters, oc, st);
2058 MATCH_PER_STREAM_OPT(audio_channels, i, channels, oc, st);
2064 MATCH_PER_STREAM_OPT(audio_ch_layouts, str, layout, oc, st);
2085 MATCH_PER_STREAM_OPT(sample_fmts, str, sample_fmt, oc, st);
2092 MATCH_PER_STREAM_OPT(audio_sample_rate, i, audio_enc->sample_rate, oc, st);
2094 MATCH_PER_STREAM_OPT(apad, str, ost->apad, oc, st);
2097 ost->avfilter = get_ost_filters(o, oc, ost);
2132 check_streamcopy_filters(o, oc, ost, AVMEDIA_TYPE_AUDIO);
2137 static OutputStream *new_data_stream(OptionsContext *o, AVFormatContext *oc, int source_index)
2141 ost = new_output_stream(o, oc, AVMEDIA_TYPE_DATA, source_index);
2150 static OutputStream *new_unknown_stream(OptionsContext *o, AVFormatContext *oc, int source_index)
2154 ost = new_output_stream(o, oc, AVMEDIA_TYPE_UNKNOWN, source_index);
2163 static OutputStream *new_attachment_stream(OptionsContext *o, AVFormatContext *oc, int source_index)
2165 OutputStream *ost = new_output_stream(o, oc, AVMEDIA_TYPE_ATTACHMENT, source_index);
2171 static OutputStream *new_subtitle_stream(OptionsContext *o, AVFormatContext *oc, int source_index)
2177 ost = new_output_stream(o, oc, AVMEDIA_TYPE_SUBTITLE, source_index);
2186 MATCH_PER_STREAM_OPT(frame_sizes, str, frame_size, oc, st);
2329 AVFormatContext *oc)
2334 case AVMEDIA_TYPE_VIDEO: ost = new_video_stream(o, oc, -1); break;
2335 case AVMEDIA_TYPE_AUDIO: ost = new_audio_stream(o, oc, -1); break;
2420 AVFormatContext *oc;
2456 err = avformat_alloc_output_context2(&oc, NULL, o->format, filename);
2457 if (!oc) {
2462 of->ctx = oc;
2463 of->format = oc->oformat;
2465 oc->duration = o->recording_time;
2467 oc->interrupt_callback = int_cb;
2470 oc->flags |= AVFMT_FLAG_BITEXACT;
2487 init_output_filter(ofilter, o, oc);
2496 if (!o->video_disable && av_guess_codec(oc->oformat, NULL, filename, NULL, AVMEDIA_TYPE_VIDEO) != AV_CODEC_ID_NONE) {
2498 int qcr = avformat_query_codec(oc->oformat, oc->oformat->video_codec, 0);
2530 new_video_stream(o, oc, idx);
2534 if (!o->audio_disable && av_guess_codec(oc->oformat, NULL, filename, NULL, AVMEDIA_TYPE_AUDIO) != AV_CODEC_ID_NONE) {
2562 new_audio_stream(o, oc, idx);
2566 MATCH_PER_TYPE_OPT(codec_names, str, subtitle_codec_name, oc, "s");
2567 if (!o->subtitle_disable && (avcodec_find_encoder(oc->oformat->subtitle_codec) || subtitle_codec_name)) {
2574 avcodec_find_encoder(oc->oformat->subtitle_codec);
2590 new_subtitle_stream(o, oc, i);
2597 enum AVCodecID codec_id = av_guess_codec(oc->oformat, NULL, filename, NULL, AVMEDIA_TYPE_DATA);
2603 new_data_stream(o, oc, i);
2634 init_output_filter(ofilter, o, oc);
2655 case AVMEDIA_TYPE_VIDEO: ost = new_video_stream (o, oc, src_idx); break;
2656 case AVMEDIA_TYPE_AUDIO: ost = new_audio_stream (o, oc, src_idx); break;
2657 case AVMEDIA_TYPE_SUBTITLE: ost = new_subtitle_stream (o, oc, src_idx); break;
2658 case AVMEDIA_TYPE_DATA: ost = new_data_stream (o, oc, src_idx); break;
2659 case AVMEDIA_TYPE_ATTACHMENT: ost = new_attachment_stream(o, oc, src_idx); break;
2662 ost = new_unknown_stream (o, oc, src_idx);
2710 ost = new_attachment_stream(o, oc, -1);
2721 if (!oc->nb_streams && !(oc->oformat->flags & AVFMT_NOSTREAMS)) {
2722 av_dump_format(oc, nb_output_files - 1, oc->url, 1);
2830 if (oc->oformat->flags & AVFMT_NEEDNUMBER) {
2831 if (!av_filename_number_test(oc->url)) {
2832 print_error(oc->url, AVERROR(EINVAL));
2837 if (!(oc->oformat->flags & AVFMT_NOSTREAMS) && !input_stream_potentially_available) {
2843 if (!(oc->oformat->flags & AVFMT_NOFILE)) {
2848 if ((err = avio_open2(&oc->pb, filename, AVIO_FLAG_WRITE,
2849 &oc->interrupt_callback,
2854 } else if (strcmp(oc->oformat->name, "image2")==0 && !av_filename_number_test(filename))
2860 oc->max_delay = (int)(o->mux_max_delay * AV_TIME_BASE);
2871 copy_metadata(o->metadata_map[i].specifier, *p ? p + 1 : p, oc,
2893 copy_chapters(input_files[o->chapters_input_file], of, oc,
2898 av_dict_copy(&oc->metadata, input_files[0]->ctx->metadata,
2901 av_dict_set(&oc->metadata, "duration", NULL, 0);
2902 av_dict_set(&oc->metadata, "creation_time", NULL, 0);
2903 av_dict_set(&oc->metadata, "company_name", NULL, 0);
2904 av_dict_set(&oc->metadata, "product_name", NULL, 0);
2905 av_dict_set(&oc->metadata, "product_version", NULL, 0);
2948 program = av_new_program(oc, progid);
2975 av_program_add_stream_index(oc, progid, st_num);
3002 for (j = 0; j < oc->nb_streams; j++) {
3003 ost = output_streams[nb_output_streams - oc->nb_streams + j];
3004 if ((ret = check_stream_specifier(oc, oc->streams[j], stream_spec)) > 0) {
3013 av_dict_set(&oc->streams[j]->metadata, o->metadata[i].u.str, *val ? val : NULL, 0);
3022 m = &oc->metadata;
3025 if (index < 0 || index >= oc->nb_chapters) {
3029 m = &oc->chapters[index]->metadata;
3032 if (index < 0 || index >= oc->nb_programs) {
3036 m = &oc->programs[index]->metadata;
3046 err = set_dispositions(of, oc);