Help configuring .yml for to publish a stream with FFmpeg #624
Unanswered
seabass1217
asked this question in
Questions
Replies: 1 comment
-
The cause of the slowness is the fact that you're performing at least two re-encodings:
the server has no role in this; in my opinion, you can try this (but i won't give further details since it's not server related):
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm trying to publish a rtsp stream from OpenCV via rtsp-simple-sever with FFmpeg. I'm using a Jetson NX to connect to a rtsp server on a wireless IP camera that outputs a 30 fps, 720p stream. I want to republish to rtsp-simple-server with FFmpeg with as little latency as possible. The FFmpeg command is the code below.
The code does not through any errors by most of the frames are dropped, thus the effective frame-rate is 5 fps with about 10 sec of latency. I have not made any changes to the .yml file and so my question is there a FFmpeg command that already exist that can help this task? Also, should I modify the .yml file and if so, what changes are needed?
Thanks
Python OpenCV Code:
import cv2
import subprocess as sp
rtsp_server = 'rtsp://127.0.0.1:8554/mystream'
cap = cv2.VideoCapture('rtsp://192.168.0.6:8080/h264_ulaw.sdp')
sizeStr = str(int(cap.get(cv2.CAP_PROP_FRAME_WIDTH))) + 'x' + str(int(cap.get(cv2.CAP_PROP_FRAME_HEIGHT)))
fps = int(cap.get(cv2.CAP_PROP_FPS))
command = ['ffmpeg',
#'-re',
'-s', sizeStr,
'-r', str(fps), # rtsp fps (from input server)
'-i', '-',
process = sp.Popen(command, stdin=sp.PIPE)
while(cap.isOpened()):
ret, frame = cap.read()
ret2, frame2 = cv2.imencode('.png', frame)
process.stdin.write(frame2.tobytes())
OUTPUT from RTSP Sever
Beta Was this translation helpful? Give feedback.
All reactions