GstCUDA - Example: cudamux: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 35: Line 35:


<syntaxhighlight lang=bash>
<syntaxhighlight lang=bash>
gst-launch-1.0 cudamux name=cuda location=./mixer.so videotestsrc pattern=ball \
gst-launch-1.0 cudamux name=cuda location=./mixer.so videotestsrc pattern=ball is-live=true ! "video/x-raw,width=1280,height=720,format=I420,framerate=30/1" !  
is-live=true ! "video/x-raw,width=1280,height=720,format=I420,framerate=30/1" ! \
nvvidconv ! "video/x-raw(memory:NVMM),width=1280,height=720,format=I420,framerate=30/1" ! queue ! cuda.sink_0 videotestsrc is-live=true ! "video/x-raw,width=1280,height=720,format=I420,framerate=30/1" ! nvvidconv ! "video/x-raw(memory:NVMM),width=1280,height=720,format=I420,framerate=30/1" ! queue ! cuda.sink_1 cuda. ! nvvidconv ! perf print-arm-load=true ! nvoverlaysink --gst-debug=0
nvvidconv ! "video/x-raw(memory:NVMM),width=1280,height=720,format=I420,framerate=30/1" ! \
queue ! cuda.sink_0 videotestsrc is-live=true ! "video/x-raw,width=1280,height=720,\
format=I420,framerate=30/1" ! nvvidconv ! "video/x-raw(memory:NVMM),width=1280,height=720,\
format=I420,framerate=30/1" ! queue ! cuda.sink_1 cuda. ! nvvidconv ! perf print-arm-load=true ! \
nvoverlaysink --gst-debug=0
</syntaxhighlight>
</syntaxhighlight>


Line 47: Line 42:


<syntaxhighlight lang=bash>
<syntaxhighlight lang=bash>
GST-PERF INFO -->  Timestamp: 0:02:13.615967657; Bps: 776; fps: 60.0; CPU: 8;   
GST-PERF INFO -->  Timestamp: 21:48:33.279751940; Bps: 763; fps: 32.48; CPU: 25;   
GST-PERF INFO -->  Timestamp: 0:02:14.632537582; Bps: 763; fps: 60.3; CPU: 8;   
GST-PERF INFO -->  Timestamp: 21:48:34.279839845; Bps: 776; fps: 30.0; CPU: 25;   
GST-PERF INFO -->  Timestamp: 0:02:15.632844549; Bps: 776; fps: 60.0; CPU: 8;   
GST-PERF INFO -->  Timestamp: 21:48:35.311903301; Bps: 751; fps: 30.3; CPU: 25;   
GST-PERF INFO -->  Timestamp: 0:02:16.649615644; Bps: 763; fps: 60.3; CPU: 9;   
GST-PERF INFO -->  Timestamp: 21:48:36.312767089; Bps: 776; fps: 30.0; CPU: 25;   
GST-PERF INFO -->  Timestamp: 0:02:17.666065311; Bps: 763; fps: 60.3; CPU: 12;   
GST-PERF INFO -->  Timestamp: 21:48:37.344449777; Bps: 752; fps: 30.6; CPU: 26;   
GST-PERF INFO -->  Timestamp: 0:02:18.682560220; Bps: 763; fps: 60.3; CPU: 12;   
GST-PERF INFO -->  Timestamp: 21:48:38.344565041; Bps: 776; fps: 30.0; CPU: 25;   
GST-PERF INFO -->  Timestamp: 0:02:19.699122957; Bps: 763; fps: 60.3; CPU: 11;   
GST-PERF INFO -->  Timestamp: 21:48:39.346374558; Bps: 775; fps: 29.97; CPU: 25;   
GST-PERF INFO -->  Timestamp: 0:02:20.699298792; Bps: 776; fps: 60.0; CPU: 11;   
GST-PERF INFO -->  Timestamp: 21:48:40.378383451; Bps: 751; fps: 30.3; CPU: 25;   
GST-PERF INFO -->  Timestamp: 0:02:21.715510459; Bps: 763; fps: 60.3; CPU: 11;   
GST-PERF INFO -->  Timestamp: 21:48:41.411104423; Bps: 751; fps: 30.3; CPU: 25;   
GST-PERF INFO -->  Timestamp: 0:02:22.715910009; Bps: 776; fps: 60.0; CPU: 11;  
GST-PERF INFO -->  Timestamp: 21:48:42.411187827; Bps: 776; fps: 30.0; CPU: 24;  
</syntaxhighlight>
</syntaxhighlight>




