JavaForm 上的 Gstreamer 运行
Gstreamer run on JavaForm
假设我们有一个如下所示的 GStreamer 命令,并且它 运行 在控制台上运行得很好。我如何在特定的 JFrame
上 运行?当我在终端上 运行 这个命令时,它会打开一个新的视频场景。但我需要 运行 将此视频放在 Netbeans 上特定大小的 JFrame 表单上。
gst-launch-1.0 udpsrc port=5004 buffer-size=622080 ! avdec_h264 ! videoconvert ! fpsdisplaysink
下面是解决方案;
(我的解决方案如下。)
// Gstreamer init - İlklendir
Gst.init(Version.BASELINE, "BasicPipeline");
// Create a named pipeline - sink isimli bir pipeline yarat.
pipeline = (Pipeline) Gst.parseLaunch("videotestsrc ! appsink name=sink");
// Create am appsink that refers to pipeline - sink'ten bir appSink nesnesi yarat
AppSink sink = (AppSink) pipeline.getElementByName("sink");
// Create GstVideoComponent object - gstVc objesi yarat.
GstVideoComponent vc = new GstVideoComponent(sink);
vc.setSize(600, 560);
vc.setVisible(true);
// main screen is a form screen that is public static and has a jform named panel_video - vc'yi form'a ekle
mainScreen.panel_video.add(vc);
// play video - video'yu koştur.
pipeline.play();
谢谢,
假设我们有一个如下所示的 GStreamer 命令,并且它 运行 在控制台上运行得很好。我如何在特定的 JFrame
上 运行?当我在终端上 运行 这个命令时,它会打开一个新的视频场景。但我需要 运行 将此视频放在 Netbeans 上特定大小的 JFrame 表单上。
gst-launch-1.0 udpsrc port=5004 buffer-size=622080 ! avdec_h264 ! videoconvert ! fpsdisplaysink
下面是解决方案; (我的解决方案如下。)
// Gstreamer init - İlklendir
Gst.init(Version.BASELINE, "BasicPipeline");
// Create a named pipeline - sink isimli bir pipeline yarat.
pipeline = (Pipeline) Gst.parseLaunch("videotestsrc ! appsink name=sink");
// Create am appsink that refers to pipeline - sink'ten bir appSink nesnesi yarat
AppSink sink = (AppSink) pipeline.getElementByName("sink");
// Create GstVideoComponent object - gstVc objesi yarat.
GstVideoComponent vc = new GstVideoComponent(sink);
vc.setSize(600, 560);
vc.setVisible(true);
// main screen is a form screen that is public static and has a jform named panel_video - vc'yi form'a ekle
mainScreen.panel_video.add(vc);
// play video - video'yu koştur.
pipeline.play();
谢谢,