Bug 1173

Summary: GLMediaPlayer: EOS not reported for FFMPEG video
Product: [JogAmp] Jogl Reporter: Alan Sambol <alan.zgb>
Component: videoAssignee: Sven Gothel <sgothel>
Status: CONFIRMED ---    
Severity: major CC: alan.zgb, gouessej, kdropucic
Priority: ---    
Version: 2.4.0   
Hardware: pc_all   
OS: windows   
Type: DEFECT SCM Refs:
Workaround: ---
Bug Depends on:    
Bug Blocks: 1216    

Description Alan Sambol 2015-07-09 12:17:15 CEST
When using MovieSimple test demo, GLMediaEventListener doesn't getGLMediaEventListener.EVENT_CHANGE_EOS event on end of stream. Other events (pause, play, etc) are reported normally. Currently I don't see a way to detect video end, except counting frames which is impractical.

Another, possibly related issue is that when playing any MP3 file using GLMediaPlayer (STREAM_ID_NONE for video), EOS _is_ reported, but about 10 seconds before the track end.

FFmpeg version: 2014-01-15 git-785dc14
  libavutil      52. 62.100 / 52. 62.100
  libavcodec     55. 48.101 / 55. 48.101
  libavformat    55. 23.103 / 55. 23.103
  libavdevice    55.  5.102 / 55.  5.102
  libavfilter     4.  1.100 /  4.  1.100
  libswscale      2.  5.101 /  2.  5.101
  libswresample   0. 17.104 /  0. 17.104
  libpostproc    52.  3.100 / 52.  3.100
Comment 1 Alan Sambol 2015-07-09 12:19:14 CEST
A simple way to test this is to seek to a few seconds before video end. On end, the video just stops, even though it should restart:

                if( 0 != ( GLMediaEventListener.EVENT_CHANGE_EOS & event_mask ) ) {
                    new Thread() {
                        public void run() {
                            // loop for-ever ..
                            mPlayer.seek(0);
                            mPlayer.play();
                        } }.start();
                }
Comment 2 Julien Gouesse 2015-07-09 13:15:37 CEST
Please can you use a more recent version version of FFMPEG with JOGL 2.3.1?
Comment 3 Kruno Dropucic 2015-09-05 14:48:51 CEST
Hi, we tried with the latest 20150905-git-a87ada5 FFmpeg version, but the problem remains. JOGL version is 2.3.1.
Comment 4 Kruno Dropucic 2015-09-05 16:09:43 CEST
When using Libav (tested with http://builds.libav.org/windows/release-gpl/libav-11.3-win64.7z) instead of FFmpeg EOS is detected and everything works ok, so the problem probably lies in Java wrapper or in FFmpeg itself.

The problem still persists for us because our application is deployed on Windows platform where usage of FFmpeg instead of Libav is advised by your code comments.
Comment 5 Sven Gothel 2019-03-30 02:45:22 CET
(In reply to Kruno Dropucic from comment #4)
> When using Libav (tested with
> http://builds.libav.org/windows/release-gpl/libav-11.3-win64.7z) instead of
> FFmpeg EOS is detected and everything works ok, so the problem probably lies
> in Java wrapper or in FFmpeg itself.
> 
> The problem still persists for us because our application is deployed on
> Windows platform where usage of FFmpeg instead of Libav is advised by your
> code comments.

Yes, FFMPEG usage is recommended. 
Will need to test all our ffmpeg binding / GLMediaPlayer issued for version 2.4.0.