[FFmpeg-devel] Forward frame wall clock time from avdevice to HLS muxer
Jesper Ek
deadbeef84 at gmail.com
Thu Aug 27 15:55:55 EEST 2020
Den ons 26 aug. 2020 kl 12:56 skrev Andreas Rheinhardt <
andreas.rheinhardt at gmail.com>:
> Jesper Ek:
> > Hi,
> >
> > I have implemented a libavdevice to capture audio and video from an AJA
> > Kona card (similar to decklink). I'm then using the HLS muxer to encode
> my
> > stream. Now I need the HLS EXT-X-PROGRAM-DATE-TIME tag to specify exactly
> > when the input source was recorded, so my plan is to forward the "wall
> > clock time" (from the avdevice implementation) to the hls muxer, and use
> > that instead of using system time (av_gettime()).
> >
> > I cant use PTS, so what is the correct way to pass "wall clock time"
> > metadata for every frame to the HLS encoder?
> >
> > I noticed that the decklink implementation uses
> > `av_packet_add_side_data(&pkt, AV_PKT_DATA_STRINGS_METADATA, ...)` to add
> > timecode information, is this the correct approach?
> >
>
> AV_PKT_DATA_PRFT side data might be the right tool for you.
>
That's exactly what I'm looking for! However there seems to be some missing
parts to make it work for my use case. I've tried adding AV_PKT_DATA_PRFT
in my avdevice implementation, but the side data gets lost when being coded
inte h264. Looking at the libx264 encoder it has some code to create new
PRFT data from av_gettime(), this is not what I want to do. I would like to
preserve the PRFT from the input. I guess I can add prft side data to the
AVFrame created by rawdec so it's forwarded to libx264, but I feel maybe
this should be done on a higher level? Would it make sense to always copy
PRFT from input packet to the encoded packet?
>
> > I hope this mailing list is appropriate for my question, otherwise please
> > forgive me.
>
> It is only appropriate for this mailing list if you want to improve
> FFmpeg itself (i.e. by making the hls muxer use AV_PKT_DATA_PRFT; the
> dash muxer already seems to use it). If not, the user mailing list is
> the right place.
>
Yes, that's definitely the end goal. I have some other patches related to
the hls muxer that I would like to submit.
>
> - Andreas
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".
More information about the ffmpeg-devel
mailing list