Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage
Register FAQ Calendar Today's Posts Search

Reply
 
Thread Tools Search this Thread Display Modes
Old 21st September 2009, 19:44   #1  |  Link
jjones3535a
Registered User
 
Join Date: Apr 2008
Posts: 18
Camera as source

Hi,

Is it possible to write a script that uses a live camera (attached webcam for example) as a video source?

Thanks.
jjones3535a is offline   Reply With Quote
Old 21st September 2009, 20:06   #2  |  Link
thewebchat
Advanced Blogging
 
Join Date: May 2009
Posts: 480
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.
thewebchat is offline   Reply With Quote
Old 21st September 2009, 20:30   #3  |  Link
jjones3535a
Registered User
 
Join Date: Apr 2008
Posts: 18
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.
jjones3535a is offline   Reply With Quote
Old 21st September 2009, 23:14   #4  |  Link
jmartinr
Registered User
 
jmartinr's Avatar
 
Join Date: Dec 2007
Location: Enschede, NL
Posts: 301
You can make a graph, and use ffdshow with its (avisynth-)filtering. See pictures on http://www.roelofs-coaching.nl/index...ideo&Itemid=10 for some possibilities. You can use zoomplayer to play them.
jmartinr is offline   Reply With Quote
Old 22nd September 2009, 00:45   #5  |  Link
jjones3535a
Registered User
 
Join Date: Apr 2008
Posts: 18
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.
jjones3535a is offline   Reply With Quote
Old 22nd September 2009, 02:45   #6  |  Link
Sagekilla
x264aholic
 
Join Date: Jul 2007
Location: New York
Posts: 1,752
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.
__________________
You can't call your encoding speed slow until you start measuring in seconds per frame.
Sagekilla is offline   Reply With Quote
Old 22nd September 2009, 11:09   #7  |  Link
jmartinr
Registered User
 
jmartinr's Avatar
 
Join Date: Dec 2007
Location: Enschede, NL
Posts: 301
Quote:
Originally Posted by jjones3535a View Post
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.
jmartinr is offline   Reply With Quote
Old 25th April 2010, 06:22   #8  |  Link
NerdWithNoLife
Registered User
 
NerdWithNoLife's Avatar
 
Join Date: Jul 2007
Posts: 157
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.

Then delete the last thing in the chain - the renderer:

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."
__________________
f=33
NerdWithNoLife is offline   Reply With Quote
Old 25th April 2010, 09:38   #9  |  Link
jmartinr
Registered User
 
jmartinr's Avatar
 
Join Date: Dec 2007
Location: Enschede, NL
Posts: 301
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.
__________________
Roelofs Coaching
jmartinr is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 15:21.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.