4 Template

Here’s common command line for each case.

Get camera/video Source

  • video
    gst-launch-1.0 filesrc location=pexels-george-morina-5372874.mp4 ! qtdemux ! h264parse ! nvv4l2decoder ! nvvideoconvert ! videoconvert ! xvimagesink sync=true
  • Basler
    gst-launch-1.0 pylonsrc pixel-format=BayerRG8 width=1280 height=720 fps=7 ! videoconvert ! xvimagesink sync=false
  • Appropho gst-launch-1.0 v4l2src io-mode=0 device=/dev/video0 do-timestamp=true ! 'video/x-raw, width=1920, height=1080, framerate=30/1, format=UYVY' ! xvimagesink sync=false

    Pre-processing / Post-process

AI inferece

  • Classification
    • googlenet gst-launch-1.0 pylonsrc camera=0 fps=20 ! videoconvert ! adrt model=/home/adlink/Downloads/model/googlenet.engine batch=1 ! adtrans_classifier label="/home/adlink/Desktop/EVA Sample/EVA_IDE/model/googlenet-v2_RT_labels.txt" ! admetadrawer ! videoconvert ! fpsdisplaysink video-sink=xvimagesink text-overlay=true
  • Object detection
    • yolov3-tiny
      gst-launch-1.0 filesrc location=pexels-george-morina-5372874.mp4 ! qtdemux ! h264parse ! nvv4l2decoder ! nvvideoconvert ! videoconvert ! adrt rgbconv=true model=yolov3-tiny-288-1012.engine device=0 scale=0.0039 mean="0 0 0" batch=1 ! adtrans_yolotrt label-file=label.txt blob-size="9,18" mask="(3,4,5),(0,1,2)" anchor="(10,14),(23,27),(37,58),(81,82),(135,169),(344,319)" input_width=288 class-num=80 input_height=288 threshold=0.4 ! admetadrawer ! videoconvert ! xvimagesink sync=true
    • yolov3
      gst-launch-1.0 pylonsrc camera=0 fps=6 ! videoconvert ! adrt model=yolov3-416_test.engine scale=0.004 mean="0 0 0" device=0 batch=1 ! adtrans_yolo label=label.txt class-num=2 ! admetadrawer ! videoconvert ! xvimagesink sync=false
    • ssd inception
      gst-launch-1.0 pylonsrc camera=0 fps=15 ! videoscale ! video/x-raw, width=800, height=600 ! videoconvert ! adrt model=/home/adlink/Downloads/model/ssdv2.engine batch=1 device=0 scale=0.0078 mean="0 0 0" norm=false ! adtrans_ssd label=/home/adlink/Downloads/model/ssd_coco_labels.txt ! admetadrawer ! videoconvert ! fpsdisplaysink video-sink=xvimagesink text-overlay=true
  • Pose detection
    gst-launch-1.0 pylonsrc pixel-format=BayerRG8 width=1280 height=720 fps=7 ! bayer2rgb ! videoconvert ! adrt model="/home/adlink/Desktop/EVA Sample/EVA_IDE/model/pose-b1.engine" scale=0.0039 rgbconv=true ! adtrans_openpose_py ! admetadrawer ! videoconvert ! xvimagesink sync=false
  • Segmentation
    • fcn
      gst-launch-1.0 videotestsrc ! adrt model=road.engine scale=1.0 mean="0 0 0" device=0 batch=1 ! adtrans_segment class-num=4 blob-height=512 blob-width=896 ! xvimagesink sync=false

RTSP

Launch RTSP server before every operation

 $ /opt/adlink/eva/bin/rtsp-simple-server
  • Video file streaming out
    gst-launch-1.0 videotestsrc ! videoconvert ! nvvideoconvert ! nvv4l2h264enc ! rtspclientsink location=rtsp://localhost:8554/test
  • Appropho camera streaming out
    gst-launch-1.0 v4l2src io-mode=4 ! videoconvert ! nvvideoconvert ! nvv4l2h264enc ! rtspclientsink location=rtsp://localhost:8554/test gst-launch-1.0 v4l2src io-mode=0 ! 'video/x-raw, width=1920, height=1080, framerate=30/1, format=UYVY' ! nvvideoconvert ! 'video/x-raw(memory:NVMM)' ! nvv4l2h265enc bitrate=4000000 ! rtspclientsink location=rtsp://localhost:8554/test
  • Receive RTSP streaming
    gst-launch-1.0 rtspsrc location=rtsp://localhost:8554/test ! rtph265depay ! h264parse ! avdec_h264 ! xvimagesink gst-launch-1.0 rtspsrc location=rtsp://localhost:8554/test user-id=admin user-pw=admin ! rtph264depay ! h264parse ! nvv4l2decoder ! nvvideoconvert ! "video/x-raw(memory:NVMM),format=RGBA" ! nvegltransform ! nveglglessink sync=false

    Save file

  • Save as mkv file
    gst-launch-1.0 v4l2src io-mode=0 device=/dev/video0 do-timestamp=true ! nvvideoconvert ! 'video/x-raw(memory:NVMM)' ! nvv4l2h264enc bitrate=4000000 ! h264parse ! matroskamux ! filesink location=test.mkv

  • Preview
    gst-launch-1.0 v4l2src io-mode=0 device=/dev/video0 do-timestamp=true ! 'video/x-raw, width=1920, height=1080, framerate=30/1, format=UYVY' ! xvimagesink sync=false

  • Preview & save
    gst-launch-1.0 v4l2src io-mode=0 device=/dev/video0 do-timestamp=true ! 'video/x-raw, width=1920, height=1080, framerate=30/1, format=UYVY' ! videoconvert ! tee name=t ! queue ! 'video/x-raw, format=(string)UYVY' ! nvvideoconvert ! 'video/x-raw(memory:NVMM)' ! nvv4l2h264enc bitrate=4000000 ! h264parse ! matroskamux ! filesink location=test.mkv sync=false t. ! queue ! xvimagesink sync=false

  • Inference and save video gst-launch-1.0 filesrc location=pallet.mp4 ! decodebin ! nvvidconv ! videoconvert ! adrt model=pallet_yolov4_416.engine scale=0.004 mean="0 0 0" rgbconv=True ! adtrans_yolo class-num=1 anchor=anchor="(12,16),(19,36),(40,28),(36,75),(76,55),(72,146),(142,110),(192,243),(459,401)" threshold=0.3 label=pallet_yolov4_v1.names use-sigmoid=True ! admetadrawer ! videoconvert ! omxh264enc bitrate=4000000 ! h264parse ! qtmux ! filesink location=filename.h264