diff mbox series

[FFmpeg-devel,1/3] avformat/movenc: Add command line option to set base mov file timescale

Message ID 1587405459-29001-2-git-send-email-kevin.j.wheatley@gmail.com
State New
Headers show
Series avformat/movenc: Support for variable timescale in mov containers | expand

Checks

Context Check Description
andriy/default pending
andriy/make success Make finished
andriy/make_fate success Make fate finished

Commit Message

Kevin Wheatley April 20, 2020, 5:57 p.m. UTC
Signed-off-by: Kevin Wheatley <kevin.j.wheatley@gmail.com>
---
 libavformat/movenc.c | 1 +
 libavformat/movenc.h | 1 +
 2 files changed, 2 insertions(+)

Comments

Marton Balint May 21, 2020, 9:11 p.m. UTC | #1
On Mon, 20 Apr 2020, Kevin Wheatley wrote:

> Signed-off-by: Kevin Wheatley <kevin.j.wheatley@gmail.com>
> ---
> libavformat/movenc.c | 1 +
> libavformat/movenc.h | 1 +
> 2 files changed, 2 insertions(+)
>
> diff --git a/libavformat/movenc.c b/libavformat/movenc.c
> index 253cff8..7d79eca 100644
> --- a/libavformat/movenc.c
> +++ b/libavformat/movenc.c
> @@ -91,6 +91,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},
> +    { "mov_timescale", "set timescale of mov container", offsetof(MOVMuxContext, mov_timescale), AV_OPT_TYPE_INT, {.i64 = MOV_TIMESCALE}, 0, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM},

Docs update is missing.

>     { "video_track_timescale", "set timescale of all video tracks", offsetof(MOVMuxContext, video_track_timescale), 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 },
>     { "use_editlist", "use edit list", offsetof(MOVMuxContext, use_editlist), AV_OPT_TYPE_BOOL, {.i64 = -1}, -1, 1, AV_OPT_FLAG_ENCODING_PARAM},
> diff --git a/libavformat/movenc.h b/libavformat/movenc.h
> index 997b2d6..322968c 100644
> --- a/libavformat/movenc.h
> +++ b/libavformat/movenc.h
> @@ -205,6 +205,7 @@ typedef struct MOVMuxContext {
>     AVIOContext *mdat_buf;
>     int first_trun;
> 
> +    int mov_timescale;
>     int video_track_timescale;
>
>     int reserved_moov_size; ///< 0 for disabled, -1 for automatic, size otherwise
> -- 
> 1.8.5.6

Regards,
Marton
diff mbox series

Patch

diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 253cff8..7d79eca 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -91,6 +91,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},
+    { "mov_timescale", "set timescale of mov container", offsetof(MOVMuxContext, mov_timescale), AV_OPT_TYPE_INT, {.i64 = MOV_TIMESCALE}, 0, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM},
     { "video_track_timescale", "set timescale of all video tracks", offsetof(MOVMuxContext, video_track_timescale), 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 },
     { "use_editlist", "use edit list", offsetof(MOVMuxContext, use_editlist), AV_OPT_TYPE_BOOL, {.i64 = -1}, -1, 1, AV_OPT_FLAG_ENCODING_PARAM},
diff --git a/libavformat/movenc.h b/libavformat/movenc.h
index 997b2d6..322968c 100644
--- a/libavformat/movenc.h
+++ b/libavformat/movenc.h
@@ -205,6 +205,7 @@  typedef struct MOVMuxContext {
     AVIOContext *mdat_buf;
     int first_trun;
 
+    int mov_timescale;
     int video_track_timescale;
 
     int reserved_moov_size; ///< 0 for disabled, -1 for automatic, size otherwise