Gstreamer-rs RTSP example only works with videotestsrc? #193

Hi,

cargo run --bin rtsp-server --features="rtsp-server" -- "videotestsrc ! x264enc ! rtph264pay name=pay0 pt=96" works.
But
cargo run --bin rtsp-server --features="rtsp-server" -- "v4l2src device=/dev/video0 ! video/x-raw,format=YUY2,width=640,height=480,framerate=30/1 ! x264enc ! h264parse ! rtph264pay name=pay0 pt=96" not works.

I am a newbie with Gstreamer.
Cloud you kindly try the second one on Linux?I test is on my Ubuntu laptop PC.

I can see my Linux laptop PC camera light up for a bit time.
Is that mean I need permission?

What’s the output of gst-device-monitor-1.0 Video/Source ?

You may also want to use x264enc tune=zerolatency (but that doesn’t make it work/not-work)

Device found:

	name  : Integrated Camera (V4L2)
	class : Video/Source
	caps  : video/x-raw, format=YUY2, width=640, height=480, framerate={ (fraction)30/1, (fraction)15/1 }
	        video/x-raw, format=YUY2, width=320, height=180, framerate={ (fraction)30/1, (fraction)15/1 }
	        video/x-raw, format=YUY2, width=320, height=240, framerate={ (fraction)30/1, (fraction)15/1 }
	        video/x-raw, format=YUY2, width=352, height=288, framerate={ (fraction)30/1, (fraction)15/1 }
	        video/x-raw, format=YUY2, width=424, height=240, framerate={ (fraction)30/1, (fraction)15/1 }
	        video/x-raw, format=YUY2, width=640, height=360, framerate={ (fraction)30/1, (fraction)15/1 }
	        video/x-raw, format=YUY2, width=848, height=480, framerate=20/1
	        video/x-raw, format=YUY2, width=960, height=540, framerate=15/1
	        video/x-raw, format=YUY2, width=1280, height=720, framerate=10/1
	        image/jpeg, width=640, height=480, framerate={ (fraction)30/1, (fraction)15/1 }
	        image/jpeg, width=320, height=180, framerate={ (fraction)30/1, (fraction)15/1 }
	        image/jpeg, width=320, height=240, framerate={ (fraction)30/1, (fraction)15/1 }
	        image/jpeg, width=352, height=288, framerate={ (fraction)30/1, (fraction)15/1 }
	        image/jpeg, width=424, height=240, framerate={ (fraction)30/1, (fraction)15/1 }
	        image/jpeg, width=640, height=360, framerate={ (fraction)30/1, (fraction)15/1 }
	        image/jpeg, width=848, height=480, framerate={ (fraction)30/1, (fraction)15/1 }
	        image/jpeg, width=960, height=540, framerate={ (fraction)30/1, (fraction)15/1 }
	        image/jpeg, width=1280, height=720, framerate={ (fraction)30/1, (fraction)15/1 }
	properties:
		api.v4l2.cap.bus_info = usb-0000:00:14.0-8
		api.v4l2.cap.capabilities = 84a00001
		api.v4l2.cap.card = Integrated Camera: Integrated C
		api.v4l2.cap.device-caps = 04200001
		api.v4l2.cap.driver = uvcvideo
		api.v4l2.cap.version = 6.8.1
		api.v4l2.path = /dev/video0
		device.api = v4l2
		device.devids = 20736
		device.id = 51
		device.product.id = 0x568
		device.vendor.id = 0x13d
		factory.name = api.v4l2.source
		media.class = Video/Source
		node.description = Integrated Camera (V4L2)
		node.name = v4l2_input.pci-0000_00_14.0-usb-0_8_1.0
		node.nick = Integrated Camera
		node.pause-on-idle = false
		object.path = v4l2:/dev/video0
		priority.session = 1000
		factory.id = 10
		client.id = 35
		clock.quantum-limit = 8192
		media.role = Camera
		node.driver = true
		object.id = 49
		object.serial = 201
	gst-launch-1.0 pipewiresrc target-object=201 ! ...