diff mbox

[FFmpeg-devel] avformat/movenc: use correct iTunes copyright atom

Message ID 20180403060518.12368-1-timo.teras@iki.fi
State Accepted
Commit 62c1cfcc35a7772d9634fb9d2d1e74952843c108
Headers show

Commit Message

Timo Teräs April 3, 2018, 6:05 a.m. UTC
Support for writing copyright metadata was added in commit bed4fc54c9
for 3GP, MOV and iTunes metadata. 3GP and MOV cases are formally
specified. However, iTunes format does not have specification, and
it seems to have been assumed that it would use the same atom as
MOV (both being Apple formats).

However, Apple uses 'cprt' atom for iTunes metadata (do note that
the iTunes 'cprt' encoding is generic iTunes ItemList atom, not
the 3GP 'cprt' encoding. These are also inside different parent
atoms).

Most references trying to document iTunes atoms mention only
the 'cprt' tag. See:
 - http://atomicparsley.sourceforge.net/mpeg-4files.html
 - http://mutagen.readthedocs.io/en/latest/api/mp4.html

Same applies to other software supporting this tag. Most of them
encode and decode only the 'cprt' atom.

ffmpeg mov demuxer supports both atoms in this context. There are
few pieces of other software that support similarly both 'cprt' and
the incorrect '\251cpy' atom in this context. I believe they do it in
order to read the ffmpeg encoded incorrect copyright atom.

In light of the above this changes the copyright atom to 'cprt' as
it seems to be supported univerally and is the correct atom to use.

Signed-off-by: Timo Teräs <timo.teras@iki.fi>
---
 libavformat/movenc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Timo Teräs April 10, 2018, 7:38 p.m. UTC | #1
On Tue,  3 Apr 2018 09:05:18 +0300
Timo Teräs <timo.teras@iki.fi> wrote:

> Support for writing copyright metadata was added in commit bed4fc54c9
> for 3GP, MOV and iTunes metadata. 3GP and MOV cases are formally
> specified. However, iTunes format does not have specification, and
> it seems to have been assumed that it would use the same atom as
> MOV (both being Apple formats).
>[snip]

Ping?

It's been 2 weeks since the original mail + inquiry. And one week since
this. What's the usual time for waiting feedback? Would this be soon
good to go in?

Timo

> diff --git a/libavformat/movenc.c b/libavformat/movenc.c
> index 97327f739d..54f19c3a73 100644
> --- a/libavformat/movenc.c
> +++ b/libavformat/movenc.c
> @@ -3484,7 +3484,7 @@ static int mov_write_ilst_tag(AVIOContext *pb,
> MOVMuxContext *mov, }
>      mov_write_string_metadata(s, pb, "\251cmt", "comment"  , 1);
>      mov_write_string_metadata(s, pb, "\251gen", "genre"    , 1);
> -    mov_write_string_metadata(s, pb, "\251cpy", "copyright", 1);
> +    mov_write_string_metadata(s, pb, "cprt",    "copyright", 1);
>      mov_write_string_metadata(s, pb, "\251grp", "grouping" , 1);
>      mov_write_string_metadata(s, pb, "\251lyr", "lyrics"   , 1);
>      mov_write_string_metadata(s, pb, "desc",    "description",1);
Michael Niedermayer April 10, 2018, 10:29 p.m. UTC | #2
On Tue, Apr 10, 2018 at 10:38:30PM +0300, Timo Teras wrote:
> On Tue,  3 Apr 2018 09:05:18 +0300
> Timo Teräs <timo.teras@iki.fi> wrote:
> 
> > Support for writing copyright metadata was added in commit bed4fc54c9
> > for 3GP, MOV and iTunes metadata. 3GP and MOV cases are formally
> > specified. However, iTunes format does not have specification, and
> > it seems to have been assumed that it would use the same atom as
> > MOV (both being Apple formats).
> >[snip]
> 
> Ping?
> 
> It's been 2 weeks since the original mail + inquiry. And one week since
> this. What's the usual time for waiting feedback? Would this be soon
> good to go in?

will apply
thx

[...]
diff mbox

Patch

diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 97327f739d..54f19c3a73 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -3484,7 +3484,7 @@  static int mov_write_ilst_tag(AVIOContext *pb, MOVMuxContext *mov,
     }
     mov_write_string_metadata(s, pb, "\251cmt", "comment"  , 1);
     mov_write_string_metadata(s, pb, "\251gen", "genre"    , 1);
-    mov_write_string_metadata(s, pb, "\251cpy", "copyright", 1);
+    mov_write_string_metadata(s, pb, "cprt",    "copyright", 1);
     mov_write_string_metadata(s, pb, "\251grp", "grouping" , 1);
     mov_write_string_metadata(s, pb, "\251lyr", "lyrics"   , 1);
     mov_write_string_metadata(s, pb, "desc",    "description",1);