aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/movenc.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2006-04-04 12:58:56 +0000
committerMichael Niedermayer <michaelni@gmx.at>2006-04-04 12:58:56 +0000
commit9e282ba38279d961ee6970ae89cd5bb25aa4caf8 (patch)
tree0e1b24f4296a632651bf0d1ad11e9f2425125f17 /libavformat/movenc.c
parent7b748aff2c84e97e04c5ce9fb2ec7684d52489ee (diff)
downloadffmpeg-9e282ba38279d961ee6970ae89cd5bb25aa4caf8.tar.gz
the PSP rejects video with too high bitrates so lets claim they arent too high ...
Originally committed as revision 5267 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/movenc.c')
-rw-r--r--libavformat/movenc.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 2fbfdbddd3..41e4d6d747 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -1510,6 +1510,8 @@ static void mov_write_uuidprof_tag(ByteIOContext *pb, AVFormatContext *s)
AVCodecContext *AudioCodec = s->streams[1]->codec;
int AudioRate = AudioCodec->sample_rate;
int FrameRate = ((VideoCodec->time_base.den) * (0x10000))/ (VideoCodec->time_base.num);
+ int audio_kbitrate= AudioCodec->bit_rate / 1000;
+ int video_kbitrate= FFMIN(VideoCodec->bit_rate / 1000, 800 - audio_kbitrate);
put_be32(pb, 0x94 ); /* size */
put_tag(pb, "uuid");
@@ -1535,8 +1537,8 @@ static void mov_write_uuidprof_tag(ByteIOContext *pb, AVFormatContext *s)
put_tag(pb, "mp4a");
put_be32(pb, 0x20f );
put_be32(pb, 0x0 );
- put_be32(pb, AudioCodec->bit_rate / 1000);
- put_be32(pb, AudioCodec->bit_rate / 1000);
+ put_be32(pb, audio_kbitrate);
+ put_be32(pb, audio_kbitrate);
put_be32(pb, AudioRate );
put_be32(pb, AudioCodec->channels );
@@ -1547,8 +1549,8 @@ static void mov_write_uuidprof_tag(ByteIOContext *pb, AVFormatContext *s)
put_tag(pb, "mp4v");
put_be32(pb, 0x103 );
put_be32(pb, 0x0 );
- put_be32(pb, VideoCodec->bit_rate / 1000);
- put_be32(pb, VideoCodec->bit_rate / 1000);
+ put_be32(pb, video_kbitrate);
+ put_be32(pb, video_kbitrate);
put_be32(pb, FrameRate);
put_be32(pb, FrameRate);
put_be16(pb, VideoCodec->width);