Pixel and green screen when I encode with nvv4l2h264enc plugin

Please provide complete information as applicable to your setup.

• Hardware Platform (Jetson / GPU) : T1200
• DeepStream Version : 7.0
• NVIDIA GPU Driver Version (valid for GPU only) : 550
• Issue Type( questions, new requirements, bugs) : I can not reproduce i imagen that i encode in h264

Hi , I am using the deepstream samples docker to try execute this pipeline :
#!/bin/sh
gst-launch-1.0 v4l2src device=“/dev/video0”
! “image/jpeg, width=(int)1280, height=(int)720, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)30/1”
! nvjpegdec
! nvvideoconvert
! nvv4l2h264enc bitrate=50000 control-rate=1 preset-id=3 profile=0 tuning-info-id=1
! rtph264pay
! udpsink host=host.docker.internal port=8005

When i reproduce the image in the client pipeline, I see that the image is wrong.
I am not sure about what parameters i need touch to fix it .

The client pipeline is : gst-launch-1.0 udpsrc port=8005 caps = “application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264, payload=(int)96” ! queue max-size-bytes=2048 ! rtph264depay ! decodebin ! videoconvert ! autovideosink

I think that the problem is in sender part, but i am not sure if the problem is in the encoder or in the videoconvert.

Thank you very much for you clues and advise to fix it.

Kind regards

Mikaut7

PD: I checked with videotestsrc instead the camera , and the pipeline work … so i dont know if i need something to install in the docker or another things

Hi, it seems like there might be an issue due to your bitrate being too small or your iframe interval being too big. You can try using these parameters instead, which use the default bitrate:

nvv4l2h264enc bitrate=4000000 insert-sps-pps=true  iframeinterval=5 control-rate=1 maxperf-enable=true

please refer to this faq for How to connect a USB camera in DeepStream

Good evening,

Thank you very much for your answer , i check it but the problem continue, moreover the plugin ```
nvv4l2h264enc the docker with deepstream7.0 doesn’t the attributes : insert-sps-pps and maxperf-enable.

I am not sure if this plugin have something similar with different name.

Thank you very much ,

I check the faqs and I continue with the problem.

  1. I can’t reproduce this mosaic issue. the only difference in commmand-line is using “udpsink host=224.224.255.255”.
  2. to narrow down this issue, please use the following cmd to check if the 264 file is played well.
    gst-launch-1.0 v4l2src device=“/dev/video0”
    ! “image/jpeg, width=(int)1280, height=(int)720, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)30/1”
    ! nvjpegdec
    ! nvvideoconvert
    ! nvv4l2h264enc bitrate=50000 control-rate=1 preset-id=3 profile=0 tuning-info-id=1 ! filesink location=test.264

Maybe, could be problem from the graphic card ?

I check with you command and yes, the video is bad - > https://we.tl/t-kEL8duILTr

  1. why do you need to use jpeg output format? why not use YUV format?
  2. please use the following cmd to check if jpeg decoding is fine.
gst-launch-1.0 v4l2src device="/dev/video0"   \
! "image/jpeg, width=(int)1280, height=(int)720, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)30/1"  \
! nvjpegdec  ! nveglglessink

Hi !

I need use jpeg because the cap of the camara is with this format :

Device found:

name  : Integrated_Webcam_HD: Integrate
class : Video/Source
caps  : video/x-raw, format=(string)YUY2, width=(int)1280, height=(int)720, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)10/1;
        video/x-raw, format=(string)YUY2, width=(int)640, height=(int)480, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)30/1;
        video/x-raw, format=(string)YUY2, width=(int)640, height=(int)360, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)30/1;
        video/x-raw, format=(string)YUY2, width=(int)424, height=(int)240, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)30/1;
        video/x-raw, format=(string)YUY2, width=(int)320, height=(int)240, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)30/1;
        video/x-raw, format=(string)YUY2, width=(int)320, height=(int)180, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)30/1;
        video/x-raw, format=(string)YUY2, width=(int)160, height=(int)120, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)30/1;
        image/jpeg, width=(int)1280, height=(int)720, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)30/1;
        image/jpeg, width=(int)960, height=(int)540, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)30/1;
        image/jpeg, width=(int)848, height=(int)480, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)30/1;
        image/jpeg, width=(int)640, height=(int)480, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)30/1;
        image/jpeg, width=(int)640, height=(int)360, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)30/1;

I want al least a video with 30 FPS and 1280x720.

About your second test , it works :

I was starting to think that maybe it was a camera problem.

I check the pipeline in another computer , and it works . So I imagine that is problem of my graphic card , maybe it is not compatible with H264 or is broken.

from the result, nvjpegdec 's output is played well by nveglglessink. To continue to narrow down this issue, please do some tests.

  1. could you share the results of following two cmd, wondering to know the discrepancies of negotiation.
gst-launch-1.0 v4l2src device="/dev/video0"   ! "image/jpeg, width=(int)1280, height=(int)720, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)30/1"  ! nvjpegdec  ! nveglglessink  >1.log  -v >1.log 2>1.log
gst-launch-1.0 v4l2src device="/dev/video0"   ! "image/jpeg, width=(int)1280, height=(int)720, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)30/1"  ! nvjpegdec  !  nvvideoconvert ! nvv4l2h264enc ! fakesink  -v  >2.log 2>2.log
  1. To check if this issue is related to nvvideoconvert, please use the following cmd to check if the output video is fine.
gst-launch-1.0 v4l2src device="/dev/video0"   ! "image/jpeg, width=(int)1280, height=(int)720, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)30/1"  ! nvjpegdec  !  nvvideoconvert ! 'video/x-raw(memory:NVMM),format=I420' ! nveglglessink

Hi ! ,

I attach the log in this post
2.log (4.3 KB)
1.log (2.3 KB)

About you second petition , the output is fine .

Thanks for the sharing! from the test results above, the data before nvv4l2h264enc is fine. we should check if the issue is related to nvv4l2h264enc.

  1. from the test, the issue is not related to the source. please use the following the cmd to check if the output video is fine.
gst-launch-1.0  filesrc location=/opt/nvidia/deepstream/deepstream/samples/streams/sample_720p.mp4 ! qtdemux ! h264parse ! nvv4l2decoder  ! nvvideoconvert ! 'video/x-raw(memory:NVMM),format=I420' ! nvv4l2h264enc bitrate=1000000 ! filesink location=test.264
  1. if the output video in the step 1 is fine, the issue should be related to nvv4l2h264enc 's parameters. please use the following the cmd to check if the output video is fine.
gst-launch-1.0  filesrc location=/opt/nvidia/deepstream/deepstream/samples/streams/sample_720p.mp4 ! qtdemux ! h264parse ! nvv4l2decoder  ! nvvideoconvert ! 'video/x-raw(memory:NVMM),format=I420' ! nvv4l2h264enc bitrate=50000 control-rate=1 preset-id=3 profile=0 tuning-info-id=1 ! filesink location=test1.264

There is no update from you for a period, assuming this is not an issue anymore. Hence we are closing this topic. If need further support, please open a new one. Thanks

Hi Fanzh ,

Thank you very much for you help.

Finally my computer died , so I am sure that the problem was my graphic card.

Thank you very much for you advise and your time !

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.