VAR-SOM-MX6 GSTREAM: Difference between revisions
Line 15: | Line 15: | ||
== Major GStreamer commands == | == Major GStreamer commands == | ||
Two major commands, | Two major commands, gst-inspect allow you to to get documentation on available elements and detail information on a specific element. | ||
gst-launch allow you to create and execute GStreamer pipelines. | |||
=== gst-inspect === | === gst-inspect === | ||
List all available elements: | List all available elements: | ||
<pre>$ gst-inspect </pre> | <pre>$ gst-inspect </pre> | ||
List all avilable i.MX6 specific elements: | List all avilable i.MX6 specific elements: | ||
<pre>$ gst-inspect | grep imx</pre> | <pre>$ gst-inspect | grep imx | ||
For example: | |||
root@var-som-mx6:~# gst-inspect | grep imx | |||
mp3enc.imx: mfw_mp3encoder: mp3 audio encoder | |||
v4lsink.imx: imxv4l2sink: v4l2 video sink | |||
isink.imx: mfw_isink: IPU-based video sink | |||
aiur.imx: webm: webm | |||
aiur.imx: aiurdemux: aiur universal demuxer | |||
tvsrc.imx: tvsrc: v4l2 based tv src | |||
v4lsrc.imx: imxv4l2src: v4l2 based camera src | |||
audiopeq.imx: mfw_audio_pp: audio post equalizer | |||
beep.imx: ac3: ac3 | |||
beep.imx: 3ca: ac3 | |||
beep.imx: beepdec: beep audio decoder | |||
beep.imx: beepdec.vorbis: Vorbis decoder | |||
beep.imx: beepdec.mp3: MP3 decoder | |||
beep.imx: beepdec.aac: AAC LC decoder | |||
amrdec.imx: mfw_amrdecoder: amr audio decoder | |||
vpu.imx: vpudec: VPU-based video decoder | |||
vpu.imx: vpuenc: VPU-based video encoder | |||
ipucsc.imx: mfw_ipucsc: IPU-based video converter | |||
</pre> | |||
Detail help information on a specific element: | Detail help information on a specific element: | ||
<pre>$ gst-inspect imxv4l2sink</pre> | <pre>$ gst-inspect imxv4l2sink</pre> |
Revision as of 11:52, 16 December 2015
Under construction!!!
Stream Camera with imxcamera application
On your host machine install Video Lan VLC VideoLan
- Find out your host IP address (Windows:ipconfig Linux:ifconfig)
- Start VLC, Media->Open Network Stream. Set the URL to "rtp://@:5004" and hit "Play".
- On target start imxcamera application.
- Hit the Settigns button. Select "Enable RTP" box and set the IP to you host machine. Hit OK.
- Push the Camera button to get a Video camera Image.
- Hit the blue button and the camera will be streamed to you host VLC.
Introduction to gstream
GStreamer
GStreamer is a powerful pipeline-based multimedia framework.
GStreamer allows a programmer to create a variety of media-handling components, including simple audio playback, audio and video playback, recording, streaming and editing. This is not a GStreamer reference manual but a overview for using in on Variscite i.MX6 products.
Major GStreamer commands
Two major commands, gst-inspect allow you to to get documentation on available elements and detail information on a specific element. gst-launch allow you to create and execute GStreamer pipelines.
gst-inspect
List all available elements:
$ gst-inspect
List all avilable i.MX6 specific elements:
$ gst-inspect | grep imx For example: root@var-som-mx6:~# gst-inspect | grep imx mp3enc.imx: mfw_mp3encoder: mp3 audio encoder v4lsink.imx: imxv4l2sink: v4l2 video sink isink.imx: mfw_isink: IPU-based video sink aiur.imx: webm: webm aiur.imx: aiurdemux: aiur universal demuxer tvsrc.imx: tvsrc: v4l2 based tv src v4lsrc.imx: imxv4l2src: v4l2 based camera src audiopeq.imx: mfw_audio_pp: audio post equalizer beep.imx: ac3: ac3 beep.imx: 3ca: ac3 beep.imx: beepdec: beep audio decoder beep.imx: beepdec.vorbis: Vorbis decoder beep.imx: beepdec.mp3: MP3 decoder beep.imx: beepdec.aac: AAC LC decoder amrdec.imx: mfw_amrdecoder: amr audio decoder vpu.imx: vpudec: VPU-based video decoder vpu.imx: vpuenc: VPU-based video encoder ipucsc.imx: mfw_ipucsc: IPU-based video converter
Detail help information on a specific element:
$ gst-inspect imxv4l2sink
gst-launch
Simple example:
gst-launch -v videotestsrc ! imxv4l2sink
i.MX6 major elements
Prefix |
Element Name |
description |
---|---|---|
mp3enc.imx | mfw_mp3encoder | mp3 audio encoder |
v4lsink.imx | imxv4l2sink | v4l2 video sink |
isink.imx | mfw_isink | IPU-based video sink |
v4lsrc.imx | imxv4l2src | v4l2 based camera src |
vpu.imx | vpudec | VPU-based video decoder |
vpu.imx | vpuenc | VPU-based video encoder |
ipucsc.imx | mfw_ipucsc | IPU-based video converter |
Test Stream
Test pattern. Width will be set to output display width.
$ gst-launch -v videotestsrc ! imxv4l2sink
Test pattern with specific paramters on the input
$ gst-launch videotestsrc pattern=ball ! imxv4l2sink
Test pattern with specific paramters on the output
$ gst-launch videotestsrc ! imxv4l2sink disp-width=1280 disp-height=720
Test pattern with specific paramters on the input and output
$ gst-launch videotestsrc pattern=ball ! imxv4l2sink disp-width=1280 disp-height=720
Camera Stream
Test pattern.
$ gst-launch imxv4l2src device=/dev/video0 capture-mode=4 fps-n=30 queue-size=7 ! queue max-size-buffers=3 ! imxv4l2sink disp-width=1280 disp-height=720
- capture-mode ov5460 options:
- ov5640_mode_VGA_640_480 = 0,
- ov5640_mode_QVGA_320_240 = 1,
- ov5640_mode_NTSC_720_480 = 2,
- ov5640_mode_PAL_720_576 = 3,
- ov5640_mode_720P_1280_720 = 4,
- ov5640_mode_1080P_1920_1080 = 5
This is a 3 elements pipe.The queue in the middle is an GStreamer element.
Video Encode
720p:
$ gst-launch imxv4l2src capture-mode=4 fps-n=30 ! queue ! vpuenc codec=6 ! matroskamux ! filesink location=test.avi
1080p:
$ gst-launch imxv4l2src capture-mode=5 fps-n=30 ! queue ! vpuenc codec=6 ! matroskamux ! filesink location=test.avi
- The codec type for encoding
- flags: readable, writable
- Enum "vpuenc_codec" Default: 0, "mpeg4"
- (0): mpeg4 - video/mpeg,
- (5): h263 - video/x-h263
- (6): avc - video/x-h264
- (12): mjpg - image/jpeg