Exemplo n.º 1
0
static int dv_write_header(AVFormatContext *s)
{
    DVMuxContext *c = s->priv_data;

    if (!dv_init_mux(s)) {
        av_log(s, AV_LOG_ERROR, "Can't initialize DV format!\n"
                    "Make sure that you supply exactly two streams:\n"
                    "     video: 25fps or 29.97fps, audio: 2ch/48kHz/PCM BigEndian\n"
                    "     (50Mbps allows an optional second audio stream)\n");
        return -1;
    }

    // default to drop frame timecode for 29.97 fps
    if (c->sys->time_base.den == 30000 && c->sys->time_base.num == 1001)
        c->timecode_drop_frame = 1;

    if (c->timecode) {
        int drop, framenum;
        framenum = ff_timecode_to_framenum(c->timecode, c->sys->time_base, &drop);
        if (framenum < 0) {
            if (framenum == -1)
                av_log(s, AV_LOG_ERROR, "error parsing timecode, syntax: 00:00:00[;:]00\n");
            else if (framenum == -2)
                av_log(s, AV_LOG_ERROR, "error, unsupported fps for timecode\n");
            else if (framenum == -3)
                av_log(s, AV_LOG_ERROR, "error, drop frame is only allowed with "
                       "30000/1001 or 60000/1001 fps\n");
            return -1;
        }
        c->timecode_start = framenum;
        c->timecode_drop_frame = drop;
    }

    return 0;
}
Exemplo n.º 2
0
static int dv_write_header(AVFormatContext *s)
{
    if (!dv_init_mux(s)) {
        av_log(s, AV_LOG_ERROR, "Can't initialize DV format!\n"
                    "Make sure that you supply exactly two streams:\n"
                    "     video: 25fps or 29.97fps, audio: 2ch/48Khz/PCM\n"
                    "     (50Mbps allows an optional second audio stream)\n");
        return -1;
    }
    return 0;
}