Lines Matching defs:oc
415 static int copy_metadata(char *outspec, char *inspec, AVFormatContext *oc, AVFormatContext *ic, OptionsContext *o)
474 SET_DICT(type_out, meta_out, oc, idx_out);
492 for (i = 0; i < oc->nb_streams; i++) {
493 if ((ret = check_stream_specifier(oc, oc->streams[i], ostream_spec)) > 0) {
494 meta_out = &oc->streams[i]->metadata;
1050 static OutputStream *new_output_stream(OptionsContext *o, AVFormatContext *oc, enum AVMediaType type, int source_index)
1053 AVStream *st = avformat_new_stream(oc, NULL);
1054 int idx = oc->nb_streams - 1, ret = 0;
1065 if (oc->nb_streams - 1 < o->nb_streamid_map)
1066 st->id = o->streamid_map[oc->nb_streams - 1];
1077 choose_encoder(o, oc, ost);
1090 ost->encoder_opts = filter_codec_opts(o->g->codec_opts, ost->enc->id, oc, st, ost->enc);
1092 MATCH_PER_STREAM_OPT(presets, str, preset, oc, st);
1117 ost->encoder_opts = filter_codec_opts(o->g->codec_opts, AV_CODEC_ID_NONE, oc, st, NULL);
1121 MATCH_PER_STREAM_OPT(max_frames, i64, ost->max_frames, oc, st);
1131 MATCH_PER_STREAM_OPT(copy_prior_start, i, ost->copy_prior_start, oc ,st);
1133 MATCH_PER_STREAM_OPT(bitstream_filters, str, bsf, oc, st);
1150 MATCH_PER_STREAM_OPT(codec_tags, str, codec_tag, oc, st);
1158 MATCH_PER_STREAM_OPT(qscale, dbl, qscale, oc, st);
1164 if (oc->oformat->flags & AVFMT_GLOBALHEADER)
1232 static char *get_ost_filters(OptionsContext *o, AVFormatContext *oc,
1252 static void check_streamcopy_filters(OptionsContext *o, AVFormatContext *oc,
1266 static OutputStream *new_video_stream(OptionsContext *o, AVFormatContext *oc, int source_index)
1273 ost = new_output_stream(o, oc, AVMEDIA_TYPE_VIDEO, source_index);
1277 MATCH_PER_STREAM_OPT(frame_rates, str, frame_rate, oc, st);
1283 MATCH_PER_STREAM_OPT(frame_aspect_ratios, str, frame_aspect_ratio, oc, st);
1294 MATCH_PER_STREAM_OPT(filter_scripts, str, ost->filters_script, oc, st);
1295 MATCH_PER_STREAM_OPT(filters, str, ost->filters, oc, st);
1306 MATCH_PER_STREAM_OPT(frame_sizes, str, frame_size, oc, st);
1313 MATCH_PER_STREAM_OPT(frame_pix_fmts, str, frame_pix_fmt, oc, st);
1327 MATCH_PER_STREAM_OPT(intra_matrices, str, intra_matrix, oc, st);
1335 MATCH_PER_STREAM_OPT(chroma_intra_matrices, str, chroma_intra_matrix, oc, st);
1345 MATCH_PER_STREAM_OPT(inter_matrices, str, inter_matrix, oc, st);
1354 MATCH_PER_STREAM_OPT(rc_overrides, str, p, oc, st);
1385 MATCH_PER_STREAM_OPT(pass, i, do_pass, oc, st);
1397 MATCH_PER_STREAM_OPT(passlogfiles, str, ost->logfile_prefix, oc, st);
1402 MATCH_PER_STREAM_OPT(forced_key_frames, str, ost->forced_keyframes, oc, st);
1406 MATCH_PER_STREAM_OPT(force_fps, i, ost->force_fps, oc, st);
1409 MATCH_PER_STREAM_OPT(top_field_first, i, ost->top_field_first, oc, st);
1412 ost->avfilter = get_ost_filters(o, oc, ost);
1416 MATCH_PER_STREAM_OPT(copy_initial_nonkeyframes, i, ost->copy_initial_nonkeyframes, oc ,st);
1420 check_streamcopy_filters(o, oc, ost, AVMEDIA_TYPE_VIDEO);
1425 static OutputStream *new_audio_stream(OptionsContext *o, AVFormatContext *oc, int source_index)
1432 ost = new_output_stream(o, oc, AVMEDIA_TYPE_AUDIO, source_index);
1438 MATCH_PER_STREAM_OPT(filter_scripts, str, ost->filters_script, oc, st);
1439 MATCH_PER_STREAM_OPT(filters, str, ost->filters, oc, st);
1444 MATCH_PER_STREAM_OPT(audio_channels, i, audio_enc->channels, oc, st);
1446 MATCH_PER_STREAM_OPT(sample_fmts, str, sample_fmt, oc, st);
1453 MATCH_PER_STREAM_OPT(audio_sample_rate, i, audio_enc->sample_rate, oc, st);
1455 MATCH_PER_STREAM_OPT(apad, str, ost->apad, oc, st);
1458 ost->avfilter = get_ost_filters(o, oc, ost);
1491 check_streamcopy_filters(o, oc, ost, AVMEDIA_TYPE_AUDIO);
1496 static OutputStream *new_data_stream(OptionsContext *o, AVFormatContext *oc, int source_index)
1500 ost = new_output_stream(o, oc, AVMEDIA_TYPE_DATA, source_index);
1509 static OutputStream *new_attachment_stream(OptionsContext *o, AVFormatContext *oc, int source_index)
1511 OutputStream *ost = new_output_stream(o, oc, AVMEDIA_TYPE_ATTACHMENT, source_index);
1517 static OutputStream *new_subtitle_stream(OptionsContext *o, AVFormatContext *oc, int source_index)
1523 ost = new_output_stream(o, oc, AVMEDIA_TYPE_SUBTITLE, source_index);
1529 MATCH_PER_STREAM_OPT(copy_initial_nonkeyframes, i, ost->copy_initial_nonkeyframes, oc, st);
1534 MATCH_PER_STREAM_OPT(frame_sizes, str, frame_size, oc, st);
1652 AVFormatContext *oc)
1658 case AVMEDIA_TYPE_VIDEO: ost = new_video_stream(o, oc, -1); break;
1659 case AVMEDIA_TYPE_AUDIO: ost = new_audio_stream(o, oc, -1); break;
1710 AVFormatContext *oc;
1755 err = avformat_alloc_output_context2(&oc, NULL, o->format, filename);
1756 if (!oc) {
1761 of->ctx = oc;
1763 oc->duration = o->recording_time;
1765 file_oformat= oc->oformat;
1766 oc->interrupt_callback = int_cb;
1783 init_output_filter(ofilter, o, oc);
1802 int err = read_ffserver_streams(o, oc, filename);
1807 for(j = nb_output_streams - oc->nb_streams; j < nb_output_streams; j++) {
1831 if (!o->video_disable && av_guess_codec(oc->oformat, NULL, filename, NULL, AVMEDIA_TYPE_VIDEO) != AV_CODEC_ID_NONE) {
1833 int qcr = avformat_query_codec(oc->oformat, oc->oformat->video_codec, 0);
1849 new_video_stream(o, oc, idx);
1853 if (!o->audio_disable && av_guess_codec(oc->oformat, NULL, filename, NULL, AVMEDIA_TYPE_AUDIO) != AV_CODEC_ID_NONE) {
1864 new_audio_stream(o, oc, idx);
1868 MATCH_PER_TYPE_OPT(codec_names, str, subtitle_codec_name, oc, "s");
1869 if (!o->subtitle_disable && (avcodec_find_encoder(oc->oformat->subtitle_codec) || subtitle_codec_name)) {
1872 new_subtitle_stream(o, oc, i);
1905 init_output_filter(ofilter, o, oc);
1920 case AVMEDIA_TYPE_VIDEO: ost = new_video_stream (o, oc, src_idx); break;
1921 case AVMEDIA_TYPE_AUDIO: ost = new_audio_stream (o, oc, src_idx); break;
1922 case AVMEDIA_TYPE_SUBTITLE: ost = new_subtitle_stream (o, oc, src_idx); break;
1923 case AVMEDIA_TYPE_DATA: ost = new_data_stream (o, oc, src_idx); break;
1924 case AVMEDIA_TYPE_ATTACHMENT: ost = new_attachment_stream(o, oc, src_idx); break;
1958 ost = new_attachment_stream(o, oc, -1);
1970 for (i = nb_output_streams - oc->nb_streams; i < nb_output_streams; i++) { //for all streams of this output file
1976 && (!e->key[5] || check_stream_specifier(oc, ost->st, e->key+6)))
2019 if (oc->oformat->flags & AVFMT_NEEDNUMBER) {
2020 if (!av_filename_number_test(oc->filename)) {
2021 print_error(oc->filename, AVERROR(EINVAL));
2026 if (!(oc->oformat->flags & AVFMT_NOFILE)) {
2031 if ((err = avio_open2(&oc->pb, filename, AVIO_FLAG_WRITE,
2032 &oc->interrupt_callback,
2037 } else if (strcmp(oc->oformat->name, "image2")==0 && !av_filename_number_test(filename))
2045 oc->max_delay = (int)(o->mux_max_delay * AV_TIME_BASE);
2056 copy_metadata(o->metadata_map[i].specifier, *p ? p + 1 : p, oc,
2083 av_dict_copy(&oc->metadata, input_files[0]->ctx->metadata,
2086 av_dict_set(&oc->metadata, "duration", NULL, 0);
2087 av_dict_set(&oc->metadata, "creation_time", NULL, 0);
2117 for (j = 0; j < oc->nb_streams; j++) {
2118 if ((ret = check_stream_specifier(oc, oc->streams[j], stream_spec)) > 0) {
2119 av_dict_set(&oc->streams[j]->metadata, o->metadata[i].u.str, *val ? val : NULL, 0);
2127 m = &oc->metadata;
2130 if (index < 0 || index >= oc->nb_chapters) {
2134 m = &oc->chapters[index]->metadata;