Can't set UMS to rebroadcast RTSP -> RTMP w/Xiaomi Small Sq

All the issues related to streaming of recorded media.

Can't set UMS to rebroadcast RTSP -> RTMP w/Xiaomi Small Sq

Postby codster » Fri Feb 24, 2017 7:24 am

Hello; I have a "Xiaomi 1080p Smart Wifi IP "Small Square" Camera". And I'm trying to get it to work with UMS. I have a RTSP, and am just re-broadcasting it with UMS to RTMP. I am not having much success...

Playing the RTSP stream directly from my IP CAM works fine:
```
ffplay rtsp://192.168.0.190/unicast
...
Input #0, rtsp, from 'rtsp://192.168.0.190/unicast':= 0B f=0/0
Metadata:
title : LIVE555 Streaming Media v2014.07.04
comment : LIVE555 Streaming Media v2014.07.04
Duration: N/A, start: 0.099856, bitrate: N/A
Stream #0:0: Video: h264 (High), yuv420p, 1280x720, 9.83 tbr, 90k tbn, 180k tbc
```

However, when I run Unreal Medea Server, and just add the "Rebroadcast Live RTSP", with the RTSP link: rtsp://192.168.0.190/unicast, it adds everything fine. But when I try to view the RTMP link Unreal Media Server provides, I can see the client connect in UMS, and it gets the metadata, but then just dies from there, showing as "connecting" or "buffering" and shows no picture in any player. If I set it to grab audio only, then it will play audio only from the camera, with the UMS RTMP stream in a player. So it seems it's set up right as it can read the audio source fine... just when I try Video there are issues. In ffplay it displays. The Unreal Streaming Player also just hangs as well displaying nothing.

```
ffplay rtmp://localhost:5119/live/aqua
...
Metadata: : 0.000 fd= 0 aq= 0KB vq= 0KB sq= 0B f=0/0
RealTime 1
Title aqua
width 1280.00
height 720.00
framerate 15.00
videodatarate 934285.00
RTMP_ReadPacket, failed to read RTMP packet headersq= 0B f=0/0
rtmp://localhost:5119/live/aqua: Invalid data found when processing input
nan : 0.000 fd= 0 aq= 0KB vq= 0KB sq= 0B f=0/0
```

And IMG to my UMS settings is here: https://cloud.githubusercontent.com/ass ... 7abe8b.PNG

Anyone know what might be the problem? Like I said, if I do "AUDIO" only then the stream works. But when I add video the RTMP stream just hangs (in UnrealStreamPlayer, MPV, ffplay, or the HTTP5 players). When the player plays the video, you see a client show up in UMS, and under "Live Encodes" it shows it "receving source from RTSP... but seems like something is off with the RTSP stream or somethings not set up right? But the IPCAM RTSP stream can play directly in all the players, but can't play the UMS RTMP stream. Any Ideas? Like i said I am using the Xiaomi Small Square.
codster
 
Posts: 0
Joined: Fri Feb 24, 2017 6:57 am

Re: Can't set UMS to rebroadcast RTSP -> RTMP w/Xiaomi Small

Postby admin » Fri Feb 24, 2017 8:51 am

Did you try to set UDP as a transport, instead of TCP, and/or disable A/V synch?
admin
Site Admin
 
Posts: 1039
Joined: Fri Aug 21, 2009 10:13 am

Re: Can't set UMS to rebroadcast RTSP -> RTMP w/Xiaomi Small

Postby codster » Fri Feb 24, 2017 4:00 pm

Yes, I have played with all the settings. I set the transport as: TCP, UDP and HTTP. None worked. When I play the RTSP stream directly in ffplay, it attempts UDP first and times out, then says "Attempting TCP" and then works. So I believe TCP is the correct one. I've tried all 3 though. Again, if I set the stream to "Audio Only", then it will pull the stream fine and play Audio via UMS's RTMP.

I've also enabled and disabled A/V Synch. Same result. Only works if I have "Audio Only" and have Audio enabled on the IPCAM. Whenever there is a Video Stream, UMS can't seem to get it.

