-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add MJPEG support in GStreamer driver, refs #145
- Loading branch information
Showing
4 changed files
with
157 additions
and
56 deletions.
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
webcam-capture-drivers/driver-gstreamer/src/example/java/GStreamerDriverMjpegExample.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import static com.github.sarxos.webcam.ds.gstreamer.GStreamerDriver.FORMAT_MJPEG; | ||
import static com.github.sarxos.webcam.ds.gstreamer.GStreamerDriver.FORMAT_RGB; | ||
import static com.github.sarxos.webcam.ds.gstreamer.GStreamerDriver.FORMAT_YUV; | ||
|
||
import java.util.Arrays; | ||
|
||
import javax.swing.JFrame; | ||
|
||
import com.github.sarxos.webcam.Webcam; | ||
import com.github.sarxos.webcam.WebcamPanel; | ||
import com.github.sarxos.webcam.ds.gstreamer.GStreamerDriver; | ||
|
||
|
||
public class GStreamerDriverMjpegExample { | ||
|
||
static { | ||
Webcam.setDriver(new GStreamerDriver(Arrays.asList(FORMAT_MJPEG, FORMAT_RGB, FORMAT_YUV))); | ||
} | ||
|
||
public static void main(String[] args) { | ||
|
||
WebcamPanel panel = new WebcamPanel(Webcam.getWebcams().get(0)); | ||
panel.setFPSDisplayed(true); | ||
|
||
JFrame frame = new JFrame("GStreamer Webcam Capture Driver Demo"); | ||
frame.add(panel); | ||
frame.pack(); | ||
frame.setVisible(true); | ||
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters