You've already forked libopenshot
mirror of
https://github.com/OpenShot/libopenshot.git
synced 2026-03-02 08:53:52 -08:00
Reverting video_timestamp increment logic which used pkt.duration. In some codecs (such as vp8), this approach breaks due to differences in the timebase vs the framerate. For example, if the timebase is an inverse of the FPS, everything works. But if the timebase is not, for example 1/1000000, this approach breaks.
This commit is contained in:
@@ -768,12 +768,12 @@ void FFmpegReader::UpdateVideoInfo() {
|
||||
// Check for valid duration (if found)
|
||||
if (info.duration <= 0.0f && pFormatCtx->duration >= 0)
|
||||
// Use the format's duration
|
||||
info.duration = pFormatCtx->duration / AV_TIME_BASE;
|
||||
info.duration = float(pFormatCtx->duration) / AV_TIME_BASE;
|
||||
|
||||
// Calculate duration from filesize and bitrate (if any)
|
||||
if (info.duration <= 0.0f && info.video_bit_rate > 0 && info.file_size > 0)
|
||||
// Estimate from bitrate, total bytes, and framerate
|
||||
info.duration = (info.file_size / info.video_bit_rate);
|
||||
info.duration = float(info.file_size) / info.video_bit_rate;
|
||||
|
||||
// No duration found in stream of file
|
||||
if (info.duration <= 0.0f) {
|
||||
|
||||
Reference in New Issue
Block a user