===4K 60fps capture to display (in-place=true)===
===1080p 60fps camera stream + 1080p 60fps videotestsrc sources mixed to display (in-place=false)===


====Example pipeline====
====Example pipeline====


<syntaxhighlight lang=bash>
<syntaxhighlight lang=bash>
gst-launch-1.0 nvcamerasrc queue-size=10 sensor-id=0 fpsRange='60 60' ! "video/x-raw(memory:NVMM),width=3840,height=2160,format=I420,framerate=60/1" ! nvvidconv ! "video/x-raw(memory:NVMM),width=3840,height=2160,format=I420,framerate=60/1" ! cudafilter in-place=true location=./gray-scale-filter.so ! perf print-arm-load=true ! nvoverlaysink --gst-debug=0
gst-launch-1.0 cudamux name=cuda location=./mixer.so videotestsrc pattern=ball is-live=true ! "video/x-raw,width=640,height=480,format=I420,framerate=60/1" ! nvvidconv ! "video/x-raw(memory:NVMM),width=1920,height=1080,format=I420,framerate=60/1" ! queue !  cuda.sink_0 nvcamerasrc queue-size=10 sensor-id=0 fpsRange='60 60' ! "video/x-raw(memory:NVMM),width=1920,height=1080,format=I420,framerate=60/1" ! nvvidconv ! "video/x-raw(memory:NVMM),width=1920,height=1080,format=I420,framerate=60/1" ! queue ! cuda.sink_1 cuda. ! nvvidconv ! perf print-arm-load=true ! nvoverlaysink --gst-debug=0
</syntaxhighlight>
</syntaxhighlight>


Line 71: Line 66:


<syntaxhighlight lang=bash>
<syntaxhighlight lang=bash>
GST-PERF INFO -->  Timestamp: 0:03:56.819087040; Bps: 776; fps: 60.0; CPU: 16;   
GST-PERF INFO -->  Timestamp: 22:04:56.593436486; Bps: 763; fps: 60.3; CPU: 33;   
GST-PERF INFO -->  Timestamp: 0:03:57.825121037; Bps: 771; fps: 59.64; CPU: 13;   
GST-PERF INFO -->  Timestamp: 22:04:57.593838787; Bps: 776; fps: 60.0; CPU: 33;   
GST-PERF INFO -->  Timestamp: 0:03:58.837141233; Bps: 766; fps: 59.28; CPU: 14;   
GST-PERF INFO -->  Timestamp: 22:04:58.609787695; Bps: 764; fps: 60.9; CPU: 32;   
GST-PERF INFO -->  Timestamp: 0:03:59.849401695; Bps: 766; fps: 59.28; CPU: 14;   
GST-PERF INFO -->  Timestamp: 22:04:59.609907812; Bps: 776; fps: 60.0; CPU: 34;   
GST-PERF INFO -->  Timestamp: 0:04:00.859525079; Bps: 768; fps: 59.40; CPU: 13;   
GST-PERF INFO -->  Timestamp: 22:05:00.609942878; Bps: 776; fps: 60.0; CPU: 32;   
GST-PERF INFO -->  Timestamp: 0:04:01.871618207; Bps: 766; fps: 59.28; CPU: 15;   
GST-PERF INFO -->  Timestamp: 22:05:01.626993130; Bps: 763; fps: 59.98; CPU: 33;   
GST-PERF INFO -->  Timestamp: 0:04:02.883459413; Bps: 767; fps: 59.34; CPU: 15;   
GST-PERF INFO -->  Timestamp: 22:05:02.627490381; Bps: 776; fps: 60.0; CPU: 35;   
GST-PERF INFO -->  Timestamp: 0:04:03.894646509; Bps: 767; fps: 59.34; CPU: 14;   
GST-PERF INFO -->  Timestamp: 22:05:03.643151065; Bps: 764; fps: 60.9; CPU: 35;   
GST-PERF INFO -->  Timestamp: 0:04:04.906216370; Bps: 767; fps: 59.34; CPU: 14;   
GST-PERF INFO -->  Timestamp: 22:05:04.659751376; Bps: 763; fps: 60.3; CPU: 36;   
GST-PERF INFO -->  Timestamp: 0:04:05.917121183; Bps: 768; fps: 59.40; CPU: 14;  
GST-PERF INFO -->  Timestamp: 22:05:05.660301596; Bps: 776; fps: 60.0; CPU: 36;
</syntaxhighlight>
</syntaxhighlight>




