Opened 13 years ago
Closed 12 years ago
#1052 closed defect (fixed)
libavformat doesn't preserve some metadata for mov containers
Reported by: | bbraun | Owned by: | |
---|---|---|---|
Priority: | normal | Component: | avformat |
Version: | git-master | Keywords: | mov |
Cc: | Blocked By: | ||
Blocking: | Reproduced by developer: | no | |
Analyzed by developer: | no |
Description
libavformat doesn't support writing the metadata tags: episode_sort, season_number, media_type, hd_video, or gapless_playback.
Attached is a diff to provide writing these metadata tags.
This can be reproduced by:
ffmpeg -i foo.m4v -metadata episode_sort=2 -metadata season_number=5 bar.m4v
ffmpeg -i bar.m4v
look for those metadata tags. They are not preserved.
Additionally, when reencoding files that have these tags set, the metadata is not preserved.
Attachments (1)
Change History (4)
by , 13 years ago
Attachment: | movenc.diff added |
---|
comment:1 by , 13 years ago
Keywords: | mov added |
---|---|
Version: | unspecified → git-master |
comment:2 by , 13 years ago
+static int mov_write_int8_metadata(AVFormatContext *s, AVIOContext *pb,
+ const char *name, const char *tag,
+ int long_style)
+{
+ int64_t pos = avio_tell(pb);
+ AVDictionaryEntry *t = NULL;
always writen before read, thus =NULL is useless
+ uint8_t num;
+
+ if (!(t = av_dict_get(s->metadata, tag, NULL, 0)))
+ return 0;
+ num = t ? atoi(t->value) : 0;
t cant be NULL here
+
+ avio_wb32(pb, 4);
+ ffio_wfourcc(pb, name);
+ avio_w8(pb, 0);
+ avio_w8(pb, 0);
+ avio_w8(pb, 0);
+ avio_w8(pb, num);
+ return update_size(pb, pos);
you dont need update_size when the size is fixed
also this function can be factored with the very similar mov_write_int8_metadata_no_padding()
Please send patches to ffmpeg-devel, they receive more attention there.
And please change indentation slightly: