[FFmpeg-devel] [PATCH] Ignore invalid sprop-parameter-sets missing PPS

Michael Niedermayer michael at niedermayer.cc
Mon Feb 29 13:47:54 CET 2016


On Mon, Feb 29, 2016 at 01:59:22PM +0200, Andrew Shulgin wrote:
> Corrected the patch a bit, now setting extradata_size to 0
> 
> On Mon, Feb 29, 2016 at 1:13 PM, Andrew Shulgin <andrewshulginua at gmail.com>
> wrote:
> 
> > Correct SPS and PPS are in the stream.
> > Maybe it's reasonale to use existing SPS. But i'm not sure how to
> > implement that.
> > Yeah really, setting extradata_size to 0 should not be skipped.
> >
> > On Mon, Feb 29, 2016 at 1:01 PM, Michael Niedermayer <
> > michael at niedermayer.cc> wrote:
> >
> >> On Sat, Feb 27, 2016 at 09:56:01PM +0200, Andrew Shulgin wrote:
> >> > Some Hikvison RTSP cameras send wrong sprop-parameter-sets in SDP - it's
> >> > missing PPS.
> >> >
> >> > Example of correct sprop-parameter-sets:
> >> > sprop-parameter-sets=Z0IAH5W4PASaEAAAcIAAFfkAQA==,aM48gA==
> >> > Example of wrong sprop-parameter-sets:
> >> > sprop-parameter-sets=Z0IAH5WoPASaEAAAcIAAFfkIQA==,
> >> >
> >> > My patch adds a workaround that ignores invalid sprop-parameter-sets.
> >>
> >> from where does it get the correct parameter set ?
> >> is it in the stream ? or repeated sprop-parameter-sets ?
> >>
> >> also shuldnt the sps be used instead of skipped?
> >> or the skip code be made conditional on codec->extradata_size > 0 ?
> >>
> >> [...]
> >> --
> >> Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
> >>
> >> Complexity theory is the science of finding the exact solution to an
> >> approximation. Benchmarking OTOH is finding an approximation of the exact
> >>
> >> _______________________________________________
> >> ffmpeg-devel mailing list
> >> ffmpeg-devel at ffmpeg.org
> >> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> >>
> >>
> >

>  rtpdec_h264.c |    4 ++++
>  1 file changed, 4 insertions(+)
> 04777111f044772997bed9c6ac4367b4a4c83952  0001-Ignore-invalid-sprop-parameter-sets-missing-PPS.patch
> From 5ba47e182a47753ed47344b25fd6ba9d15698fd1 Mon Sep 17 00:00:00 2001
> From: Andrew Shulgin <andrewshulginua at gmail.com>
> Date: Mon, 29 Feb 2016 13:57:42 +0200
> Subject: [PATCH] Ignore invalid sprop-parameter-sets missing PPS
> 
> ---
>  libavformat/rtpdec_h264.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/libavformat/rtpdec_h264.c b/libavformat/rtpdec_h264.c
> index b399be4..4c0003e 100644
> --- a/libavformat/rtpdec_h264.c
> +++ b/libavformat/rtpdec_h264.c
> @@ -168,6 +168,10 @@ static int sdp_parse_fmtp_config_h264(AVFormatContext *s,
>          int ret;
>          codec->extradata_size = 0;
>          av_freep(&codec->extradata);
> +        if (value[strlen(value) - 1] == ',') {
> +            av_log(s, AV_LOG_WARNING, "Missing PPS in sprop-parameter-sets, ignoring\n");
> +            return 0;
> +        }

what i meant was that if there is no extradata set then extracting
the SPS without the missig PPS into it would make sense
while if extradata was already set then a SPS only sprop would be
better skiped as it would remove a already extradted  PPS

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

If you drop bombs on a foreign country and kill hundred thousands of
innocent people, expect your government to call the consequence
"unprovoked inhuman terrorist attacks" and use it to justify dropping
more bombs and killing more people. The technology changed, the idea is old.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20160229/040a22c5/attachment.sig>


More information about the ffmpeg-devel mailing list