=== 720p 60fps videotestsrc to display (in-place=true) ===
=== 2x 1080p 60fps camera streams mixed to display (in-place=false) ===
'''Note:''' We only use one camera source that is splitted in two sources by a tee element. One of the video source input branches is flipped by 180 degrees, so the resultant image is a combination of the input image with the same image rotated.


====Example pipeline====
====Example pipeline====


<syntaxhighlight lang=bash>
<syntaxhighlight lang=bash>
gst-launch-1.0 videotestsrc is-live=true ! "video/x-raw,width=1280,height=720,format=I420,framerate=60/1" ! nvvidconv ! "video/x-raw(memory:NVMM),width=1280,height=720,format=I420,framerate=60/1" ! cudafilter in-place=true location=./gray-scale-filter.so ! perf print-arm-load=true ! nvoverlaysink --gst-debug=0
gst-launch-1.0 cudamux name=cuda location=./mixer.so nvcamerasrc queue-size=10 sensor-id=0 fpsRange='60 60' ! "video/x-raw(memory:NVMM),width=1920,height=1080,format=I420,framerate=60/1" ! tee name=t t.src_0 ! nvvidconv ! "video/x-raw(memory:NVMM),width=1920,height=1080,format=I420,framerate=60/1" ! queue ! cuda.sink_0 t.src_1 ! nvvidconv flip-method=2 ! "video/x-raw(memory:NVMM),width=1920,height=1080,format=I420,framerate=60/1" ! queue ! cuda.sink_1 cuda. ! nvvidconv ! perf print-arm-load=true ! nvoverlaysink --gst-debug=0
</syntaxhighlight>
</syntaxhighlight>


Line 95: Line 91:


<syntaxhighlight lang=bash>
<syntaxhighlight lang=bash>
GST-PERF INFO -->  Timestamp: 0:12:29.994184572; Bps: 776; fps: 60.0; CPU: 18;   
GST-PERF INFO -->  Timestamp: 22:29:36.540394267; Bps: 776; fps: 60.0; CPU: 26;   
GST-PERF INFO -->  Timestamp: 0:12:31.010495933; Bps: 763; fps: 60.3; CPU: 18;   
GST-PERF INFO -->  Timestamp: 22:29:37.557019712; Bps: 763; fps: 60.3; CPU: 27;   
GST-PERF INFO -->  Timestamp: 0:12:32.010535558; Bps: 776; fps: 60.0; CPU: 18;   
GST-PERF INFO -->  Timestamp: 22:29:38.573266100; Bps: 763; fps: 60.3; CPU: 27;   
GST-PERF INFO -->  Timestamp: 0:12:33.027377442; Bps: 763; fps: 60.3; CPU: 18;   
GST-PERF INFO -->  Timestamp: 22:29:39.589838109; Bps: 763; fps: 60.3; CPU: 26;   
GST-PERF INFO -->  Timestamp: 0:12:34.044071960; Bps: 763; fps: 60.3; CPU: 18;   
GST-PERF INFO -->  Timestamp: 22:29:40.589912895; Bps: 776; fps: 60.0; CPU: 25;   
GST-PERF INFO -->  Timestamp: 0:12:35.044204013; Bps: 776; fps: 60.0; CPU: 19;   
GST-PERF INFO -->  Timestamp: 22:29:41.590099450; Bps: 776; fps: 60.0; CPU: 26;   
GST-PERF INFO -->  Timestamp: 0:12:36.044224584; Bps: 776; fps: 60.0; CPU: 19;   
GST-PERF INFO -->  Timestamp: 22:29:42.590126059; Bps: 776; fps: 60.0; CPU: 26;   
GST-PERF INFO -->  Timestamp: 0:12:37.060451742; Bps: 763; fps: 60.3; CPU: 19;   
GST-PERF INFO -->  Timestamp: 22:29:43.590282250; Bps: 776; fps: 60.0; CPU: 26;   
GST-PERF INFO -->  Timestamp: 0:12:38.060585805; Bps: 776; fps: 60.0; CPU: 19;   
GST-PERF INFO -->  Timestamp: 22:29:44.606635721; Bps: 763; fps: 60.3; CPU: 26;   
GST-PERF INFO -->  Timestamp: 0:12:39.060628072; Bps: 776; fps: 60.0; CPU: 18;
GST-PERF INFO -->  Timestamp: 22:29:45.606758423; Bps: 776; fps: 60.0; CPU: 25;
</syntaxhighlight>
</syntaxhighlight>




