Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PATCH] libavformat/mov.c: Added configuration flag to skip cover art atom while opening mov parser
@ 2022-04-20 11:39 Malviya, Janpriya
  2022-04-20 13:23 ` Derek Buitenhuis
  0 siblings, 1 reply; 5+ messages in thread
From: Malviya, Janpriya @ 2022-04-20 11:39 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Banerjee, Debasmit, Patel, Pratik, Van Iderstine, David

Hello ffmpeg dev team,
Please look in attached patch.  while integrating FFmpeg we require to add "skip_cover_page" options to skip cover art atom from parsing for M4A / MP4 streams. By default values set as 0 ( False ) so it will not impact others.

Signed-off-by: Janpriya Malviya <Janpriya_Malviya@bose.com>
---
 libavformat/isom.h | 1 +
 libavformat/mov.c  | 7 +++++++
 2 files changed, 8 insertions(+)

diff --git a/libavformat/isom.h b/libavformat/isom.h
index 5caf42b..87f1fe3 100644
--- a/libavformat/isom.h
+++ b/libavformat/isom.h
@@ -315,6 +315,7 @@ typedef struct MOVContext {
     int have_read_mfra_size;
     uint32_t mfra_size;
     uint32_t max_stts_delta;
+    int skip_cover_page;
 } MOVContext;
 
 int ff_mp4_read_descr_len(AVIOContext *pb);
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 6c847de..5e94946 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -201,6 +201,12 @@ static int mov_read_covr(MOVContext *c, AVIOContext *pb, int type, int len)
         return 0;
     }
 
+    if ( c->skip_cover_page ){
+        av_log(c->fc, AV_LOG_WARNING, "skip cover art from parsing \n");
+        avio_skip(pb, len);
+        return 0;
+    }
+
     sc = av_mallocz(sizeof(*sc));
     if (!sc)
         return AVERROR(ENOMEM);
@@ -8866,6 +8872,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 },
+    { "skip_cover_page", "Skip cover pages from parsing ", OFFSET(skip_cover_page),AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, .flags = FLAGS },
 
     { NULL },
 };
-- 
2.7.4


_______________________________________________
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] libavformat/mov.c: Added configuration flag to skip cover art atom while opening mov parser
  2022-04-20 11:39 [FFmpeg-devel] [PATCH] libavformat/mov.c: Added configuration flag to skip cover art atom while opening mov parser Malviya, Janpriya
@ 2022-04-20 13:23 ` Derek Buitenhuis
  2022-04-22 14:30   ` Malviya, Janpriya
  0 siblings, 1 reply; 5+ messages in thread
From: Derek Buitenhuis @ 2022-04-20 13:23 UTC (permalink / raw)
  To: ffmpeg-devel

On 4/20/2022 12:39 PM, Malviya, Janpriya wrote:
> Hello ffmpeg dev team,
> Please look in attached patch.  while integrating FFmpeg we require to add "skip_cover_page" options to skip cover art atom from parsing for M4A / MP4 streams. By default values set as 0 ( False ) so it will not impact others.

Why?

- 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] 5+ messages in thread

* Re: [FFmpeg-devel] [PATCH] libavformat/mov.c: Added configuration flag to skip cover art atom while opening mov parser
  2022-04-20 13:23 ` Derek Buitenhuis
@ 2022-04-22 14:30   ` Malviya, Janpriya
  2022-04-23  9:06     ` Hendrik Leppkes
  0 siblings, 1 reply; 5+ messages in thread
From: Malviya, Janpriya @ 2022-04-22 14:30 UTC (permalink / raw)
  To: FFmpeg development discussions and patches
  Cc: Banerjee, Debasmit, White, Brian, Van Iderstine, David

Hi Derek, 

We require to add this configuration for the following reasons :
- We have our own pipeline mechanism to download & fetch audio data from source. 
- We are using ffmpeg with custom IO callbacks for parsing & decoding fragmentedMP4 streams. 
- Inside the custom IO read operation we are asking to download data from upstream elements. 
- If any stream contains a cover page ( e.g. image file ) then the custom io read call-back issues a read request with large buffer size ( which is obvious ) . On the other side , our source downloader is unable to handle a data request of  that size because of buffer constraints. 
- To integrate FFmpeg with our architecture , we added this flag to issue skip for cover page from parsing 

Let me know what you think.

Regards 
Janpriya.

-----Original Message-----
From: ffmpeg-devel <ffmpeg-devel-bounces@ffmpeg.org> On Behalf Of Derek Buitenhuis
Sent: 20 April 2022 06:54 PM
To: ffmpeg-devel@ffmpeg.org
Subject: Re: [FFmpeg-devel] [PATCH] libavformat/mov.c: Added configuration flag to skip cover art atom while opening mov parser

On 4/20/2022 12:39 PM, Malviya, Janpriya wrote:
> Hello ffmpeg dev team,
> Please look in attached patch.  while integrating FFmpeg we require to add "skip_cover_page" options to skip cover art atom from parsing for M4A / MP4 streams. By default values set as 0 ( False ) so it will not impact others.

