Skip to content

fix: use track.timescale and not movie.timescale#372

Open
Equipo45 wants to merge 1 commit into
midrender:mainfrom
Equipo45:bugfix/movie_timescale_track.timescale_mismatch
Open

fix: use track.timescale and not movie.timescale#372
Equipo45 wants to merge 1 commit into
midrender:mainfrom
Equipo45:bugfix/movie_timescale_track.timescale_mismatch

Conversation

@Equipo45
Copy link
Copy Markdown

Description

Hi! Thank you for making this short renderer!

I was trying it with several videos, and I found a little bug. In some places, we are working with different timescales, which can cause a mismatch in timestamps of the rendering of the video leading to this error in the parser.ts:

Timestamp 1242.6843333333334 is outside of the video, max timestamp is 1060.4583333333333

This is because the movie timescales, in some videos, can be taken from the Audio, and not the video. Here we have an example:

ffprobe -loglevel quiet -i little_error_video.mp4 -show_format -show_streams | grep time_base
time_base=1/50000 --> track.timescale
time_base=1/48000 --> track.movie_timescale

ffprobe -loglevel quiet -i huge_error_video.mp4 -show_format -show_streams | grep time_base
time_base=1/25000 --> track.timescale
time_base=1/48000 --> track.movie_timescale

Or you can see it directly in the debug, looking at the timescale of the track and the movie_timescale of the track, which should be working with the same number:

:claqueta: [BACKEND] MP4 PARSER DEBUG
parser.ts:33 :gráfico_de_barras: Track Info: {duration: 74934000, timescale: 25000, movie_timescale: 48000, nb_samples: 74934, duration_sec: '2997.360', …}duration: 74934000duration_min: "50.0"duration_sec: "2997.360"movie_timescale: 48000nb_samples: 74934timescale: 25000[[Prototype]]: Object
parser.ts:42 :lápiz2: Edit Lists: {hasEdits: false, editCount: 0}
parser.ts:99 :ábaco: [BACKEND] Edit 0 FPS Calculation: {trackDurationInSec: '2997.360', segDur_CURRENT: '1561.125000', segDur_FIXED: '2997.360000', mediaRate: '1.000000', fps_CURRENT: '25.000', …}fps_CURRENT: "25.000"fps_FIXED: "25.000"isProblematic: falsemediaRate: "1.000000"segDur_CURRENT: "1561.125000"segDur_FIXED: "2997.360000"trackDurationInSec: "2997.360"[[Prototype]]: Object
parser.ts:112 :dardo: [BACKEND] Final edits created: 1

Thank you for contributing to the open-source community!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant