[FFmpeg-devel] [PATCH v3] avformat/smoothstreamingenc:add bitrate calculate

Jun Li junli1026 at gmail.com
Sat Mar 16 02:26:01 EET 2019


On Fri, Mar 15, 2019 at 4:15 PM Michael Niedermayer <michael at niedermayer.cc>
wrote:

> On Thu, Mar 14, 2019 at 11:21:58AM -0700, Jun Li wrote:
> > Calculate bitrate based on fragment size, only applied when
> > bitrate is not set, for example rtsp source.
> >
> > Signed-off-by: Jun Li <junli1026 at gmail.com>
> > ---
> >  libavformat/smoothstreamingenc.c | 32 +++++++++++++++++++++++++++-----
> >  1 file changed, 27 insertions(+), 5 deletions(-)
> >
> > diff --git a/libavformat/smoothstreamingenc.c
> b/libavformat/smoothstreamingenc.c
> > index 094712af27..30bb188aa2 100644
> > --- a/libavformat/smoothstreamingenc.c
> > +++ b/libavformat/smoothstreamingenc.c
> > @@ -320,11 +320,13 @@ static int ism_write_header(AVFormatContext *s)
> >          AVDictionary *opts = NULL;
> >
> >          if (!s->streams[i]->codecpar->bit_rate) {
> > -            av_log(s, AV_LOG_ERROR, "No bit rate set for stream %d\n",
> i);
> > -            ret = AVERROR(EINVAL);
> > -            goto fail;
>
> > +            av_log(s, AV_LOG_WARNING, "No bit rate set for stream
> %d\n", i);
> > +            // create a tmp name for the directory of fragments
> > +            snprintf(os->dirname, sizeof(os->dirname),
> "%s/QualityLevels(Tmp_%"PRId64")", s->url, i);
>
> "i" cannot be "%d" and %"PRId64" at the same time
>
> [...]
> --
> Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>
> Into a blind darkness they enter who follow after the Ignorance,
> they as if into a greater darkness enter who devote themselves
> to the Knowledge alone. -- Isha Upanishad
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1
>
> iEYEARECAAYFAlyMMh0ACgkQYR7HhwQLD6uHZACeOiKsIs38O9VjpdvfRUAe5cV7
> U7sAn0RBbjZJsvqX+IlR284ZYytZ4j5u
> =qYmJ
> -----END PGP SIGNATURE-----
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel



Thanks, version 4 is sent out to address this:
https://patchwork.ffmpeg.org/patch/12318/


More information about the ffmpeg-devel mailing list