I found out following:
When using
// Spawn a new mplayer process
const env = { ...process.env, DISPLAY: ':0' };
const mplayerProcess = spawn(`mplayer`,
['-rtsp-stream-over-tcp',
'-noborder',
'-monitoraspect', '0',
'-vf', 'rotate=-1',
'-geometry', '5:225',
'-x', '640',
'-y', '360',
'rtsp://axisviewer:password@192.168.178.55/axis-media/media.amp?streamprofile=ACC_Low'],
{env: env});
The stream is correct on the monitor.
When using
// Spawn a new mplayer process
const env = { ...process.env, DISPLAY: ':0' };
const mplayerProcess = spawn(`mplayer`,
['',
'', '',
'-rtsp-stream-over-tcp',
'',
'', '',
'-noborder',
'-monitoraspect', '0',
'-vf', 'rotate=-1',
'-geometry', '5:225',
'-x', '640',
'-y', '360',
'rtsp://axisviewer:password@192.168.178.55/axis-media/media.amp?streamprofile=ACC_Low'],
{env: env});
The stream is NOT correct on the monitor (MPlayer window in the center).
So the problem is spawning with empty parameters.
When running it from the command line, this is not an issue, as the shell takes care of the empty places between the arguments.
I tried with undefined
and null
iso ''
but that does not work.
Only idea how to solve this ?
Cleaning the array somehow ?