[FFmpeg-devel] Input metadata not updated inside mux context

Steven Liu lingjiujianke at gmail.com
Mon Jan 2 13:04:09 EET 2017


2017-01-02 17:10 GMT+08:00 Christo Grozev <cgrozev at gmail.com>:

>
> Happy New Year to all!
>
> I am trying to create a patch for metadata-aware hls splitting.
> Unfortunately, i cannot seem to get updated metadata from the
> AVFormatContext object inside the muxer scope. For example, within hlsenc.c
> I have this::
>
>     static int hls_start(AVFormatContext *s)
>     {
>     HLSContext *c = s->priv_data;
>     AVFormatContext *oc = c->avf;
>     AVFormatContext *vtt_oc = c->vtt_avf;
>     AVDictionary *options = NULL;
>     char *filename, iv_string[KEYSIZE*2 + 1];
>     int err = 0;
>     int ret = 0;
>     AVDictionaryEntry *tag = NULL;
>
>     av_log(s, AV_LOG_DEBUG, "Lets check if there's metadata now.. ");
>
>     tag = av_dict_get(oc->metadata, "StreamTitle", tag,
> AV_DICT_IGNORE_SUFFIX);
>     printf("%s\n",tag->value);
>
>
>
> However, what is logged is always the original StreamTitle that was valid
> when the initial connection to the input url was made, and is not updating
> it further. Granted, this is the output stream context, but it does contain
> the initial metadata, apparently. What would be the way to update it, or to
> access the input context's metadata? Or is the only solution to re-poll the
> input stream in a separate process?
>

You can use hls_ts_options to set the mpegts metadata.

>
>
>
> Thanks in advance
>
> Christo
>
>
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>


More information about the ffmpeg-devel mailing list