简体   繁体   中英

How to capture video with audio from webcam in Processing

I'm trying to capture video with audio from a webcam using Processing. I'm able to capture video using Processing's video library but there's no way of capturing audio along the video with that library. There is a separate library for working with audio (the minim library) but I don't know how to merge together audio and video.

I need it to be with processing because is pretty much the only programming language I know. Now, Processing is really Java so I think there should be possible to use the Java Media Framework but I don't really know where to start to use the JMF along with Processing.

Anyone can give me some guidance on how to capture audio and video in Processing/Java?

Edit
What I'm trying to do can be done using the GSVideo library. GSPipeline is the way to go, I found this post on processing's forum with more details.

Just import the minim library into Processing (if you don't already have it installed) and you will have the audio extensions in the Processing directly. You can then use the AudioInput class with AudioSource class (this is better than AudioStream) to record the audio along with the video capture.

You should be able to find an interesting discussion on merging audio/video here: Processing Discourse: Minim . There is a comparison of Minim vs. ESS and a number of interesting opinions on how to go about doing it.

I am on ubuntu, and how I was able to do this was to actually just record a screencast, using gtk-recordmydesktop. Now the snag: the JDK I was using does not use ALSA, so effectively disabling to use PulseAudio to redirect the output sound back to input.

But, if you export the sketch to an applet, and run the applet in a browser, the java-container does use ALSA, so you can just record the sound with the video.

Hope this helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM