RPi native video player won't play sound

I’m having trouble playing a video with sound on a Raspberry Pi using the native ofVideoPlayer. The sound will start playing with the video but will quickly drift out of sync and eventually just stop playing. All this happens very quickly, in under 10 seconds.

The video is encoded in H.264 and the sound in AAC at 48 Khz. I’m using the HDMI output for audio. If I play the same video using the omxplayer command in the shell, it plays with no problems.

Could this be a memory issue or is there a setting I’m missing somewhere? Any help or suggestions is appreciated. Thanks!

FWIW, I tried switching to MPEG audio instead of AAC but I’m still getting the same behaviour.

I’m looking at switching to ofxOMXPlayer, but I thought the native ofVideoPlayer would work similarly as it uses the gst-omx wrapper. I don’t remember where I saw this though, is it correct or am I making this up?

Yes gstreamer uses omx as well, as far as i remember the version of the omx plugin in raspbian was kind of outdated. that was in the previous version though so not completely sure. archlinux for sure had the latest version

in any case the gstreamer version has a little overhead even when using native pixels so the ofxOMXPlayer plugin is still a little faster

No idea about why audio might not work though i doubt that’s even handled by the omx plugin and not sure if ofxOMXPlayer supports audio. cc @jvcleave

yeah ofxOMXPlayer supports audio in video but not audio alone

Ok thanks. It’s really odd, if I use PCM the audio plays all the way through but it’s totally out of sync with the video. It doesn’t sound warped, so I think it’s just drifting over time. It’s totally fine if I use the command line omxplayer.

I’m going to try more formats and report back if I get anywhere.

@jvcleave I’m also trying ofxOMXPlayer, but have to rebuild my cross-compiler yet again :weary: