diff mbox series

[FFmpeg-devel,v2,2/2] ibavformat/mov: Add support for exporting poster time.

Message ID c8f54a5d8696f4aa45ec3fcdc6775096bb2254fe.1664979908.git.ffmpegagent@gmail.com
State New
Headers show
Series libavformat/mov: Add support for exporting poster time. | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Aman Karmani Oct. 5, 2022, 2:25 p.m. UTC
From: Bryce Chester Newman <bryce.newman@gettyimages.com>

Change demuxer option name from
poster_time_location
to export_poster_time_location.

Export the poster_time_location if available.
The poster_time_location is calculated using
the poster_time / time_scale = X seconds.
The value of poster_time_location indicates
where in the video the poster frame is.

Addresses feedback
from https://www.mail-archive.com/ffmpeg-devel@ffmpeg.org/msg138122.html.

Signed-off-by: Bryce Chester Newman bryce.newman@gettyimages.com
---
 doc/demuxers.texi  | 4 ++--
 libavformat/isom.h | 2 +-
 libavformat/mov.c  | 4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)

Comments

Bryce Newman Nov. 28, 2022, 2:11 p.m. UTC | #1
Hi,
This should address the feedback from a prior change that was not accepted.
Could I please get some eyes on this?
Thank you in advance.
Bryce
    
    

Bryce Chester Newman | Principal Developer
 
p: +12069255045 | 



From: Bryce Chester Newman <ffmpegagent@gmail.com>
Date: Wednesday, October 5, 2022 at 8:25 AM
To: ffmpeg-devel@ffmpeg.org <ffmpeg-devel@ffmpeg.org>
Cc: Bryce Newman <bryce.newman@gettyimages.com>, Bryce Newman <bryce.newman@gettyimages.com>
Subject: [EXTERNAL] [PATCH v2 2/2] ibavformat/mov: Add support for exporting poster time.
From: Bryce Chester Newman <bryce.newman@gettyimages.com>

Change demuxer option name from
poster_time_location
to export_poster_time_location.

Export the poster_time_location if available.
The poster_time_location is calculated using
the poster_time / time_scale = X seconds.
The value of poster_time_location indicates
where in the video the poster frame is.

Addresses feedback
from https://www.mail-archive.com/ffmpeg-devel@ffmpeg.org/msg138122.html.

Signed-off-by: Bryce Chester Newman bryce.newman@gettyimages.com
---
 doc/demuxers.texi  | 4 ++--
 libavformat/isom.h | 2 +-
 libavformat/mov.c  | 4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/doc/demuxers.texi b/doc/demuxers.texi
index b1f4926c40..447287357d 100644
--- a/doc/demuxers.texi
+++ b/doc/demuxers.texi
@@ -750,10 +750,10 @@ cast to int32 are used to adjust onward dts.
 Unit is the track time scale. Range is 0 to UINT_MAX. Default is @code{UINT_MAX - 48000*10} which allows upto
 a 10 second dts correction for 48 kHz audio streams while accommodating 99.9% of @code{uint32} range.

-@item poster_time_location
+@item export_poster_time_location
 Export the poster_time_location if available.
 The poster_time_location is calculated using the poster_time / time_scale = X seconds.
-The value of poster_time_location indicates where in the video the poster frame is.
+The value of the poster_time_location key indicates where in the video the poster frame is.
 Default is false.
 @end table

diff --git a/libavformat/isom.h b/libavformat/isom.h
index fb3d8d5618..f621abec76 100644
--- a/libavformat/isom.h
+++ b/libavformat/isom.h
@@ -326,7 +326,7 @@ typedef struct MOVContext {
         int64_t extent_offset;
     } *avif_info;
     int avif_info_size;
-    int poster_time_location;
+    int export_poster_time_location;
 } MOVContext;

 int ff_mp4_read_descr_len(AVIOContext *pb);
diff --git a/libavformat/mov.c b/libavformat/mov.c
index b914bbc96a..be939f6cc2 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -1542,7 +1542,7 @@ static int mov_read_mvhd(MOVContext *c, AVIOContext *pb, MOVAtom atom)
     avio_rb32(pb); /* current time */
     avio_rb32(pb); /* next track ID */

