[Libav-user] Using Libav to make HLS clips from H264

Carl Eugen Hoyos ceffmpeg at gmail.com
Tue Nov 21 00:33:59 EET 2017


2017-11-20 23:12 GMT+01:00 Tyler Brooks <tylerjbrooks at gmail.com>:

> My encoder gives me a timestamp on every frame (int64_t in microseconds).
> The hardware is pretty good and the timestamps are very nearly always
> separated to 1/framerate.  In my case the framerate is 30fps so the frames
> come out of the encoder about every 30ms (lets just say for easy math for
> now).
>
> Of course, I could use those timestamps for my pts/dts.  Indeed, I have
> tried.
>
> But here is the root of my problem.  The key frames are handed to me as four
> NAL packets (SPS, PPS, SEI, key_frame) all at the same time and all with the
> same timestamp.  That makes sense.  The metadata meant for the decoder (SPS,
> PPS and SEI) should to be associated with the leading key_frame and they
> should all share the same timestamp.  My problem is I don't know how to make
> a multi-packet 'AVPacket' to submit as a single frame to the
> 'av_write_frame' call.

Did you try to concatenate SPS, PPS and SEI with
the first key-frame?

Please do not top-post here, Carl Eugen


More information about the Libav-user mailing list