FFmpeg muxing over HTTP

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

FFmpeg muxing over HTTP

Glenn W
Hello,

I am trying to mux my raw h264 video to RTSP packets over HTTP.

However, using wireshark and reading the docs, I see this is not an option.

I tried a hack using `-f rtsp http:xxx.x.x.:xxx/xx`  but it was still only
sending over TCP.

My use case is that I am needing to send this stream to a web app running
in cloud.

If not using RTSP, is there any other way to use FFmpeg to send raw h264
packets over HTTP. I have looked into HLS protocol, but this is more only
used for hosting. I need to SEND h264 packets efficiently as possible, and
over HTTP.

I don't understand why this should not be possible, as FFmpeg can use RTSP
protocol to request over HTTP when demuxing. On my server side, I am also
using FFmpeg to read rtsp stream using `ffmpeg -rtsp_flags listen
-rtsp_transport http -i ....`
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: FFmpeg muxing over HTTP

Carl Eugen Hoyos-2
2019-03-14 6:51 GMT+01:00, Glenn W <[hidden email]>:
> I need to SEND h264 packets efficiently as possible, and
> over HTTP.

Then why don't you send AnnexB? It seems hard to believe
that it has more overhead than rtsp...

> I don't understand why this should not be possible, as FFmpeg
> can use RTSP protocol to request over HTTP when demuxing.

(That's not exactly a strong argument...)

Carl Eugen
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: FFmpeg muxing over HTTP

Glenn W
Even when I run this command:

`ffmpeg -re -i hq-video.mp4 -c:v libx264 -an -s 1280x720 -f h264
http://my-server/push`

It is still sending the data only over *TCP*. Why is this the case??

How can I just get FFmpeg to send the data over *HTTP*??



On Thu, Mar 14, 2019 at 3:57 AM Carl Eugen Hoyos <[hidden email]> wrote:

> 2019-03-14 6:51 GMT+01:00, Glenn W <[hidden email]>:
> > I need to SEND h264 packets efficiently as possible, and
> > over HTTP.
>
> Then why don't you send AnnexB? It seems hard to believe
> that it has more overhead than rtsp...
>
> > I don't understand why this should not be possible, as FFmpeg
> > can use RTSP protocol to request over HTTP when demuxing.
>
> (That's not exactly a strong argument...)
>
> Carl Eugen
> _______________________________________________
> ffmpeg-user mailing list
> [hidden email]
> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> [hidden email] with subject "unsubscribe".
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: FFmpeg muxing over HTTP

Carl Eugen Hoyos-2


> Am 14.03.2019 um 16:21 schrieb wolfe.t.glenn <[hidden email]>:
>
> Even when I run this command:
>
> `ffmpeg -re -i hq-video.mp4 -c:v libx264 -an -s 1280x720 -f h264
> http://my-server/push`
>
> It is still sending the data only over *TCP*. Why is this the case??

Because while http does not strictly require tcp iirc, it is always used over tcp afaik. I don’t think my-server would accept anything else.
If you want udp (or rtp) tell FFmpeg so.

Please avoid top-posting here, Carl Eugen
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: FFmpeg muxing over HTTP

Glenn W
@ Carl - sure, but I do not think you understand my question.

HTTP uses TCP, yes. But I am saying that I want the output stream to be
encapsulated in L7 packets rather than still sent over L4.

I am not asking about lower level transport. I simply need HTTP
encapsulation.

While the FFmpeg protocols documentation seems to indicate that muxing over
HTTP is quite possible, I am not seeing expected behavior as there is no
encapsulation happening.



On Thu, Mar 14, 2019 at 11:56 AM Carl Eugen Hoyos <[hidden email]>
wrote:

>
>
> > Am 14.03.2019 um 16:21 schrieb wolfe.t.glenn <[hidden email]>:
> >
> > Even when I run this command:
> >
> > `ffmpeg -re -i hq-video.mp4 -c:v libx264 -an -s 1280x720 -f h264
> > http://my-server/push` <http://my-server/push>
> >
> > It is still sending the data only over *TCP*. Why is this the case??
>
> Because while http does not strictly require tcp iirc, it is always used
> over tcp afaik. I don’t think my-server would accept anything else.
> If you want udp (or rtp) tell FFmpeg so.
>
> Please avoid top-posting here, Carl Eugen
> _______________________________________________
> ffmpeg-user mailing list
> [hidden email]
> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> [hidden email] with subject "unsubscribe".
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: FFmpeg muxing over HTTP

Carl Zwanzig
On 3/14/2019 2:30 PM, wolfe.t.glenn wrote:
> @ Carl - sure, but I do not think you understand my question.

I'm not sure you understand HTTP; how do you _send_ http without it being
_requested_? AFAIK, one end has to request the data and thus open the
stream. Generally setting an IP of 0.0.0.0 indicates to listen on the port.

The -f mpegts indicates to use that output format, which would go over tcp
or udp (don't know why it accepts http, not going into the code at the moment).

You may need to investigate other streaming protocols like rtp or rtsp, or
setting up hls (which I think is what you really need).

Also, take a look at https://trac.ffmpeg.org/wiki/StreamingGuide

> On Thu, Mar 14, 2019 at 11:56 AM Carl Eugen Hoyos <[hidden email]>
> wrote:
[...]
>> Please avoid top-posting here

still a good idea (as is removing the old message footers)

Also, AFAIK, we haven't seen the full command _with_ the output; among other
things, it tells everyone which version of ffmpeg you're using and what
options it was built with.

z!
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: FFmpeg muxing over HTTP

Moritz Barsnick
On Thu, Mar 14, 2019 at 19:11:10 -0700, Carl Zwanzig wrote:
> On 3/14/2019 2:30 PM, wolfe.t.glenn wrote:
> > @ Carl - sure, but I do not think you understand my question.
>
> I'm not sure you understand HTTP; how do you _send_ http without it being
> _requested_?

By sending e.g. an HTTP request with method POST to a certain URL.

Look at ffmpeg's http input protocol: It too can listen for a client's
http connection. That client sends HTTP "without it being requested".

> Generally setting an IP of 0.0.0.0 indicates to listen on the port.

Who ever user 0.0.0.0 in this thread? It might work if you use ffmpeg's
"-listen 1" option, then telling to listen on all interfaces.

But that deviates from the question. I believe Glenn wishes to send
MPEG-TS over RTSP, but RTSP shall be tunneled in HTTP.

I thought the option "-rtsp_transport http" is meant for that, but
ffmpeg tells me:
[rtsp @ 0xacc0780] Unsupported lower transport method, only UDP and TCP are supported for output.

So I guess *sending* RTSP over HTTP is not implemented.

Cheers,
Moritz
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: FFmpeg muxing over HTTP

Carl Eugen Hoyos-2
Am Fr., 15. März 2019 um 12:20 Uhr schrieb Moritz Barsnick <[hidden email]>:

> So I guess *sending* RTSP over HTTP is not implemented.

That's definitely correct.

Greetings from Karl-Marx-Stadt, Carl Eugen
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".