Why?

- Derek
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://urldefense.com/v3/__https://ffmpeg.org/mailman/listinfo/ffmpeg-devel__;!!I6pijIezNA!1yHHDlJTrhDzhOKl0pzKhQjCdI7Xz9tLwffBUFRwvGDfkcYo9QqHko7Q5IXdWX3dcmxQgWIkgJL4x75FVs6l1MCHEuEzoIU8$ 

To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

_______________________________________________
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] libavformat/mov.c: Added configuration flag to skip cover art atom while opening mov parser
  2022-04-22 14:30   ` Malviya, Janpriya
@ 2022-04-23  9:06     ` Hendrik Leppkes
  2022-04-26  3:06       ` Malviya, Janpriya
  0 siblings, 1 reply; 5+ messages in thread
From: Hendrik Leppkes @ 2022-04-23  9:06 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

On Fri, Apr 22, 2022 at 4:30 PM Malviya, Janpriya
<Janpriya_Malviya@bose.com> wrote:
>
> Hi Derek,
>
> We require to add this configuration for the following reasons :
> - We have our own pipeline mechanism to download & fetch audio data from source.
> - We are using ffmpeg with custom IO callbacks for parsing & decoding fragmentedMP4 streams.
> - Inside the custom IO read operation we are asking to download data from upstream elements.
> - If any stream contains a cover page ( e.g. image file ) then the custom io read call-back issues a read request with large buffer size ( which is obvious ) . On the other side , our source downloader is unable to handle a data request of  that size because of buffer constraints.
> - To integrate FFmpeg with our architecture , we added this flag to issue skip for cover page from parsing
>
> Let me know what you think.

This sounds like you are solving a very specific problem in your
environment, coming from your software stack and setup, in a generic
library.
I fail to see the use for anyone else.

- Hendrik
_______________________________________________
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] libavformat/mov.c: Added configuration flag to skip cover art atom while opening mov parser
  2022-04-23  9:06     ` Hendrik Leppkes
@ 2022-04-26  3:06       ` Malviya, Janpriya
  0 siblings, 0 replies; 5+ messages in thread
From: Malviya, Janpriya @ 2022-04-26  3:06 UTC (permalink / raw)
  To: FFmpeg development discussions and patches
  Cc: Banerjee, Debasmit, White, Brian, Van Iderstine, David

Hi Hendrik,

Thank you for your feedback.
We will not merge it into master, maintain this patch on our side.

Regards
Janpriya

From: Hendrik Leppkes<mailto:h.leppkes@gmail.com>
Sent: 23 April 2022 02:36 PM
To: FFmpeg development discussions and patches<mailto:ffmpeg-devel@ffmpeg.org>
Subject: Re: [FFmpeg-devel] [PATCH] libavformat/mov.c: Added configuration flag to skip cover art atom while opening mov parser

On Fri, Apr 22, 2022 at 4:30 PM Malviya, Janpriya
<Janpriya_Malviya@bose.com> wrote:
>
> Hi Derek,
>
> We require to add this configuration for the following reasons :
> - We have our own pipeline mechanism to download & fetch audio data from source.
> - We are using ffmpeg with custom IO callbacks for parsing & decoding fragmentedMP4 streams.
> - Inside the custom IO read operation we are asking to download data from upstream elements.
> - If any stream contains a cover page ( e.g. image file ) then the custom io read call-back issues a read request with large buffer size ( which is obvious ) . On the other side , our source downloader is unable to handle a data request of  that size because of buffer constraints.
> - To integrate FFmpeg with our architecture , we added this flag to issue skip for cover page from parsing
>
> Let me know what you think.

This sounds like you are solving a very specific problem in your
environment, coming from your software stack and setup, in a generic
library.
I fail to see the use for anyone else.

- Hendrik
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://urldefense.com/v3/__https://ffmpeg.org/mailman/listinfo/ffmpeg-devel__;!!I6pijIezNA!1yC7ZIMlMQc1s4je3aXXpcvFtzUbTATAg7GUrZcQjrPlJctsKBvQmJp9Ct517a6cWWrCmaeSFObq9RzZv3XGlIg$<https://urldefense.com/v3/__https:/ffmpeg.org/mailman/listinfo/ffmpeg-devel__;!!I6pijIezNA!1yC7ZIMlMQc1s4je3aXXpcvFtzUbTATAg7GUrZcQjrPlJctsKBvQmJp9Ct517a6cWWrCmaeSFObq9RzZv3XGlIg$>

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

_______________________________________________
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-04-26  3:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-20 11:39 [FFmpeg-devel] [PATCH] libavformat/mov.c: Added configuration flag to skip cover art atom while opening mov parser Malviya, Janpriya
2022-04-20 13:23 ` Derek Buitenhuis
2022-04-22 14:30   ` Malviya, Janpriya
2022-04-23  9:06     ` Hendrik Leppkes
2022-04-26  3:06       ` Malviya, Janpriya

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