<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
I am trying to switch between a live source (udpsrc) and videotestsrc and stream the output to an rtspserver (udpsink).</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="color:rgb(51, 51, 51);font-family:DIN-Web-Pro, Helvetica, Arial, sans-serif;font-size:15px;letter-spacing:0.15px;background-color:rgb(255, 255, 255);display:inline !important">I’m running the input-selector-test.c code from<span> </span></span><a href="https://github.com/GStreamer/gst-plugins-base/blob/master/tests/icles/input-selector-test.c" rel="noopener nofollow ugc" style="background-color:rgb(255, 255, 255);color:rgb(118, 185, 0);cursor:pointer;overflow-wrap:break-word;font-family:DIN-Web-Pro, Helvetica, Arial, sans-serif;font-size:15px;letter-spacing:0.15px">github-gstreamer
 blob</a> and only changing the pipeline<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
I have a 3 sample pipelines that work as proof of concepts. </div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<p style="color:rgb(51, 51, 51);font-family:DIN-Web-Pro, Helvetica, Arial, sans-serif;font-size:15px;letter-spacing:0.15px;background-color:rgb(255, 255, 255)">
Pipeline<span> </span><span>#1</span><span> </span>demonstrates the switching between videotestsrc and udpsrc and outputting to a nveglglessink.</p>
<blockquote style="border-left:5px solid var(--primary-low);background-color:var(--blend-primary-secondary-5);clear:both;padding:12px;color:rgb(51, 51, 51);font-family:DIN-Web-Pro, Helvetica, Arial, sans-serif;font-size:15px;letter-spacing:0.15px">
<p style="margin-top:0px !important;margin-bottom:0px !important">pipeline = gst_parse_launch(“udpsrc port=5555 timeout=1000000020 ! application/x-rtp, media=video, clock-rate=90000, encoding-name=H265,playload=96 ! rtpjitterbuffer latency=5 do-lost=true !
 rtph265depay ! h265parse ! video/x-h265,alignment=au ! nvv4l2decoder disable-dpb=true enable-max-performance=1 ! queue max-size-bytes=0 ! identity name=elm_id ! queue ! vs.sink_0 videotestsrc pattern=black ! vs.sink_1 input-selector name=vs ! nvvidconv ! nveglglessink
 window-width=720 window-height=480 sync=false qos=false”, NULL);</p>
