[FFmpeg-devel] How to get width/height of an H264 stream using its SPS ?

Ronald S. Bultje rsbultje at gmail.com
Thu Jul 30 18:50:23 CEST 2015


Hi,

On Thu, Jul 30, 2015 at 10:58 AM, PROMONET Michel <
michel.promonet at thalesgroup.com> wrote:

> Hi Ronald,
>
> Thanks for the quick answer, following the code this was also my guess.
>
> From my side I feel that it could be nice to use ffmpeg to decode SPS
> without any stream, I would like to avoid an other processing of the SPS.
>
> Is there a particular reason for hiding width/height before decoding ? and
> could it be a potential evolution of ffmpeg ?


I think you're looking at this from the wrong angle. If you want to get the
w/h from a sps, just write a function that does so. You could even re-use
functions from h264_ps.c or reuse the binary exported abi (using h264.h as
api).

But expecting any sort of relationship between AVCodecContext and sps is
not realistic.

Ronald


More information about the ffmpeg-devel mailing list