Mercurial > libavformat.hg
comparison movenc.c @ 6243:40f3dc7e5fcb libavformat
In mov muxer, write pixel aspect ratio tag in mov files.
Based on a patch by Daniel Kristjansson, danielk at cuymedia dot net
author | bcoudurier |
---|---|
date | Thu, 08 Jul 2010 21:57:20 +0000 |
parents | a2c4863f9199 |
children | f2ad554b2464 |
comparison
equal
deleted
inserted
replaced
6242:79b5e6fa86c9 | 6243:40f3dc7e5fcb |
---|---|
745 put_buffer(pb, track->enc->extradata, track->enc->extradata_size); | 745 put_buffer(pb, track->enc->extradata, track->enc->extradata_size); |
746 | 746 |
747 return updateSize(pb, pos); | 747 return updateSize(pb, pos); |
748 } | 748 } |
749 | 749 |
750 static int mov_write_pasp_tag(ByteIOContext *pb, MOVTrack *track) | |
751 { | |
752 AVRational sar; | |
753 av_reduce(&sar.num, &sar.den, track->enc->sample_aspect_ratio.num, | |
754 track->enc->sample_aspect_ratio.den, INT_MAX); | |
755 | |
756 put_be32(pb, 16); | |
757 put_tag(pb, "pasp"); | |
758 put_be32(pb, track->enc->sample_aspect_ratio.num); | |
759 put_be32(pb, track->enc->sample_aspect_ratio.den); | |
760 return 16; | |
761 } | |
762 | |
750 static int mov_write_video_tag(ByteIOContext *pb, MOVTrack *track) | 763 static int mov_write_video_tag(ByteIOContext *pb, MOVTrack *track) |
751 { | 764 { |
752 int64_t pos = url_ftell(pb); | 765 int64_t pos = url_ftell(pb); |
753 char compressor_name[32]; | 766 char compressor_name[32]; |
754 | 767 |
805 mov_write_avcc_tag(pb, track); | 818 mov_write_avcc_tag(pb, track); |
806 if(track->mode == MODE_IPOD) | 819 if(track->mode == MODE_IPOD) |
807 mov_write_uuid_tag_ipod(pb); | 820 mov_write_uuid_tag_ipod(pb); |
808 } else if(track->vosLen > 0) | 821 } else if(track->vosLen > 0) |
809 mov_write_glbl_tag(pb, track); | 822 mov_write_glbl_tag(pb, track); |
823 | |
824 if (track->mode == MODE_MOV && | |
825 track->enc->sample_aspect_ratio.den && track->enc->sample_aspect_ratio.num && | |
826 track->enc->sample_aspect_ratio.den != track->enc->sample_aspect_ratio.num) { | |
827 mov_write_pasp_tag(pb, track); | |
828 } | |
810 | 829 |
811 return updateSize(pb, pos); | 830 return updateSize(pb, pos); |
812 } | 831 } |
813 | 832 |
814 static int mov_write_rtp_tag(ByteIOContext *pb, MOVTrack *track) | 833 static int mov_write_rtp_tag(ByteIOContext *pb, MOVTrack *track) |