I am currently trying to play multiple videos in java using netbeans. I am able to play multiple videos using multiple gstreamer players but how do i use one player to play multiple videos instead so that it will not lag?
Asked
Active
Viewed 2,082 times
1 Answers
0
What is the source of the video? Since you failed to mention that I'll cite an example with RTSP for mpeg4 stream. You could replace this with mjpeg stream or file source or whatever you need.
Think of bins and pads based on the following pipeline. It should not be difficult to program this in Java.
gst-launch -e videomixer name=mix ! ffmpegcolorspace ! xvimagesink \
rtspsrc location="rtsp://<ip>/mpeg4/<cam>/media.amp" debug=1 ! rtpmp4vdepay ! mpeg4videoparse ! ffdec_mpeg4 ! ffmpegcolorspace ! \
textoverlay font-desc="Sans 24" text="CAM1" valign=top halign=left shaded-background=true ! \
videobox border-alpha=0 top=-200 left=-50 ! mix. \
rtspsrc location="rtsp://<ip>/mpeg4/<cam>/media.amp" debug=1 ! rtpmp4vdepay ! mpeg4videoparse ! ffdec_mpeg4 ! ffmpegcolorspace! \
textoverlay font-desc="Sans 24" text="CAM2" valign=top halign=left shaded-background=true ! \
videobox border-alpha=0 top=-200 left=-450 ! mix.
What basically this does is create a single window and display multiple video streams there - in this case two video streams.
If you need clue on how to program in gstreamer-java see my RTSP example Playing RTSP with python-gstreamer

Community
- 1
- 1

enthusiasticgeek
- 2,640
- 46
- 53