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/13 14:41] 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 13: Line 36:
  
 show usb camera show usb camera
 +<code>
 +gst-launch-1.0 v4l2src device=/dev/video0 ! xvimagesink
 +</code>
 +
 +rtsp client
 +<code>
 +gst-launch-1.0 \
 +  rtspsrc location=rtsp://foscam:foscam1@192.168.2.14:554/videoMain ! rtph264depay \
 +  ! h264parse ! avdec_h264 \
 +  ! 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>
 +
 +hardware decode
 +<code>
 +F=videos/traffico01-1152x720-1610kb.mkv
 +gst-launch-1.0 filesrc location=$F ! matroskademux ! queue ! h264parse ! omxh264dec ! autovideoconvert ! xvimagesink
 +</code>
 +
 +hardware encode
 +<code>
 +...  ! 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> <code>
 v4l2-ctl --list-devices v4l2-ctl --list-devices
  
-v4l2-ctl --list-formats-ext -d /dev/video2                                                                                                                         ✔  10055  14:40:36+v4l2-ctl --list-formats-ext -d /dev/video0                                                                                               
 ioctl: VIDIOC_ENUM_FMT ioctl: VIDIOC_ENUM_FMT
  Type: Video Capture  Type: Video Capture
Line 22: Line 85:
  [0]: 'GRBG' (8-bit Bayer GRGR/BGBG)  [0]: 'GRBG' (8-bit Bayer GRGR/BGBG)
  Size: Discrete 1280x960  Size: Discrete 1280x960
- Interval: Discrete 0.044s (22.500 fps)+ Interval: Discrete 0.033s (30.000 fps) 
 + Interval: Discrete 0.040s (25.000 fps) 
 + Interval: Discrete 0.067s (15.000 fps)
  Size: Discrete 1280x720  Size: Discrete 1280x720
  Interval: Discrete 0.033s (30.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 640x480  Size: Discrete 640x480
- Interval: Discrete 0.013s (80.000 fps)+ 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  Size: Discrete 320x240
- Interval: Discrete 0.006s (160.000 fps)+ 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>
  
-gst-launch-1.0 v4l2src device=/dev/video0 ! xvimagesink+<code> 
 +v4l2-ctl -/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>
  
-rtsp client+
 <code> <code>
-gst-launch-1.0 \ +ffplay -f video4linux2 -s 640x480 -i /dev/video0 
-  rtspsrc location=rtsp://foscam:foscam1@192.168.2.14:554/videoMain ! rtph264depay \ + 
-  ! h264parse ! avdec_h264 \ +Stream #0:0Video: rawvideo ([186]GR[8] 0x85247BA), bayer_grbg8, 640x480, 245760 kb/s, 100 fps, 100 tbr, 1000k tbn, 1000k tbc
-  ! videoconvert ! xvimagesink+
 </code> </code>
  
-hardware decode 
 <code> <code>
-F=videos/traffico01-1152x720-1610kb.mkv +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 
-gst-launch-1.0 filesrc location=$F matroskademux queue h264parse ! omxh264dec ! autovideoconvert ! xvimagesink+ 
 +# width=640,height=480,framerate=100/
 +# width=1280,height=960,framerate=30/
 </code> </code>
  
-hardware encode+save to file with h264 encode
 <code> <code>
-...  ! videoconvert ! omxh264enc ! matroskamux ! filesink location=test.mkv+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.1563021667.txt.gz
  • Last modified: 2019/07/13 14:41
  • by scipio