} mov_pix_fmt_tags[] = {
{ PIX_FMT_YUYV422, MKTAG('y','u','v','s'), 0 },
{ PIX_FMT_UYVY422, MKTAG('2','v','u','y'), 0 },
- { PIX_FMT_BGR555, MKTAG('r','a','w',' '), 16 },
+ { PIX_FMT_RGB555BE,MKTAG('r','a','w',' '), 16 },
{ PIX_FMT_RGB555LE,MKTAG('L','5','5','5'), 16 },
{ PIX_FMT_RGB565LE,MKTAG('L','5','6','5'), 16 },
{ PIX_FMT_RGB565BE,MKTAG('B','5','6','5'), 16 },
+ { PIX_FMT_GRAY16BE,MKTAG('b','1','6','g'), 16 },
{ PIX_FMT_RGB24, MKTAG('r','a','w',' '), 24 },
{ PIX_FMT_BGR24, MKTAG('2','4','B','G'), 24 },
{ PIX_FMT_ARGB, MKTAG('r','a','w',' '), 32 },
{ PIX_FMT_BGRA, MKTAG('B','G','R','A'), 32 },
{ PIX_FMT_RGBA, MKTAG('R','G','B','A'), 32 },
+ { PIX_FMT_ABGR, MKTAG('A','B','G','R'), 32 },
+ { PIX_FMT_RGB48BE, MKTAG('b','4','8','r'), 48 },
};
static int mov_get_rawvideo_codec_tag(AVFormatContext *s, MOVTrack *track)
int tag = track->enc->codec_tag;
if (!tag || (track->enc->strict_std_compliance >= FF_COMPLIANCE_NORMAL &&
- (tag == MKTAG('d','v','c','p') ||
+ (track->enc->codec_id == CODEC_ID_DVVIDEO ||
track->enc->codec_id == CODEC_ID_RAWVIDEO ||
+ track->enc->codec_id == CODEC_ID_H263 ||
av_get_bits_per_sample(track->enc->codec_id)))) { // pcm audio
if (track->enc->codec_id == CODEC_ID_DVVIDEO)
tag = mov_get_dv_codec_tag(s, track);
return updateSize(pb, pos);
}
+static int mov_write_pasp_tag(ByteIOContext *pb, MOVTrack *track)
+{
+ AVRational sar;
+ av_reduce(&sar.num, &sar.den, track->enc->sample_aspect_ratio.num,
+ track->enc->sample_aspect_ratio.den, INT_MAX);
+
+ put_be32(pb, 16);
+ put_tag(pb, "pasp");
+ put_be32(pb, sar.num);
+ put_be32(pb, sar.den);
+ return 16;
+}
+
static int mov_write_video_tag(ByteIOContext *pb, MOVTrack *track)
{
int64_t pos = url_ftell(pb);
} else if(track->vosLen > 0)
mov_write_glbl_tag(pb, track);
+ if (track->mode == MODE_MOV &&
+ track->enc->sample_aspect_ratio.den && track->enc->sample_aspect_ratio.num &&
+ track->enc->sample_aspect_ratio.den != track->enc->sample_aspect_ratio.num) {
+ mov_write_pasp_tag(pb, track);
+ }
+
return updateSize(pb, pos);
}
char buf[1000] = "";
int len;
- ff_sdp_write_media(buf, sizeof(buf), ctx, NULL, 0, 0);
+ ff_sdp_write_media(buf, sizeof(buf), ctx, NULL, NULL, 0, 0);
av_strlcatf(buf, sizeof(buf), "a=control:streamid=%d\r\n", index);
len = strlen(buf);
put_be32(pb, 0); /* size */
put_tag(pb, "ilst");
mov_write_string_metadata(s, pb, "\251nam", "title" , 1);
- mov_write_string_metadata(s, pb, "\251ART", "author" , 1);
+ mov_write_string_metadata(s, pb, "\251ART", "artist" , 1);
mov_write_string_metadata(s, pb, "aART", "album_artist", 1);
mov_write_string_metadata(s, pb, "\251wrt", "composer" , 1);
mov_write_string_metadata(s, pb, "\251alb", "album" , 1);
put_be16(pb, language_code("eng")); /* language */
put_buffer(pb, t->value, strlen(t->value)+1); /* UTF8 string value */
if (!strcmp(tag, "albm") &&
- (t = av_metadata_get(s->metadata, "date", NULL, 0)))
+ (t = av_metadata_get(s->metadata, "track", NULL, 0)))
put_byte(pb, atoi(t->value));
}
return updateSize(pb, pos);
return ret;
if (mov->mode & MODE_3GP) {
+ mov_write_3gp_udta_tag(pb_buf, s, "perf", "artist");
mov_write_3gp_udta_tag(pb_buf, s, "titl", "title");
mov_write_3gp_udta_tag(pb_buf, s, "auth", "author");
mov_write_3gp_udta_tag(pb_buf, s, "gnre", "genre");
mov_write_3gp_udta_tag(pb_buf, s, "cprt", "copyright");
mov_write_3gp_udta_tag(pb_buf, s, "yrrc", "date");
} else if (mov->mode == MODE_MOV) { // the title field breaks gtkpod with mp4 and my suspicion is that stuff is not valid in mp4
+ mov_write_string_metadata(s, pb_buf, "\251ART", "artist" , 0);
mov_write_string_metadata(s, pb_buf, "\251nam", "title" , 0);
mov_write_string_metadata(s, pb_buf, "\251aut", "author" , 0);
mov_write_string_metadata(s, pb_buf, "\251alb", "album" , 0);
mov_write_string_metadata(s, pb_buf, "\251day", "date" , 0);
- mov_write_string_tag(pb_buf, "\251enc", LIBAVFORMAT_IDENT, 0, 0);
+ mov_write_string_metadata(s, pb_buf, "\251swr", "encoder" , 0);
mov_write_string_metadata(s, pb_buf, "\251des", "comment" , 0);
mov_write_string_metadata(s, pb_buf, "\251gen", "genre" , 0);
mov_write_string_metadata(s, pb_buf, "\251cpy", "copyright" , 0);
put_be32(pb, size+8);
put_tag(pb, "udta");
put_buffer(pb, buf, size);
- av_free(buf);
}
+ av_free(buf);
return 0;
}
mov_write_header,
ff_mov_write_packet,
mov_write_trailer,
- .flags = AVFMT_GLOBALHEADER | AVFMT_VARIABLE_FPS,
+ .flags = AVFMT_GLOBALHEADER,
.codec_tag = (const AVCodecTag* const []){codec_movvideo_tags, codec_movaudio_tags, 0},
};
#endif
mov_write_header,
ff_mov_write_packet,
mov_write_trailer,
- .flags = AVFMT_GLOBALHEADER | AVFMT_VARIABLE_FPS,
+ .flags = AVFMT_GLOBALHEADER,
.codec_tag = (const AVCodecTag* const []){ff_mp4_obj_type, 0},
};
#endif