|
|
| import gst | | import gst |
| | | |
| t | mypipeline = """v4l2src ! ffmpegcolorspace ! queue ! vp8enc quality=10 speed=4 | t | mypipeline = """v4l2src ! ffmpegcolorspace ! queue ! vp8enc quality=10 speed=6 |
| ! mux. pulsesrc ! | | ! mux. pulsesrc ! |
| audio/x-raw-int ! queue ! audioconvert ! vorbisenc ! mux. webmmux name=mux ! fi | | audio/x-raw-int ! queue ! audioconvert ! vorbisenc ! mux. webmmux name=mux ! fi |
| lesink location=screencast2.webm""" | | lesink location=screencast2.webm""" |
| | | |
|
|
| | | |
| gst-launch ximagesrc ! ffmpegcolorspace ! queue ! vp8enc quality=10 speed=2 ! | | gst-launch ximagesrc ! ffmpegcolorspace ! queue ! vp8enc quality=10 speed=2 ! |
| mux. pulsesrc ! audio/x-raw-int ! queue ! audioconvert ! vorbisenc ! mux. webmmu | | mux. pulsesrc ! audio/x-raw-int ! queue ! audioconvert ! vorbisenc ! mux. webmmu |
| x name=mux ! filesink location=screencast2.webm | | x name=mux ! filesink location=screencast2.webm |
| t | | t | |
| | | python gstreamer binding example |
| | | ==================================== |
| | | |
| | | Access the webcam from python: |
| | | |
| | | .. code-block:: python |
| | | |
| | | import gst |
| | | |
| | | mypipeline = """v4l2src ! ffmpegcolorspace ! queue ! vp8enc quality=10 speed=4 |
| | | ! mux. pulsesrc ! |
| | | audio/x-raw-int ! queue ! audioconvert ! vorbisenc ! mux. webmmux name=mux ! fi |
| | | lesink location=screencast2.webm""" |
| | | |
| | | # create pipeline object |
| | | pipeline = gst.parse_launch(mypipeline) |
| | | |
| | | # start capturing video from webcam! |
| | | pipeline.set_state(gst.STATE_PLAYING) |
| | | |
| | | # stop capturing video from webcam |
| | | pipeline.set_state(gst.STATE_NULL) |
| | | |
| | | |
|
|
| t | | t | Screen Recording with audio on Linux |
| | | ========================================= |
| | | |
| | | I use this command to record my screen and audio into webm format: |
| | | |
| | | .. code-block:: bash |
| | | |
| | | gst-launch ximagesrc ! ffmpegcolorspace ! queue ! vp8enc quality=10 speed=2 ! |
| | | mux. pulsesrc ! audio/x-raw-int ! queue ! audioconvert ! vorbisenc ! mux. webmmu |
| | | x name=mux ! filesink location=screencast2.webm |