Login  Register

Re: JOGL media player?

Posted by Xerxes Rånby on Apr 28, 2013; 8:28pm
URL: https://forum.jogamp.org/JOGL-media-player-tp4027810p4029067.html

Sven Gothel wrote
On 04/26/2013 03:06 PM, Xerxes Rånby [via jogamp] wrote:
>
> I have checked the code and the current FFMPEGMediaPlayer back-end needs
> improvement.

Yes, very good review Xerxes!

Me, the designer of GLMediaPlayer :), stopped working
on the multithreaded feature after I finished the Android impl.
The latter uses multithreading, hence it's smooth w/o drop.

Indeed, a fill-thread should be added to decode the n texFrames
and soon the n audioFrames until full (-> Ringbuffer).

The getNext*() shall fetch the next data from the ringbuffer
(non blocking) or wait until one is available (blocking)
and push it to the sink (audio) or return it (video texure).

Indeed .. an audio packet would drop a frame ('even worse').

Great analysis.

Thx, Sven
I am working on a JOGL branch with an updated JOGL FFMPEGMediaPlayer.
http://github.com/xranby/jogl/commits/FFMPEGMediaPlayer-audio

A quick fix for most of the stuttering on mobile devices using the FFMPEGMediaPlayer back-end is to keep on decoding packets until a video frame is available. It also make video playback in real-time on low end embedded machines using 30Hz screen refresh rate:
http://github.com/xranby/jogl/commit/9086ca1491c5fcf1ae318093b715045d9e30df87

Feel free to join the now ongoing forum and IRC discussion on how to implement a threaded low overhead 0-copy frame caching system with proper sync for audio and video to be used by the updated FFMPEGMediaPlayer back-end.

Cheers
Xerxes