> For the encoding part instead I do not understand how I am supposed to set 
> the id2v3tag field of the encoder’s ADTSContext [1], which apparently if set 
> is going to be written in the header. Any help/hint would be greatly 
> appreciated.
Got it. Posting here the answer for future readers.

There are two things that have to be done:
- set the id3v2 metadata of the target AVFormatContext
```c
  const AVDictionaryEntry *e = NULL;
  while ((e = av_dict_iterate(metadata, e))) {
    av_dict_set(&fmtctx->metadata, e->key, e->value, 0);
  }
```

- When writing the header, set the appropriate option (in this case write_id3v2 
for the ADTS encoder)
```c
  AVDictionary *opts = NULL;
  av_dict_set_int(&opts, "write_id3v2", 1, 0);
  ret = avformat_write_header(encoder->fmt, &opts);
```

Done!

Cheers,
Daniel

_______________________________________________
Libav-user mailing list
[email protected]
https://ffmpeg.org/mailman/listinfo/libav-user

To unsubscribe, visit link above, or email
[email protected] with subject "unsubscribe".

Reply via email to