It's weird because ffplay/mpv/ipcamlive.com/vlc can all get and play the RTSP stream fine from the IPCAM's RTSP link (rtsp://192.168.0.190:554/unicast). Every player I attempt to play the RTSP stream in can play the IPCAM's RTSP link... just UMS is the only software which I can't seem to get to view the RTSP video stream... Or at least can't get it to rebroadcast the RTSP -> RTMP.

The codec info for the RTSP stream is: Video: h264 (High), yuv420p, 1280x720, 9.83 tbr, 90k tbn, 180k tbc. Which is right for UMS's RTMP correct? You just want H264 and AAC(Audio Disabled).

When adding the camera to ipcamlive.com, it pulls the RTSP feed and says the stream info is:
Protocol: rtsp
Compression: h264
Resolution: 1280x720
Frame rate: 10.16fps
Bandwidth: 0.26 mbps
codster
 
Posts: 0
Joined: Fri Feb 24, 2017 6:57 am

Re: Can't set UMS to rebroadcast RTSP -> RTMP w/Xiaomi Small

Postby codster » Fri Feb 24, 2017 4:40 pm

A little more info... It seems that only the Unreal Streaming Player can play the Audio, when i have "Audio Only" set in UMS's RTMP Stream. If I have audio only, and play the RTMP link via ffplay, it errors out:

AUDIO ONLY with FFPLAY
HandShake: client signature does not match! 0KB sq= 0B f=0/0
Received FLV packet before play()! Ignoring. 0KB sq= 0B f=0/0
RTMP_ReadPacket, failed to read RTMP packet header
rtmp://192.168.0.111:5119/live/aqua: Unknown error occurred

AUDIO ONLY with UnrealStreamingPlayer: WORKS


VIDEO ONLY with FFPLAY:
HandShake: client signature does not match! 0KB sq= 0B f=0/0
...
RTMP_ReadPacket, failed to read RTMP packet headersq= 0B f=0/0
rtmp://localhost:5119/live/aqua: Invalid data found when processing input

VIDEO ONLY with UnrealStreamingPlayer: ERROR Receiving data from Server
codster
 
Posts: 0
Joined: Fri Feb 24, 2017 6:57 am

Re: Can't set UMS to rebroadcast RTSP -> RTMP w/Xiaomi Small

Postby codster » Fri Feb 24, 2017 5:00 pm

Maybe this is easier... I can't tell if it's my UMS installation... maybe the UMS 64bit install is not good. Or maybe I need an older version other than v12. Currently I am using: Unreal Media Server, version 12.0, x64 Edition

Before I start installing a million versions, maybe someone can tell me if they also experience this problem with my IPCAM. I have opened my IPCAM's Ports, so someone else can view it and add it to their UMS. The info is below. I enabled Audio on the webcam in case someone wants to test audio, but I usually only have Video Only set in the UMS, and turn audio off on the IPCAM. It's just pointing at my Aquarium right now.


RTSP URL: rtsp://brownhome.dlinkddns.com:554/unicast


Try playing the RTSP Link Directly:
ffplay rtsp://brownhome.dlinkddns.com:554/unicast
or
mpv rtsp://brownhome.dlinkddns.com:554/unicast
or
vlc rtsp://brownhome.dlinkddns.com:554/unicast

All 3 work, with Video+Audio (usually I have Audio disabled, which is (pcm_alaw codec)).


Now try to add the working RTSP stream to UMS.
UMS > Rebroadcast RTSP Stream > RTSP Link: rtsp://brownhome.dlinkddns.com:554/unicast > Set Alias (aqua if u like) > Everything else default.

Can change the option to "Video Only" if you like. Then play in ffplay or UnrealStreamingPlayer:
ffplay rtmp://localhost:5119/live/aqua
or
UnrealStreamingPlayer

Both error out, but u do see a connection in UMS, and a connection to the RTSP IPCAM in UMS too. Just no video is produced.

Now you can set the stream to "Audio Only" in UMS settings, and repeat with ffplay or UnrealStreamingPlayer.
ffplay errors out, UnrealStreamingPlayer will play the Audio...


Anyone have any ideas? Or maybe the IPCAM's RTSP link is working in your guys's UMS?
codster
 
Posts: 0
Joined: Fri Feb 24, 2017 6:57 am

Re: Can't set UMS to rebroadcast RTSP -> RTMP w/Xiaomi Small

Postby admin » Fri Feb 24, 2017 5:38 pm

Looks like invalid RTSP implementation by this camera
admin
Site Admin
 
Posts: 1039
Joined: Fri Aug 21, 2009 10:13 am

Re: Can't set UMS to rebroadcast RTSP -> RTMP w/Xiaomi Small

Postby codster » Fri Feb 24, 2017 6:30 pm

[quote="admin"]Looks like invalid RTSP implementation by this camera[/quote]
Ah maybe. But weird that all the other RTSP players can play the RTSP stream... I am starting to think maybe UMS is getting hung up on the "b=AS:956707" bitrate...

I installed Unreal Live Server, and added the "RTSP Client DirectShow Source Filter" (the Media Foundation RTSP Source didn't give me an option in ULS).

Then, I then add the RTSP stream with the initialization link: "URL= rtsp://192.168.0.190/unicast | Transport = TCP". It views the information for the stream as:
AVC1, 956707 kbps, 1280x720

The bitrate seems wrong, in my camera i set "-Q 10 -b 2048". However, during the ULS setup, if you click "preview", it opens the window "Active Movie Window" and it can play the IPCAM Direct RTSP stream fine here...

If you set up with "Stream original content", and click okay. Then try to "Right-Click > View Live Source" it opens the stream in UnrealStreamPlayer, and it doesn't work. It says the bitrate is 956707. However, if you change the properties to "Apply software compression" (works), or "Stream uncompressed video" (works, sets bitrate to near ~300k). The bitrate seems to be set right, and if I view the stream with UnrealStreamPlayer, it now works from UnrealLiveServer.


When playing the IPCAM Direct RTSP Stream in ffplay, I do see:
[rtsp @ 00000000025e45a0] SDP:
v=0
o=- 1487976378629315 1 IN IP4 192.168.0.190
s=LIVE555 Streaming Media v2014.07.04
i=LIVE555 Streaming Media v2014.07.04
t=0 0
a=tool:LIVE555 Streaming Media v2014.07.04
a=type:broadcast
a=control:*
a=range:npt=0-
a=x-qt-text-nam:LIVE555 Streaming Media v2014.07.04
a=x-qt-text-inf:LIVE555 Streaming Media v2014.07.04
m=video 0 RTP/AVP 96
c=IN IP4 0.0.0.0
b=AS:956707
a=rtpmap:96 H264/90000
a=fmtp:96 profile-level-id=644029;sprop-parameter-sets=Z2RAKawsqAUAW5A=,aO44gA==
a=control:track1
m=audio 0 RTP/AVP 8
c=IN IP4 0.0.0.0
b=AS:956707
a=control:track2


Which does seem to be a mess. I assume it's here where UMS is getting the bitrate from: "b=AS:956707" . Yet even though this b= value is set (incorrectly?), ffplay still plays the RTSP stream fine (and ULS can re-encode the stream fine too...). But yea from the SDP, seems like b, m, t, and o, flags are all maybe incorrect. And there are multiple b, and a:control flags...


Some Questions?

Seems like I can get it working with UnrealLiveServer, with the "RTSP Client DirectShow Source Filter", and just re-encode it. However this source filter is a demo and will only work for 9mins in UnrealLiveServer correct? No way around this? Or does the source filter work unlimited when uses with UnrealLiveServer only (like some of the other media components on that page)?

If it is the malformed SDP, or bitrate that UMS is complaining about? Why are other players fine with viewing the direct RTSP Stream? When the bitrate is not set, should UMS error out like it currently does? Or just grumble and then view/rebroadcast the stream like other RTSP players do?
Even if the RTSP stream has a malformed SDP, yet can still play in all other players. And UMS understands the RTSP stream enough to "encode" it to something else, but it can't rebroadcast it correctly? If it has enough info to encode it on the fly and rebroadcast, shouldn't it be able to rebroadcast fine?
codster
 
Posts: 0
Joined: Fri Feb 24, 2017 6:57 am

Re: Can't set UMS to rebroadcast RTSP -> RTMP w/Xiaomi Small

Postby admin » Fri Feb 24, 2017 7:54 pm

You are talking puzzles. If RTSP source filter can get the stream then Unreal Media Server will get it too. Maybe there are some issues between players and Unreal Media Server, so players just cannot receive streams? Try starting HLS on your aqua broadcast. Does it work? If yes then the RTSP part is OK.
admin
Site Admin
 
Posts: 1039
Joined: Fri Aug 21, 2009 10:13 am

Re: Can't set UMS to rebroadcast RTSP -> RTMP w/Xiaomi Small

Postby codster » Sat Feb 25, 2017 3:57 am

Yea it's a weird situation.
UMS can read the RTSP stream just fine I'm sure, it just can't rebroadcast the Video Part (I assume cuz it's not rewriting the SPD headers, or something else when rebroadcasting).
ULS (with RTSP Source Filter) can read the RTSP stream as well, but can not play it unless I change the "Video Type" under settings to encode the incoming RTSP. If I do not "Apply Software Compression" or "Stream Uncompressed Video", then I can not view the RTSP stream from ULS.

Under "Video Type" in ULS:
- Stream Original Content - ULS DOESN'T WORK, CAN'T PREVIEW STREAM, JUST BLANK.
- Apply Software Compression - KEEPING ALL OTHER SETTINGS SAME, JUST CHANGE THIS AND STREAM WORKS.
- Stream Uncompressed Video - SAME AS "APPLY SOFTWARE COMPRESSION", I.E. WORKS.

I think UMS has the "Stream Original Content", when I click RTSP Rebroadcast. And it has a hard time rebroadcasting the video part of the Xiaomi's Small Square IPCAM's RTSP.


So here is where I am right now:
1) IPCAM RTSP > UMS > UnrealStreamPlayer = Does not work.
2) IPCAM RTSP > ULS (Stream Original Content) > UMS > UnrealStreamPlayer = Does not work. (Same as above pretty much).
3) IPCAM RTSP > ULS (Software Compression or Uncompressed Video) > UMS > UnrealStreamPlayer = WORKS!