</blockquote>
<div style="margin-top: 0px; margin-bottom: 0px;">
<p style="color:rgb(51, 51, 51);font-family:DIN-Web-Pro, Helvetica, Arial, sans-serif;font-size:15px;letter-spacing:0.15px;background-color:rgb(255, 255, 255)">
Pipeline<span> </span><span>#2</span><span> </span>demonstrates the switching between two videotestsrc and outputting to a udpsink</p>
<blockquote style="border-left:5px solid var(--primary-low);background-color:var(--blend-primary-secondary-5);clear:both;padding:12px;color:rgb(51, 51, 51);font-family:DIN-Web-Pro, Helvetica, Arial, sans-serif;font-size:15px;letter-spacing:0.15px">
<p style="margin-top:0px !important;margin-bottom:0px !important">pipeline = gst_parse_launch(“videotestsrc pattern=0 ! vs.sink_0 videotestsrc pattern=1”<br>
" ! vs.sink_1 input-selector name=vs ! video/x-raw,width=640,height=480"<br>
" ! nvvidconv"<br>
" ! video/x-raw(memory:NVMM), format=I420,width=1920,height=1080, framerate=15/1"<br>
" ! nvv4l2h264enc insert-sps-pps=1 profile=4"<br>
" ! video/x-h264,stream-format=byte-stream"<br>
" ! rtph264pay pt=96 "<br>
“! udpsink host=127.0.0.1 port=11111 sync=false async=false”, NULL);</p>
</blockquote>
<p style="color:rgb(51, 51, 51);font-family:DIN-Web-Pro, Helvetica, Arial, sans-serif;font-size:15px;letter-spacing:0.15px;background-color:rgb(255, 255, 255)">
Pipeline#3 demonstrates the streaming of a udpsrc to a udpsink</p>
<blockquote style="border-left:5px solid var(--primary-low);background-color:var(--blend-primary-secondary-5);clear:both;padding:12px;color:rgb(51, 51, 51);font-family:DIN-Web-Pro, Helvetica, Arial, sans-serif;font-size:15px;letter-spacing:0.15px">
<p style="margin-top:0px !important;margin-bottom:0px !important">pipeline = gst_parse_launch(“udpsrc port=5555 timeout=1000000020 !”<br>
" application/x-rtp, media=video, clock-rate=90000, encoding-name=H265,playload=96 !"<br>
" rtpjitterbuffer latency=5 do-lost=true !"<br>
" rtph265depay !"<br>
" h265parse !"<br>
" video/x-h265,alignment=au !"<br>
" nvv4l2decoder disable-dpb=true enable-max-performance=1 !"<br>
" queue max-size-bytes=0 !"<br>
" identity name=elm_id !"<br>
" queue !"<br>
" nvvidconv !"<br>
" nvv4l2h264enc insert-sps-pps=1 profile=4 !"<br>
" video/x-h264,stream-format=byte-stream !"<br>
" rtph264pay pt=96 !"<br>
" udpsink host=127.0.0.1 port=11111 sync=false async=false", NULL);</p>
</blockquote>
<p style="color:rgb(51, 51, 51);font-family:DIN-Web-Pro, Helvetica, Arial, sans-serif;font-size:15px;letter-spacing:0.15px;background-color:rgb(255, 255, 255)">
Using the three pipelines above, I created this Pipeline<span> </span><span>#4</span><span> </span>to switch between udpsrc and videotestsrc and send it to a udpsink</p>
<blockquote style="border-left:5px solid var(--primary-low);background-color:var(--blend-primary-secondary-5);clear:both;padding:12px;color:rgb(51, 51, 51);font-family:DIN-Web-Pro, Helvetica, Arial, sans-serif;font-size:15px;letter-spacing:0.15px">
<p style="margin-top:0px !important;margin-bottom:0px !important">pipeline = gst_parse_launch(<br>
" udpsrc port=5555 timeout=3000000020 !"<br>
" application/x-rtp, media=video, clock-rate=90000, encoding-name=H265,playload=96 !"<br>
" rtpjitterbuffer latency=5 do-lost=true !"<br>
" rtph265depay !"<br>
" h265parse !"<br>
" video/x-h265,alignment=au !"<br>
" nvv4l2decoder disable-dpb=true enable-max-performance=1 !"<br>
" queue max-size-bytes=0 !"<br>
" identity name=elm_id !"<br>
" vs.sink_0 videotestsrc is-live=true pattern=0 !"<br>
" vs.sink_1 input-selector name=vs !"<br>
" nvvidconv !"<br>
" video/x-raw(memory:NVMM), format=I420,width=1920,height=1080 !"<br>
" nvv4l2h264enc insert-sps-pps=1 profile=4 !"<br>
" video/x-h264,stream-format=byte-stream !"<br>
" rtph264pay pt=96 !"<br>
" udpsink host=127.0.0.1 port=11111 sync=false async=false", NULL);</p>
</blockquote>
<p style="color:rgb(51, 51, 51);font-family:DIN-Web-Pro, Helvetica, Arial, sans-serif;font-size:15px;letter-spacing:0.15px;background-color:rgb(255, 255, 255)">
The above pipeline streams alright until I try to switch input-selector active pad. At that point it throws an error.</p>
<blockquote style="border-left:5px solid var(--primary-low);background-color:var(--blend-primary-secondary-5);clear:both;padding:12px;color:rgb(51, 51, 51);font-family:DIN-Web-Pro, Helvetica, Arial, sans-serif;font-size:15px;letter-spacing:0.15px">
<p style="margin-top:0px !important;margin-bottom:0px !important">0:00:01.568228480 18319 0x7f78003f20 WARN h265parse gsth265parse.c:1063:gst_h265_parse_handle_frame: broken/invalid nal Type: 38 FD, Size: 3 will be dropped<br>
NvMMLiteOpen : Block : BlockType = 279<br>
NVMEDIA: Reading vendor.tegra.display-size : status: 6<br>
NvMMLiteBlockCreate : Block : BlockType = 279<br>
0:00:01.750144288 18319 0x7f78003f20 WARN v4l2 gstv4l2object.c:4435:gst_v4l2_object_probe_caps:<a style="color:rgb(118, 185, 0);cursor:pointer;overflow-wrap:break-word">nvv4l2decoder0:src</a><span> </span>Failed to probe pixel aspect ratio with VIDIOC_CROPCAP:
 Unknown error -1<br>
0:00:01.750223552 18319 0x7f78003f20 WARN v4l2 gstv4l2object.c:2372:gst_v4l2_object_add_interlace_mode:0x556a7d7840 Failed to determine interlace mode<br>
NvMMLiteOpen : Block : BlockType = 4<br>
===== NVMEDIA: NVENC =====<br>
NvMMLiteBlockCreate : Block : BlockType = 4<br>
0:00:01.756999520 18319 0x556a7ed1e0 WARN v4l2bufferpool gstv4l2bufferpool.c:1057:gst_v4l2_buffer_pool_start:<a style="color:rgb(118, 185, 0);cursor:pointer;overflow-wrap:break-word">nvv4l2h264enc0:pool:src</a><span> </span>Uncertain or not enough buffers,
 enabling copy threshold<br>
0:00:01.758034272 18319 0x7f78003f20 WARN v4l2videodec gstv4l2videodec.c:1623:gst_v4l2_video_dec_decide_allocation: Duration invalid, not setting latency<br>
0:00:01.758496544 18319 0x7f78003f20 WARN v4l2bufferpool gstv4l2bufferpool.c:1057:gst_v4l2_buffer_pool_start:<a style="color:rgb(118, 185, 0);cursor:pointer;overflow-wrap:break-word">nvv4l2decoder0:pool:src</a><span> </span>Uncertain or not enough buffers,
 enabling copy threshold<br>
