[FFmpeg-devel] Missing documentation of metadata keys

Ramiro Polla ramiro.polla
Wed Oct 21 01:26:39 CEST 2009


On Tue, Oct 20, 2009 at 8:27 PM, Stefano Sabatini
<stefano.sabatini-lala at poste.it> wrote:
> On date Tuesday 2009-10-20 16:16:52 -0200, Ramiro Polla encoded:
>> Hi,
>>
>> On Tue, Oct 20, 2009 at 3:30 PM, Ronald S. Bultje <rsbultje at gmail.com> wrote:
>> > On Tue, Oct 20, 2009 at 1:10 PM, Bjoern Voigt <bjoern at cs.tu-berlin.de> wrote:
>> >> If I scanned the source code right, metadata keys are static. If they are
>> >> indeed more dynamic (dependent on compile options, libraries etc.), a more
>> >> dynamic approach (like a "-list-metadata-keys" option for ffmpeg) would
>> >> probably be a better idea.
>> >
>> > Regardless of static or not, this would be a good idea, IMHO.
>> > Introspection is a great thing.
>
> +1.
>
>> Attached patch should be a good starting point to list the conversion
>> tags from ffmpeg (and document its use in the manuals).
>
> Duplicating information and synching docs with the code is always
> brittle and leads to inaccurate / outdated documentation, I think is
> better to provide some mechanism to make the user ask the requested
> information directly to the program, either make the documentation
> generated by the code.

Hmm, I didn't specify what "its" was referring to in the
parenthesis... I meant to say:
(and document the parameter "list"'s use in the manuals). I agree that
documentation shouldn't be duplicated.

>> It doesn't
>> list tags that are used for example in nut, which gets them using
>> av_metadata_get(). Maybe there could be a way for all tags to be
>> listed in AVOutputFormat.
>>
>> Anyways, I don't plan on following up on this patch, it was just a
>> moment of boredom, feel free to pick it up if it's useful =). And
>> expect more replies from the metadata maintainers...
>>
>> Ramiro Polla
>
>> Index: ffmpeg.c
>> ===================================================================
>> --- ffmpeg.c ?(revision 20334)
>> +++ ffmpeg.c ?(working copy)
>> @@ -32,6 +32,7 @@
>> ?#include <limits.h>
>> ?#include <unistd.h>
>> ?#include "libavformat/avformat.h"
>> +#include "libavformat/metadata.h"
>> ?#include "libavdevice/avdevice.h"
>> ?#include "libswscale/swscale.h"
>> ?#include "libavcodec/opt.h"
>> @@ -2604,8 +2605,25 @@
>> ? ? ?char *mid= strchr(arg, '=');
>>
>> ? ? ?if(!mid){
>> + ? ? ? ?if (!strcmp(arg, "list")) {
>> + ? ? ? ? ? ?const AVMetadataConv *conv;
>> + ? ? ? ? ? ?if (!file_oformat) {
>> + ? ? ? ? ? ? ? ?fprintf(stderr, "Output format must be specified to list metadata tags.\n");
>
> Maybe better without the point, more consistent with most FFmpeg
> messages.

No opinion here, but I trust you know about ffmpeg's output messages
much more than I do...

>> + ? ? ? ? ? ? ? ?av_exit(1);
>> + ? ? ? ? ? ?}
>> + ? ? ? ? ? ?if ((conv = file_oformat->metadata_conv)) {
>> + ? ? ? ? ? ? ? ?int i = 0;
>> + ? ? ? ? ? ? ? ?fprintf(stderr, "Available metadata tags are:\n");
>> + ? ? ? ? ? ? ? ?while (conv[i].generic)
>> + ? ? ? ? ? ? ? ? ? ?fprintf(stderr, "%s\n", conv[i++].generic);
>
> stdout, suppose someone wants to grep the list of supported tags.

good idea.

>> + ? ? ? ? ? ?} else {
>> + ? ? ? ? ? ? ? ?fprintf(stderr, "Output format has no metadata tags.\n");
>> + ? ? ? ? ? ?}
>> + ? ? ? ? ? ?av_exit(0);
>> + ? ? ? ?} else {
>> ? ? ? ? ?fprintf(stderr, "Missing =\n");
>> ? ? ? ? ?av_exit(1);
>> + ? ? ? ?}
>> ? ? ?}
>> ? ? ?*mid++= 0;
>
> Regards.

Oh, great, so you are picking up the patch? =) As I said I can't
really work on it any further right now, I just started for fun and
gave up when I saw the calls to av_get_metadata() which I couldn't
easily list...

Ramiro Polla



More information about the ffmpeg-devel mailing list