Open jaygooby opened 3 months ago
您的信已收到,我将尽快给您答复
Hi @jaygooby it looks like the issue is because ffmpeg is using a chunked post, meaning it opens a connection and sends data without closing the connection. The module is not designed for that. Chunked posts can be misinterpreted, like where the real message starts/finishes. I don't know this feature of ffmpeg. Try to check if it has options to not use chunked posts. If it does not, I guess that the solution would be to do a simple custom application to listen to the ffmpeg post, break down each group of progress notifications, and then post to the nginx using the module to broadcast it to all your subscribers. Please, let me know if this makes sense for you. I can try to help with this custom application.
@wandenberg thanks for the confirmation :(
I know there's no way to disable the ffmpeg chunked POST, so I'll see what else I can do…
ffmpeg can also stream its progress to a pipe or fifo; I'll see if I can intercept the data that way and POST each update separately
I'm trying to use
ffmpeg
's-progress
URL option to send rendering progress data to a/pub
channel.Here's a simple example that generates 30 seconds of black h264 video:
The
-progress
URL is a/pub
channel:http://127.0.0.1/pub?id=ffmpeg
My nginx location looks like:
ffmpeg
sends its progress data as a chunked POST body. I've tested that it sends as it happens, by capturing its output with netcat:You can see the chunked POST headers, followed by the data:
The problem I've got is that with that ^^^ nginx location block, nothing appears in the channel until ffmpeg closes the connection. I've tried with the commented out
proxy_
directives too, just in case. Any ideas about what's missing so the client's POST body isn't buffered?