Multiple camera encode on jetson nano

hi guys,

i’m struggling with the encoder :

i try to encode multiple camera at the same time, but it does not seems to work well…

as far as i can see, it seems in the Example 15_multivideo_encode that you managed to encode multiple files by creating threads on the entire code to run the encoder. so i’ve got 2 questions for you :

1 - is that possible to encode 3 camera at the same time on the nano ?
2 - is “threading the overall” the only solution ?

tks

i’ve made a class for the encoder. it works fine with v4l2 and i’m not intended to switch to gstreamer.

Hi,
It depends on resolution and frame rate. For 3 1080p30 sources, it should achieve the performance in hardware encoding. You have developed an application in
Encode frames using Nvenc v4l2 - #17 by bob7421

For a quick check you can run multiple processes such as

$ _your_application_ -d /dev/video0 & _your_application_ -d /dev/video1 & _your_application_ -d /dev/video2 &

And check if it achieves target performance.

Hi DaneLLL,

ok,

i made a mistake in my post : i try to encode 3 flux from 1 camera.

if you have read the post ( https://forums.developer.nvidia.com/t/encode-frames-using-nvenc-v4l2/183424/17 ) , you know that the 3 flux came from 3 VIC instances. actually i can encode 1 flux.

i might not expect i’m out of the capacity but this is the camera’s resolutions :

  • 720p @ 120FPS
  • 1080p @ 62FPS ( 65 FPS )
  • 1920x1200 @60FPS

*the three resolutions works : the capture, color conversion and encoding is working well *

and this is the 3 flux resolution i want to encode :

  • original ( one of the 3 above)
  • 720p
  • 480p

the encoder should encode at 30-60 FPS as it is set in the params

i read the sample 15 on Jetson Linux API. it seems that you thread the entire system including resolutions and the create encoder function. i was expecting to open one time the encoder and create threads only when its really needed : when buffer is declared.

did i missed something ?

Hi,
Each resolution has to create one NvVideoEncoder. Looks like you want to encode one 170p120, one 1080p62, one 1920x1200p60, one 720p, one 480p, so you need to create 5 NvVideoEncoder classes.

This use-case is not verified on Jetson Nano and may not achieve target performance for all 5 encoding threads. Would need to give it a try.

hi, thanks,

i will try.

but for your reference : i try to encode one resolution among 720p @ 120FPS , 1080p @ 62FPS, or 1920x1200 @60FPS and want 3 output from the encoder : (the original selected before encoding ( so the native from camera ) and 720p and 480p

hi again,

after many attempt here is the situation :

when i try to create an object “videoencoder” with different name ( of the object but also of the encoder) it always say (from the second one ) that the encoder is busy. this seems to happen when the Queuing is called…

so, for reference i created 2 objects from my encoder class. they both use 2 different resolutions. and they came from one camera.

in fact, its near the same than the frontend example except that their is one camera, ( so one input ), and 3 output from the VIC so 3 diferents data to encode.

i’ve also tested this and it works, but its on two differents camera and two context …

if i try to load the two cameras in the same program to encode one flux each, it goes wrong…

Hi,
It is single v4l2 capture thread in 12_camera_v4l2_cuda. You would need to refer to it and develop multiple v4l2 capture threads for your use-case.

And for multiple encoding threads, would need to refer to 15_multivideo_encode.

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