diff mbox series

[FFmpeg-devel] avformat/flvdec: RtmpSampleAccess no longer breaks stream detection

Message ID 20200819070654.15978-1-p.vanderspek@bluebillywig.com
State Accepted
Headers show
Series [FFmpeg-devel] avformat/flvdec: RtmpSampleAccess no longer breaks stream detection
Related show

Checks

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

Commit Message

Peter van der Spek Aug. 19, 2020, 7:06 a.m. UTC
Since release 4.2, FFmpeg fails to detect the correct streams in an RTMP
stream that contains a |RtmpSampleAccess AMF object prior to the
onMetaData AMF object. In the debug log it would show "[flv] Unknown
type |RtmpSampleAccess".

This functionality broke in commit d7638d8dfc3c4ffd0dc18a64937a5a07ed67b354
as unknown metadata packets now result in an opaque data stream, and the
|RtmpSampleAccess packet was an "unknown" metadata packet type.

With this change the RTMP streams are correctly detected when there
is a |RtmpSampleAccess object prior to the onMetaData object.

Signed-off-by: Peter van der Spek <p.vanderspek@bluebillywig.com>
---
 libavformat/flvdec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Michael Niedermayer Aug. 20, 2020, 11:19 a.m. UTC | #1
On Wed, Aug 19, 2020 at 09:06:54AM +0200, Peter van der Spek wrote:
> Since release 4.2, FFmpeg fails to detect the correct streams in an RTMP
> stream that contains a |RtmpSampleAccess AMF object prior to the
> onMetaData AMF object. In the debug log it would show "[flv] Unknown
> type |RtmpSampleAccess".
> 
> This functionality broke in commit d7638d8dfc3c4ffd0dc18a64937a5a07ed67b354
> as unknown metadata packets now result in an opaque data stream, and the
> |RtmpSampleAccess packet was an "unknown" metadata packet type.
> 
> With this change the RTMP streams are correctly detected when there
> is a |RtmpSampleAccess object prior to the onMetaData object.
> 
> Signed-off-by: Peter van der Spek <p.vanderspek@bluebillywig.com>
> ---
>  libavformat/flvdec.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c
> index 0862273..d480d0b 100644
> --- a/libavformat/flvdec.c
> +++ b/libavformat/flvdec.c
> @@ -715,7 +715,7 @@ static int flv_read_metabody(AVFormatContext *s, int64_t next_pos)
>      if (!strcmp(buffer, "onCaptionInfo"))
>          return TYPE_ONCAPTIONINFO;
>  
> -    if (strcmp(buffer, "onMetaData") && strcmp(buffer, "onCuePoint")) {
> +    if (strcmp(buffer, "onMetaData") && strcmp(buffer, "onCuePoint") && strcmp(buffer, "|RtmpSampleAccess")) {
>          av_log(s, AV_LOG_DEBUG, "Unknown type %s\n", buffer);
>          return TYPE_UNKNOWN;
>      }

when transcoding this will copy this "|RtmpSampleAccess" thing in the output
is that intended ?

thx

[...]
Peter van der Spek Aug. 20, 2020, 3:14 p.m. UTC | #2
I suppose that’s okay. It’s in the input stream as well after all.
On 20 Aug 2020, 13:19 +0200, Michael Niedermayer <michael@niedermayer.cc>, wrote:
> On Wed, Aug 19, 2020 at 09:06:54AM +0200, Peter van der Spek wrote:
> > Since release 4.2, FFmpeg fails to detect the correct streams in an RTMP
> > stream that contains a |RtmpSampleAccess AMF object prior to the
> > onMetaData AMF object. In the debug log it would show "[flv] Unknown
> > type |RtmpSampleAccess".
> >
> > This functionality broke in commit d7638d8dfc3c4ffd0dc18a64937a5a07ed67b354
> > as unknown metadata packets now result in an opaque data stream, and the
> > |RtmpSampleAccess packet was an "unknown" metadata packet type.
> >
> > With this change the RTMP streams are correctly detected when there
> > is a |RtmpSampleAccess object prior to the onMetaData object.
> >
> > Signed-off-by: Peter van der Spek <p.vanderspek@bluebillywig.com>
> > ---
> > libavformat/flvdec.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c
> > index 0862273..d480d0b 100644
> > --- a/libavformat/flvdec.c
> > +++ b/libavformat/flvdec.c
> > @@ -715,7 +715,7 @@ static int flv_read_metabody(AVFormatContext *s, int64_t next_pos)
> > if (!strcmp(buffer, "onCaptionInfo"))
> > return TYPE_ONCAPTIONINFO;
> >
> > - if (strcmp(buffer, "onMetaData") && strcmp(buffer, "onCuePoint")) {
> > + if (strcmp(buffer, "onMetaData") && strcmp(buffer, "onCuePoint") && strcmp(buffer, "|RtmpSampleAccess")) {
> > av_log(s, AV_LOG_DEBUG, "Unknown type %s\n", buffer);
> > return TYPE_UNKNOWN;
> > }
>
> when transcoding this will copy this "|RtmpSampleAccess" thing in the output
> is that intended ?
>
> thx
>
> [...]
> --
> Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>
> It is what and why we do it that matters, not just one of them.
>
> _______________________________________________
> 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".
Michael Niedermayer Aug. 20, 2020, 8:39 p.m. UTC | #3
On Thu, Aug 20, 2020 at 05:14:12PM +0200, Peter van der Spek wrote:
> I suppose that’s okay. It’s in the input stream as well after all.

well, then the patch is probably ok, but ill wait a few days before applyng
so we dont miss something.
dont hesitate to remind me to apply this in a few days

thx

> On 20 Aug 2020, 13:19 +0200, Michael Niedermayer <michael@niedermayer.cc>, wrote:
> > On Wed, Aug 19, 2020 at 09:06:54AM +0200, Peter van der Spek wrote:
[...]
> > when transcoding this will copy this "|RtmpSampleAccess" thing in the output
> > is that intended ?
> >
> > thx
> >
> > [...]
> > --
> > Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
> >
> > It is what and why we do it that matters, not just one of them.
> >
> > _______________________________________________
> > 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".
> _______________________________________________
> 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".
Peter van der Spek Sept. 21, 2020, 10:10 a.m. UTC | #4
Hi Michael,

Friendly ping to get this one merged.

Thanks,
Peter
On 20 Aug 2020, 22:39 +0200, Michael Niedermayer <michael@niedermayer.cc>, wrote:
> On Thu, Aug 20, 2020 at 05:14:12PM +0200, Peter van der Spek wrote:
> > I suppose that’s okay. It’s in the input stream as well after all.
>
> well, then the patch is probably ok, but ill wait a few days before applyng
> so we dont miss something.
> dont hesitate to remind me to apply this in a few days
>
> thx
>
> > On 20 Aug 2020, 13:19 +0200, Michael Niedermayer <michael@niedermayer.cc>, wrote:
> > > On Wed, Aug 19, 2020 at 09:06:54AM +0200, Peter van der Spek wrote:
> [...]
> > > when transcoding this will copy this "|RtmpSampleAccess" thing in the output
> > > is that intended ?
> > >
> > > thx
> > >
> > > [...]
> > > --
> > > Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
> > >
> > > It is what and why we do it that matters, not just one of them.
> > >
> > > _______________________________________________
> > > 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".
> > _______________________________________________
> > 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".
>
> --
> Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>
> "I am not trying to be anyone's saviour, I'm trying to think about the
> future and not be sad" - Elon Musk
>
>
> _______________________________________________
> 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".
Michael Niedermayer Sept. 23, 2020, 7:29 p.m. UTC | #5
On Mon, Sep 21, 2020 at 12:10:04PM +0200, Peter van der Spek wrote:
> Hi Michael,
> 
> Friendly ping to get this one merged.

will apply

thx

[...]
diff mbox series

Patch

diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c
index 0862273..d480d0b 100644
--- a/libavformat/flvdec.c
+++ b/libavformat/flvdec.c
@@ -715,7 +715,7 @@  static int flv_read_metabody(AVFormatContext *s, int64_t next_pos)
     if (!strcmp(buffer, "onCaptionInfo"))
         return TYPE_ONCAPTIONINFO;
 
-    if (strcmp(buffer, "onMetaData") && strcmp(buffer, "onCuePoint")) {
+    if (strcmp(buffer, "onMetaData") && strcmp(buffer, "onCuePoint") && strcmp(buffer, "|RtmpSampleAccess")) {
         av_log(s, AV_LOG_DEBUG, "Unknown type %s\n", buffer);
         return TYPE_UNKNOWN;
     }