-    if(c->poster_time_location && poster_time && c->time_scale && c->time_scale > 0) {
+    if(c->export_poster_time_location && poster_time && c->time_scale && c->time_scale > 0) {
         av_log(c->fc, AV_LOG_TRACE, "poster_time = %i, time_scale = %i\n", poster_time, c->time_scale);
         char buffer[32];
         int poster_time_location = poster_time / c->time_scale;
@@ -9123,7 +9123,7 @@ static const AVOption mov_options[] = {
     { "enable_drefs", "Enable external track support.", OFFSET(enable_drefs), AV_OPT_TYPE_BOOL,
         {.i64 = 0}, 0, 1, FLAGS },
     { "max_stts_delta", "treat offsets above this value as invalid", OFFSET(max_stts_delta), AV_OPT_TYPE_INT, {.i64 = UINT_MAX-48000*10 }, 0, UINT_MAX, .flags = AV_OPT_FLAG_DECODING_PARAM },
-    { "poster_time_location", "Export the poster time location.", OFFSET(poster_time_location), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, FLAGS | AV_OPT_FLAG_EXPORT },
+    { "export_poster_time_location", "Export the poster time location.", OFFSET(export_poster_time_location), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, FLAGS | AV_OPT_FLAG_EXPORT },
     { NULL },
 };

--
ffmpeg-codebot
Bryce Newman Jan. 9, 2023, 5:01 p.m. UTC | #2
Hi,
Any possibility of getting this change into the next versioned release of FFmpeg?
Thank you.
Bryce
    
    

Bryce Chester Newman | Principal Developer
 
p: +12069255045 | 



From: Bryce Newman <bryce.newman@gettyimages.com>
Date: Monday, November 28, 2022 at 7:11 AM
To: ffmpeg-devel@ffmpeg.org <ffmpeg-devel@ffmpeg.org>
Subject: Re: [EXTERNAL] [PATCH v2 2/2] ibavformat/mov: Add support for exporting poster time.
Hi,
This should address the feedback from a prior change that was not accepted.
Could I please get some eyes on this?
Thank you in advance.
Bryce

From: Bryce Chester Newman <ffmpegagent@gmail.com>
Date: Wednesday, October 5, 2022 at 8:25 AM
To: ffmpeg-devel@ffmpeg.org <ffmpeg-devel@ffmpeg.org>
Cc: Bryce Newman <bryce.newman@gettyimages.com>, Bryce Newman <bryce.newman@gettyimages.com>
Subject: [EXTERNAL] [PATCH v2 2/2] ibavformat/mov: Add support for exporting poster time.
From: Bryce Chester Newman <bryce.newman@gettyimages.com>

Change demuxer option name from
poster_time_location
to export_poster_time_location.

Export the poster_time_location if available.
The poster_time_location is calculated using
the poster_time / time_scale = X seconds.
The value of poster_time_location indicates
where in the video the poster frame is.

Addresses feedback
from https://www.mail-archive.com/ffmpeg-devel@ffmpeg.org/msg138122.html.

Signed-off-by: Bryce Chester Newman bryce.newman@gettyimages.com
---
 doc/demuxers.texi  | 4 ++--
 libavformat/isom.h | 2 +-
 libavformat/mov.c  | 4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/doc/demuxers.texi b/doc/demuxers.texi
index b1f4926c40..447287357d 100644
--- a/doc/demuxers.texi
+++ b/doc/demuxers.texi
@@ -750,10 +750,10 @@ cast to int32 are used to adjust onward dts.
 Unit is the track time scale. Range is 0 to UINT_MAX. Default is @code{UINT_MAX - 48000*10} which allows upto
 a 10 second dts correction for 48 kHz audio streams while accommodating 99.9% of @code{uint32} range.

-@item poster_time_location
+@item export_poster_time_location
 Export the poster_time_location if available.
 The poster_time_location is calculated using the poster_time / time_scale = X seconds.
-The value of poster_time_location indicates where in the video the poster frame is.
+The value of the poster_time_location key indicates where in the video the poster frame is.
 Default is false.
 @end table

diff --git a/libavformat/isom.h b/libavformat/isom.h
index fb3d8d5618..f621abec76 100644
--- a/libavformat/isom.h
+++ b/libavformat/isom.h
@@ -326,7 +326,7 @@ typedef struct MOVContext {
         int64_t extent_offset;
     } *avif_info;
     int avif_info_size;
-    int poster_time_location;
+    int export_poster_time_location;
 } MOVContext;

 int ff_mp4_read_descr_len(AVIOContext *pb);
diff --git a/libavformat/mov.c b/libavformat/mov.c
index b914bbc96a..be939f6cc2 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -1542,7 +1542,7 @@ static int mov_read_mvhd(MOVContext *c, AVIOContext *pb, MOVAtom atom)
     avio_rb32(pb); /* current time */
     avio_rb32(pb); /* next track ID */

-    if(c->poster_time_location && poster_time && c->time_scale && c->time_scale > 0) {
+    if(c->export_poster_time_location && poster_time && c->time_scale && c->time_scale > 0) {
         av_log(c->fc, AV_LOG_TRACE, "poster_time = %i, time_scale = %i\n", poster_time, c->time_scale);
         char buffer[32];
         int poster_time_location = poster_time / c->time_scale;
@@ -9123,7 +9123,7 @@ static const AVOption mov_options[] = {
     { "enable_drefs", "Enable external track support.", OFFSET(enable_drefs), AV_OPT_TYPE_BOOL,
         {.i64 = 0}, 0, 1, FLAGS },
     { "max_stts_delta", "treat offsets above this value as invalid", OFFSET(max_stts_delta), AV_OPT_TYPE_INT, {.i64 = UINT_MAX-48000*10 }, 0, UINT_MAX, .flags = AV_OPT_FLAG_DECODING_PARAM },
-    { "poster_time_location", "Export the poster time location.", OFFSET(poster_time_location), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, FLAGS | AV_OPT_FLAG_EXPORT },
+    { "export_poster_time_location", "Export the poster time location.", OFFSET(export_poster_time_location), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, FLAGS | AV_OPT_FLAG_EXPORT },
     { NULL },
 };

--
ffmpeg-codebot
Zhao Zhili Jan. 10, 2023, 2:56 a.m. UTC | #3
> On Oct 5, 2022, at 22:25, Bryce Chester Newman <ffmpegagent@gmail.com> wrote:
> 
> From: Bryce Chester Newman <bryce.newman@gettyimages.com>
> 
> Change demuxer option name from
> poster_time_location
> to export_poster_time_location.
> 
> Export the poster_time_location if available.
> The poster_time_location is calculated using
> the poster_time / time_scale = X seconds.
> The value of poster_time_location indicates
> where in the video the poster frame is.
> 
> Addresses feedback
> from https://www.mail-archive.com/ffmpeg-devel@ffmpeg.org/msg138122.html.
> 
> Signed-off-by: Bryce Chester Newman bryce.newman@gettyimages.com
> ---
> doc/demuxers.texi  | 4 ++--
> libavformat/isom.h | 2 +-
> libavformat/mov.c  | 4 ++--
> 3 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/doc/demuxers.texi b/doc/demuxers.texi
> index b1f4926c40..447287357d 100644
> --- a/doc/demuxers.texi
> +++ b/doc/demuxers.texi
> @@ -750,10 +750,10 @@ cast to int32 are used to adjust onward dts.
> Unit is the track time scale. Range is 0 to UINT_MAX. Default is @code{UINT_MAX - 48000*10} which allows upto
> a 10 second dts correction for 48 kHz audio streams while accommodating 99.9% of @code{uint32} range.
> 
> -@item poster_time_location
> +@item export_poster_time_location
> Export the poster_time_location if available.
> The poster_time_location is calculated using the poster_time / time_scale = X seconds.
> -The value of poster_time_location indicates where in the video the poster frame is.
> +The value of the poster_time_location key indicates where in the video the poster frame is.
> Default is false.
> @end table
> 
> diff --git a/libavformat/isom.h b/libavformat/isom.h
> index fb3d8d5618..f621abec76 100644
> --- a/libavformat/isom.h
> +++ b/libavformat/isom.h
> @@ -326,7 +326,7 @@ typedef struct MOVContext {
>         int64_t extent_offset;
>     } *avif_info;
>     int avif_info_size;
> -    int poster_time_location;
> +    int export_poster_time_location;
> } MOVContext;
> 
> int ff_mp4_read_descr_len(AVIOContext *pb);
> diff --git a/libavformat/mov.c b/libavformat/mov.c
> index b914bbc96a..be939f6cc2 100644
> --- a/libavformat/mov.c
> +++ b/libavformat/mov.c
> @@ -1542,7 +1542,7 @@ static int mov_read_mvhd(MOVContext *c, AVIOContext *pb, MOVAtom atom)
>     avio_rb32(pb); /* current time */
>     avio_rb32(pb); /* next track ID */
> 
> -    if(c->poster_time_location && poster_time && c->time_scale && c->time_scale > 0) {
> +    if(c->export_poster_time_location && poster_time && c->time_scale && c->time_scale > 0) {
>         av_log(c->fc, AV_LOG_TRACE, "poster_time = %i, time_scale = %i\n", poster_time, c->time_scale);
>         char buffer[32];
>         int poster_time_location = poster_time / c->time_scale;
> @@ -9123,7 +9123,7 @@ static const AVOption mov_options[] = {
>     { "enable_drefs", "Enable external track support.", OFFSET(enable_drefs), AV_OPT_TYPE_BOOL,
>         {.i64 = 0}, 0, 1, FLAGS },
>     { "max_stts_delta", "treat offsets above this value as invalid", OFFSET(max_stts_delta), AV_OPT_TYPE_INT, {.i64 = UINT_MAX-48000*10 }, 0, UINT_MAX, .flags = AV_OPT_FLAG_DECODING_PARAM },
> -    { "poster_time_location", "Export the poster time location.", OFFSET(poster_time_location), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, FLAGS | AV_OPT_FLAG_EXPORT },
> +    { "export_poster_time_location", "Export the poster time location.", OFFSET(export_poster_time_location), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, FLAGS | AV_OPT_FLAG_EXPORT },
>     { NULL },
> };
> 

Firstly, the patch should be based on master.

Secondly, it’s too ad hoc. I don’t see a strong reason to export such information.
Those fields only defined by quicktime, not defined by ISO base media file format.
diff mbox series

Patch

diff --git a/doc/demuxers.texi b/doc/demuxers.texi
index b1f4926c40..447287357d 100644
--- a/doc/demuxers.texi
+++ b/doc/demuxers.texi
@@ -750,10 +750,10 @@  cast to int32 are used to adjust onward dts.
 Unit is the track time scale. Range is 0 to UINT_MAX. Default is @code{UINT_MAX - 48000*10} which allows upto
 a 10 second dts correction for 48 kHz audio streams while accommodating 99.9% of @code{uint32} range.
 
-@item poster_time_location
+@item export_poster_time_location
 Export the poster_time_location if available.
 The poster_time_location is calculated using the poster_time / time_scale = X seconds.
-The value of poster_time_location indicates where in the video the poster frame is.
+The value of the poster_time_location key indicates where in the video the poster frame is.
 Default is false.
 @end table
 
diff --git a/libavformat/isom.h b/libavformat/isom.h
index fb3d8d5618..f621abec76 100644
--- a/libavformat/isom.h
+++ b/libavformat/isom.h
@@ -326,7 +326,7 @@  typedef struct MOVContext {
         int64_t extent_offset;
     } *avif_info;
     int avif_info_size;
-    int poster_time_location;
+    int export_poster_time_location;
 } MOVContext;
 
 int ff_mp4_read_descr_len(AVIOContext *pb);
diff --git a/libavformat/mov.c b/libavformat/mov.c
index b914bbc96a..be939f6cc2 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -1542,7 +1542,7 @@  static int mov_read_mvhd(MOVContext *c, AVIOContext *pb, MOVAtom atom)
     avio_rb32(pb); /* current time */
     avio_rb32(pb); /* next track ID */
 
-    if(c->poster_time_location && poster_time && c->time_scale && c->time_scale > 0) {
+    if(c->export_poster_time_location && poster_time && c->time_scale && c->time_scale > 0) {
         av_log(c->fc, AV_LOG_TRACE, "poster_time = %i, time_scale = %i\n", poster_time, c->time_scale);
         char buffer[32];
         int poster_time_location = poster_time / c->time_scale;
@@ -9123,7 +9123,7 @@  static const AVOption mov_options[] = {
     { "enable_drefs", "Enable external track support.", OFFSET(enable_drefs), AV_OPT_TYPE_BOOL,
         {.i64 = 0}, 0, 1, FLAGS },
     { "max_stts_delta", "treat offsets above this value as invalid", OFFSET(max_stts_delta), AV_OPT_TYPE_INT, {.i64 = UINT_MAX-48000*10 }, 0, UINT_MAX, .flags = AV_OPT_FLAG_DECODING_PARAM },
-    { "poster_time_location", "Export the poster time location.", OFFSET(poster_time_location), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, FLAGS | AV_OPT_FLAG_EXPORT },
+    { "export_poster_time_location", "Export the poster time location.", OFFSET(export_poster_time_location), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, FLAGS | AV_OPT_FLAG_EXPORT },
     { NULL },
 };