putDescr(pb, 0x04, 13 + decoderSpecificInfoLen);
// Object type indication
- put_byte(pb, codec_get_tag(ff_mov_obj_type, track->enc->codec_id));
+ put_byte(pb, codec_get_tag(ff_mp4_obj_type, track->enc->codec_id));
// the following fields is made of 6 bits to identify the streamtype (4 for video, 5 for audio)
// plus 1 bit to indicate upstream and 1 bit set to 1 (reserved)
static int mov_write_ctts_tag(ByteIOContext *pb, MOVTrack* track)
{
- Time2Sample *ctts_entries;
+ MOV_stts_t *ctts_entries;
uint32_t entries = 0;
uint32_t atom_size;
int i;
/* Time to sample atom */
static int mov_write_stts_tag(ByteIOContext *pb, MOVTrack* track)
{
- Time2Sample *stts_entries;
+ MOV_stts_t *stts_entries;
uint32_t entries = -1;
uint32_t atom_size;
int i;
(version == 1) ? put_be64(pb, track->trackDuration) : put_be32(pb, track->trackDuration); /* duration */
put_be16(pb, track->language); /* language */
put_be16(pb, 0); /* reserved (quality) */
+
+ if(version!=0 && track->mode == MODE_MOV){
+ av_log(NULL, AV_LOG_ERROR,
+ "FATAL error, file duration too long for timebase, this file will not be\n"
+ "playable with quicktime. Choose a different timebase or a different\n"
+ "container format\n");
+ }
+
return 32;
}
MOVContext *mov = s->priv_data;
int i;
+ if (url_is_streamed(&s->pb)) {
+ av_log(s, AV_LOG_ERROR, "muxer does not support non seekable output\n");
+ return -1;
+ }
+
/* Default mode == MP4 */
mov->mode = MODE_MP4;
track->tag = mov_find_audio_codec_tag(s, track);
track->timescale = st->codec->sample_rate;
av_set_pts_info(st, 64, 1, st->codec->sample_rate);
- switch(track->enc->codec_id){
- case CODEC_ID_MP3:
- case CODEC_ID_AAC:
- case CODEC_ID_AMR_NB:
- case CODEC_ID_AMR_WB:
- track->audio_vbr = 1;
- break;
- default:
- track->sampleSize = (av_get_bits_per_sample(st->codec->codec_id) >> 3) * st->codec->channels;
- }
- if (!st->codec->frame_size) {
+ if(!st->codec->frame_size){
av_log(s, AV_LOG_ERROR, "track %d: codec frame size is not set\n", i);
return -1;
+ }else if(st->codec->frame_size > 1){ /* assume compressed audio */
+ track->audio_vbr = 1;
+ }else{
+ track->sampleSize = (av_get_bits_per_sample(st->codec->codec_id) >> 3) * st->codec->channels;
}
}
}