int64_t cluster_time_limit;
int is_dash;
int dash_track_number;
+ int is_live;
uint32_t chapter_id_offset;
int wrote_chapters;
mimetype = ff_mkv_mime_tags[i].str;
break;
}
+ for (i = 0; ff_mkv_image_mime_tags[i].id != AV_CODEC_ID_NONE; i++)
+ if (ff_mkv_image_mime_tags[i].id == st->codec->codec_id) {
+ mimetype = ff_mkv_image_mime_tags[i].str;
+ break;
+ }
}
if (!mimetype) {
av_log(s, AV_LOG_ERROR, "Attachment stream %d has no mimetype tag and "
// reserve space for the duration
mkv->duration = 0;
mkv->duration_offset = avio_tell(pb);
- put_ebml_void(pb, 11); // assumes double-precision float to be written
+ if (!mkv->is_live) {
+ put_ebml_void(pb, 11); // assumes double-precision float to be written
+ }
end_ebml_master(pb, segment_info);
ret = mkv_write_tracks(s);
return ret;
}
- if (!s->pb->seekable)
+ if (!s->pb->seekable && !mkv->is_live)
mkv_write_seekhead(pb, mkv->main_seekhead);
mkv->cues = mkv_start_cues(mkv->segment_offset);
avio_seek(pb, currentpos, SEEK_SET);
}
- end_ebml_master(pb, mkv->segment);
+ if (!mkv->is_live) {
+ end_ebml_master(pb, mkv->segment);
+ }
av_freep(&mkv->tracks);
av_freep(&mkv->cues->entries);
av_freep(&mkv->cues);
{ AV_CODEC_ID_NONE, 0xFFFFFFFF }
};
+static const AVCodecTag additional_subtitle_tags[] = {
+ { AV_CODEC_ID_DVB_SUBTITLE, 0xFFFFFFFF },
+ { AV_CODEC_ID_HDMV_PGS_SUBTITLE, 0xFFFFFFFF },
+ { AV_CODEC_ID_NONE, 0xFFFFFFFF }
+};
+
#define OFFSET(x) offsetof(MatroskaMuxContext, x)
#define FLAGS AV_OPT_FLAG_ENCODING_PARAM
static const AVOption options[] = {
{ "cluster_time_limit", "Store at most the provided number of milliseconds in a cluster.", OFFSET(cluster_time_limit), AV_OPT_TYPE_INT64, { .i64 = -1 }, -1, INT64_MAX, FLAGS },
{ "dash", "Create a WebM file conforming to WebM DASH specification", OFFSET(is_dash), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, FLAGS },
{ "dash_track_number", "Track number for the DASH stream", OFFSET(dash_track_number), AV_OPT_TYPE_INT, { .i64 = 1 }, 0, 127, FLAGS },
+ { "live", "Write files assuming it is a live stream.", OFFSET(is_live), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, FLAGS },
{ "allow_raw_vfw", "allow RAW VFW mode", OFFSET(allow_raw_vfw), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, FLAGS },
{ NULL },
};
AVFMT_TS_NONSTRICT | AVFMT_ALLOW_FLUSH,
.codec_tag = (const AVCodecTag* const []){
ff_codec_bmp_tags, ff_codec_wav_tags,
- additional_audio_tags, additional_video_tags, 0
+ additional_audio_tags, additional_video_tags, additional_subtitle_tags, 0
},
.subtitle_codec = AV_CODEC_ID_ASS,
.query_codec = mkv_query_codec,