Open catboyschrody opened 1 week ago
Okay so through lots of testing I figured it out. This stream formatting for ffmpeg works:
test_scale: #native is 2560x1440
- ffmpeg:cam1#video=h264#width=1280#height=720
You need to have video set to something otherwise you cant transcode a stream copy.
So then I started playing around with custom formats. Although I couldnt manage to create my new format, I could override existing ones.
Previously RTSP looked like this:
"h264": "-c:v libx264 -g 50 -profile:v high -level:v 4.1 -preset:v superfast -tune:v zerolatency -pix_fmt:v yuv420p"
This is what I turned it into, note that go2rtc doesn't actually handle multi-line strings right, so this would all be one line, i just added indentation so its legible:
ffmpeg:
rtsp: >
-fflags nobuffer
-flags low_delay
-timeout 5000000
-thread_queue_size 512
-user_agent go2rtc/ffmpeg
-rtsp_flags prefer_tcp
-i rtsp://localhost:8554/cam1
-i rtsp://localhost:8554/cam2
-i rtsp://localhost:8554/cam3
-i rtsp://localhost:8554/cam4
-filter_complex '[0:v][1:v]hstack[top];[2:v][3:v]hstack[bottom];[top][bottom]vstack'"
And this gives me exactly what I wanted:
Although tbh its kind of finicky and slow to load
I am using ffmpeg version 2024-09-22, go2rtc version=1.9.4 I have the following, which works:
Now, I want to handle this with ffmpeg. According to the documentation, with the format being
ffmpeg:{input}#{param1}#{param2}#{param3}
the following simple stream should work:test: ffmpeg:rtsp://localhost:8554/cam3
But I am getting the error: error="read tcp 127.0.0.1:8554->127.0.0.1:50731: wsarecv: An established connection was aborted by the software in your host machine."Now the following works:
But I cant apply operations like
#rotate=90
or `options: rotate: 90' to workThe following doesnt work either:
test: ffmpeg:rtsp://10.0.0.45:80/ch2_0.264
My end goal is to create a new rtsp stream by taking 4 camera streams, cam1, cam2, cam3 and cam4 and applying the following:
-filter_complex "[0:v][1:v]hstack[top];[2:v][3:v]hstack[bottom];[top][bottom]vstack"
I want to use the camera stream created by go2rtc as opposed to from the camera source because I need the functionality of reconnect_interval.I have ensured both go2rtc.exe and ffmpeg.exe are in windows antivirus and firewall exclusion list
But I'm failing at basically step two, getting ffmpeg to work