0:00:01.773898240 18319 0x556a7ed050 WARN v4l2bufferpool gstv4l2bufferpool.c:1503:gst_v4l2_buffer_pool_dqbuf:<a style="color:rgb(118, 185, 0);cursor:pointer;overflow-wrap:break-word">nvv4l2decoder0:pool:src</a><span> </span>Driver should never set v4l2_buffer.field
 to ANY<br>
H264: Profile = 100, Level = 0<br>
0:00:01.796312064 18319 0x7f7c0048a0 WARN v4l2bufferpool gstv4l2bufferpool.c:1503:gst_v4l2_buffer_pool_dqbuf:<a style="color:rgb(118, 185, 0);cursor:pointer;overflow-wrap:break-word">nvv4l2h264enc0:pool:src</a><span> </span>Driver should never set v4l2_buffer.field
 to ANY<br>
** Message: 12:44:28.736: switching<br>
** Message: 12:44:28.737: switching1<br>
** Message: 12:44:28.738: current number of sources : 2, active source sink_0<br>
0:00:50.168575040 18319 0x7f7c0048a0 WARN v4l2allocator gstv4l2allocator.c:1492:gst_v4l2_allocator_dqbuf:<a style="color:rgb(118, 185, 0);cursor:pointer;overflow-wrap:break-word">nvv4l2h264enc0:pool:src:allocator</a><span> </span>V4L2 provided buffer has bytesused
 0 which is too small to include data_offset 0<br>
0:00:50.168862400 18319 0x556a7ed2d0 WARN videoencoder<span> </span><strong style="font-weight:bolder">gstvideoencoder.c:678:gst_video_encoder_setcaps: rejected caps video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, framerate=(fraction)30/1, multiview-mode=(string)mono,
 pixel-aspect-ratio=(fraction)3/4, interlace-mode=(string)progressive, format=(string)I420</strong><br>
<strong style="font-weight:bolder">NvMMLiteOpen : Block : BlockType = 4</strong><br>
===== NVMEDIA: NVENC =====<br>
NvMMLiteBlockCreate : Block : BlockType = 4<br>
<strong style="font-weight:bolder">0:00:50.172948384 18319 0x556a7ed2d0 WARN v4l2bufferpool gstv4l2bufferpool.c:1057:gst_v4l2_buffer_pool_start:<a style="color:rgb(118, 185, 0);cursor:pointer;overflow-wrap:break-word">nvv4l2h264enc0:pool:src</a><span> </span>Uncertain
 or not enough buffers, enabling copy threshold</strong><br>
<strong style="font-weight:bolder">nvbuf_utils: nvbuffer Payload Type not supported</strong><br>
<strong style="font-weight:bolder">NvBufferGetParams failed for src_dmabuf_fd</strong><br>
<strong style="font-weight:bolder">nvbuffer_transform Failed</strong><br>
<strong style="font-weight:bolder">gst_nvvconv_transform: NvBufferTransform Failed</strong><br>
0:00:50.175376704 18319 0x556a7ed2d0 WARN basesrc gstbasesrc.c:3055:gst_base_src_loop: error: Internal data stream error.<br>
0:00:50.175401824 18319 0x556a7ed2d0 WARN basesrc gstbasesrc.c:3055:gst_base_src_loop: error: streaming stopped, reason error (-5)<br>
Error: Internal data stream error.</p>
</blockquote>
<p style="color:rgb(51, 51, 51);font-family:DIN-Web-Pro, Helvetica, Arial, sans-serif;font-size:15px;letter-spacing:0.15px;background-color:rgb(255, 255, 255)">
I’m not sure why the nvv4l2h264enc is rejecting the caps? It did not throw such an error in Pipeline<span> </span><span>#3</span>. I also don’t know what the is causing the NVBuf errors.</p>
<p style="color:rgb(51, 51, 51);font-family:DIN-Web-Pro, Helvetica, Arial, sans-serif;font-size:15px;letter-spacing:0.15px;background-color:rgb(255, 255, 255)">
<br>
</p>
<p style="color:rgb(51, 51, 51);font-family:DIN-Web-Pro, Helvetica, Arial, sans-serif;font-size:15px;letter-spacing:0.15px;background-color:rgb(255, 255, 255)">
Has anyone successfully used the input-selector for such a task before? I am using an NVIDIA board and am wondering if this is a hardware support package issue.</p>
<p style="color:rgb(51, 51, 51);font-family:DIN-Web-Pro, Helvetica, Arial, sans-serif;font-size:15px;letter-spacing:0.15px;background-color:rgb(255, 255, 255)">
<br>
</p>
<p style="color:rgb(51, 51, 51);font-family:DIN-Web-Pro, Helvetica, Arial, sans-serif;font-size:15px;letter-spacing:0.15px;background-color:rgb(255, 255, 255)">
Thanks for any input!</p>
<p style="color:rgb(51, 51, 51);font-family:DIN-Web-Pro, Helvetica, Arial, sans-serif;font-size:15px;letter-spacing:0.15px;background-color:rgb(255, 255, 255)">
Mercy</p>
<br>
</div>
</div>
</body>
</html>