h |= 0x8000;
put_be16(pb, h);
put_buffer(pb, ffm->packet, ffm->packet_end - ffm->packet);
+ put_flush_packet(pb);
/* prepare next packet */
ffm->frame_offset = 0; /* no key frame */
bit_rate = 0;
for(i=0;i<s->nb_streams;i++) {
st = s->streams[i];
- bit_rate += st->codec.bit_rate;
+ bit_rate += st->codec->bit_rate;
}
put_be32(pb, bit_rate);
av_set_pts_info(st, 64, 1, 1000000);
st->priv_data = fst;
- codec = &st->codec;
+ codec = st->codec;
/* generic info */
put_be32(pb, codec->codec_id);
put_byte(pb, codec->codec_type);
put_be32(pb, codec->bit_rate);
put_be32(pb, st->quality);
put_be32(pb, codec->flags);
+ put_be32(pb, codec->flags2);
+ put_be32(pb, codec->debug);
/* specific info */
switch(codec->codec_type) {
case CODEC_TYPE_VIDEO:
- put_be32(pb, codec->frame_rate_base);
- put_be32(pb, codec->frame_rate);
+ put_be32(pb, codec->time_base.num);
+ put_be32(pb, codec->time_base.den);
put_be16(pb, codec->width);
put_be16(pb, codec->height);
put_be16(pb, codec->gop_size);
+ put_be32(pb, codec->pix_fmt);
put_byte(pb, codec->qmin);
put_byte(pb, codec->qmax);
put_byte(pb, codec->max_qdiff);
put_be64_double(pb, codec->i_quant_offset);
put_be64_double(pb, codec->b_quant_offset);
put_be32(pb, codec->dct_algo);
+ put_be32(pb, codec->strict_std_compliance);
+ put_be32(pb, codec->max_b_frames);
+ put_be32(pb, codec->luma_elim_threshold);
+ put_be32(pb, codec->chroma_elim_threshold);
+ put_be32(pb, codec->mpeg_quant);
+ put_be32(pb, codec->intra_dc_precision);
+ put_be32(pb, codec->me_method);
+ put_be32(pb, codec->mb_decision);
+ put_be32(pb, codec->nsse_weight);
+ put_be32(pb, codec->frame_skip_cmp);
+ put_be64_double(pb, codec->rc_buffer_aggressivity);
break;
case CODEC_TYPE_AUDIO:
put_be32(pb, codec->sample_rate);
int size= pkt->size;
//XXX/FIXME use duration from pkt
- if (st->codec.codec_type == CODEC_TYPE_AUDIO) {
- duration = ((float)st->codec.frame_size / st->codec.sample_rate * 1000000.0);
+ if (st->codec->codec_type == CODEC_TYPE_AUDIO) {
+ duration = ((float)st->codec->frame_size / st->codec->sample_rate * 1000000.0);
} else {
- duration = (1000000.0 * st->codec.frame_rate_base / (float)st->codec.frame_rate);
+ duration = (1000000.0 * st->codec->time_base.num / (float)st->codec->time_base.den);
}
pts = fst->pts;
ffm->write_index = get_be64(pb);
/* get also filesize */
if (!url_is_streamed(pb)) {
- ffm->file_size = url_filesize(url_fileno(pb));
+ ffm->file_size = url_fsize(pb);
adjust_write_index(s);
} else {
ffm->file_size = (uint64_t_C(1) << 63) - 1;
st->priv_data = fst;
- codec = &st->codec;
+ codec = st->codec;
/* generic info */
- st->codec.codec_id = get_be32(pb);
- st->codec.codec_type = get_byte(pb); /* codec_type */
+ st->codec->codec_id = get_be32(pb);
+ st->codec->codec_type = get_byte(pb); /* codec_type */
codec->bit_rate = get_be32(pb);
st->quality = get_be32(pb);
codec->flags = get_be32(pb);
+ codec->flags2 = get_be32(pb);
+ codec->debug = get_be32(pb);
/* specific info */
switch(codec->codec_type) {
case CODEC_TYPE_VIDEO:
- codec->frame_rate_base = get_be32(pb);
- codec->frame_rate = get_be32(pb);
+ codec->time_base.num = get_be32(pb);
+ codec->time_base.den = get_be32(pb);
codec->width = get_be16(pb);
codec->height = get_be16(pb);
codec->gop_size = get_be16(pb);
+ codec->pix_fmt = get_be32(pb);
codec->qmin = get_byte(pb);
codec->qmax = get_byte(pb);
codec->max_qdiff = get_byte(pb);
codec->i_quant_offset = get_be64_double(pb);
codec->b_quant_offset = get_be64_double(pb);
codec->dct_algo = get_be32(pb);
+ codec->strict_std_compliance = get_be32(pb);
+ codec->max_b_frames = get_be32(pb);
+ codec->luma_elim_threshold = get_be32(pb);
+ codec->chroma_elim_threshold = get_be32(pb);
+ codec->mpeg_quant = get_be32(pb);
+ codec->intra_dc_precision = get_be32(pb);
+ codec->me_method = get_be32(pb);
+ codec->mb_decision = get_be32(pb);
+ codec->nsse_weight = get_be32(pb);
+ codec->frame_skip_cmp = get_be32(pb);
+ codec->rc_buffer_aggressivity = get_be64_double(pb);
break;
case CODEC_TYPE_AUDIO:
codec->sample_rate = get_be32(pb);
av_new_packet(pkt, size);
pkt->stream_index = ffm->header[0];
+ pkt->pos = url_ftell(&s->pb);
if (ffm->header[1] & FLAG_KEY_FRAME)
pkt->flags |= PKT_FLAG_KEY;