diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2008-03-02 19:51:31 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2008-03-02 19:51:31 +0000 |
commit | 5b0875491242b975afeabc2df4651316f981efc2 (patch) | |
tree | 17aaa6b3be7eea1e949141b9c6ab35ec033d839d /libavformat/avienc.c | |
parent | 1f3d74d39bc5478f5a5ec5b169e341ac18053ce0 (diff) | |
download | ffmpeg-streaming-5b0875491242b975afeabc2df4651316f981efc2.zip ffmpeg-streaming-5b0875491242b975afeabc2df4651316f981efc2.tar.gz |
Store aspect ratio in avis.
Originally committed as revision 12290 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/avienc.c')
-rw-r--r-- | libavformat/avienc.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/libavformat/avienc.c b/libavformat/avienc.c index 6b62f76..6e8901e 100644 --- a/libavformat/avienc.c +++ b/libavformat/avienc.c @@ -283,6 +283,38 @@ static int avi_write_header(AVFormatContext *s) end_tag(pb, avi->indexes[i].indx_start); } + if( stream->codec_type == CODEC_TYPE_VIDEO + && stream->sample_aspect_ratio.num>0 + && stream->sample_aspect_ratio.den>0){ + int vprp= start_tag(pb, "vprp"); + AVRational dar = av_mul_q(stream->sample_aspect_ratio, + (AVRational){stream->width, stream->height}); + int num, den; + av_reduce(&num, &den, dar.num, dar.den, 0xFFFF); + + put_le32(pb, 0); //video format = unknown + put_le32(pb, 0); //video standard= unknown + put_le32(pb, lrintf(1.0/av_q2d(stream->time_base))); + put_le32(pb, stream->width ); + put_le32(pb, stream->height); + put_le16(pb, num); + put_le16(pb, den); + put_le32(pb, stream->width ); + put_le32(pb, stream->height); + put_le32(pb, 1); //progressive FIXME + + put_le32(pb, stream->height); + put_le32(pb, stream->width ); + put_le32(pb, stream->height); + put_le32(pb, stream->width ); + put_le32(pb, 0); + put_le32(pb, 0); + + put_le32(pb, 0); + put_le32(pb, 0); + end_tag(pb, vprp); + } + end_tag(pb, list2); } |