tips:gstreamer

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
tips:gstreamer [2019/07/11 07:50] scipiotips:gstreamer [2023/11/16 11:42] (current) – [gstream jetson] sscipioni
Line 1: Line 1:
 +====== gstream jetson ======
 +
 +
 +
 +orin native
 +<code bash>
 +URL=rtsp://192.168.1.1:7447/IFnqNlmdfTQxDOWV
 +#URL=rtsp://192.168.2.35:7447/60e1a6425a20203019f719aa_1
 +gst-launch-1.0 rtspsrc location=$URL protocols=tcp latency=0 ! rtph264depay ! queue ! h264parse ! nvv4l2decoder ! nvvideoconvert ! autovideosink
 +</code>
 +
 +deepstream amd64
 +<code bash>
 +URL=rtsp://192.168.2.35:7447/60e1a6425a20203019f719aa_1
 +
 +</code>
 +
 +nvv4l2h264enc
 +<code>
 +gst-launch-1.0 videotestsrc is-live=1 ! nvvidconv ! nvv4l2h264enc ! h264parse ! matroskamux ! filesink location=/tmp/out.mkv
 +</code>
 +
 +
 ====== gstreamer ====== ====== gstreamer ======
  
Line 14: Line 37:
 show usb camera show usb camera
 <code> <code>
-gst-launch-1.0 v4l2src ! xvimagesink+gst-launch-1.0 v4l2src device=/dev/video0 ! xvimagesink
 </code> </code>
  
Line 23: Line 46:
   ! h264parse ! avdec_h264 \   ! h264parse ! avdec_h264 \
   ! videoconvert ! xvimagesink   ! videoconvert ! xvimagesink
 +</code>
 +
 +rtsp save stream to test.mkv without h264 decoding
 +<code>
 +gst-launch-1.0 -e rtspsrc location=rtsp://flex/s0 protocols=tcp \
 + ! rtph264depay ! h264parse ! matroskamux ! filesink location=test.mkv
 </code> </code>
  
Line 34: Line 63:
 <code> <code>
 ...  ! videoconvert ! omxh264enc ! matroskamux ! filesink location=test.mkv ...  ! videoconvert ! omxh264enc ! matroskamux ! filesink location=test.mkv
 +</code>
 +
 +inspect pipeline properties
 +<code>
 +... ! fakesink -v | grep fake
 +</code>
 +
 +
 +===== ocam camera =====
 +
 +[[https://github.com/withrobot/oCam/tree/master/Products/oCam-1CGN-U|oCam-1CGN-U]]
 +
 +identify
 +<code>
 +v4l2-ctl --list-devices
 +
 +v4l2-ctl --list-formats-ext -d /dev/video0                                                                                               
 +ioctl: VIDIOC_ENUM_FMT
 + Type: Video Capture
 +
 + [0]: 'GRBG' (8-bit Bayer GRGR/BGBG)
 + Size: Discrete 1280x960
 + Interval: Discrete 0.033s (30.000 fps)
 + Interval: Discrete 0.040s (25.000 fps)
 + Interval: Discrete 0.067s (15.000 fps)
 + Size: Discrete 1280x720
 + Interval: Discrete 0.033s (30.000 fps)
 + Interval: Discrete 0.040s (25.000 fps)
 + Interval: Discrete 0.067s (15.000 fps)
 + Size: Discrete 640x480
 + Interval: Discrete 0.010s (100.000 fps)
 + Interval: Discrete 0.011s (90.000 fps)
 + Interval: Discrete 0.017s (60.000 fps)
 + Interval: Discrete 0.020s (50.000 fps)
 + Interval: Discrete 0.033s (30.000 fps)
 + Interval: Discrete 0.040s (25.000 fps)
 + Interval: Discrete 0.067s (15.000 fps)
 + Size: Discrete 320x240
 + Interval: Discrete 0.006s (180.000 fps)
 + Interval: Discrete 0.007s (150.000 fps)
 + Interval: Discrete 0.008s (120.000 fps)
 + Interval: Discrete 0.010s (100.000 fps)
 + Interval: Discrete 0.017s (60.000 fps)
 + Interval: Discrete 0.020s (50.000 fps)
 +</code>
 +
 +<code>
 +v4l2-ctl -d /dev/video0 --list-ctrls                                                            
 +    white_balance_red_component 0x0098090e (int)    : min=0 max=250 step=1 default=100 value=100
 +   white_balance_blue_component 0x0098090f (int)    : min=0 max=250 step=1 default=100 value=100
 +                           gain 0x00980913 (int)    : min=0 max=255 step=1 default=64 value=64
 +                  exposure_auto 0x009a0901 (menu)   : min=0 max=3 default=1 value=1
 +              exposure_absolute 0x009a0902 (int)    : min=1 max=1000 step=1 default=55 value=128
 +</code>
 +
 +
 +<code>
 +ffplay -f video4linux2 -s 640x480 -i /dev/video0
 +
 +Stream #0:0: Video: rawvideo ([186]GR[8] / 0x85247BA), bayer_grbg8, 640x480, 245760 kb/s, 100 fps, 100 tbr, 1000k tbn, 1000k tbc
 +</code>
 +
 +<code>
 +gst-launch-1.0 -v v4l2src device=/dev/video0 ! 'video/x-bayer,format=grbg,width=640,height=480,framerate=100/1,colorimetry=bt601' ! bayer2rgb ! videoconvert ! xvimagesink
 +
 +# width=640,height=480,framerate=100/1
 +# width=1280,height=960,framerate=30/1
 +
 +</code>
 +
 +save to file with h264 encode
 +<code>
 +gst-launch-1.0 -e v4l2src device=/dev/video0 ! 'video/x-bayer,format=grbg,width=1280,height=960,framerate=30/1,colorimetry=bt601' ! bayer2rgb ! videoconvert ! x264enc ! matroskamux ! filesink location=test.mkv
 </code> </code>
  
  • tips/gstreamer.1562824243.txt.gz
  • Last modified: 2019/07/11 07:50
  • by scipio