===1080p 60fps capture to display (in-place=false)===
===2x 4K 60fps camera streams mixed to fakesink (in-place=false)===
'''Note:''' Due to limitations of the nvoverlaysink element, we use a fakesink instead to demonstrate that cudamux is capable to handle up to 2x4K@60fps streams.


====Example pipeline====
====Example pipeline====


<syntaxhighlight lang=bash>
<syntaxhighlight lang=bash>
gst-launch-1.0 nvcamerasrc queue-size=10 sensor-id=0 fpsRange='60 60' ! "video/x-raw(memory:NVMM),width=1920,height=1080,format=I420,framerate=60/1" ! nvvidconv ! "video/x-raw(memory:NVMM),width=1920,height=1080,format=I420,framerate=60/1" ! cudafilter in-place=false location=./gray-scale-filter.so ! nvvidconv ! perf print-arm-load=true ! nvoverlaysink --gst-debug=0
gst-launch-1.0 cudamux name=cuda location=./mixer.so nvcamerasrc queue-size=10 sensor-id=0 fpsRange='60 60' ! "video/x-raw(memory:NVMM),width=3840,height=2160,format=I420,framerate=60/1" ! tee name=t t.src_0 ! nvvidconv ! "video/x-raw(memory:NVMM),width=3840,height=2160,format=I420,framerate=60/1" ! queue ! cuda.sink_0 t.src_1 ! nvvidconv flip-method=2 ! "video/x-raw(memory:NVMM),width=3840,height=2160,format=I420,framerate=60/1" ! queue ! cuda.sink_1 cuda. ! perf print-arm-load=true ! fakesink --gst-debug=0
</syntaxhighlight>
</syntaxhighlight>


Line 119: Line 116:


<syntaxhighlight lang=bash>
<syntaxhighlight lang=bash>
GST-PERF INFO -->  Timestamp: 0:05:46.167015649; Bps: 776; fps: 60.0; CPU: 20; 
GST-PERF INFO -->  Timestamp: 22:36:03.257382576; Bps: 12318415; fps: 59.40; CPU: 28;   
GST-PERF INFO -->  Timestamp: 0:05:47.167023874; Bps: 776; fps: 60.0; CPU: 18; 
GST-PERF INFO -->  Timestamp: 22:36:04.269501023; Bps: 12294071; fps: 59.28; CPU: 28;   
GST-PERF INFO -->  Timestamp: 0:05:48.183394748; Bps: 763; fps: 60.3; CPU: 19; 
GST-PERF INFO -->  Timestamp: 22:36:05.280928748; Bps: 12306231; fps: 59.34; CPU: 29;   
GST-PERF INFO -->  Timestamp: 0:05:49.183590994; Bps: 776; fps: 60.0; CPU: 23; 
GST-PERF INFO -->  Timestamp: 22:36:06.292548867; Bps: 12306231; fps: 59.34; CPU: 30;   
GST-PERF INFO -->  Timestamp: 0:05:50.183618490; Bps: 776; fps: 60.0; CPU: 27;   
GST-PERF INFO -->  Timestamp: 22:36:07.304494555; Bps: 12306231; fps: 59.34; CPU: 33;   
GST-PERF INFO -->  Timestamp: 0:05:51.184194423; Bps: 776; fps: 60.0; CPU: 45; 
GST-PERF INFO -->  Timestamp: 22:36:08.314887239; Bps: 12318415; fps: 59.40; CPU: 32;   
GST-PERF INFO -->  Timestamp: 0:05:52.200942016; Bps: 763; fps: 60.3; CPU: 46; 
GST-PERF INFO -->  Timestamp: 22:36:09.327312506; Bps: 12294071; fps: 59.28; CPU: 31;   
GST-PERF INFO -->  Timestamp: 0:05:53.216856380; Bps: 764; fps: 60.9; CPU: 45; 
GST-PERF INFO -->  Timestamp: 22:36:10.340253028; Bps: 12294071; fps: 59.28; CPU: 30;   
GST-PERF INFO -->  Timestamp: 0:05:54.217181741; Bps: 776; fps: 60.0; CPU: 46; 
GST-PERF INFO -->  Timestamp: 22:36:11.351945386; Bps: 12306231; fps: 59.34; CPU: 33;   
GST-PERF INFO -->  Timestamp: 0:05:55.217598561; Bps: 776; fps: 60.0; CPU: 46; 
GST-PERF INFO -->  Timestamp: 22:36:12.361623391; Bps: 12330624; fps: 59.46; CPU: 31;  
</syntaxhighlight>
 
 
===4K 60fps capture to fakesink (in-place=false)===
 
