Freeseer / freeseer

Designed for capturing presentations at conferences. Pre-fill a list of talks to record, record them, and upload them to YouTube with our YouTube Uploader.
http://freeseer.readthedocs.org
GNU General Public License v3.0
215 stars 110 forks source link

Desktop Audio Capture Plug-in for Windows #633

Closed Cryspia closed 9 years ago

Cryspia commented 9 years ago

The audio capture plug-in for Windows can only capture the autoaudio sound or the test sound. It does not have desktop source audio capture for WIndows.

Since there is already desktop video capture for WIndows, it is better to have also the audio capture to finish the whole desktop capture environment.

Cryspia commented 9 years ago

I have searched many materials on the net, but cannot find useful gstreamer plugin for windows. I tried openalsrc, osssrc, but find them do not really support Windows. WIndows has a sound card capture plugin called directsoundsrc. However, I can not find any document of that plugin in the official site or Google. I tried to load that plugin and add the configs, but it seems that this plugin does not really have the config settings, since there will be an error log tells that

AttributeError: '__main__.GstDirectSoundSrc' object has no attribute 'probe_property_name'

By using it with default settings, I can only capture the microphone, which is meaningless since that function is the same as the autoaudiosrc plugin.

Does anyone have some advice of the plugin to use? Or should I give up the plan to add this function?

In addition: There is a plugin called osxaudiosrc can be used to capture the sound card for Mac OS. But since I do not have a Mac, so I have no way to test it.

Cryspia commented 9 years ago

OK. I found that Windows is actually able to capture the desktop sound. Use the system record setting to enable the Stereo Mix and set it default, and then it is able to record directly via autoaudiosrc. However, by doing that, the user can no more capture both the microphone and the stereo at the same time in Multiple Audio Input, so I still consider a new solution is needed. I found a usable plugin called dshowaudiosrc. I allows the user to choose a source to record (similar to pulsesrc but under Windows). Presently, there are some bugs and I cannot really capture the audios. But I am looking at it and hopefully it will be solved soon.

Cryspia commented 9 years ago

Unfortunately, it could be unsolvable. It can be a bug of the plug-in its own. I found someone else has this problem from Google. And it is said that the plugin has not been tested for Windows 7 or 8. It may work on Windows XP but it is meaningless. I am not sure whether I can find other plugins.

Cryspia commented 9 years ago

http://permalink.gmane.org/gmane.comp.video.gstreamer.devel/36842

zxiiro commented 9 years ago

Pretty much all the Windows GStreamer plugins are pretty poorly documented so yes that sucks :(

However you might be able to find more documentation via gst-inspect command [1]. It's a command that queries a GStreamer plugins installed on your computer and prints out the various variables the plugin supports, occasionally it'll have more details than any documentation you find. Hope this helps.

[1] http://docs.gstreamer.com/display/GstSDK/gst-inspect

Cryspia commented 9 years ago

@zxiiro The dshowaudiosrc plugin is really strange. I think the problem happens here: When I use

audiosrc.set_property('device-name', self.config.source)

Although self.config.source is not None, the value of

audiosrc.get_property('device-name')

will still be None after the assignment.

There should be nothing wrong with the property name 'device-name' because I can correctly get the devices from that: default

It does not feel like a plugin bug. Any ideas of that is wrong with this?

(PS. Generally I just copy your pulsesrc plugin files for this test, just replace 'pulsesrc' to 'dshowaudiosrc', 'device' to 'device-name', and change the os to win32.)

zxiiro commented 9 years ago

Where is your code to look at?

according to pulsesrc getting the property "device-name" didn't work for pulsesrc so maybe similar issue here. It's also possible setting the property for device-name might be expecting a different input format. Have you tried contacting the GStreamer devs to see what they can tell you?

There should be a mailing list as well as #gstreamer on freenode.

Cryspia commented 9 years ago

It is in my test branch so I do not push it onto github. I have tried "device" in that plugin but neither it can work. It cannot even give out the device choices. There is an email address in the document page, but I just wonder whether it is OK to disturb the devs.

zxiiro commented 9 years ago

Of course it is, that's the purpose of their contact email. Don't hesitate to ask them questions if you need help.

Edit: You might also want to join the gstreamer-devel mailing list and ask your question there too.

Cryspia commented 9 years ago

Here is the simplified code of the problem. I have sent it to the plugin dev

import pygst
pygst.require("0.10")
import gst

audiosrc = gst.element_factory_make("dshowaudiosrc", "audiosrc")
source = 'Microphone (Realtek High Definition Audio)'

audiosrc.set_property('device-name', source)
# Get a None as output. Which is invalid.
print 'device-name: %s' % audiosrc.get_property('device-name')
zxiiro commented 9 years ago

Something I learned last week at a Python meetup.

You should avoid using

'string %s' % variable
and instead use
'string %s', variable
the reason is the modulus % is processed regardless of if the code makes it into the block (such as an if statement) or not and the other way using "," only gets processed if the code actually makes it into the block.

Doesn't matter in your simple code example but it's something to keep in mind as it does affect performance if you use the code in more complex situations.

Cryspia commented 9 years ago

Thanks for your tips!

Cryspia commented 9 years ago

I still get no response from neither the plugin-dev nor the gstreamer mailling list. This issue is closed.