UnityPlugin-AVProVideo icon indicating copy to clipboard operation
UnityPlugin-AVProVideo copied to clipboard

[Android] SetActiveAudioTrack makes video jump forward in time

Open JeffWTD opened this issue 1 month ago • 3 comments

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


JeffWTD avatar Nov 24 '25 15:11 JeffWTD

Can you send over a video that we can reproduce the issue with please @JeffWTD

Ste-RH avatar Nov 28 '25 12:11 Ste-RH

Can you send over a video that we can reproduce the issue with please @JeffWTD

Chris-RH avatar Dec 09 '25 09:12 Chris-RH

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.

JeffWTD avatar Dec 09 '25 14:12 JeffWTD

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.

Ste-RH avatar Dec 15 '25 16:12 Ste-RH