* [FFmpeg-devel] [PATCH] [PATCH] libavformat/mov: Expose Quicktime poster_time value as metadata TAG.
@ 2022-02-02 23:22 Bryce Chester Newman
2022-07-12 17:20 ` [FFmpeg-devel] [EXTERNAL] " Bryce Newman
2022-07-13 11:19 ` Anton Khirnov
0 siblings, 2 replies; 5+ messages in thread
From: Bryce Chester Newman @ 2022-02-02 23:22 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Bryce Chester Newman
From: Bryce Chester Newman <bryce.newman@gettyimages.com>
I need the ability to derive the poster time found in the mvhd, so I can
use that value to create a thumbnail from ffmpeg. More details can be
found here
https://www.mail-archive.com/ffmpeg-user@ffmpeg.org/msg30003.html
Signed-off-by: Bryce Chester Newman <bryce.newman@gettyimages.com>
---
libavformat/mov: Expose Quicktime poster_time value as metadata TAG.
I need the ability to derive the poster time found in the mvhd, so I can
use that value to create a thumbnail from ffmpeg. More details can be
found here
https://www.mail-archive.com/ffmpeg-user@ffmpeg.org/msg30003.html
Signed-off-by: Bryce Chester Newman bryce.newman@gettyimages.com
Published-As: https://github.com/ffstaging/FFmpeg/releases/tag/pr-ffstaging-21%2Fbrycechesternewman%2Fpatch-poster-time-tag-v1
Fetch-It-Via: git fetch https://github.com/ffstaging/FFmpeg pr-ffstaging-21/brycechesternewman/patch-poster-time-tag-v1
Pull-Request: https://github.com/ffstaging/FFmpeg/pull/21
libavformat/mov.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/libavformat/mov.c b/libavformat/mov.c
index a80fcc1606..3d36f6563f 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -1487,6 +1487,7 @@ static int mov_read_mvhd(MOVContext *c, AVIOContext *pb, MOVAtom atom)
{
int i;
int64_t creation_time;
+ int32_t poster_time;
int version = avio_r8(pb); /* version */
avio_rb24(pb); /* flags */
@@ -1525,12 +1526,21 @@ static int mov_read_mvhd(MOVContext *c, AVIOContext *pb, MOVAtom atom)
avio_rb32(pb); /* preview time */
avio_rb32(pb); /* preview duration */
- avio_rb32(pb); /* poster time */
+ poster_time = avio_rb32(pb); /* poster time */
avio_rb32(pb); /* selection time */
avio_rb32(pb); /* selection duration */
avio_rb32(pb); /* current time */
avio_rb32(pb); /* next track ID */
+ av_log(c->fc, AV_LOG_TRACE, "poster_time = %i, time_scale = %i\n", poster_time, c->time_scale);
+ if(poster_time && c->time_scale && c->time_scale > 0) {
+ char buffer[32];
+ float poster_time_location = (float)poster_time / c->time_scale;
+ snprintf(buffer, sizeof(buffer), "%.2f", poster_time_location);
+ /* This will appear as a TAG in the format section of FFProbe output using -show_format */
+ av_dict_set(&c->fc->metadata, "poster_time", buffer, 0);
+ }
+
return 0;
}
base-commit: 2e82c610553efd69b4d9b6c359423a19c2868255
--
ffmpeg-codebot
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [FFmpeg-devel] [EXTERNAL] [PATCH] [PATCH] libavformat/mov: Expose Quicktime poster_time value as metadata TAG.
2022-02-02 23:22 [FFmpeg-devel] [PATCH] [PATCH] libavformat/mov: Expose Quicktime poster_time value as metadata TAG Bryce Chester Newman
@ 2022-07-12 17:20 ` Bryce Newman
2022-07-13 11:19 ` Anton Khirnov
1 sibling, 0 replies; 5+ messages in thread
From: Bryce Newman @ 2022-07-12 17:20 UTC (permalink / raw)
To: Bryce Chester Newman, ffmpeg-devel
[-- Attachment #1.1: Type: text/plain, Size: 3134 bytes --]
Hello,
Can someone please have a look at this patch request?
Thank you in advance.
Bryce
Bryce Chester Newman | Principal Developer
p: +12069255045 |
From: Bryce Chester Newman <ffmpegagent@gmail.com>
Date: Wednesday, February 2, 2022 at 4:22 PM
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] [PATCH] libavformat/mov: Expose Quicktime poster_time value as metadata TAG.
From: Bryce Chester Newman <bryce.newman@gettyimages.com>
I need the ability to derive the poster time found in the mvhd, so I can
use that value to create a thumbnail from ffmpeg. More details can be
found here
https://www.mail-archive.com/ffmpeg-user@ffmpeg.org/msg30003.html
Signed-off-by: Bryce Chester Newman <bryce.newman@gettyimages.com>
---
libavformat/mov: Expose Quicktime poster_time value as metadata TAG.
I need the ability to derive the poster time found in the mvhd, so I can
use that value to create a thumbnail from ffmpeg. More details can be
found here
https://www.mail-archive.com/ffmpeg-user@ffmpeg.org/msg30003.html
Signed-off-by: Bryce Chester Newman bryce.newman@gettyimages.com
Published-As: https://github.com/ffstaging/FFmpeg/releases/tag/pr-ffstaging-21%2Fbrycechesternewman%2Fpatch-poster-time-tag-v1
Fetch-It-Via: git fetch https://github.com/ffstaging/FFmpeg pr-ffstaging-21/brycechesternewman/patch-poster-time-tag-v1
Pull-Request: https://github.com/ffstaging/FFmpeg/pull/21
libavformat/mov.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/libavformat/mov.c b/libavformat/mov.c
index a80fcc1606..3d36f6563f 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -1487,6 +1487,7 @@ static int mov_read_mvhd(MOVContext *c, AVIOContext *pb, MOVAtom atom)
{
int i;
int64_t creation_time;
+ int32_t poster_time;
int version = avio_r8(pb); /* version */
avio_rb24(pb); /* flags */
@@ -1525,12 +1526,21 @@ static int mov_read_mvhd(MOVContext *c, AVIOContext *pb, MOVAtom atom)
avio_rb32(pb); /* preview time */
avio_rb32(pb); /* preview duration */
- avio_rb32(pb); /* poster time */
+ poster_time = avio_rb32(pb); /* poster time */
avio_rb32(pb); /* selection time */
avio_rb32(pb); /* selection duration */
avio_rb32(pb); /* current time */
avio_rb32(pb); /* next track ID */
+ av_log(c->fc, AV_LOG_TRACE, "poster_time = %i, time_scale = %i\n", poster_time, c->time_scale);
+ if(poster_time && c->time_scale && c->time_scale > 0) {
+ char buffer[32];
+ float poster_time_location = (float)poster_time / c->time_scale;
+ snprintf(buffer, sizeof(buffer), "%.2f", poster_time_location);
+ /* This will appear as a TAG in the format section of FFProbe output using -show_format */
+ av_dict_set(&c->fc->metadata, "poster_time", buffer, 0);
+ }
+
return 0;
}
base-commit: 2e82c610553efd69b4d9b6c359423a19c2868255
--
ffmpeg-codebot
[-- Attachment #1.2: 0.png --]
[-- Type: image/png, Size: 2684 bytes --]
[-- Attachment #1.3: 1.png --]
[-- Type: image/png, Size: 2260 bytes --]
[-- Attachment #1.4: 2.png --]
[-- Type: image/png, Size: 2256 bytes --]
[-- Attachment #1.5: 3.png --]
[-- Type: image/png, Size: 7110 bytes --]
[-- Attachment #1.6: 4.jpg --]
[-- Type: image/jpeg, Size: 12723 bytes --]
[-- Attachment #2: Type: text/plain, Size: 251 bytes --]
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [FFmpeg-devel] [EXTERNAL] [PATCH] [PATCH] libavformat/mov: Expose Quicktime poster_time value as metadata TAG.
2022-02-02 23:22 [FFmpeg-devel] [PATCH] [PATCH] libavformat/mov: Expose Quicktime poster_time value as metadata TAG Bryce Chester Newman
2022-07-12 17:20 ` [FFmpeg-devel] [EXTERNAL] " Bryce Newman
@ 2022-07-13 11:19 ` Anton Khirnov
2022-07-19 17:37 ` Bryce Newman
1 sibling, 1 reply; 5+ messages in thread
From: Anton Khirnov @ 2022-07-13 11:19 UTC (permalink / raw)
To: Bryce Chester Newman, ffmpeg-devel
Quoting Bryce Newman (2022-07-12 19:20:17)
> Hello,
> Can someone please have a look at this patch request?
> Thank you in advance.
Metadata is intended for user-presentable strings, not structured
values.
The least bad way of exporting this I can think of is adding a
demuxer-private AV_OPT_FLAG_EXPORT option.
Also, avoid floating point - it is inexact.
--
Anton Khirnov
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [FFmpeg-devel] [EXTERNAL] [PATCH] [PATCH] libavformat/mov: Expose Quicktime poster_time value as metadata TAG.
2022-07-13 11:19 ` Anton Khirnov
@ 2022-07-19 17:37 ` Bryce Newman
0 siblings, 0 replies; 5+ messages in thread
From: Bryce Newman @ 2022-07-19 17:37 UTC (permalink / raw)
To: FFmpeg development discussions and patches, Bryce Chester Newman
[-- Attachment #1.1: Type: text/plain, Size: 1643 bytes --]
Thank you for the feedback Anton.
I only care about this value being displayed when calling ffprobe, so does it make sense to do this in ffprobe.c or could this be added to the existing mov.c demuxer?
“demuxer-private AV_OPT_FLAG_EXPORT” is new territory for me, so was wondering if there some example of how the similar values could be added to allow ffprobe to stdout the value – perhaps some existing commit request that shows how to make use of exposing values using AV_OPT_FLAG_EXPORT?
Thank you for your time.
From: ffmpeg-devel <ffmpeg-devel-bounces@ffmpeg.org> on behalf of Anton Khirnov <anton@khirnov.net>
Date: Wednesday, July 13, 2022 at 5:19 AM
To: Bryce Chester Newman <ffmpegagent@gmail.com>, ffmpeg-devel@ffmpeg.org <ffmpeg-devel@ffmpeg.org>
Subject: Re: [FFmpeg-devel] [EXTERNAL] [PATCH] [PATCH] libavformat/mov: Expose Quicktime poster_time value as metadata TAG.
Quoting Bryce Newman (2022-07-12 19:20:17)
> Hello,
> Can someone please have a look at this patch request?
> Thank you in advance.
Metadata is intended for user-presentable strings, not structured
values.
The least bad way of exporting this I can think of is adding a
demuxer-private AV_OPT_FLAG_EXPORT option.
Also, avoid floating point - it is inexact.
--
Anton Khirnov
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
Bryce Chester Newman | Principal Developer
p: +12069255045 |
[-- Attachment #1.2: 0.png --]
[-- Type: image/png, Size: 2684 bytes --]
[-- Attachment #1.3: 1.png --]
[-- Type: image/png, Size: 2260 bytes --]
[-- Attachment #1.4: 2.png --]
[-- Type: image/png, Size: 2256 bytes --]
[-- Attachment #1.5: 3.png --]
[-- Type: image/png, Size: 7110 bytes --]
[-- Attachment #1.6: 4.jpg --]
[-- Type: image/jpeg, Size: 12723 bytes --]
[-- Attachment #2: Type: text/plain, Size: 251 bytes --]
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [FFmpeg-devel] [PATCH] [PATCH] libavformat/mov: Expose Quicktime poster_time value as metadata TAG.
@ 2022-03-30 15:33 Bryce Newman
0 siblings, 0 replies; 5+ messages in thread
From: Bryce Newman @ 2022-03-30 15:33 UTC (permalink / raw)
To: ffmpegagent; +Cc: Bryce Newman, ffmpeg-devel
[-- Attachment #1.1: Type: text/plain, Size: 191 bytes --]
Hello,
I was wondering if there are any comments on this patch request?
Thank you in advance.
Bryce
Bryce Chester Newman | Principal Developer
p: +12069255045 |
[-- Attachment #1.2: 0.png --]
[-- Type: image/png, Size: 2684 bytes --]
[-- Attachment #1.3: 1.png --]
[-- Type: image/png, Size: 2260 bytes --]
[-- Attachment #1.4: 2.png --]
[-- Type: image/png, Size: 2256 bytes --]
[-- Attachment #1.5: 3.png --]
[-- Type: image/png, Size: 7110 bytes --]
[-- Attachment #1.6: 4.jpg --]
[-- Type: image/jpeg, Size: 8790 bytes --]
[-- Attachment #2: Type: text/plain, Size: 251 bytes --]
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2022-07-19 17:38 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-02 23:22 [FFmpeg-devel] [PATCH] [PATCH] libavformat/mov: Expose Quicktime poster_time value as metadata TAG Bryce Chester Newman
2022-07-12 17:20 ` [FFmpeg-devel] [EXTERNAL] " Bryce Newman
2022-07-13 11:19 ` Anton Khirnov
2022-07-19 17:37 ` Bryce Newman
2022-03-30 15:33 [FFmpeg-devel] " Bryce Newman
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
This inbox may be cloned and mirrored by anyone:
git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
ffmpegdev@gitmailbox.com
public-inbox-index ffmpegdev
Example config snippet for mirrors.
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git