[Ffmpeg-cvslog] CVS: ffmpeg/libavformat movenc.c,1.60,1.61

Michael Niedermayer CVS michael
Tue Apr 4 14:58:59 CEST 2006


Update of /cvsroot/ffmpeg/ffmpeg/libavformat
In directory mail:/var2/tmp/cvs-serv14312

Modified Files:
	movenc.c 
Log Message:
the PSP rejects video with too high bitrates so lets claim they arent too high ...


Index: movenc.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavformat/movenc.c,v
retrieving revision 1.60
retrieving revision 1.61
diff -u -d -r1.60 -r1.61
--- movenc.c	26 Mar 2006 13:34:51 -0000	1.60
+++ movenc.c	4 Apr 2006 12:58:56 -0000	1.61
@@ -1510,6 +1510,8 @@
     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 @@
     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 @@
     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);





More information about the ffmpeg-cvslog mailing list