[FFmpeg-cvslog] Do not write ID3v1 tags by default

Diogo Franco git at videolan.org
Wed Aug 17 14:42:48 CEST 2011


ffmpeg | branch: master | Diogo Franco <diogomfranco at gmail.com> | Tue Aug 16 09:43:23 2011 +0000| [f1f298cd32b18bb910ff045df327ccb139628db7] | committer: Anton Khirnov

Do not write ID3v1 tags by default

ID3v1 are legacy tags with several limitations; furthermore
avconv/ffmpeg writes the tags in UTF-8 which probably has near-0
software support.

Add a -write_id3v1 option to be able to turn it on; disabled by default.

Signed-off-by: Anton Khirnov <anton at khirnov.net>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f1f298cd32b18bb910ff045df327ccb139628db7
---

 libavformat/mp3enc.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/libavformat/mp3enc.c b/libavformat/mp3enc.c
index e702e3b..3704e49 100644
--- a/libavformat/mp3enc.c
+++ b/libavformat/mp3enc.c
@@ -135,6 +135,7 @@ static int id3v2_put_ttag(AVFormatContext *s, const char *str1, const char *str2
 typedef struct MP3Context {
     const AVClass *class;
     int id3v2_version;
+    int write_id3v1;
     int64_t nb_frames_offset;
 } MP3Context;
 
@@ -144,7 +145,7 @@ static int mp3_write_trailer(struct AVFormatContext *s)
     MP3Context *mp3 = s->priv_data;
 
     /* write the id3v1 tag */
-    if (id3v1_create_tag(s, buf) > 0) {
+    if (mp3 && mp3->write_id3v1 && id3v1_create_tag(s, buf) > 0) {
         avio_write(s->pb, buf, ID3v1_TAG_SIZE);
     }
 
@@ -178,6 +179,8 @@ AVOutputFormat ff_mp2_muxer = {
 static const AVOption options[] = {
     { "id3v2_version", "Select ID3v2 version to write. Currently 3 and 4 are supported.",
       offsetof(MP3Context, id3v2_version), FF_OPT_TYPE_INT, {.dbl = 4}, 3, 4, AV_OPT_FLAG_ENCODING_PARAM},
+    { "write_id3v1", "Enable ID3v1 writing. ID3v1 tags are written in UTF-8 which may not be supported by most software.",
+      offsetof(MP3Context, write_id3v1), FF_OPT_TYPE_INT, {.dbl = 0}, 0, 1, AV_OPT_FLAG_ENCODING_PARAM},
     { NULL },
 };
 



More information about the ffmpeg-cvslog mailing list