Changes between Version 3 and Version 4 of linux/media


Ignore:
Timestamp:
02/19/2019 09:50:07 PM (14 months ago)
Author:
Tim Harvey
Comment:

added examples and media-ctl pipeline config script

Legend:

Unmodified
Added
Removed
Modified
  • linux/media

    v3 v4  
    266266
    267267Note that to aid in the configuration of and for backward compatibility with V4L2 applications that use controls the capture device interfaces inherit controls from the active entities in the current pipeline thus these controls can be accessed via the entity subdev or from the active capture device interface. For example the FIM controls are available from the ipu_csi subdevs or from the active capture device.
     268
     269
     270==== setup script
     271Because the combinations of sensor, cpu, and board are plentiful we have created a way to create an appropriate pipeline configuration script that needs only to know what sensor you wish to use.
     272
     273Installation:
     274{{{#!bash
     275wget http://dev.gateworks.com/docs/linux/media/media-ctl-setup
     276chmod +x media-ctl-setup
     277}}}
     278
     279Examples:
     280 * Analog CVBS capture
     281{{{#!bash
     282./media-ctl-setup adv7180 > setup
     283/bin/sh setup
     284}}}
     285 * Digital HDMI capture
     286{{{#!bash
     287./media-ctl-setup tda1997x > setup
     288/bin/sh setup
     289}}}
     290
     291
     292==== capture and streaming examples
     293With the assumption that you have already configured your capture device and set it to the {{{DEVICE}}} env variable the following examples are useful examples for capture and streaming:
     294
     295Examples:
     296 * basic raw frame capture with {{{v4l2-ctl}}}:
     297{{{#!bash
     298# capture 1 frame
     299v4l2-ctl --device /dev/video4 --stream-mmap --stream-to=x.raw --stream-count=1
     300# convert with imagemagick (assumes you captured a 480p YUV frame)
     301convert -size 720x480 -depth 16 uyvy:x.raw frame.png
     302}}}
     303 * Display capture source:
     304{{{#!bash
     305# display kmssink
     306gst-launch-1.0 v4l2src device=$DEVICE ! kmssink
     307# display fbdevsink
     308gst-launch-1.0 v4l2src device=$DEVICE ! v4l2video10convert output-io-mode=dmabuf-import ! fbdevsink
     309}}}
     310 * Encode to JPEG (software based encode) and stream via RTP/UDP:
     311{{{#!bash
     312# stream JPEG/RTP/UDP
     313gst-launch-1.0 v4l2src device=$DEVICE ! jpegenc ! rtpjpegpay ! udpsink host=$SERVER port=$PORT
     314# client on $SERVER:$PORT could be viewing via 'gst-launch-1.0 udpsrc port=5000 ! application/x-rtp,payload=96 ! rtpjpegdepay ! jpegdec ! autovideosink'
     315}}}
     316 * Encode to H264 (hardware based encode) and stream via RTP/UDP:
     317{{{#!bash
     318# stream H264/RTP/UDP
     319gst-launch-1.0 v4l2src device=$DEVICE ! \
     320        v4l2video10convert output-io-mode=dmabuf-import ! \
     321        v4l2h264enc output-io-mode=dmabuf-import ! \
     322        rtph264pay ! udpsink host=$SERVER port=$PORT
     323# client on $SERVER:$PORT could be viewing via 'gst-launch-1.0 udpsrc port=5001 caps=application/x-rtp,payload=96 ! rtph264depay ! decodebin ! autovideosink'
     324}}}