Connecting to a livestream.cgi raw h264 stream.

Community help for connecting new cameras to iSpy
Kelpi
Posts: 3
Joined: Tue Jan 09, 2018 5:46 am

Connecting to a livestream.cgi raw h264 stream.

Postby Kelpi » Tue Jan 09, 2018 6:19 am

I have one of these generic xxcamera / foscam / wanscam IP cameras. I can connect to the MJPEG stream easily enough using the URL:

http://192.168.1.116:41111/videostream. ... s=PASSWORD

But what I would really like to do is access the higher quality h264 stream. After a bit of wiresharking I found out that its location is:

http://192.168.1.116:41111/livestream.c ... &filename=

Some people in the forums have had success using livestream.cgi but I cant get it working. The main problem seems to be when you connect to that address it just spews raw h264 at you. If you try and open the network stream in VLC you get "http error: invalid HTTP reply 'U��'" in the logs. If you save the stream to a file and specify that you are using the h264 demuxer it will play though.

You can view the live stream using ffplay

ffplay -i "http://192.168.1.116:41111/livestream.cgi?user=admin&pwd=PASSWORD&streamid=0&audio=0&filename="

With the output:

Input #0, h264, from 'http://192.168.1.116:41111/livestream.cgi?user=admin&pwd=PASSWORD&streamid=0&audio=0&filename=':
Duration: N/A, bitrate: N/A
Stream #0:0: Video: h264 (Constrained Baseline), yuv420p(progressive), 1280x720, 25 fps, 25 tbr, 1200k tbn, 50 tbc
nan M-V: nan fd= 0 aq= 0KB vq= 0KB sq= 0B f=0/0

I try connecting to ispy but the lack of a proper HTTP reply seems to stop me. VLC wont work as mentioned above and FFMPEG seems to have the same issue. Its not expecting a raw stream so everything falls over at the connection stage.

Does anyone have any ideas on how to get it working?

Kelpi
Posts: 3
Joined: Tue Jan 09, 2018 5:46 am

Re: Connecting to a livestream.cgi raw h264 stream.

Postby Kelpi » Sat Jan 13, 2018 1:33 am

Replying to my own post.

If you are desperate to get it working you can use ffmpeg to re-encode the stream at the command prompt using:

ffmpeg -i "http://192.168.1.116:41111/livestream.cgi?user=admin&pwd=PASSWORD&streamid=0&audio=0&filename=" -preset ultrafast -vcodec libx264 -tune zerolatency -b 900k -f mpegts udp://127.0.0.1:1234

Then you can connect to "udp://127.0.0.1:1234" under the FFMPEG tab of the IP camera connection window. I'd prefer not to do the double handling though but it might be the only way.


Return to “Connecting Cameras”

Who is online

Users browsing this forum: No registered users and 1 guest