I have made a gst-launch prototype script to encode and stream a high bandwidth video stream. So far so good, performance and quality are great, very little CPU usage, the hardware is great.
However, I must login on a graphical session and run my script from within that session for it to work. I have not found a way to automate the start of such script. I cannot put in a startup file (systemd or rc.local) the script will run but throw a bunch of cryptic errors.
For now I will mitigate by installing x11vnc and perform a graphical login from my laptop and launch the script manually, but what could it be that prevent this to work? Ideally this would be a headless system.
Please share the gstreamer pipeline to reproduce the issue. X is enable by default in each release and all tests are done with it. It is possible certain cases do not work without X. We may need to check if your usecase can be supported without X.
keep in mind I do not use the local display. I want to capture from a v4l2 interface (in principle it could be a USB webcam) and stream it to the YouTube. When I start this pipeline manually in the GUI, it works real well.
I do not intend to use the local HDMI at all. The video is encoded and then streamed over the internet.
Of I course tried to write a systemd script and, as I said in the top message, the script starts but the pipeline throws a bunch of errors. The only way to make it work successfully is to 1) have a monitor physically attached to the Jetson Nano 2) login manually and run the command from a local terminal.
That uses the hardware format converter is the culprit. If I use software conversion, that obviously uses CPU to turn data around (about 70% of one CPU in my case) I can run the script without a graphical environment, just by having systemd or rc.local start the script.
I have tried to look into the documentation and - I have not found any explicit dependency between nvvidconv and a graphical login. Maybe the drive is not going to be initialized, memory not allocated?
Please share full patch and steps in detail for r32.2.1/Jetson Nano. So that we can reproduce the issue first. Certain plugins such as nveglglessink have dependency to X. But nvvidconv should not. Probably some other reasones trigger the failure.
To test this, I have a v4l2 USB3 device that does video capture at 1920x1080.
If you do not care to setup a proper Youtube account to test this, just start a networking usage utility (I use iptraf-ng) and check there is a steady ~5-6Mbps stream up to a youtube server. If you only see 50-60kbps the stream is not working.
Note how the first pipeline uses nvvidconv ! ‘video/x-raw(memory:NVMM), format=(string)I420’ to translate the v4l2 output for the encoder while the working pipeline uses a software approach with ‘videoconvert’
In fact, I just tried, one needs to have a proper youtube key instead of the mock key=“aacc-ccaa-aacc-ccaa” I wrote on the forum. I am performing some tests with filesink to see if it produces the same behavior.
By the way, in the script above, one can substitute the rtmpsink element with either “fakesink” (but then there is no feedback) or “filesink location=‘file.bin’”. With the latter, the “working” pipeline with software conversion shows a steady increase of the size of the output, the one that uses nvvidconv stays stuck at one size for minutes, then sometimes spits out something, then again stops. That is, unless I log in manually in the system, with a physical monitor attached.