How to transfer using ffmpeg over HTTP

I am currently making a stream that should display correctly in Flowplayer. First I send it to another computer via RTP. Here I also checked with VLC that the codec, etc. Do what they do right.

Now I want to expose this stream in Flowplayer as a file, so it can be displayed using what I used in VLC: http://localhost:8080/test.mp4 for example.

I got the full line: ffmpeg -i input -f mp4 http://localhost:8080/test.mp4

However, no matter how I try to do this, I get only an input / output error. Is this only possible with something like ffserver or another?

I think this does not work, because ffmpeg cannot act as a server; it works on VLC as it can. (Although VLC destroys the codecs that I installed, and for some reason they cannot be read)

A (sort of) workaround I can use is to save the RTP stream to a file and then load it. This, however, only works after the file no longer opens; Otherwise, I get a codec error.

+7
source share
1 answer

you need this command line

 ffmpeg -f v4l2 -s 320x240 -r 25 -i /dev/video0 -f alsa -ac 1 -i hw:0 http://localhost:8090/feed1.ffm 

make sure your feed name ends with ".ffm", and if not, add "-f ffm" in front of your channel URL to manually specify the output format (since ffmpeg will not be able to detect this automatically), for example, "-f ffm http: // localhost: 8090 / blah.bleh ".

0
source

Source: https://habr.com/ru/post/970244/


All Articles