[Android] SetActiveAudioTrack makes video jump forward in time
Unity version
6000.0.60f1
Unity editor platform
Windows
AVPro Video edition
Core
AVPro Video version
3.3.3
Device hardware
Pico G4 Business Ultra
Which Android OS version are you using?
16
Unity Graphics API
OpenGLES 3
Video API
MediaPlayer
Texture format
BGRA
Audio output
System Direct
Any other Media Player component configuration required to reproduce the issue.
No response
Which output component(s) are you using?
Apply to Material
Any other component configuration required to reproduce the issue.
No response
The issue
Whenever I call SetActiveAudioTrack to switch the audio track to one of 5 tracks in a video it moves the video forward. This seems to happen both when the video is playing, AND when the video is not playing, causing the video to start somewhere 3 or so seconds into the video when pressing play. The amount it skips seems to be a bit random, but around 3 to 8 seconds.
Media information
360 Equirect 4K video at 60 FPS AV1 encoding with 5 audio tracks included using ffmpeg. Bitrate does not seem to change anything. I made a newly encoded version at half and quarter bitrate and issue persists.
Logcat output
Can you send over a video that we can reproduce the issue with please @JeffWTD
Can you send over a video that we can reproduce the issue with please @JeffWTD
I sent a mail again with a link to the video. I now also notice that sometimes when playing at random points in the video I get a freeze for about a second, then I see green stripes in the image and then it resumes, im guessing when it reaches the next i-frame.
Im playing it using the default MediaPlayer with all default settings. The file is locally on the headset in the persistent path.
Is there any way to make AVPro load more of the video into RAM? I see settings for this for streaming but none for local playback.
Is there any way to make AVPro load more of the video into RAM? I see settings for this for streaming but none for local playback.
Short answer is 'no'. ExoPlayer under the hood is likely loading the whole file into memory, but feeds frames through the decoder as required. I suspect you are asking if we can pump more frames through to increase the buffered amount. This is the 'no' part, and that is not what you can adjust for streaming media - that is just the amount streamed into ram ready for decoding.