Opened 6 years ago
Last modified 16 months ago
#1231 assigned task
win32 and osx webcam capture
Reported by: | Antoine Martin | Owned by: | Antoine Martin |
---|---|---|---|
Priority: | major | Milestone: | 4.2 |
Component: | encodings | Version: | trunk |
Keywords: | webcam | Cc: |
Description (last modified by )
Attachments (3)
Change History (16)
comment:1 Changed 6 years ago by
Description: | modified (diff) |
---|---|
Status: | new → assigned |
comment:7 Changed 4 years ago by
Milestone: | 1.0 → 2.3 |
---|
comment:8 Changed 4 years ago by
The macos capture script above is based on How can I capture iSight frames with Python in Snow Leopard?. It works.. just not on my dev VM (light comes on, but frames never arrive), so I have to ssh to the mac mini to test it.
Still TODO:
- clean it up and add it to "darwin" webcam module
- implement device enumeration
- improve memory management so we can compress in another thread and release the buffer after we're done
- port to AVFoundation (ie: AVCaptureDevice) since all the documentation for
QTKit
is now 404 (dead links everywhere - thanks apple!): Transitioning QTKit Code to AV Foundation
Note: the py2app packaging for QTKit
involved using packages and not modules? (IIRC)
For win32:
See also #1627
comment:9 Changed 4 years ago by
Description: | modified (diff) |
---|---|
Summary: | ffmpeg webcam capture codec → win32 and osx webcam capture |
Changed 4 years ago by
Attachment: | opencv.patch added |
---|
PKGBUILD patch to limit the number of opencv modules we build with makepkg
comment:10 Changed 4 years ago by
The patch above removes all the dependencies we don't need from the opencv MSYS2 package build, saving around 80MB of disk space.
The savings for our installer package are much smaller (~5MB) because we already trimmed it quite a bit and the file is compressed.
This should make things less brittle too: the opencv package seems to break very regularly in MSYS2 due to the huge amount of dependencies it has and because of the way the module loads them all - they would need to rebuild the package every time a dependency is updated.
Only problem is that the 32-bit version crashes hard, even the simple opencv_version.exe
tool does... so r18290 disables webcam support in 32-bit builds.
comment:11 Changed 4 years ago by
We now build AVFoundation
(r18246, also for python3: r18296 + r18297), and we have a nasty py2app packaging workaround too: r18298.
The webcam port to AVFoundation
above might work, but we're blocked by this pyobjc bug: Support marshalling OS_dispatch_queue on macOS 10.10 and 10.11
I'm not sure if this can be worked around using ctypes either.
Once that's fixed, we'll need to to parse the sampleBuffer
object using:
from Quartz import CoreVideo
then:
comment:13 Changed 4 years ago by
Milestone: | 2.3 → 3.1 |
---|
comment:15 Changed 2 years ago by
Milestone: | 4.0 → 4.1 |
---|
comment:16 Changed 2 years ago by
pyobjc has moved to github: https://github.com/ronaldoussoren/pyobjc/.
But this particular issue was not, it's been wiped like it never existed!
comment:17 Changed 20 months ago by
Milestone: | 4.1 → 4.2 |
---|
comment:18 Changed 16 months ago by
this ticket has been moved to: https://github.com/Xpra-org/xpra/issues/1231
Hopefully we can use the same code for enumerating video devices on osx. (see ticket:1113#comment:4)
The same code can probably be used to capture the whole desktop on win32: DirectShow and may help with #389.