microsoft / FFmpegInterop

This is a code sample to make it easier to use FFmpeg in Windows applications.
Apache License 2.0
1.27k stars 308 forks source link

RTSP Ip Camera Stream #93

Open mscott161 opened 7 years ago

mscott161 commented 7 years ago

I have tried the samples, but I get no video. The ip camera is sending h.264. It is a live stream, I have tested it with vlc and a standalone rtsp viewer. the uri is rtsp://192.168.2.220:80/ I see the network pulling in data, but the mediaelement is not showing the video. My code is

PropertySet options = new PropertySet(); options.add("rtsp_flags", "prefer_tcp");

FFmpegMSS = FFmpegInteropMSS.CreateFFmpegInteropMSSFromUri(uri, false, false, options); MediaStreamSource mss = FFmpegMSS.GetMediaStreamSource(); mediaElement.SetMediaStreamSource(mss);

The code does not throw an exception. Any help would be appreciated.

MarekJavurek commented 7 years ago

Hi, same problem here... I am trying play RTSP h264 stream from my IP cam. Program just frezes without exception. Branch: helmut-steiner-ffmpeg3.1 Platform: x86

But the problem is not only about RTSP, this code:

FFmpegMSS = FFmpegInteropMSS.CreateFFmpegInteropMSSFromUri("http://www.w3schools.com/html/mov_bbb.mp4", false, false);
mss = FFmpegMSS.GetMediaStreamSource();
mPlayer.SetMediaStreamSource(mss);
mPlayer.Play();

ends with:

An exception of type 'System.Runtime.InteropServices.COMException' occurred in rasp-test.exe but was not handled in user code
WinRT information: Třída není zaregistrována

(translation of "Třída není zaregistrována": Class not registered) on line: FFmpegMSS = FFmpegInteropMSS.CreateFFmpegInteropMSSFromUri("http://www.w3schools.com/html/mov_bbb.mp4", false, false);

PS: project "FFmpegInterop" is added in references and all 7 dlls are added into my project: image

mscott161 commented 7 years ago

Have you tried using just the mediaelement in XAML to play the movie. I have not had a problem playing a static movie mp4 h264 without using ffmpeginterop.

MarekJavurek commented 7 years ago

Yes, its working. But my main goal is to stream RTSP.

mscott161 commented 7 years ago

You will need to use a RTSP stream server like Wowza to stream it on the RTSP protocol.

khouzam commented 7 years ago

Hi @peane

I noticed that you're adding the IOT extensions, are you running this on desktop or on an IOT device?

MarekJavurek commented 7 years ago

Hi @khouzam

My goal is to run this on Raspberry PI Windows IOT (RTSP stream viewer), but now I try to build on x86 (desktop). PS: Is it necessary to register ffmpeg dlls via regsvr32.exe?

dmandreev commented 7 years ago

Same repro on x64. Any resolution for this?

mscott161 commented 7 years ago

@peane I too am trying to view a RTSP Live stream that is flv with h.264 to a Windows IOT device, I have had no luck, it compiles but no video is displayed.

dmandreev commented 7 years ago

I can successfully play example stream from rtsp://184.72.239.149/vod/mp4:BigBuckBunny_115k.mov but have no idea why rtsp from ip camera doesn't work. ffmpeg code little bit messy, trying to debug. Hanlg is at ret = ff_poll_interrupt(&p, 1, timeout, &h->interrupt_callback); and this code have no difference between winrt/desktop build.

chiecla commented 7 years ago

@mscott161 could you upload your RTSP Ip Camera Stream Project to github for everyone. I am doing it too and got many problem thanks so much :D

mscott161 commented 7 years ago

@chiecla I have not had the rtsp ip camera stream to play with the ffmpeg or XAML window only over http for mp4.

anhthoai commented 5 years ago

@chiecla I have C# RTSP stream app using ffmpeg, it works very fast and light. It can play all rtsp cameras

nlambuca commented 5 years ago

@chiecla I have C# RTSP stream app using ffmpeg, it works very fast and light. It can play all rtsp cameras

Hi, could you help with some sample code for this? I am working on building my own NVR for my RTSP cameras...

Thanks