mirror of https://git.ffmpeg.org/ffmpeg.git
compute codec bitrate in mov demuxer, patch by haim alon, haim dot alter at gmail dot com
Originally committed as revision 20368 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
d3ee771514
commit
c5898e8623
|
@ -1429,6 +1429,7 @@ static void mov_build_index(MOVContext *mov, AVStream *st)
|
||||||
unsigned int stss_index = 0;
|
unsigned int stss_index = 0;
|
||||||
unsigned int stps_index = 0;
|
unsigned int stps_index = 0;
|
||||||
unsigned int i, j;
|
unsigned int i, j;
|
||||||
|
uint64_t stream_size = 0;
|
||||||
|
|
||||||
/* adjust first dts according to edit list */
|
/* adjust first dts according to edit list */
|
||||||
if (sc->time_offset) {
|
if (sc->time_offset) {
|
||||||
|
@ -1488,6 +1489,7 @@ static void mov_build_index(MOVContext *mov, AVStream *st)
|
||||||
}
|
}
|
||||||
|
|
||||||
current_offset += sample_size;
|
current_offset += sample_size;
|
||||||
|
stream_size += sample_size;
|
||||||
current_dts += sc->stts_data[stts_index].duration;
|
current_dts += sc->stts_data[stts_index].duration;
|
||||||
distance++;
|
distance++;
|
||||||
stts_sample++;
|
stts_sample++;
|
||||||
|
@ -1498,6 +1500,7 @@ static void mov_build_index(MOVContext *mov, AVStream *st)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
st->codec->bit_rate = stream_size*8*sc->time_scale/st->duration;
|
||||||
} else {
|
} else {
|
||||||
for (i = 0; i < sc->chunk_count; i++) {
|
for (i = 0; i < sc->chunk_count; i++) {
|
||||||
unsigned chunk_samples;
|
unsigned chunk_samples;
|
||||||
|
|
Loading…
Reference in New Issue