I have installed Gstreamer via homebrew on my mac. I want to stream the mac's internal camera's footage, however when I run
gst-device-monitor-1.0 I keep getting Probing devices... Failed to start device monitor!
I also tried running the same command with GST_DEBUG=2 and then I get
WARN devicemonitor gstdevicemonitor.c:501:gst_device_monitor_start:<devicemonitor0> No filters have been set, will expose all devices found
0:00:00.002759000 24294 0x7ffc5151c190 WARN devicemonitor gstdevicemonitor.c:507:gst_device_monitor_start:<devicemonitor0> No providers match the current filters
The version I'm running is
gst-device-monitor-1.0 version 1.20.0
GStreamer 1.20.0
How do I get this to work? I have checked the mac settings and I don't see anything that'd block this. How do I make gstreamer see my mac's internal camera?
export GST_PLUGIN_PATH=/opt/homebrew/lib/gstreamer-1.0/
Setting this works for me.
I have the same problem on my Mac (M1, macOS Monterey). It is issue of gst-device-monitor-1.0. According to its source code it cannot find any corresponding device providers:
if (monitor->priv->filters->len == 0) {
GST_WARNING_OBJECT (monitor, "No filters have been set, will expose all "
"devices found");
gst_device_monitor_add_filter_unlocked (monitor, NULL, NULL);
}
if (monitor->priv->providers->len == 0) {
GST_OBJECT_UNLOCK (monitor);
GST_WARNING_OBJECT (monitor, "No providers match the current filters");
return FALSE;
}
The problem appeared a year ago and has not yet been resolved:
https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/issues/780
https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/667
Still gstreamer itself can access video (including mac's internal camera) and audio sources on macOS just fine.
Video:
gst-launch-1.0 avfvideosrc device-index=0 ! video/x-raw, framerate=30/1, width=1280, height=720 ! queue ! autovideosink
Audio:
gst-launch-1.0 -v osxaudiosrc device=0 ! audio/x-raw ! queue ! autoaudiosink
Note: avfvideosrc is part of gst-plugins-bad, osxaudiosrc - part of gst-plugins-good
Related
I am trying to create my own system for Raspberry Pi4 using Buildroot.
Target is to make custom OS with Xorg, Qt5 and OpenGLESv2 HW rendering. I create my custom Buildroot configuration, nothing specific yet. Very similar to default raspberry pi4 buildroot config but enabled Xorg/Mesa/OpenGLES. My config is that:
BR2_arm=y
BR2_cortex_a72=y
BR2_ARM_FPU_NEON_VFPV4=y
BR2_CCACHE=y
BR2_CCACHE_DIR="$(BR2_EXTERNAL_I_TREE_PATH)/../.buildroot-ccache"
BR2_TOOLCHAIN_BUILDROOT_GLIBC=y
BR2_TOOLCHAIN_BUILDROOT_CXX=y
BR2_TARGET_GENERIC_HOSTNAME="MyHost"
BR2_TARGET_GENERIC_ISSUE="Welcome to MyHost"
BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_EUDEV=y
BR2_TARGET_GENERIC_ROOT_PASSWD="4rt56gbd"
BR2_SYSTEM_DHCP="eth0"
BR2_ROOTFS_USERS_TABLES="$(BR2_EXTERNAL_I_TREE_PATH)/board/rpi4/users.txt"
BR2_ROOTFS_OVERLAY="$(BR2_EXTERNAL_I_TREE_PATH)/rootfs_overlay/"
BR2_ROOTFS_POST_BUILD_SCRIPT="$(BR2_EXTERNAL_I_TREE_PATH)/board/rpi4/post-build.sh"
BR2_ROOTFS_POST_IMAGE_SCRIPT="$(BR2_EXTERNAL_I_TREE_PATH)/board/rpi4/post-image.sh"
BR2_ROOTFS_POST_SCRIPT_ARGS="--add-miniuart-bt-overlay"
BR2_LINUX_KERNEL=y
BR2_LINUX_KERNEL_CUSTOM_TARBALL=y
BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="$(call github,raspberrypi,linux,967d45b29ca2902f031b867809d72e3b3d623e7a)/linux-967d45b29ca2902f031b867809d72e3b3d623e7a.tar.gz"
BR2_LINUX_KERNEL_DEFCONFIG="bcm2711"
BR2_LINUX_KERNEL_DTS_SUPPORT=y
BR2_LINUX_KERNEL_INTREE_DTS_NAME="bcm2711-rpi-4-b"
BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y
BR2_PACKAGE_GLMARK2=y
BR2_PACKAGE_MESA3D_DEMOS=y
BR2_PACKAGE_MESA3D=y
BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_KMSRO=y
BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_V3D=y
BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_VC4=y
BR2_PACKAGE_MESA3D_OPENGL_GLX=y
BR2_PACKAGE_MESA3D_OPENGL_ES=y
BR2_PACKAGE_XORG7=y
BR2_PACKAGE_XSERVER_XORG_SERVER=y
BR2_PACKAGE_XCB_UTIL_CURSOR=y
BR2_PACKAGE_XCB_UTIL_KEYSYMS=y
BR2_PACKAGE_XCB_UTIL_WM=y
BR2_PACKAGE_XLIB_LIBFS=y
BR2_PACKAGE_XLIB_LIBXSCRNSAVER=y
BR2_PACKAGE_XLIB_LIBXCOMPOSITE=y
BR2_PACKAGE_XLIB_LIBXFONT=y
BR2_PACKAGE_XLIB_LIBXTST=y
BR2_PACKAGE_XLIB_LIBXVMC=y
BR2_PACKAGE_XLIB_LIBXXF86DGA=y
BR2_PACKAGE_XLIB_LIBDMX=y
BR2_PACKAGE_XAPP_X11PERF=y
BR2_PACKAGE_XAPP_XCALC=y
BR2_PACKAGE_XAPP_XCLOCK=y
BR2_PACKAGE_XDRIVER_XF86_INPUT_KEYBOARD=y
BR2_PACKAGE_XDRIVER_XF86_INPUT_LIBINPUT=y
BR2_PACKAGE_XDRIVER_XF86_INPUT_MOUSE=y
BR2_PACKAGE_XDRIVER_XF86_VIDEO_FBDEV=y
BR2_PACKAGE_XDRIVER_XF86_VIDEO_FBTURBO=y
BR2_PACKAGE_XFONT_FONT_ADOBE_100DPI=y
BR2_PACKAGE_XFONT_FONT_ADOBE_75DPI=y
BR2_PACKAGE_XFONT_FONT_ADOBE_UTOPIA_100DPI=y
BR2_PACKAGE_XFONT_FONT_ADOBE_UTOPIA_75DPI=y
BR2_PACKAGE_XFONT_FONT_ADOBE_UTOPIA_TYPE1=y
BR2_PACKAGE_XFONT_FONT_ARABIC_MISC=y
BR2_PACKAGE_XFONT_FONT_BH_100DPI=y
BR2_PACKAGE_XFONT_FONT_BH_75DPI=y
BR2_PACKAGE_XFONT_FONT_BH_LUCIDATYPEWRITER_100DPI=y
BR2_PACKAGE_XFONT_FONT_BH_LUCIDATYPEWRITER_75DPI=y
BR2_PACKAGE_XFONT_FONT_BH_TTF=y
BR2_PACKAGE_XFONT_FONT_BH_TYPE1=y
BR2_PACKAGE_XFONT_FONT_BITSTREAM_100DPI=y
BR2_PACKAGE_XFONT_FONT_BITSTREAM_75DPI=y
BR2_PACKAGE_XFONT_FONT_BITSTREAM_TYPE1=y
BR2_PACKAGE_XFONT_FONT_CRONYX_CYRILLIC=y
BR2_PACKAGE_XFONT_FONT_DAEWOO_MISC=y
BR2_PACKAGE_XFONT_FONT_DEC_MISC=y
BR2_PACKAGE_XFONT_FONT_IBM_TYPE1=y
BR2_PACKAGE_XFONT_FONT_ISAS_MISC=y
BR2_PACKAGE_XFONT_FONT_JIS_MISC=y
BR2_PACKAGE_XFONT_FONT_MICRO_MISC=y
BR2_PACKAGE_XFONT_FONT_MISC_CYRILLIC=y
BR2_PACKAGE_XFONT_FONT_MISC_ETHIOPIC=y
BR2_PACKAGE_XFONT_FONT_MISC_MELTHO=y
BR2_PACKAGE_XFONT_FONT_MUTT_MISC=y
BR2_PACKAGE_XFONT_FONT_SCHUMACHER_MISC=y
BR2_PACKAGE_XFONT_FONT_SCREEN_CYRILLIC=y
BR2_PACKAGE_XFONT_FONT_SONY_MISC=y
BR2_PACKAGE_XFONT_FONT_SUN_MISC=y
BR2_PACKAGE_XFONT_FONT_WINITZKI_CYRILLIC=y
BR2_PACKAGE_XFONT_FONT_XFREE86_TYPE1=y
BR2_PACKAGE_XDATA_XCURSOR_THEMES=y
BR2_PACKAGE_NODM=y
BR2_PACKAGE_XTERM=y
BR2_PACKAGE_OPENBOX=y
BR2_PACKAGE_RPI_FIRMWARE=y
BR2_PACKAGE_RPI_FIRMWARE_VARIANT_PI4=y
BR2_PACKAGE_RPI_FIRMWARE_X=y
BR2_PACKAGE_PYTHON3=y
BR2_PACKAGE_LIBDRI2=y
BR2_PACKAGE_OPENSSH=y
BR2_PACKAGE_SUDO=y
BR2_PACKAGE_S6=y
BR2_PACKAGE_S6_LINUX_UTILS=y
BR2_PACKAGE_S6_PORTABLE_UTILS=y
BR2_PACKAGE_UTIL_LINUX_BINARIES=y
BR2_PACKAGE_UTIL_LINUX_KILL=y
BR2_PACKAGE_UTIL_LINUX_MOUNT=y
BR2_TARGET_ROOTFS_EXT2=y
BR2_TARGET_ROOTFS_EXT2_4=y
BR2_TARGET_ROOTFS_EXT2_SIZE="512M"
# BR2_TARGET_ROOTFS_TAR is not set
BR2_PACKAGE_HOST_DOSFSTOOLS=y
BR2_PACKAGE_HOST_GENIMAGE=y
BR2_PACKAGE_HOST_MTOOLS=y
First issue comes with X server.
It starts working but very strange/ubnormal. Xorg logs show me lines:
(II) xfree86: Adding drm device (/dev/dri/card1)
(II) xfree86: Adding drm device (/dev/dri/card0)
(II) no primary bus or device found falling back to sys/devices/platform/gpu/drm/card1
But on normal Raspbian OS X server first adds card0 then card1. And makes fall back to card0. Why my Xorg starts with card1?
I think this is my main issue, because of that later GLX extension does not start. And so I cannot make OpenGLES working in my system.
In my config.txt i have line
dtoverlay=vc4-fkms-v3d
and I belive vc4 drivers start properly because I see /dev/dri/card0 /dev/dri/card1 and /dev/dri/renderD128 devices
Maybe someone had similar experience?
What I am doing wrong?
My fault in question.
I was wrong that issue was in order of /dev/dri/card? adding by Xorg.
Issue was different. xserver built in buildroot needs libglamor enabled? this should be enabled in buildroot config. If enabled then es2_info reports no issue with OpenGLES.. besides that in my case still glmark2-es2 does not work with error "Failed to open bo 1: Permission denied"
I have installed the latest version of gstreamer (v1.16.2) on a Windows 10 with a full installation and testing simple examples I have checked that several common elements are missing.
With a command like:
gst-launch-1.0 videotestsrc ! capsfilter caps=video/x-raw,format=GRAY8 ! videoconvert ! autovideosink
I receive this log:
GST_INIT gst.c:810:init_post: initialized GStreamer successfully
GST_PIPELINE gstparse.c:337:gst_parse_launch_full: parsing pipeline description 'videotestsrc ! capsfilter caps=video/x-raw,format=GRAY8 ! videoconvert ! autovideosink '
GST_ELEMENT_FACTORY gstelementfactory.c:462:gst_element_factory_make: no such element factory "videotestsrc"!
GST_PIPELINE grammar.y:816:priv_gst_parse_yyparse: no element "videotestsrc"
GST_ELEMENT_FACTORY gstelementfactory.c:462:gst_element_factory_make: no such element factory "capsfilter"!
GST_PIPELINE grammar.y:816:priv_gst_parse_yyparse: no element "capsfilter"
GST_PIPELINE grammar.y:901:priv_gst_parse_yyparse: link has no source [sink=#0000000000000000]
GST_ELEMENT_FACTORY gstelementfactory.c:462:gst_element_factory_make: no such element factory "videoconvert"!
GST_PIPELINE grammar.y:816:priv_gst_parse_yyparse: no element "videoconvert"
GST_PIPELINE grammar.y:901:priv_gst_parse_yyparse: link has no source [sink=#0000000000000000]
GST_ELEMENT_FACTORY stelementfactory.c:462:gst_element_factory_make: no such element factory "autovideosink"!
GST_PIPELINE grammar.y:816:priv_gst_parse_yyparse: no element "autovideosink"
GST_PIPELINE grammar.y:901:priv_gst_parse_yyparse: link has no source [sink=#0000000000000000]
I also have checked that the installer creates a new environment variable GSTREAMER_1_0_ROOT_X86_64 pointing to C:\gstreamer\1.0\x86_64 and it also adds the bin folder to the Path.
Does the MSI installer need any additional step to register its plugins on a Windows Machine ?
Finally I found the issue and it's solution. At least on Windows... Gstreamer generates a bin file with the list of registered plugins. This file is stored in this path
C:\Users\<name_of_user>\AppData\Local\Microsoft\Windows\INetCache\gstreamer-1.0\registry.x86_64.bin
It seems that there was an issue in the first launch and the list of plugins was broken. If you delete this bin file and launch any command over gst-launch-1.0 it checks again all its own plugins and it refreshes that bin file.
Running the below snippet in my Firefox console returns the following error [FF/56.0.2 (64-bit) on Mac OS 10.13.1]:
MediaStreamError { name: "NotReadableError", message: "Failed to
allocate audiosource", constraint: "", stack: "" } (unknown)
// Sippet
navigator.mediaDevices
.getUserMedia({
audio: true,
video: true
})
.then(stream=>{
console.log(stream.getAudioTracks())
document.getElementById('storybook-preview-iframe').contentWindow.document.getElementById('video-camera').srcObject = stream
mr = new window.MediaRecorder(stream, {
mimeType: 'video/webm'
})
mr.ondataavailable = console.log
})
.catch(console.log)
What is most troubling is it worked at one point, and then it stopped. As if something is permanently locked up... I have no way (as far as I can tell) to see what is wrong with the audio source.
I ran these insanity checks to no avail:
No other browsers or app were open and/or using camera
Restarted browser, and eventually restarted computer
I'm on a mac, and heard this would help #> sudo killall AppleCameraAssistant;sudo killall VDCAssistant. It did not.
Ran a separate script (https://jsfiddle.net/App7P/348/) but when I turned the audio to true (https://jsfiddle.net/3k89sy27/2/), I got the same error as above.
This example/demo page on getusermedia also garnered the same error: https://webrtc.github.io/samples/src/content/getusermedia/record/
Update: I've simplified the failure code even more.
navigator.mediaDevices.getUserMedia({
audio: true
}).then(function (stream) {
console.log(stream)
}).catch(console.log)
Audio does not want to register.....
Even tried FF's own Test Pilot and that failed too https://testpilot.firefox.com/experiments/voice-fill/
as #mrchestnut suggested, I downloaded Firefox Quantum (which was released as of Nov. 14th 2017) and it worked!
Blog Post on Mozilla:
https://blog.mozilla.org/blog/2017/11/14/introducing-firefox-quantum/
Download Quantum:
https://www.mozilla.org/en-US/firefox/new/?scene=2
Although this doesn't explain why it didn't work, it sure has sugar solved my problem.
I'm trying to create a very simply Gstreamer pipeline where I have a source element that is my FaceTime camera and a sink element that is a udp sink.
I first install Gstreamer using the instructions here. I ran some of the basic pipelines no problem; however, when I tried to use the following command
./gst-launch-0.10 v4l2src ! xviimagesink
I got the following error:
ERROR: pipeline could not be constructed: no element "v4l2src".
So I did some digging and turns out that the v4l2src plugin is in a gst-plugins-good. I installed these good plugins using macports using the following command:
port install gst-plugins-good
After a very long time everything installed without error. Now gst-launch appears in three places.
/Library/Frameworks/GStreamer.framework/Versions/0.10/bin/gst-launch-0.10
/opt/local/bin/gst-launch
/opt/local/bin/gst-launch-0.10
If I try to run the above mentioned pipline from any of those directories I still get
ERROR: pipeline could not be constructed: no element "v4l2src".
If I type the following command from anywhere I get some more errors but seems like it still is not finding v4lsrc.
gst-launch v4l2src ! xviimagesink
Gives:
Dynamic session lookup supported but failed: launchd did not provide a socket path, verify that org.freedesktop.dbus-session.plist is loaded!
Dynamic session lookup supported but failed: launchd did not provide a socket path, verify that org.freedesktop.dbus-session.plist is loaded!
Dynamic session lookup supported but failed: launchd did not provide a socket path, verify that org.freedesktop.dbus-session.plist is loaded!
Dynamic session lookup supported but failed: launchd did not provide a socket path, verify that org.freedesktop.dbus-session.plist is loaded!
GConf Error: Failed to contact configuration server; some possible causes are that you need to enable TCP/IP networking for ORBit, or you have stale NFS locks due to a system crash. See http://projects.gnome.org/gconf/ for information. (Details - 1: Failed to get connection to session: Not enough memory)
ERROR: pipeline could not be constructed: no element "v4l2src".
So it seems like I have GStreamer mess and I still can't get my camera to work because GStreamer can't find v4l2src.
Some help would be appreciated! Thanks in advance.
v4l2src means "video-for-linux (ver.2) source".
since you are not running "linux", it is not so surprising that you cannot use "v4l2".
you might try to use the osxvideosrc (afaik this is in gstreamer-plugins-bad).
generally i suggest to check which elements are installed on your machine when you are looking for a a specific functionality, e.g.:
$ gst-inspect | grep -i video |grep -i source
PS: and usually i find it a good idea to throw some colorspace-converter (like ffmpegcolorspace) between a video-source and and -sink.
For me those two works from MacPorts (https://www.macports.org/):
GStreamer 1.0, applemedia: avfvideosrc: Video Source (AVFoundation), use device-index parameter to select a device (index will vary depending on the connection order).
bash-3.2# port install gstreamer1*
iCeDeROM:~ cederom$ gst-inspect-1.0 |grep video | grep src
inter: intervideosrc: Internal video source
decklink: decklinkvideosrc: Decklink Video Source
applemedia: qtkitvideosrc: Video Source (QTKit)
applemedia: avfvideosrc: Video Source (AVFoundation)
ximagesrc: ximagesrc: Ximage video source
videotestsrc: videotestsrc: Video test source
autodetect: autovideosrc: Auto video source
GStreamer 0.10 (autodetect: autovideosrc: Auto video source)
bash-3.2# port install gstreamer0*
iCeDeROM:~ cederom$ gst-inspect-0.10 |grep video | grep src
ximagesrc: ximagesrc: Ximage video source
inter: intervideosrc: FIXME Long name
gsettings: gsettingsvideosrc: GSettings video src
gconfelements: gconfvideosrc: GConf video source
autodetect: autovideosrc: Auto video source
applemedia: qtkitvideosrc: Video Source (QTKit)
applemedia: miovideosrc: Video Source (MIO)
videotestsrc: videotestsrc: Video test source
I use autovideosink or osxvideosink for testing (second works faster, first use Xorg). Use gst-inspect <module> for module information.
I have a Quartz Composer Version 4.5 (141.5) on my MacOS 10.7.2 and a QuickTime Framework version 7.6.6.
All I want is just render test HLS video stream using QC. HLS stream is just an apple test stream: http://devimages.apple.com/iphone/samples/bipbop/bipbopall.m3u8
So, I've created a sketch:
(It's a MovieImporter patch covered by stream url)
Next all I can see in QC Viewer is just a blank screen and infinite debug log:
17:08:42.233 ["Movie Importer" # "Macro Patch"] > Execution failed at time 2802.003
17:08:42.313 ["Movie Importer" # "Macro Patch"] > Failed retrieving image from movie <QTMovie: 0x7fd992e02d00 time scale = 600, duration = 2184000, rate = 0.000000, tracks = { 0x7fd992f1a0e0 0x7fd992e205c0 0x7fd992e12310 0x7fd9928b11b0 0x7fd9928a7990 }> (error (null))
Also I've tried to launch same sketch on MacOS 10.6.8, QC 4.0(103.1), but unsuccessfully.
What the problem? Where I'm wrong?
It may be related to your Quartz Composer version adn Mac OS X Lion.
Try downloading the new version, as said here : http://kineme.net/forum/General/QCFramework148MovieImporterpatch