Changes between Version 5 and Version 6 of linux/media


Ignore:
Timestamp:
02/19/2019 10:36:57 PM (5 years ago)
Author:
Tim Harvey
Comment:

additional mem2mem examples and use v4l2video8convert instead of gst-master v4l2convert

Legend:

Unmodified
Added
Removed
Modified
  • linux/media

    v5 v6  
    354354# upscale
    355355gst-launch-1.0 videotestsrc ! video/x-raw,width=320,height=240 ! \
    356     v4l2convert ! \
     356    v4l2video8convert ! \
    357357    video/x-raw,width=640,height=480 ! kmssink can-scale=false
    358358# downscale
    359359gst-launch-1.0 videotestsrc ! video/x-raw,width=640,height=480 ! \
    360     v4l2convert ! \
     360    v4l2video8convert ! \
    361361    video/x-raw,width=320,height=240 ! kmssink can-scale=false
    362362# rotate
    363363gst-launch-1.0 videotestsrc ! video/x-raw,width=320,height=240 ! \
    364     v4l2convert extra-controls=cid,rotate=90 ! \
     364    v4l2video8convert extra-controls=cid,rotate=90 ! \
    365365    video/x-raw,width=240,height=320 ! kmssink can-scale=false
    366366# hflip
    367367gst-launch-1.0 videotestsrc ! video/x-raw,width=320,height=240 ! \
    368     v4l2convert extra-controls=cid,horizontal_flip=1 ! \
     368    v4l2video8convert extra-controls=cid,horizontal_flip=1 ! \
    369369    video/x-raw,width=640,height=480 ! kmssink can-scale=false
    370370# vflip
    371371gst-launch-1.0 videotestsrc ! video/x-raw,width=320,height=240 ! \
    372     v4l2convert extra-controls=cid,vertical_flip=1 ! \
     372    v4l2video8convert extra-controls=cid,vertical_flip=1 ! \
    373373    video/x-raw,width=640,height=480 ! kmssink can-scale=false
    374374}}}
    375375  - note the above examples force the input format (resolution in this case) to differ from the output format otherwise gstreamer will bypass the v4l2convert entity thinking it not necessary as gstreamer does not understand the flip/rotation properties. GStreamer master (in development) adds the 'disable-passthrough' property which can be enabled to force disabling passthrough
     376 * scale/rotate/flip using imx-media capture device and KMS display driver (can use dmabufs for this as they are all imx hardware entitites):
     377{{{#!bash
     378# scale sensor input to 720p display
     379gst-launch-1.0 v4l2src device=$DEVICE ! \
     380     v4l2video8convert output-io-mode=dmabuf-import ! \
     381     video/x-raw,width=1280,height=720 ! \
     382     kmssink can-scale=false
     383# scale sensor input to 1080p display
     384gst-launch-1.0 v4l2src device=$DEVICE ! \
     385     v4l2video8convert output-io-mode=dmabuf-import ! \
     386     video/x-raw,width=1920,height=1080 ! \
     387     kmssink can-scale=false
     388# scale/flip
     389gst-launch-1.0 v4l2src device=$DEVICE ! \
     390     v4l2video8convert output-io-mode=dmabuf-import extra-controls=cid,horizontal_flip=1 ! \
     391     video/x-raw,width=1920,height=1080 ! \
     392     kmssink can-scale=false
     393# scale/rotate
     394gst-launch-1.0 v4l2src device=$DEVICE ! \
     395     v4l2video8convert output-io-mode=dmabuf-import extra-controls=cid,rotate=90 ! \
     396     video/x-raw,width=720,height=1280 ! \
     397     kmssink can-scale=false
     398}}}
    376399
    377400
     
    402425# encode
    403426gst-launch-1.0 v4l2src device=$DEVICE ! \
    404      v4l2convert output-io-mode=dmabuf-import ! \
     427     v4l2video8convert output-io-mode=dmabuf-import ! \
    405428     v4l2h264enc output-io-mode=dmabuf-import ! \
    406429     rtph264pay ! udpsink host=$SERVER port=$PORT
    407430# scale/encode
    408431gst-launch-1.0 v4l2src device=$DEVICE ! \
    409      v4l2convert output-io-mode=dmabuf-import ! \
     432     v4l2video8convert output-io-mode=dmabuf-import ! \
    410433     video/x-raw,width=1440,height=960 ! \
    411434     v4l2h264enc output-io-mode=dmabuf-import ! \
     
    413436# scale/flip/encode
    414437gst-launch-1.0 v4l2src device=$DEVICE ! \
    415      v4l2convert output-io-mode=dmabuf-import extra-controls=cid,horizontal_flip=1 ! \
     438     v4l2video8convert output-io-mode=dmabuf-import extra-controls=cid,horizontal_flip=1 ! \
    416439     video/x-raw,width=1440,height=960 ! \
    417440     v4l2h264enc output-io-mode=dmabuf-import ! \
     
    419442# scale/rotate/encode
    420443gst-launch-1.0 v4l2src device=$DEVICE ! \
    421      v4l2convert output-io-mode=dmabuf-import extra-controls=cid,rotate=90 ! \
     444     v4l2video8convert output-io-mode=dmabuf-import extra-controls=cid,rotate=90 ! \
    422445     video/x-raw,width=1440,height=960 ! \
    423446     v4l2h264enc output-io-mode=dmabuf-import ! \