Hi,
I run the command in a subprocess python. It works great !
command_gstreamer="gst-launch-1.0 nvcompositor -e background-w=2560 background-h=1440 name=mix \
"+camera["18"]+" "+camera["19"]+" "+camera["20"]+" "+camera["21"]+" \
! 'video/x-raw(memory:NVMM),format=RGBA,width="+resolution_w_double+",height="+resolution_h_double+"' ! nvvidconv ! 'video/x-raw(memory:NVMM),format=NV12' ! nvv4l2h264enc insert-vui=1 profile=2 \
! h264parse ! video/x-h264,width="+resolution_w_double+",height="+resolution_h_double+",framerate="+fps+"/1 ! matroskamux ! filesink location="+folder_to_save+date+".mp4 sync=false \
"+camera["18_bis"]+" "+camera["19_bis"]+" "+camera["20_bis"]+" "+camera["21_bis"]+" \
& PID=$! ; sleep "+time+" ; kill -INT $PID"
process = subprocess.call(command_gstreamer, shell=True)