google / ExoPlayer

This project is deprecated and stale. The latest ExoPlayer code is available in https://github.com/androidx/media
https://developer.android.com/media/media3/exoplayer
Apache License 2.0
21.71k stars 6.02k forks source link

durationUs error caused by different track timescale #7941

Closed XiaoLongTX closed 4 years ago

XiaoLongTX commented 4 years ago

[REQUIRED] Issue description

I have a video that contains two tracks. The timescale of one track is 1000, the timescale of the other track is 48000, and the movieTimescale is 1000. As a result, the video time I get is 48 times the real video time.

[REQUIRED] Reproduction steps

This problem will inevitably occur when using ExoPlayer to play the video file I sent to dev.exoplayer@gmail.com.

[REQUIRED] Version of ExoPlayer being used

latest

[REQUIRED] Device(s) and version(s) of Android being used

Device independent

XiaoLongTX commented 4 years ago

PR#7923 @kim-vde kim

kim-vde commented 4 years ago

What subject did you use in your email? You should use "Issue #7941". Thanks.

XiaoLongTX commented 4 years ago

@kim-vde I hava resend mail with subject Issue #7941

kim-vde commented 4 years ago

In the case of your file, the tracks duration are derived from the tkhd boxes. One track has duration 41906 while the other has duration 2010112. According to the specification, these durations are given in the timescale indicated in the mvhd box, which is 1000 in this case. The duration of the second file should therefore be updated in order for the file to be valid.