Changes between Version 3 and Version 4 of linux/media

02/19/2019 09:50:07 PM (4 years ago)
Tim Harvey

added examples and media-ctl pipeline config script


  • linux/media

    v3 v4  
    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.
     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.
     276chmod +x media-ctl-setup
     280 * Analog CVBS capture
     282./media-ctl-setup adv7180 > setup
     283/bin/sh setup
     285 * Digital HDMI capture
     287./media-ctl-setup tda1997x > setup
     288/bin/sh setup
     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:
     296 * basic raw frame capture with {{{v4l2-ctl}}}:
     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
     303 * Display capture source:
     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
     310 * Encode to JPEG (software based encode) and stream via RTP/UDP:
     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'
     316 * Encode to H264 (hardware based encode) and stream via RTP/UDP:
     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'