Hey guys and gals,
I'm looking into implementing metadata support for live streams, and I
wanted to bounce around a proposed implementation and a few questions
before I really dive into it (with hopes that it can be merged someday). To
start, I've found that metadata is updated in the following ways:
* http: stored as an option named "icy_metadata_packet"
* rtmp/flv: stored in AVFormatContext->metadata and updated on every change
* ogg: stored in AVFormatContext->streams[...]->metadata and updated on
change
The problem is that each stores metadata in a different location, and they
all lack PTSs, so finding metadata and syncing display becomes difficult.
To that end, I propose the following (full disclosure: I've only been
working with the libav code base for a few days, so I'm sure the more
experienced will have suggestions and pointers):
struct AVFormatContext {
...
AVLiveMetadata *live_metadata;
int nb_live_metadata;
}
struct AVLiveMetadata {
int64_t pts;
AVDictionary *metadata;
}
For getting metadata from the context:
int avformat_live_metadata(AVFormatContext *s, AVLiveMetadata *md, int
which); // For getting a single update at an index
int avformat_live_metadata_after(AVFormatContext *s, AVLiveMetadata *md,
int64_t pts); // For only getting an update if it occurred after pts
For adding a metadata update to the context:
void avformat_live_metadata_add(AVFormatContext *s, AVDictionary *md,
int64_t pts); // Puts it at the end of the metadata array
There are a few problems with this approach:
1) For icecast/http, it only has access to a URLContext: what do you guys
think would be the best way to handle this?
2) Existing metadata updates should, in my opinion, be left alone so as not
to break any existing programs that use and it possibly poll it for
changes. Opinions?
Thanks,
-Andrew
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel