2014-03-18 6:43 GMT+09:00 John Stebbins <[email protected]>: > --- > libavformat/movenc.c | 5 ++++- > libavformat/movenc.h | 2 ++ > 2 files changed, 6 insertions(+), 1 deletion(-) > > diff --git a/libavformat/movenc.c b/libavformat/movenc.c > index 2ae3475..fedfc3c 100644 > --- a/libavformat/movenc.c > +++ b/libavformat/movenc.c > @@ -64,6 +64,7 @@ static const AVOption options[] = { > { "min_frag_duration", "Minimum fragment duration", > offsetof(MOVMuxContext, min_fragment_duration), AV_OPT_TYPE_INT, {.i64 = > 0}, 0, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM}, > { "frag_size", "Maximum fragment size", offsetof(MOVMuxContext, > max_fragment_size), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, > AV_OPT_FLAG_ENCODING_PARAM}, > { "ism_lookahead", "Number of lookahead entries for ISM files", > offsetof(MOVMuxContext, ism_lookahead), AV_OPT_TYPE_INT, {.i64 = 0}, 0, > INT_MAX, AV_OPT_FLAG_ENCODING_PARAM}, > + { "brand", "Override major brand", offsetof(MOVMuxContext, > major_brand), AV_OPT_TYPE_STRING, {.str = NULL}, .flags = > AV_OPT_FLAG_ENCODING_PARAM }, > { NULL }, > }; > > @@ -2564,7 +2565,9 @@ static int mov_write_ftyp_tag(AVIOContext *pb, > AVFormatContext *s) > avio_wb32(pb, 0); /* size */ > ffio_wfourcc(pb, "ftyp"); > > - if (mov->mode == MODE_3GP) { > + if (mov->major_brand) > + ffio_wfourcc(pb, mov->major_brand); > + else if (mov->mode == MODE_3GP) { > ffio_wfourcc(pb, has_h264 ? "3gp6" : "3gp4"); > minor = has_h264 ? 0x100 : 0x200; > } else if (mov->mode & MODE_3G2) { > diff --git a/libavformat/movenc.h b/libavformat/movenc.h > index 1b669e8..cd48981 100644 > --- a/libavformat/movenc.h > +++ b/libavformat/movenc.h > @@ -159,6 +159,8 @@ typedef struct MOVMuxContext { > AVIOContext *mdat_buf; > > int64_t reserved_moov_pos; > + > + char * major_brand; > } MOVMuxContext; > > #define FF_MOV_FLAG_RTP_HINT 1 > -- > 1.8.5.3 > > _______________________________________________ > libav-devel mailing list > [email protected] > https://lists.libav.org/mailman/listinfo/libav-devel >
Are you sure there is danger to be able to produce non-spec compliant files? Brand indicates what spec the file is compliant with. Some derived file formats can't be produced by the capability of the present libavformat because of its restrictions. Files which have incompatible structure physically and/or temporally shall be avoided. Well, I don't have strong objection about this patch though since other options (e.g. fragment related) also could produce non-compliances. _______________________________________________ libav-devel mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-devel
