summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Liu <lq@chinaffmpeg.org>2016-11-21 20:26:11 +0800
committerSteven Liu <lq@chinaffmpeg.org>2016-11-22 10:18:23 +0800
commitd316b21dba227fa2a2bce0daf02a62f11821227f (patch)
tree2c9f8e6df1a5422264dcb4b169634b17d43cf93f
parent0b8df0ce48e6e3d3263f20ec0ce20fe72bdae318 (diff)
downloadffmpeg-streaming-d316b21dba227fa2a2bce0daf02a62f11821227f.zip
ffmpeg-streaming-d316b21dba227fa2a2bce0daf02a62f11821227f.tar.gz
avformat/flvenc: add no_metadata to flvflags
some flv have no metadata, ffmpeg will same with the source flv stream. Signed-off-by: Steven Liu <lingjiujianke@gmail.com>
-rw-r--r--doc/muxers.texi3
-rw-r--r--libavformat/flvenc.c8
2 files changed, 10 insertions, 1 deletions
diff --git a/doc/muxers.texi b/doc/muxers.texi
index 806182a..8689341 100644
--- a/doc/muxers.texi
+++ b/doc/muxers.texi
@@ -148,6 +148,9 @@ Place AAC sequence header based on audio stream data.
@item no_sequence_end
Disable sequence end tag.
+@item no_metadata
+Disable metadata tag.
+
@item add_keyframe_index
Used to facilitate seeking; particularly for HTTP pseudo streaming.
@end table
diff --git a/libavformat/flvenc.c b/libavformat/flvenc.c
index 4ca6aea..177052a 100644
--- a/libavformat/flvenc.c
+++ b/libavformat/flvenc.c
@@ -67,6 +67,7 @@ typedef enum {
FLV_AAC_SEQ_HEADER_DETECT = (1 << 0),
FLV_NO_SEQUENCE_END = (1 << 1),
FLV_ADD_KEYFRAME_INDEX = (1 << 2),
+ FLV_NO_METADATA = (1 << 3),
} FLVFlags;
typedef struct FLVFileposition {
@@ -744,7 +745,11 @@ static int flv_write_header(AVFormatContext *s)
flv->reserved = 5;
}
- write_metadata(s, 0);
+ if (flv->flags & FLV_NO_METADATA) {
+ pb->seekable = 0;
+ } else {
+ write_metadata(s, 0);
+ }
for (i = 0; i < s->nb_streams; i++) {
flv_write_codec_header(s, s->streams[i]->codecpar);
@@ -1055,6 +1060,7 @@ static const AVOption options[] = {
{ "flvflags", "FLV muxer flags", offsetof(FLVContext, flags), AV_OPT_TYPE_FLAGS, {.i64 = 0}, INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, "flvflags" },
{ "aac_seq_header_detect", "Put AAC sequence header based on stream data", 0, AV_OPT_TYPE_CONST, {.i64 = FLV_AAC_SEQ_HEADER_DETECT}, INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, "flvflags" },
{ "no_sequence_end", "disable sequence end for FLV", 0, AV_OPT_TYPE_CONST, {.i64 = FLV_NO_SEQUENCE_END}, INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, "flvflags" },
+ { "no_metadata", "disable metadata for FLV", 0, AV_OPT_TYPE_CONST, {.i64 = FLV_NO_METADATA}, INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, "flvflags" },
{ "add_keyframe_index", "Add keyframe index metadata", 0, AV_OPT_TYPE_CONST, {.i64 = FLV_ADD_KEYFRAME_INDEX}, INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, "flvflags" },
{ NULL },
};
OpenPOWER on IntegriCloud