View Full Version : Camera as source
jjones3535a
21st September 2009, 19:44
Hi,
Is it possible to write a script that uses a live camera (attached webcam for example) as a video source?
Thanks.
thewebchat
21st September 2009, 20:06
AviSynth requires knowledge of the exact length of a stream, and most editing operations require random access as well. If by "live source," you mean the analog output on some cheap cameras, I don't think this will work the way you want it to. You should first capture the camera to DV or some other fixed format before using AviSynth.
jjones3535a
21st September 2009, 20:30
Yes, I am referring to output of a camera attached to the PC, such as a web cam connected via USB or a DV device connected via Firewire.
I was hoping there was a way to do something like: DirectShowSouce("Logitech Webcam Pro 9000") and feed that into Avisynth.
I was hoping I could use Avisynth features (transitions, effects, etc.) as I'm capturing video from the attached device.
jmartinr
21st September 2009, 23:14
You can make a graph, and use ffdshow with its (avisynth-)filtering. See pictures on http://www.roelofs-coaching.nl/index.php?option=com_content&view=article&id=19:trainingsvideos-met-eigen-commentaar&catid=2:video&Itemid=10 for some possibilities. You can use zoomplayer to play them.
jjones3535a
22nd September 2009, 00:45
Thanks for the response. Can graph files be generated without a GUI? I'm looking for a method to capture Live Video with Avisynth in an automated way - as the video capture device could vary from system to system. Any other thoughts?
Thanks.
Sagekilla
22nd September 2009, 02:45
Capture to a file then do your processing in avisynth afterwards.
If you try to do real time capture and filtering, it would be extremely likely that frame drops would occur.
jmartinr
22nd September 2009, 11:09
Thanks for the response. Can graph files be generated without a GUI? I'm looking for a method to capture Live Video with Avisynth in an automated way - as the video capture device could vary from system to system. Any other thoughts?
Thanks.
I wouldn't now how to do that without some programming. VLC has some possibilities too to have a cam as input. Might be more straightforward for what you want.
If you find a solution, please post it here. I would be interested.
NerdWithNoLife
25th April 2010, 06:22
After making some progress here, this thread seemed like a good place for posting this solution. Why would anyone want a live source in AviSynth? To use an interlaced DV camcorder, and get some halfway decent deinterlacing for live web streaming. This method can even trick DScaler into seeing your capture card or camera.
First, open graphedit and click Insert Filters (Ctrl+F). You'll want the device you'll use to be up and running, connected to the PC while you do this. Under WDM Streaming Capture Devices, select the device you want AviSynth to see. Next, you need a video pin from which DirectShow can connect. An easy way is to right click on the video pin of your device, and click Render Pin.
http://img97.imageshack.us/img97/4885/renderpin.png (http://img97.imageshack.us/i/renderpin.png/)
Then delete the last thing in the chain - the renderer:
http://img7.imageshack.us/img7/5240/deleterenderer.png (http://img7.imageshack.us/i/deleterenderer.png/)
Now save the GRF file. In your script, just put: DirectShowSource("YourGraph.grf",audio=false,framecount=215784) #or some other big amount of frames. Note the audio=false, since audio and video cannot be done at the same time. This will be a video only script.
Now you should be able to open the AVS with other software and see the live input. If all went well, you should be able to resize or deinterlace via the script (without getting too CPU intensive, of course). DScaler was also able to see it as a "file."
jmartinr
25th April 2010, 09:38
If you try my previuous posted solution with Zoomplayer you can have the audio too (in the grahp itself you can save your processed video). I use an old version of Zoomplayer. No idea if it works with a new version.
This discussion looks a bit like an old one here: http://forum.doom9.org/showthread.php?t=64461. The problem is similar. You want to read a stream.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.