Publishing to Wowza via port 80

I know that I can get Wowza to stream to clients via port 80. However, I’d like to be able to push a stream to Wowza via port 80. Specifically, using ffmpeg to do the encoding.

What I’m currently doing is:

ffmpeg -i ‘udp://localhost:5000?fifo_size=1000000&overrun_nonfatal=1’ -crf 30 -preset ultrafast -acodec aac -strict experimental -ar 44100 -ac 2 -b:a 96k -vcodec libx264 -r 25 -b:v 700k -f flv ‘rtmp://wowza/live/cam0’

I have tried:

ffmpeg -i ‘udp://localhost:5000?fifo_size=1000000&overrun_nonfatal=1’ -crf 30 -preset ultrafast -acodec aac -strict experimental -ar 44100 -ac 2 -b:a 96k -vcodec libx264 -r 25 -b:v 700k -f flv ‘rtmp://wowza:80/live/cam0’

but that gives me:

Input #0, mpegts, from ‘udp://localhost:5000?fifo_size=1000000&overrun_nonfatal=1’:

Duration: N/A, start: 40876.855822, bitrate: 8224 kb/s

Program 1

Stream #0:0[0x44]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p, 720x480 [SAR 8:9 DAR 4:3], 8000 kb/s, 32.36 fps, 30 tbr, 90k tbn, 59.94 tbc

Stream #0:1[0x45]: Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, s16, 224 kb/s

rtmp://68.188.36.162:80/live/cam0: Input/output error

I’ve also tried:

ffmpeg -i ‘udp://localhost:5000?fifo_size=1000000&overrun_nonfatal=1’ -crf 30 -preset ultrafast -acodec aac -strict experimental -ar 44100 -ac 2 -b:a 96k -vcodec libx264 -r 25 -b:v 700k -f flv ‘http://wowza:80/live/cam0

but it gives me:

Output #0, flv, to ‘http://68.188.36.162:80/live/cam0’:

Metadata:

encoder : Lavf54.15.104

Stream #0:0: Video: h264 ([7][0][0][0] / 0x0007), yuv420p, 720x480 [SAR 8:9 DAR 4:3], q=-1–1, 700 kb/s, 1k tbn, 25 tbc

Stream #0:1: Audio: aac ([10][0][0][0] / 0x000A), 44100 Hz, stereo, flt, 96 kb/s

Stream mapping:

Stream #0:0 -> #0:0 (mpeg2video -> libx264)

Stream #0:1 -> #0:1 (mp2 -> aac)

Press [q] to stop, [?] for help

[mpeg2video @ 0x269f780] warning: first frame is no keyframe

Have I overlooked something here? I’ve check that VHost.xml contains “80,554,1935” and that port 80 is showing as being successfully bound in the access log.

Not sure, those Wowza output addresses should work. I would be curious if there was something about your input stream, or something about your Wowza app. Have you tried streaming to/from a file, just to test?

ffmpeg -i ‘udp://localhost:5000?fifo_size=1000000&overrun_nonfatal= 1’ -crf 30 -preset ultrafast -acodec aac -strict experimental -ar 44100 -ac 2 -b:a 96k -vcodec libx264 -r 25 -b:v 700k -f flv cam0.flv

If that works, then send that file to Wowza:

ffmpeg -re -i cam0.flv -c copy -f flv ‘rtmp://wowza/live/cam0’

You could also try sending a generic file to Wowza too, just to compare:

ffmpeg -re -i sample.mp4 -c copy -f flv ‘rtmp://wowza/live/cam0’

Take a look at this guide:

https://www.wowza.com/docs/how-to-use-ffmpeg-with-wowza-media-server-mpeg-ts

And for playback, this guide:

https://www.wowza.com/docs/how-to-publish-and-play-a-live-stream-mpeg-ts-based-encoder

Richard

Instead of pushing to rtmp://wowza/live/cam0 I’d like to be able to push to port 80 on the Wowza server. Using a URL of ‘rtmp://wowza:80/live/cam0’ or ‘rtmpt://wowza:80/live/cam0’ results in error messages.

I just pushed a file via ffmpeg to my Wowza server – the “rtmp” prefix with port 80 specified worked for me:

ffmpeg -re -i test.flv -c copy -f flv rtmp://wowza:80/live/cam0

And according to my server firewall log, only port 80 was used for the incoming stream. (Although I played it back using port 1935.) The “http” and “rtmpt” prefixes did not work – rejected by Wowza and ffmpeg, respectively.

According to your first post, the rtmp port 80 destination in your command returns an “Input/output error” in ffmpeg?

Take a look at this guide:

Use FFmpeg to live stream with Wowza Streaming Engine

And for playback, this guide:

Publish a live stream from an MPEG-TS encoder

Richard

Sorry, I should have been clearer in my original post.

I am now successfully pulling the MPEG-TS stream from the source server, transcoding it, and pushing it to Wowza. I am also playing the stream successfully. The command:

ffmpeg -i ‘udp://localhost:5000?fifo_size=1000000&overrun_nonfatal=1’ -crf 30 -preset ultrafast -acodec aac -strict experimental -ar 44100 -ac 2 -b:a 96k -vcodec libx264 -r 25 -b:v 700k -f flv ‘rtmp://wowza/live/cam0’

is working just fine.

What I’m trying to accomplish now is allow the script to still work if the network administrator has to close port 1935 to inbound traffic on the Wowza box. Instead of pushing to rtmp://wowza/live/cam0 I’d like to be able to push to port 80 on the Wowza server. Using a URL of ‘rtmp://wowza:80/live/cam0’ or ‘rtmpt://wowza:80/live/cam0’ results in error messages.

My question then is how can I push a stream INTO Wowza on port 80.

If I follow the links above, I can create a stream file that pulls in a UDP stream from port 80. I then run ffmpeg to push a stream via UDP to port 80. Once I start that stream in streammanager it shows the stream as running, but I can’t play it.

Is there something I’m overlooking, or is there a simpler way to allow me to push the stream in to Wowza on port 80?

I modified my script to push to the internal IP address instead of the external IP and it works fine now - it appears it’s a firewall issue. But it’s now working fine.