AVPacket.pts,AVPacket.dts and AVPacket.duration 定时消息将被设置,如果已知。如果码流(stream)没有提供这些,那么他们也许未设置(即pts/dts的值为AV_NOPTS_VALUE,duration的值为0)。这些定时信息将放在AVStream.time_base 单元中,就是说,他们必须并联时基(timebase)来将自己转换成秒数。
@defgroup metadata_api Public Metadata API { 当demuxer时,元数据(metadata)API允许libavformat库将元数据标签(matadata tags)导出给客户端程序。相反的,当muxing时它允许客户端程序设置元数据。
在用于lavu_dict "AVDictionary"API的AVFormatContext, AVStream, AVChapter and AVProgram structs中的元数据域中,元数据被导出或者赋值成键值对串(pairs of key/value string),就像所用在ffmpeg中的字符串一样,元数据被设定为UTF-8双字节编码。注意:在大多数情况下,从demuxer导出的元数据不会检查是否对UTF-8编码有效。
应该记住的重要概念: 1. -key是独一无二的,不会出现2个不同的标签的key是一样的。语义上也是这样的,就是说一个demuxer不应该故意产生几个key,这些key字面上不同但语义上相同 -元数据是横向的 ,不是竖向的,它没有子标签。假如你想储存,举例:制片人Alice和演员鲍勃的孩子的电子邮件地址,可以有key=alice_and_bobs_childs_email_address -一些修饰语可以被应用到标签名上。这是通过按顺序附加一个连字符和修饰名完成的。例如下面列表出列出的情况: foo-eng-sort, not foo-sort-eng。 -语言 - - 一个value被本地化为一特定语言的标签会被附加 the ISO 639-2/B 3-letter 语言编码。 例如: Author-ger=Michael, Author-eng=Mike 而原始/默认语言是不合格的"Author"标签。如果demuxer设置了任何一个解释标签,那么它应该设置一个默认值。
-排序(sorting)- - 一个被用于排序的标签的修改版本将有附加个"-sort" 举例:artist="The Beatles", artist-sort="Beatles, The" -分路器尝试以一个通用的格式导出元数据,然而并没有通用的格式标签,因为他们储存在一个容器中。 下表列出了通用标签名: @verbatim album -- name of the set this work belongs to album_artist -- main creator of the set/album, if different from artist. e.g. "Various Artists" for compilation albums. artist -- main creator of the work comment -- any additional description of the file. composer -- who composed the work, if different from artist. copyright -- name of copyright holder. creation_time-- date when the file was created, preferably in ISO 8601. date -- date when the work was created, preferably in ISO 8601. disc -- number of a subset, e.g. disc in a multi-disc collection. encoder -- name/settings of the software/hardware that produced the file. encoded_by -- person/group who created the file. filename -- original name of the file. genre -- <self-evident>. language -- main language in which the work is performed, preferably in ISO 639-2 format. Multiple languages can be specified by separating them with commas. performer -- artist who performed the work, if different from artist. E.g for "Also sprach Zarathustra", artist would be "Richard Strauss" and performer "London Philharmonic Orchestra". publisher -- name of the label/publisher. service_name -- name of the service in broadcasting (channel name). service_provider -- name of the service provider in broadcasting. title -- name of the work. track -- number of this work in the set, can be in form current/total. variant_bitrate -- the total bitrate of the bitrate variant that the current stream is part of @endverbatim }