[FFmpeg-devel] [PATCH] h264_mp4toannexb_bsf: always set idr_sps_pps_seen when SPS/PPS is seen.

Benoit Fouet benoit.fouet at free.fr
Mon Sep 29 15:31:36 CEST 2014


Hi,

----- Mail original -----
> Hi,
> 
> Le 26/09/2014 18:38, Michael Niedermayer a écrit :
> > On Fri, Sep 26, 2014 at 09:27:01AM +0200, Benoit Fouet wrote:
> >> Hi,
> >>
> >> ----- Mail original -----
> >>> Michael Niedermayer <michaelni <at> gmx.at> writes:
> >>>
> >>>>
> >>>> On Fri, Aug 01, 2014 at 01:54:14AM +0200, Michael Niedermayer
> >>>> wrote:
> >>>>> On Thu, Jul 31, 2014 at 03:40:51PM +0200, Benoit Fouet wrote:
> >>>>>> In order not to break a sequence like "SPS IDR SPS IDR", the
> >>> boolean
> >>>>>> telling that the SPS/PPS has been seen should always be set.
> >>>>>> ---
> >>>>>>  libavcodec/h264_mp4toannexb_bsf.c | 2 +-
> >>>>>>  1 file changed, 1 insertion(+), 1 deletion(-)
> >>>>>
> >>>>> LGTM
> >>>>
> >>>> applied
> >>>>
> >>>> thanks
> >>>
> >>> A GitHub user "@thomag" commented on this commit:
> >>>
> >>>> Consider an mp4 files with just pps in the h264 stream (no sps
> >>>> in
> >>>> the
> >>>> NAL units, but available from avcc).
> >>>> In this case 'ctx->idr_sps_pps_seen' prevents inserting sps in
> >>>> the
> >>>> extracted h264, which is then unusable.
> >>>
> >>> FYI. I cannot confirm if it is correct or not, and what the
> >>> correct
> >>> solution would be.
> >>>
> >>
> >> I'm willing to try and fix this when/if we have a sample to test
> >> that.
> >> If there is also an example with just sps in the avcc and only pps
> >> in
> the stream, that'd be perfect...
> >
> > forwarding from github
> >
> >     Michael,
> >     Here is a short clip @
> https://s3.amazonaws.com/quickfire-public/dwclip2.mp4
> >     which has just PPS in the h264 stream.
> >     Please let me know if you need anything else.
> >     Regards,
> >     Thomas.
> >
> 
> OK, cool. I'll have a look at this after the weekend then.
> 

I have a first version of the patch attached.
With this patch, the sample provided from the link above can be converted with the h264_mp4toannexb_bsf, but produces warnings when played back.
What I've done here is to prepend only the missing parameter set to the filtered stream.
I'll spend some more time on it, but I'd like to get another look than mine, just in case I'm missing something obvious.

-- 
Ben
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-avcodec-h264_mp4toannexb_bsf-add-a-case-when-only-SP.patch
Type: text/x-patch
Size: 5446 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20140929/d6a5c33c/attachment.bin>


More information about the ffmpeg-devel mailing list