Please provide complete information as applicable to your setup.
• Hardware Platform (Jetson / GPU)
I’m testing this on a Jetson TX2 w/ Jetpack 4.6.2 but I think this is a basic Deepstream nvvideoconvert question. No errors - I just can’t figure out the correct configuration.
• DeepStream Version Jetpack 4.6.2
• JetPack Version (valid for Jetson only)
• TensorRT Version
• NVIDIA GPU Driver Version (valid for GPU only)
• Issue Type( questions, new requirements, bugs)
• How to reproduce the issue ? (This is for bugs. Including which sample app is using, the configuration files content, the command line used and other details for reproducing)
• Requirement details( This is for new requirement. Including the module name-for which plugin or for which sample application, the function description)
I’m working on a TX2 Jetpack 4.6.2 (fresh flash) but I think this is just a nvvideoconvert src-crop and dest-crop question
I am trying to preprocess my 1920x1080 video stream for a Detectnet model with input of 1248x384 (with no distortion). I want the maximum image from my video feed.
To get the maximum view from my camera, I want a 1920x591 (3.25 aspect ratio) crop and let’s assume I want the middle, so crop 244 off the top, 245 off the bottom and take the full width. But I need to get the 1920x591 (correct aspect ratio, wrong size) down to the right size, 1248x384.
nvvideoconvert appears to do what I want but it’s puzzling me. Here is a test source stream similar to my v4l2 image/jpeg stream
Here are some test streams but I can’t figure out the pattern:
No crops - full 1920x1080
gst-launch-1.0 -v videotestsrc pattern=21 ! video/x-raw,width=1920, height=1080, framerate=30/1 ! nvvideoconvert ! nvegltransform ! “video/x-raw(memory:EGLImage),format=RGBA” ! nveglglessink sync=false
src-crop
gst-launch-1.0 -v videotestsrc pattern=21 ! video/x-raw,width=1920, height=1080, framerate=30/1 ! nvvideoconvert src-crop=0:244:1920:591 ! “video/x-raw(memory:NVMM),format=I420” ! nvegltransform ! “video/x-raw(memory:EGLImage),format=RGBA” ! nveglglessink sync=false
results:
- output size = 1920x1080
- correct content but distorted to fit aspect ratio: 1.778
src-crop & an output size caps filter
gst-launch-1.0 -v videotestsrc pattern=21 ! video/x-raw,width=1920, height=1080, framerate=30/1 ! nvvideoconvert src-crop=0:244:1920:591 ! “video/x-raw(memory:NVMM),width=1248,height=384,format=I420” ! nvegltransform ! “video/x-raw(memory:EGLImage),format=RGBA” ! nveglglessink sync=false
results:
- output size is correct
- correct content - but it is squished towards center
src-crop & dest-crop - no output size caps filter
gst-launch-1.0 -v videotestsrc pattern=21 ! video/x-raw,width=1920, height=1080, framerate=30/1 ! nvvideoconvert src-crop=0:244:1920:591 dest-crop=0:0:1248:384 ! “video/x-raw(memory:NVMM),format=I420” ! nvegltransform ! “video/x-raw(memory:EGLImage),format=RGBA” ! nveglglessink sync=false
results:
- output size 1920x1080
- correct contents & correct aspect ratio
src-crop & dest-crop + output size caps filter
gst-launch-1.0 -v videotestsrc pattern=21 ! video/x-raw,width=1920, height=1080, framerate=30/1 ! nvvideoconvert src-crop=0:244:1920:591 dest-crop=0:0:1248:384 ! “video/x-raw(memory:NVMM),width=1248,height=384,format=I420” ! nvegltransform ! “video/x-raw(memory:EGLImage),format=RGBA” ! nveglglessink sync=false
results:
- output size correct = 1248x384
- content correct but distorted (squished - looks like 1.778 aspect ratio)
It’s obvious at this point I’m just guessing. I don’t understand src-crop and dest-crop