MCPcopy Create free account
hub / github.com/FFmpeg/FFmpeg / dv_write_header

Function dv_write_header

libavformat/dvenc.c:433–459  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

431}
432
433static int dv_write_header(AVFormatContext *s)
434{
435 AVRational rate;
436 DVMuxContext *dvc = s->priv_data;
437 AVDictionaryEntry *tcr = av_dict_get(s->metadata, "timecode", NULL, 0);
438
439 if (dv_init_mux(s) < 0) {
440 av_log(s, AV_LOG_ERROR, "Can't initialize DV format!\n"
441 "Make sure that you supply at least two streams:\n"
442 " video: 25fps or 29.97fps, audio: 2ch/48|44.1|32kHz/PCM\n"
443 " (50Mbps allows an optional second audio stream)\n");
444 return AVERROR_INVALIDDATA;
445 }
446 rate.num = dvc->sys->ltc_divisor;
447 rate.den = 1;
448 if (!tcr) { // no global timecode, look into the streams
449 int i;
450 for (i = 0; i < s->nb_streams; i++) {
451 tcr = av_dict_get(s->streams[i]->metadata, "timecode", NULL, 0);
452 if (tcr)
453 break;
454 }
455 }
456 if (tcr && av_timecode_init_from_string(&dvc->tc, rate, tcr->value, s) >= 0)
457 return 0;
458 return av_timecode_init(&dvc->tc, rate, 0, 0, s);
459}
460
461static int dv_write_packet(struct AVFormatContext *s, AVPacket *pkt)
462{

Callers

nothing calls this directly

Calls 5

av_dict_getFunction · 0.85
dv_init_muxFunction · 0.85
av_logFunction · 0.85
av_timecode_initFunction · 0.85

Tested by

no test coverage detected