Choppy Gstreamer JPEG Stream

Hi,

I’m trying to take a 1080p60 source (usb v4l2), do some manipulation and then stream it out as 720p JPEG video. It seems to be very close to working, but I’m getting slightly choppy video…it’s slight, but you can definitely tell the motion is not smooth. The following are the pipelines:

-jetson tk1
gst-launch-1.0 v4l2src device=/dev/video1 ! video/x-raw,width=1920,height=1080,framerate=60/1 ! videocrop top=360 left=640 right=0 bottom=0 ! videoscale ! video/x-raw,width=1280,height=720 ! nvjpegenc quality=100 idct-method=1 ! rtpjpegpay ! multiudpsink clients=“192.168.2.76:1234,192.168.2.100:1234”

-computer
gst-launch-1.0 udpsrc port=1234 ! application/x-rtp, encoding-name=JPEG,payload=26 ! rtpjpegdepay ! jpegdec ! autovideosink sync=false

Any pointers would be greatly appreciated.

Thanks,
Kevin

  1. Try http://elinux.org/Jetson/Performance
  2. Try replace videoscale ! video/x-raw,width=1280,height=720 to
    “video/x-raw,width=860,height=1140,format=(string)UYVY” ! nvvidconv ! “video/x-raw(memory:NVMM),width=1280,height=720”
    (full:
    gst-launch-1.0 videotestsrc ! “video/x-raw, width=1500, height=1500, framerate=(fraction)1/30” ! videocrop top=360 left=640 right=0 bottom=0 ! “video/x-raw,width=860,height=1140,format=(string)UYVY” ! nvvidconv ! “video/x-raw(memory:NVMM),width=1280,height=720” ! nvjpegenc quality=100 idct-method=1 ! rtpjpegpay ! udpsink host=192.168.0.56 sync=false
  3. Try insert “queue” between two components, for example:
    gst-launch-1.0 videotestsrc ! “video/x-raw, width=1500, height=1500, framerate=(fraction)1/30” ! videocrop top=360 left=640 right=0 bottom=0 ! “video/x-raw,width=860,height=1140,format=(string)UYVY” ! nvvidconv ! “video/x-raw(memory:NVMM),width=1280,height=720” ! queue ! nvjpegenc quality=100 idct-method=1 ! rtpjpegpay ! udpsink host=192.168.0.56 sync=false

Hi,

Thanks for you suggestions.

  1. I have played with the performance settings a bit, but the link you gave was helpful…I am currently running with the CPU/GPU maxed out.

  2. I took the video scale out completely (I don’t think it was really neccessary). However, I don’t see any improvement. Also, you’re using videotestsrc, which I think works fine, but when I use a real video source I start having issues. The following pipeline works pretty good…not perfect, but I would say it’s usable:

gst-launch-1.0 -vv v4l2src device=/dev/video0 ! "video/x-raw, width=1280, height=720, framerate=60/1" ! videocrop top=360 left=640 right=0 bottom=0 !  nvjpegenc quality=100 idct-method=1 ! rtpjpegpay ! udpsink host=192.168.2.100 port=1234 sync=false

The problem is when I switch to 1080 things get pretty choppy.

gst-launch-1.0 -vv v4l2src device=/dev/video0 ! "video/x-raw, width=1920, height=1080, framerate=60/1" ! videocrop top=360 left=640 right=0 bottom=0 !  nvjpegenc quality=100 idct-method=1 ! rtpjpegpay ! udpsink host=192.168.2.100 port=1234 sync=false
  1. Queues also don’t seem to have any real effect.

It seems like it’s the capture and not so much the pipeline. The device I’m using (http://www.magewell.com/usb-capture-hdmi/tech-specs) captures at 1080p60 but it seems like the TK1 can’t handle it…though CPU is only about 25% right now.

Thanks,
Kevin

Hi kgmoney,

Could you try to save video to local, and check if it’s laggy?

Besides, you may try to using NvMM memory: ‘video/x-raw(memory:NVMM)’ to see if get improvement.

Thanks