how does Element replay again after EOS?

66 views
Skip to first unread message

jeff chen

unread,
Oct 5, 2019, 9:12:06 AM10/5/19
to gstreamer-java
some reason i need to set mp4mux EOS state. how do i replay mp4mux or bin again after get EOS event ?

bin = Gst.parseBinFromDescription("textoverlay name=watertext font-desc=\"Sans, 42\" text=\"test\" ! tee name=t t. ! queue ! videoconvert ! appsink name=appsink t. ! queue ! identity name=identity ! x264enc name=encoder tune=4 ! mp4mux name=mux ! filesink name=filesink location=g:/test_video/text.mp4 sync=false", false);

bin.getElementByName("mux").getBus().connect((Bus.EOS) (mux_source) -> {
     System.out.println("Received the EOS on the mux!!!");
     ### bin.getElementByName("mux").setState(State.PLAYING); not working ###
     ### bin.play(); not working too ###
     ### how to set mux or bin replay again ###
});


Timer timer = new Timer();
    timer.schedule(new TimerTask() {
            @Override
            public void run() {
                   bin.getElementByName("mux").sendEvent(new EOSEvent());
            }
        }, 1000, 10000);

Neil C Smith

unread,
Oct 5, 2019, 10:12:22 AM10/5/19
to gstream...@googlegroups.com


On Sat, 5 Oct 2019, 14:12 jeff chen, <chenj...@gmail.com> wrote:
some reason i need to set mp4mux EOS state. how do i replay mp4mux or bin again after get EOS event ? 

Maybe try stop() then play() to start with.

Best wishes,

Neil
Reply all
Reply to author
Forward
0 new messages