You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The -progress URL is a /pub channel: http://127.0.0.1/pub?id=ffmpeg
My nginx location looks like:
location = /pub {
# We're not using a proxy, just the push-stream module
# proxy_buffering off;
# proxy_set_header Connection "";
# ensure http 1.1 or buffering always occurs
# proxy_http_version 1.1;
# we don't care about client max body size
client_max_body_size 0;
# don't do this, nothing comes through at all
# client_body_buffer_size 0;
# should be on by default
chunked_transfer_encoding on;
# turn off client request buffering
proxy_request_buffering off;
# activate publisher (admin) mode for this location
push_stream_publisher admin;
# query string based channel id
push_stream_channels_path $arg_id;
# access control
allow all; # don't do this in prod!
}
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:
# start "server"
nc -l 7000 > ffmpeg.http.log &
# render 30 seconds of blank h264 sending progress to the server
ffmpeg -y -progress http://127.0.0.1:7000 -t 30 -f lavfi -i color=c=black:s=640x480 -c:v libx264 -tune stillimage -pix_fmt yuv420p black.mp4
# cat the "server" log
cat ffmpeg.http.log
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?
The text was updated successfully, but these errors were encountered:
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.
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?The text was updated successfully, but these errors were encountered: