[FFmpeg-user] FFmpeg: how to output over HTTP

Moritz Barsnick barsnick at gmx.net
Wed Mar 20 12:17:07 EET 2019

On Tue, Mar 19, 2019 at 21:05:19 -0400, Glenn W wrote:
> Please see the new attached PCAP file with a sample of the correct
> Wireshark output bound to localhost. (had to gzip this one since it was
> pretty big)

Unlikle the relatively tiny logs, you could upload such binaries to a
file sharer of your choice. ;-) (They are probably not of much interest
to the world once this issue is solved.)

> I do see some VERY sporadic HTTP POST headers, I could only find 1 out of
> over 6000 and it came at the very end (see Frame 6137 of the sample).

I only see 139 packets in the attached trace.

> Further, it appears that Wireshark does not even recognize this POST as
> HTTP protocol. I am wondering if this is the expected behavior? It seems
> very strange to me.

The content looks somewhat like only MPEG-TS, from somewhere in the
middle of a stream. (I extracted the payload and tried to have ffmpeg
swallow it.) I would guess that this trace was started *after* the HTTP
connection was established.

> BTW I could actually share a small sample of the actual output since it was
> so big (ffmpeg user mail list would not allow) - but there were 5000+
> packets before that looked similar with zero HTTP headers whatsoever.

File share host. ;-)

> Since my video server (receiver) sits behind an HTTP load balancer, it will
> need to see an HTTP route in order receive the packets from the FFmpeg
> client (sender).

Does it also expect particular ports? It will need to be configured to
understand the same ports, right?

> If I can get an HTTP route through to the receiver, I am thinking I could
> use the below to maintain a persisted connection so that rest of data
> packets can just be sent over TCP:

I'm totally convinced that if you use ffmpeg the way you are doing, you
use HTTP only.

> *multiple_requests*
> *Use persistent connections if set to 1, default is 0.*

This is only a single connection stream, I doubt this applies (but I'm
not totally sure). It won't be a tunnel which you can reuse. But once
your load balancer accepts these connections, you can do it as often as
you like anyway.


More information about the ffmpeg-user mailing list