I.e. nothing is changed between 2 & 3 except that "re-encoding" step added. I assume #1 is just like #2 (UMS is just doing "Stream Original Content"). The issue with #3 is that it only runs for 7 minutes and then cuts, because the RTSP source filter is a demo.
I would prefer #1, but UMS can't rebroadcast this stream. It knows enough to re-encode the RTSP. But is getting hooked up on something it doesn't like from the RTSP that it won't rebroadcast the video part of the RTSP. I assume something with the SDP, and when ULS re-encodes/decompress it, it rewrites the SDP. So then it's fine rebroadcasting (maybe?).

Since #3 works, it means UMS & ULS could always "read" the IPCAM's RTSP in all the situations. It just can't rebroadcast the video part unless you set ULS to re-encode or decompress the video. Then it works, since (I assume) in these situations it's rewriting the headers or SDP part, and then can rebroadcast.

Yea, I used multiple players. I been using your guys "UnrealStreamPlayer" and it does the same. Can't view the Live Stream from UMS, or ULS(original). Just can view the stream from ULS(encode).
I tried with HLS as well, and it won't produce an video image either. And I tried with the Flash player, and HTML5 player in the browser. No video image is produce. Just like the UnrealStreamPlayer, or the other players (ffplay/mpv/vlc).

But yea since #3 works... UMS should be able to do Situation #1... I agree it's hanging up cuz something may be malformed. But if it's good enough to read the stream to re-encode it. UMS should be smart enough to rebroadcast it in this situation I think.
codster
 
Posts: 0
Joined: Fri Feb 24, 2017 6:57 am

Re: Can't set UMS to rebroadcast RTSP -> RTMP w/Xiaomi Small

Postby admin » Sat Feb 25, 2017 10:47 am

when you do hls - do you see .ts files generating in the folder?
admin
Site Admin
 
Posts: 1039
Joined: Fri Aug 21, 2009 10:13 am

Next

Return to Streaming Files

Who is online

Users browsing this forum: No registered users and 0 guests

cron