Commit 6c13c880 authored by Michael Niedermayer's avatar Michael Niedermayer

trying to fix a few minor values in the mp4/mov muxer

Originally committed as revision 4063 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 1ba02582
......@@ -72,6 +72,26 @@ typedef struct MOVContext {
static int mov_write_esds_tag(ByteIOContext *pb, MOVTrack* track);
const CodecTag ff_mov_obj_type[] = {
{ CODEC_ID_MPEG4 , 32 },
{ CODEC_ID_AAC , 64 },
{ CODEC_ID_MPEG1VIDEO, 106 },
{ CODEC_ID_MPEG2VIDEO, 96 },//mpeg2 profiles
{ CODEC_ID_MP2 , 107 },//FIXME mpeg2 mpeg audio -> 105
{ CODEC_ID_MP3 , 107 },//FIXME mpeg2 mpeg audio -> 105
{ CODEC_ID_H264 , 241 },
{ CODEC_ID_H263 , 242 },
{ CODEC_ID_H261 , 243 },
{ CODEC_ID_MJPEG , 108 },
{ CODEC_ID_PCM_S16LE , 224 },
{ CODEC_ID_VORBIS , 225 },
{ CODEC_ID_AC3 , 226 },
{ CODEC_ID_PCM_ALAW , 227 },
{ CODEC_ID_PCM_MULAW , 228 },
{ CODEC_ID_PCM_S16BE , 230 },
{ 0,0 },
};
//FIXME supprt 64bit varaint with wide placeholders
static int updateSize (ByteIOContext *pb, int pos)
{
......@@ -430,28 +450,28 @@ static int mov_write_esds_tag(ByteIOContext *pb, MOVTrack* track) // Basic
// ES descriptor
putDescr(pb, 0x03, 3 + descrLength(13 + decoderSpecificInfoLen) +
descrLength(1));
put_be16(pb, 0x0001); // ID (= 1)
put_be16(pb, track->trackID);
put_byte(pb, 0x00); // flags (= no flags)
// DecoderConfig descriptor
putDescr(pb, 0x04, 13 + decoderSpecificInfoLen);
if(track->enc->codec_id == CODEC_ID_AAC)
put_byte(pb, 0x40); // Object type indication
else if(track->enc->codec_id == CODEC_ID_MPEG4)
put_byte(pb, 0x20); // Object type indication (Visual 14496-2)
// Object type indication
put_byte(pb, codec_get_tag(ff_mov_obj_type, track->enc->codec_id));
if(track->enc->codec_type == CODEC_TYPE_AUDIO)
put_byte(pb, 0x15); // flags (= Audiostream)
else
put_byte(pb, 0x11); // flags (= Visualstream)
put_byte(pb, 0x0); // Buffersize DB (24 bits)
put_be16(pb, 0x0dd2); // Buffersize DB
put_byte(pb, track->enc->rc_buffer_size>>(3+16)); // Buffersize DB (24 bits)
put_be16(pb, (track->enc->rc_buffer_size>>3)&0xFFFF); // Buffersize DB
// TODO: find real values for these
put_be32(pb, track->enc->bit_rate); // maxbitrate
put_be32(pb, track->enc->bit_rate); // avg bitrate
put_be32(pb, FFMAX(track->enc->bit_rate, track->enc->rc_max_rate)); // maxbitrate (FIXME should be max rate in any 1 sec window)
if(track->enc->rc_max_rate != track->enc->rc_min_rate || track->enc->rc_min_rate==0)
put_be32(pb, 0); // vbr
else
put_be32(pb, track->enc->rc_max_rate); // avg bitrate
if (track->vosLen)
{
......
......@@ -51,7 +51,7 @@ fc01a5723a0d629bb73c74d64692120d *./data/a-h263p.avi
2414342 ./data/a-h263p.avi
28fd12ac0b168252d81df6f6e60a5d17 *./data/out.yuv
stddev: 2.07 PSNR:41.76 bytes:7602176
97d4f329489c5b83d14ad1bfe07175df *./data/a-odivx.mp4
cdfb6316e67fcdfccf169ea4162f8aba *./data/a-odivx.mp4
554440 ./data/a-odivx.mp4
e400c9175dd1811cdeee7be5555d33f1 *./data/out.yuv
stddev: 7.99 PSNR:30.06 bytes:7602176
......
......@@ -19,7 +19,7 @@ c83444a0e8ef47b6af1d868d1bb21696 *./data/b-libav.asf
794934a02582f8dfc85d1856514cf37c *./data/b-libav.flv
339325 ./data/b-libav.flv
./data/b-libav.flv CRC=7b9076f8
832a73bbf39055a70ceb50a396cb3051 *./data/b-libav.mov
f5b0461def8fe53550e7464056906563 *./data/b-libav.mov
369865 ./data/b-libav.mov
./data/b-libav.mov CRC=48f5a90d
f34e560f8f0f2c603cf0cb3e7eeb031b *./data/b-libav.nut
......
......@@ -51,7 +51,7 @@ stddev: 5.44 PSNR:33.41 bytes:7602176
868164 ./data/a-h263p.avi
80fb224bebbe2e04f228da7485b905c5 *./data/out.yuv
stddev: 1.91 PSNR:42.49 bytes:7602176
6d185f1a54e45c326ffdef3f64f53d81 *./data/a-odivx.mp4
0daf00d71c7fd36eea4e0528a0463ae3 *./data/a-odivx.mp4
120196 ./data/a-odivx.mp4
8b7657a7f9fc7298cc016abb466d1d19 *./data/out.yuv
stddev: 5.34 PSNR:33.56 bytes:7602176
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment