Re: [mistserver] Possible to stream from h264 IP camera?

3,310 views
Skip to first unread message

Jaron Vietor

unread,
Jan 15, 2013, 6:40:58 PM1/15/13
to mists...@googlegroups.com
On Tue, Jan 15, 2013 at 5:12 AM, <acco...@vt.edu> wrote:
I'm hoping to use Mistserver for a project I'm working on, and I'm hoping someone can tell me whether this scenario is possible, and hopefully even give me some pointers.
 
I'd like to be able to access a set of video streams via a custom website. To accomplish this, I'd like to use one central server with each video stream originating from various webcams connected to the internet which produce h264-encoded video. My thought is that by creating a stream in Mistserver with the URL of one of these webcams as the source then I will be able to embed this (Mistserver) stream into my website. My goal here is to limit the amount of bandwidth to the cameras and instead route all hits to the stream straight to the server.
 
I know I could accomplish this fairly easily using flash and sending a stream from a webcam to the server using that, but I'd like to avoid the use of flash as well as the need to connect each camera to its own computer.
 
Any help on whether this is even possible with Mistserver would be greatly appreciated.
 
-Alex

--
 
 

Hello Alex,

This is indeed one of the intended uses for Mistserver.
The exact setup depends on what type of output the cameras can produce. Could you share a little more as to what filetypes they are able to serve in the way you're describing?

Regards,
Jaron Viëtor



acco...@vt.edu

unread,
Jan 15, 2013, 10:23:36 PM1/15/13
to mists...@googlegroups.com
From what I can tell, it appears that the camera will only produce an mjpeg encoded video stream. After initial configuration, browsing to the camera's IP with a specified port brings up a web interface that displays the video and allows a user to control the camera (pan/tilt/etc.). The camera in question is the foscam FI8910W, but I'm by no means locked into that if you know of a better option.

Jaron Viëtor

unread,
Jan 27, 2013, 5:52:49 PM1/27/13
to mists...@googlegroups.com
Ah, I know the type of camera you're talking about.
The easiest way to re-stream that type, would be to use the MJPEG stream as in input to ffmpeg, then piping it through to the server. Something like this:

ffmpeg -i URL_TO_MJPEG_STREAM_HERE -vcodec libx264 -preset veryfast -profile:v baseline -level 30 -b BITRATE_HERE -f flv - | MistFLV2DTSC | MistBuffer STREAM_NAME_HERE

Then, you should be able to request the STREAM_NAME_HERE-named stream through all relevant protocols. Do *not* add the stream in the controller through the webinterface, by the way - it will automatically work once you start it like this.

Note that we've never tested internally running streams without audio through the server... You may have to add an silent audio track (ffmpeg can do this, too) if it doesn't work, but in theory it should work just fine without one. Try it and let us know how it goes! :-)

Regards,
Jaron Viëtor

PS: Sorry for the slow reply, for some reason my e-mail client never showed me this message and I spotted it through another interface today.... weird.

owo...@indamail.hu

unread,
Feb 9, 2013, 12:10:58 PM2/9/13
to mists...@googlegroups.com
Hello,

I have a similiar problem. I would like to stream using the MIST/SERVER a video from an Avigilon HD camera.

The camera produces an RTSP stream with H.264 codec.

I would like the MIST/SERVER to stream this video which I can include in a webpage with Video.js.

Thank you for your help,
János

Jaron Vietor

unread,
Feb 13, 2013, 7:27:35 PM2/13/13
to mists...@googlegroups.com
Hello János,

The same technique should apply, except instead of the mjpeg stream, use the RTSP stream.
For embedding in a webpage, the local settings page (by default found by connecting to port 4242 of the server in your browser) is able to generate a generic javascript include that should do the trick.

Regards,
Jaron Viëtor

--
You received this message because you are subscribed to the Google Groups "Mistserver.org" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mistserver+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Message has been deleted
Message has been deleted

owo...@indamail.hu

unread,
Feb 18, 2013, 12:50:20 PM2/18/13
to mists...@googlegroups.com
Hello Jaron!

Thanks for your help.

I tried it with the following command:
ffmpeg -i rtsp://admin:admin@IP_ADDRESS/defaultPrimary?streamType=u -vcodec libx264 -preset veryfast -profile:v baseline -level 30 -b 800 -f flv - | MistFLV2DTSC | MistBuffer Home

But I get get the following error: rtsp://admin:admin@IP_ADDRESS/defaultPrimary?streamType=u: I/O error occurred
Usually that means that input file is truncated and/or corrupted.

Should I use openRTSP before ffmpeg?

Also on the Protocols page on Mistserver Manager which HTTP protocol should I add to use Video.js? HTTPLIVE?

Thank you for your help,
János

Jaron Vietor

unread,
Feb 19, 2013, 11:51:13 AM2/19/13
to mists...@googlegroups.com
Hello János,

Try the latest development release - earlier today we fixed several live input bugs, and it should work much better (especially when using RTMP push - but that's not relevant in your case).
Here's some links to today's build:

Using openrtsp to provide input to ffmpeg might help you also, yes. It depends very much on what version of ffmpeg you're running whether or not RTSP compatibility is good, so definitely worth a try.

As for using MistServer with Video.js - I'd advice turning on HTTP Progressive and HTTP Live for best compatibility right now (plain MP4 support is planned but not supported yet - FLV should provide a good alternative until then). Note that HTTP Live (and HTTP Smooth, as well) doesn't support live input yet in the latest releases (ironically), only VoD. Live support for those two protocols should follow later this week. All other protocols do support live input - even the protocols that normally wouldn't like HTTP Progressive.

Regards,
Jaron Viëtor
Message has been deleted

Alex Corvin

unread,
Apr 8, 2013, 9:44:20 PM4/8/13
to mists...@googlegroups.com
Hi Jaron, sorry I haven't posted an update sooner. I've gotten a stream running using roughly the command you gave me. Specifically, here's the set of commands I used:
 
sudo ffmpeg -b:v 32k -f mjpeg -i http://USERNAME:PASSWORD@SERVER:PORT/video.cgi -vcodec libx264 -r 1 -b:v 32k -f flv - | /PATH/TO/MistFLV2DTSC | /PATH/TO/MistBuffer STREAMNAME
 
However, now I am having issues displaying the stream in a webpage. I would like to use the stream as a source for an HTML5 video tag. Is this possible using any of the mist tools? I have been trying to get something to work using the MPEG TS connector, but have been unsuccessful and haven't found any helpful documentation. Any help you can give me would be greatly appreciated.
 
Thanks!
-Alex

Jaron Vietor

unread,
Apr 9, 2013, 5:04:25 AM4/9/13
to mists...@googlegroups.com
Hello Alex,

We currently support two types of HTML5 tags - smooth streaming (Windows 8 and windows mobile only) and HLS (apple products only).
Support for more HTML5 types (MP4 will most likely be the first) is planned for a future release.

The integrated embed code ( http://SERVER:PORT/embed_STREAMNAME.js ) will automatically detect what is available and attempt to use the best supported protocol/HTML tag combination - simply include it as a script where you want the video to display on a webpage. If you want to tweak it or make your own embeds, http://SERVER:PORT/info_STREAMNAME.js can be used to provide all the information you may need to do so.

Regards,
Jaron



--

bhl...@gmail.com

unread,
Apr 9, 2013, 7:09:36 PM4/9/13
to mists...@googlegroups.com
Hi Jaron,

I just found MistServer and I'm excited to try it with my H.264 PTZ cameras.

I too am uncertain how to get an rtsp stream configured.

You should be able to see the rtsp feed in VLC using my rtsp URL and the Codec is : H264 - MPEG-4 AVC (part 10) (h264) (no audio)
rtsp://viewer:vie...@bhlowe.dyndns.org:5561/live2.sdp (this password is correct for a few days)

I created a command line to use ffmpeg to ingest the video feed, but I don't know exactly where to put the command line. Running it doesn't exit with any errors.
file:  /home/ec2-user/mistserver/bin/test.sh
contents:
/home/ec2-user/ffmpeg/ffmpeg -i rtsp://viewer:vie...@bhlowe.dyndns.org:5561/live2.sdp -vcodec libx264 -profile:v baseline -level 30 -b 512 -f flv - | /home/ec2-user/mistserver/bin/MistFLV2DTSC | /home/ec2-user/mistserver/bin/MistBuffer camera

Protocols are set:
RTMPActiveinterface: default, port: default, username: default
HTTPActiveinterface: default, port: 8010, username: default
HTTPSmoothActiveusername: default

Streams:

Recorded
 camera No (valid) source connected 0
source is /home/ec2-user/mistserver/bin/test.sh

Server is up on an EC2 instance at: http://54.225.99.24:4242


When I get done testing, I'll post a followup before I delete the above URL's.


- Brad

Jaron Vietor

unread,
Apr 9, 2013, 7:17:53 PM4/9/13
to mists...@googlegroups.com
Hello Brad,

It's much easier to use the RTMP ingest to get your stream into the server:
Set up a new stream with source "push://IP-ADDRESS-HERE" (use the address of the machine that runs ffmpeg), and then use the following command instead:
/home/ec2-user/ffmpeg/ffmpeg -i rtsp://viewer:vie...@bhlowe.dyndns.org:5561/live2.sdp -vcodec libx264 -profile:v baseline -level 30 -b 512 -f flv rtmp://SERVER-ADDRESS-HERE:1935/play/STREAMNAME-HERE

(Replace all the values I put in caps with the real values you used, of course - and change 1935 if you ever use a different RTMP port than the default.)

The stream you created should now show up as "Available" in the settings page and be streamable over all the protocols you've enabled, as well as supply info and embed javascripts over HTTP (see documentation for the HTTP connector in the wiki for more details on that).

Regards,
Jaron




Kmax

unread,
Jul 25, 2013, 3:27:28 PM7/25/13
to mists...@googlegroups.com
Were any of you able to get rtsp video from an IP camera to a web page?
I have mistsserver installed and running... and I just downloaded the static binaries for ffmpeg for windows.

Can you point me to a tutorial or something?
I have no idea where to begin.

Thanks

Cody Christian

unread,
Nov 9, 2013, 8:54:18 PM11/9/13
to mists...@googlegroups.com
Hey,

I've followed this topic and I'm using the following command to pass a foscam/wanscam camera into mist.

command: ffmpeg -b:v 32k -f mjpeg -i http://user:pa...@192.168.0.108/videostream.cgi -vcodec libx264 -r 1 -b:v 32k -f flv - | /usr/local/bin/mist/MistFLV2DTSC | /usr/local/bin/mist/MistBuffer webcam

However I cannot see the stream in mist or play it back in anyway. I also can't load up the embed/info urls for the stream.

Ideas?

Jaron Vietor

unread,
Nov 11, 2013, 9:38:15 AM11/11/13
to mists...@googlegroups.com
Hello Cody,

Before you run that command, make sure to add the stream as a live stream in the controller, too.
The settings don't matter - running the command will override any settings you may have entered.

That way, the stream will show up properly in all relevant places.

Regards,
Jaron Viëtor




Reply all
Reply to author
Forward
0 new messages