Hello all,
I’m having a spot of trouble with rtmps. Outbound works fine; a remote server can connect to the WOWZA server I’ve set up via rtmps and download video no problem. Uploading to the WOWZA server, however, doesn’t work out.
Specifically, I’m running WOWZA 4.2.0 (build 15089) on a CentOS 6.4 box (32 bit), and using ffmpeg from another CentOS 6.4 box across a public subnet for testing (public IPs, but does not go to the internet). When I send video to it with a command like:
[PHP]ffmpeg -i rtsp://[cam username]:[cam password]@[cam IP]:554/0 -an -vcodec copy -f flv rtmps://[stream username]:[stream password]@[streamlock random string].streamlock.net/live/flv:camera07[/PHP]
It sends some data… but not much (and I checked under the hood on the WOWZA server I put together: It’s definitely getting a file). It runs at half of a frame per second… and because I’m trying to get video off of a live camera, well, ffmpeg runs out of buffer and breaks. Output:
[PHP]
ffmpeg -i rtsp://[cam username]:[cam password]@[cam IP]:554/0 -an -vcodec copy -f flv rtmps://[stream username]:[stream password]@[streamlock random string].streamlock.net/live/flv:camera07
ffmpeg version 2.7.2-static http://johnvansickle.com/ffmpeg/ Copyright © 2000-2015 the FFmpeg developers
built with gcc 4.9.3 (Debian 4.9.3-1)
configuration: --enable-gpl --enable-version3 --disable-shared --disable-debug --enable-runtime-cpudetect --enable-libmp3lame --enable-libx264 --enable-libx265 --enable-libwebp --enable-libspeex --enable-libvorbis --enable-libvpx --enable-libfreetype --enable-fontconfig --enable-libxvid --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-gray --enable-libopenjpeg --enable-libopus --enable-libass --enable-gnutls --enable-libvidstab --enable-libsoxr --cc=gcc-4.9
libavutil 54. 27.100 / 54. 27.100
libavcodec 56. 41.100 / 56. 41.100
libavformat 56. 36.100 / 56. 36.100
libavdevice 56. 4.100 / 56. 4.100
libavfilter 5. 16.101 / 5. 16.101
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 2.100 / 1. 2.100
libpostproc 53. 3.100 / 53. 3.100
Input #0, rtsp, from ‘rtsp://[cam username]:[cam password]@[cam IP]:554/0’:
Metadata:
title : h264.mp4
Duration: N/A, start: 0.300000, bitrate: N/A
Stream #0:0: Video: h264 (Main), yuv420p(tv), 1280x720 [SAR 1:1 DAR 16:9], 20 fps, 20 tbr, 90k tbn, 40 tbc
[rtmps @ 0xc596300] Ignoring unsupported var reason
[flv @ 0xc325d80] Codec for stream 0 does not use global headers but container format requires global headers
Output #0, flv, to ‘rtmps://[stream username]:[stream password]@[streamlock random string].streamlock.net/live/flv:camera07’:
Metadata:
title : h264.mp4
encoder : Lavf56.36.100
Stream #0:0: Video: h264 ([7][0][0][0] / 0x0007), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], q=2-31, 20 fps, 20 tbr, 1k tbn, 90k tbc
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help
[flv @ 0xc325d80] Non-monotonous DTS in output stream 0:0; previous: 0, current: -250; changing to 0. This may result in incorrect timestamps in the output file.
[flv @ 0xc325d80] Non-monotonous DTS in output stream 0:0; previous: 0, current: -200; changing to 0. This may result in incorrect timestamps in the output file.
[flv @ 0xc325d80] Non-monotonous DTS in output stream 0:0; previous: 0, current: -150; changing to 0. This may result in incorrect timestamps in the output file.
[flv @ 0xc325d80] Non-monotonous DTS in output stream 0:0; previous: 0, current: -100; changing to 0. This may result in incorrect timestamps in the output file.
[flv @ 0xc325d80] Non-monotonous DTS in output stream 0:0; previous: 0, current: -50; changing to 0. This may result in incorrect timestamps in the output file.
[NULL @ 0xc2d33a0] RTP: missed 4017 packetstime=00:00:01.59 bitrate= 867.0kbits/s
[NULL @ 0xc2d33a0] RTP: PT=60: bad cseq f793 expected=e7e2
[NULL @ 0xc2d33a0] RTP: missed 4018 packets
[NULL @ 0xc2d33a0] RTP: missed 1296 packetstime=00:01:02.78 bitrate= 28.0kbits/s
[NULL @ 0xc2d33a0] RTP: missed -64245 packetsme=00:01:23.16 bitrate= 28.0kbits/s
[NULL @ 0xc2d33a0] RTP: missed 1313 packets
[NULL @ 0xc2d33a0] RTP: missed 1313 packetstime=00:01:42.99 bitrate= 25.5kbits/s
[rtsp @ 0xc2d0de0] CSeq 8 expected, 5 received.=00:02:22.80 bitrate= 20.5kbits/s
[rtsp @ 0xc2d0de0] CSeq 8 expected, 6 received.
[rtsp @ 0xc2d0de0] CSeq 8 expected, 7 received.
[flv @ 0xc325d80] Failed to update header with correct duration.ate= 22.5kbits/s
[flv @ 0xc325d80] Failed to update header with correct filesize.
frame= 99 fps=0.5 q=-1.0 Lsize= 394kB time=00:02:23.30 bitrate= 22.5kbits/s
video:391kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.573942%
[/PHP]
I’ve confirmed that both machines have negligible load (8 core processors on both machines, both machines had a load of less than 0.5 while this is going on). If I run it with rtmpe, I get the same problem. If I run the exact same command via rtmp, it works flawlessly. Trouble is, after I’ve got everything I want up and running, the actual content of the video is going to be potentially sensitive, and will have to go over the internet. Hence, Encryption is very much required for the intended application.
Is anyone up to helping me sort out what’s going wrong and how to fix it?