I have two web cameras and I want to merge their streams into a single live streaming preview and display it to the screen.
I am skilled in C#/Java programming, could you p开发者_如何学运维lease help me to find a framework that helps me to achieve this ?
Thanks,
If you are aiming only at visualizing the two videos side by side, I would recommend taking a look at DirectShow.Net and GMFBridge toolkit.
Quote from GMFBridge site about the sample project GMFPlay
included in the package:
GMFBridge: GMFPlay shows how to view multiple clips as a single movie
If you want to "merge" both streams (as drawing one on top of the other with some transparency level), then you could try this codeproject sample (for visualization only, also using DirectShow).
If you actually want to produce a new video stream and not only visualize, you could again use DirectShow combined with a mixing filter, Medialooks-Video-Mixer for example looks promissing.
You can combine two cameras, send the stream to a server (like SRS) and use ffplay to display this in real-time.
.\ffmpeg.exe -f dshow -i video="LRCP USB2.0" -i .\right.avi -filter_complex "nullsrc=size=1280x1440 [base];[0:v] setpts=PTS-STARTPTS,scale=1280x720 [upper];[1:v] setpts=PTS-STARTPTS,scale=1280x720 [lower];[base][upper] overlay=shortest=1 [temp1];[temp1][lower] overlay=shortest=1:y=720" -c:v libx264 -preset:v ultrafast -tune:v zerolatency -f flv rtmp://192.168.1.136:1935/live/stream
You can watch the combined video in real-time like in this image example.
Let me know if still not clear.
Checkout this link: https://codedump.io/share/fbX1tYFjPhdw/1/merging-two-web-cameras-streaming-into-a-single-live-streaming---programmatically
http://www.codeproject.com/KB/directx/DirectShowVMR9.aspx
Quote from GMFBridge site about the sample project GMFPlay included in the package:
GMFBridge: GMFPlay shows how to view multiple clips as a single movie If you want to "merge" both streams (as drawing one on top of the other with some transparency level), then you could try this codeproject sample (for visualization only, also using DirectShow).
If you actually want to produce a new video stream and not only visualize, you could again use DirectShow combined with a mixing filter, Medialooks-Video-Mixer for example looks promising.
精彩评论