Display a CSI camera vertical video on a vertical screen

• Jeston Nano
• DeepStream 5.0.1
• JetPack Version 4.4
• TensorRT Version 7

• Issue Type: question

• To reproduce the issue :
Use a CSI camera (PiCameraV2.1), use it vertically.
Use a screen displayed vertically (Ubuntu settings \ Displays \ Rotation: Clockwise)
Using deepstream-app will acquire the video horizontally, so I modified it as specified here:

Then the video is handled with the right orientation by the GIE. However it is not correctly displayed. It seems that deepstream doesn’t take into account the “Ubuntu Display Orientation” parameter. It is displayed just as if the screen was horizontal.

Then I modified deepstream_sink_bin.c function: create_render_bin in the same way as deespstream_source_bin.cexplained in the link above. But it didn’t work, the video wasn’t flipped.

Then I modified deespstream_osd_bin.c in the same way as deespstream_source_bin.c. The video is now displayed with the right orientation. However the resolution of the video is very bad, It seems like 800x600 expanded on a wide screen.
Furthermore I would like to not use OSD, as I don’t want anything displayed on the screen except the video. I tricked it with border-width=0 and text-size=0, but i would appreciate a better solution.

• The question is:
How to display a vertical video from a CSI camera on a vertical screen without downgrading the displayed resolution?

I think the problem comes form the pipeline that is always in 1280x720. When first flipped form 90°, the video is still in a pipeline of 1280x720, but it should be a 720x1280 pipeline. I think the video is compressed to fit in 1280x720 pipeline. That is why the results looks like 800x600. I tried to configure this resolution problem through the config file without success.

Further information, here is an extract of the configuration file used:

[tiled-display]
enable=1
rows=1
columns=1
width=1280
height=720
nvbuf-memory-type=0
...
[source0]
enable=1
type=5
camera-width=1280
camera-height=720
camera-fps-n=30
camera-fps-d=1
num-sources=1
gpu-id=0
cudadec-memtype=0
...
[streammux]
gpu-id=0
live-source=0
batch-size=1
batched-push-timeout=40000
width=1280
height=720

Hi,
We don’t verify the case by default. Will check and see if we can support the case.

Hi,
Since your buffer is in 720x1080, please set

[tiled-display]
...
width=720
height=1280
...

And for disabling OSD, please set enable=0 in [OSD].

Changing tiled display doesnt solve the problem. Of course I tried it before posting my question here. As suggested the problem comes from the pipeline at the output of the camera.

If I let OSD enabled it is because it’s the only way I found to rotate de output video. I know that enable=0 will disable it… If I disable it I am not able to rotate the output video.

Hi,
You may check this possible solution:

We have discussion about this and think landscape mode is more general in running deep learning inference. For running in portrait mode, would need to check the default sample and make customization.