How to encode dual screens simultaneously and separately with ximagesrc

Hi, all
How to encode dual screens simultaneously and separately with ximagesrc?

Hi,
We don’t have experience of running this use-case. Would need other users to share experience.

Not sure but setting xid may work. Please refer to ximagesrc

xrandr --output HDMI-0 --same-as DSI-0

xrandr --output DSI-0 --rotate inverted

my dsi screen and my hdmi screen display the exact same thing because of the first line, modify it to support two hdmi screens, and these commands run in my startup script after autologin.

Terry

1 Like

Hi,
I’m trying to use my Nano with a peculiar but Op related use-case: I want to capture my screen while playing a video and restream it to 2 destinations:

  1. A local multicast ip;
  2. a remote rtmp url.
    I created a basically working pipeline using ximagesrc but the quality is very poor above all relating to screen stuttering. Can anyone review my pipeline and tell me how (if) I can improve to obtain a better quality?
    This is the absolute forst time I use gstreamer so sorry if the pipeline is wrong.

Thanks.
Pino.
Testing my pipeline with this 720p@50fps yioutube video

https://www.youtube.com/watch?v=wZBVf_DiPlI

 GST_DEBUG=3 gst-launch-1.0 -v -e \
 ximagesrc use-damage=0 \
 ! video/x-raw \
 ! nvvidconv \
 ! 'video/x-raw(memory:NVMM),width=1280,height=720,format=NV12,framerate=(fraction)60/1' \
 ! nvv4l2h264enc maxperf-enable=1 insert-sps-pps=true bitrate=4000000 idrinterval=30 disable-cabac=true insert-aud=true poc-type=2 control-rate=1 vbv-size=750000 \
 ! queue2 \
 ! h264parse  \
 ! tee name=videoTee \
 pulsesrc device="alsa_output.platform-sound.analog-stereo.monitor" \
 ! queue \
 ! 'audio/x-raw, format=(string)S16LE, layout=(string)interleaved, rate=44100, channels=(int)2' \
 ! audioconvert \
 ! voaacenc ! aacparse \
 ! tee name=audioTee \
 flvmux streamable=true name=flvMux \
 ! queue \
 ! rtmpsink location="rtmp://<remote_url>:<rtmp_port>/<path>/<path>?e=<streamkey>" \
 mpegtsmux alignment=7 name=mpegtsMux \
 ! queue \
 ! rndbuffersize max=1316 min=1316 \
 ! queue \
 ! udpsink host=239.255.*.* port=<mc_port> ttl-mc=1 auto-multicast=true sync=0 \
  audioTee. ! queue ! flvMux. \
  audioTee. ! queue ! mpegtsMux. \
  videoTee. ! queue ! h264parse ! flvMux. \
  videoTee. ! queue ! h264parse ! mpegtsMux.