====Example pipeline====
 
<syntaxhighlight lang=bash>
gst-launch-1.0 nvcamerasrc queue-size=10 sensor-id=0 fpsRange='60 60' ! "video/x-raw(memory:NVMM),width=3840,height=2160,format=I420,framerate=60/1" ! nvvidconv ! "video/x-raw(memory:NVMM),width=3840,height=2160,format=I420,framerate=60/1" ! cudafilter in-place=false location=./gray-scale-filter.so ! perf print-arm-load=true ! fakesink --gst-debug=0
</syntaxhighlight>
 
====Performance stats====
 
<syntaxhighlight lang=bash>
GST-PERF INFO -->  Timestamp: 0:08:40.062814951; Bps: 12330624; fps: 59.46; CPU: 22
GST-PERF INFO -->  Timestamp: 0:08:41.074953852; Bps: 12294071; fps: 59.28; CPU: 23;   
GST-PERF INFO -->  Timestamp: 0:08:42.087998326; Bps: 12281934; fps: 59.23; CPU: 22;   
GST-PERF INFO -->  Timestamp: 0:08:43.097597957; Bps: 12330624; fps: 59.46; CPU: 22;   
GST-PERF INFO -->  Timestamp: 0:08:44.109302715; Bps: 12306231; fps: 59.34; CPU: 25;   
GST-PERF INFO -->  Timestamp: 0:08:45.120250840; Bps: 12318415; fps: 59.40; CPU: 22;   
GST-PERF INFO -->  Timestamp: 0:08:46.132807638; Bps: 12294071; fps: 59.28; CPU: 23;   
GST-PERF INFO -->  Timestamp: 0:08:47.144759986; Bps: 12306231; fps: 59.34; CPU: 21; 
GST-PERF INFO -->  Timestamp: 0:08:48.154396985; Bps: 12330624; fps: 59.46; CPU: 22
GST-PERF INFO -->  Timestamp: 0:08:49.167064442; Bps: 12294071; fps: 59.28; CPU: 23;   
GST-PERF INFO -->  Timestamp: 0:08:50.178082366; Bps: 12306231; fps: 59.34; CPU: 23;
</syntaxhighlight>
 
 
=== 720p 60fps videotestsrc to display (in-place=false) ===
 
====Example pipeline====
 
<syntaxhighlight lang=bash>
gst-launch-1.0 videotestsrc is-live=true ! "video/x-raw,width=1280,height=720,format=I420,framerate=60/1" ! nvvidconv ! "video/x-raw(memory:NVMM),width=1280,height=720,format=I420,framerate=60/1" ! cudafilter in-place=false location=./gray-scale-filter.so ! nvvidconv ! perf print-arm-load=true ! nvoverlaysink --gst-debug=0
</syntaxhighlight>
 
====Performance stats====
 
<syntaxhighlight lang=bash>
GST-PERF INFO -->  Timestamp: 0:16:38.724108163; Bps: 763; fps: 60.3; CPU: 12;   
GST-PERF INFO -->  Timestamp: 0:16:39.724682234; Bps: 776; fps: 60.0; CPU: 12
GST-PERF INFO -->  Timestamp: 0:16:40.740983855; Bps: 763; fps: 60.3; CPU: 12; 
GST-PERF INFO -->  Timestamp: 0:16:41.740991843; Bps: 776; fps: 60.0; CPU: 11; 
GST-PERF INFO -->  Timestamp: 0:16:42.757944147; Bps: 763; fps: 60.3; CPU: 12; 
GST-PERF INFO -->  Timestamp: 0:16:43.758090059; Bps: 776; fps: 60.0; CPU: 12; 
GST-PERF INFO -->  Timestamp: 0:16:44.774079094; Bps: 764; fps: 60.9; CPU: 12; 
GST-PERF INFO -->  Timestamp: 0:16:45.774631002; Bps: 776; fps: 60.0; CPU: 12; 
GST-PERF INFO -->  Timestamp: 0:16:46.774633540; Bps: 776; fps: 60.0; CPU: 13; 
GST-PERF INFO -->  Timestamp: 0:16:47.791021283; Bps: 763; fps: 60.3; CPU: 12;
</syntaxhighlight>
</syntaxhighlight>


}}
}}
1,433

edits