* [FFmpeg-devel] [PATCH] mov: Reduce the verbosity of the warning about fragmented MP4 vs advanced edit lists
@ 2023-01-17 9:31 Martin Storsjö
2023-01-23 13:59 ` Derek Buitenhuis
0 siblings, 1 reply; 3+ messages in thread
From: Martin Storsjö @ 2023-01-17 9:31 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Derek Buitenhuis
Only warn if the advanced_editlist option is enabled (it is enabled
by default though) so we don't print one warning for each track, and
demote the warning to AV_LOG_LEVEL_VERBOSE; this message does get
generated whenever parsing a fragmented MP4 file, regardless of
whether the file actually uses multiple edits or not.
Later when parsing the mov structures, the demuxer does warn if
the file did contain multiple edits which would require the
advanced_editlist option enabled for decoding correctly.
Adjust the warning message for the case when the file seemed like it
actually would have needed handling of advanced edit lists, to
reflect the fact that it doesn't help to try set the option as
it has been automatically disabled.
---
libavformat/isom.h | 1 +
libavformat/mov.c | 20 ++++++++++++++------
2 files changed, 15 insertions(+), 6 deletions(-)
diff --git a/libavformat/isom.h b/libavformat/isom.h
index 64fb7065d5..5107b4eb74 100644
--- a/libavformat/isom.h
+++ b/libavformat/isom.h
@@ -286,6 +286,7 @@ typedef struct MOVContext {
int use_absolute_path;
int ignore_editlist;
int advanced_editlist;
+ int advanced_editlist_autodisabled;
int ignore_chapters;
int seek_individually;
int64_t next_root_atom; ///< offset of the next root atom
diff --git a/libavformat/mov.c b/libavformat/mov.c
index e0b7df2815..6ab43b00c6 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -4063,10 +4063,15 @@ static void mov_build_index(MOVContext *mov, AVStream *st)
}
}
- if (multiple_edits && !mov->advanced_editlist)
- av_log(mov->fc, AV_LOG_WARNING, "multiple edit list entries, "
- "Use -advanced_editlist to correctly decode otherwise "
- "a/v desync might occur\n");
+ if (multiple_edits && !mov->advanced_editlist) {
+ if (mov->advanced_editlist_autodisabled)
+ av_log(mov->fc, AV_LOG_WARNING, "multiple edit list entries, "
+ "not supported in fragmented MP4 files\n");
+ else
+ av_log(mov->fc, AV_LOG_WARNING, "multiple edit list entries, "
+ "Use -advanced_editlist to correctly decode otherwise "
+ "a/v desync might occur\n");
+ }
/* adjust first dts according to edit list */
if ((empty_duration || start_time) && mov->time_scale > 0) {
@@ -4507,10 +4512,13 @@ static int mov_read_trak(MOVContext *c, AVIOContext *pb, MOVAtom atom)
* It cannot be used with use_mfra_for = {pts,dts} either, as the index
* is not complete, but filled in as more trun atoms are read, as well.
*/
- if (!sc->stts_count || c->use_mfra_for != FF_MOV_FLAG_MFRA_AUTO) {
- av_log(c->fc, AV_LOG_WARNING, "advanced_editlist does not work with fragmented "
+ if (!sc->stts_count || c->use_mfra_for != FF_MOV_FLAG_MFRA_AUTO &&
+ c->advanced_editlist) {
+
+ av_log(c->fc, AV_LOG_VERBOSE, "advanced_editlist does not work with fragmented "
"MP4. disabling.\n");
c->advanced_editlist = 0;
+ c->advanced_editlist_autodisabled = 1;
}
mov_build_index(c, st);
--
2.37.1 (Apple Git-137.1)
_______________________________________________
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] 3+ messages in thread
* Re: [FFmpeg-devel] [PATCH] mov: Reduce the verbosity of the warning about fragmented MP4 vs advanced edit lists
2023-01-17 9:31 [FFmpeg-devel] [PATCH] mov: Reduce the verbosity of the warning about fragmented MP4 vs advanced edit lists Martin Storsjö
@ 2023-01-23 13:59 ` Derek Buitenhuis
2023-01-31 12:37 ` Martin Storsjö
0 siblings, 1 reply; 3+ messages in thread
From: Derek Buitenhuis @ 2023-01-23 13:59 UTC (permalink / raw)
To: ffmpeg-devel
On 1/17/2023 9:31 AM, Martin Storsjö wrote:
> Only warn if the advanced_editlist option is enabled (it is enabled
> by default though) so we don't print one warning for each track, and
> demote the warning to AV_LOG_LEVEL_VERBOSE; this message does get
> generated whenever parsing a fragmented MP4 file, regardless of
> whether the file actually uses multiple edits or not.
>
> Later when parsing the mov structures, the demuxer does warn if
> the file did contain multiple edits which would require the
> advanced_editlist option enabled for decoding correctly.
>
> Adjust the warning message for the case when the file seemed like it
> actually would have needed handling of advanced edit lists, to
> reflect the fact that it doesn't help to try set the option as
> it has been automatically disabled.
> ---
> libavformat/isom.h | 1 +
> libavformat/mov.c | 20 ++++++++++++++------
> 2 files changed, 15 insertions(+), 6 deletions(-)
LGTM.
- Derek
_______________________________________________
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] 3+ messages in thread
* Re: [FFmpeg-devel] [PATCH] mov: Reduce the verbosity of the warning about fragmented MP4 vs advanced edit lists
2023-01-23 13:59 ` Derek Buitenhuis
@ 2023-01-31 12:37 ` Martin Storsjö
0 siblings, 0 replies; 3+ messages in thread
From: Martin Storsjö @ 2023-01-31 12:37 UTC (permalink / raw)
To: FFmpeg development discussions and patches
On Mon, 23 Jan 2023, Derek Buitenhuis wrote:
> On 1/17/2023 9:31 AM, Martin Storsjö wrote:
>> Only warn if the advanced_editlist option is enabled (it is enabled
>> by default though) so we don't print one warning for each track, and
>> demote the warning to AV_LOG_LEVEL_VERBOSE; this message does get
>> generated whenever parsing a fragmented MP4 file, regardless of
>> whether the file actually uses multiple edits or not.
>>
>> Later when parsing the mov structures, the demuxer does warn if
>> the file did contain multiple edits which would require the
>> advanced_editlist option enabled for decoding correctly.
>>
>> Adjust the warning message for the case when the file seemed like it
>> actually would have needed handling of advanced edit lists, to
>> reflect the fact that it doesn't help to try set the option as
>> it has been automatically disabled.
>> ---
>> libavformat/isom.h | 1 +
>> libavformat/mov.c | 20 ++++++++++++++------
>> 2 files changed, 15 insertions(+), 6 deletions(-)
>
> LGTM.
Pushed now, thanks!
// Martin
_______________________________________________
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] 3+ messages in thread
end of thread, other threads:[~2023-01-31 12:38 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-17 9:31 [FFmpeg-devel] [PATCH] mov: Reduce the verbosity of the warning about fragmented MP4 vs advanced edit lists Martin Storsjö
2023-01-23 13:59 ` Derek Buitenhuis
2023-01-31 12:37 ` Martin Storsjö
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