Gstreamer on OSX - osx-mountain-lion

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.

Related

Gstreamer cannot find internal camera on a Mac

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

Why Xorg server fails on system created with Buildroot for Raspberry Pi4?

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"

VLC : which file to update VLC Lua youtube script on Mac OS X?

I am trying to read a youtube video through VLC on my mac:
/Applications/VLC.app/Contents/MacOS/VLC -v https://www.youtube.com/watch?v=afzmwAKUppU&app=desktop
Which gives errors :
VLC media player 3.0.
8 Vetinari (revision 3.0.8-0-gf350b6b5a7)
[00007faf5b5e9140] lua generic warning: Error while running script /Applications/VLC.app/Contents/MacOS/share/lua/extensions/youtube.lua, function descriptor() not found
[00007faf5b4589c0] macosx interface warning: Failed to enable media key support, likely app needs to be whitelisted in Security Settings.
[00007faf5b784950] securetransport tls client warning: Ignoring ALPN request due to lack of support in the backend. Proxy behavior potentially undefined.
[00007faf5b770200] lua stream warning: Couldn't extract video URL, falling back to alternate youtube API
[00007faf5b6b5b60] securetransport tls client warning: Ignoring ALPN request due to lack of support in the backend. Proxy behavior potentially undefined.
[00007faf5f97ce70] securetransport tls client warning: Ignoring ALPN request due to lack of support in the backend. Proxy behavior potentially undefined.
2020-10-15 13:45:28.281 VLC[65658:198319] Can't find app with identifier com.spotify.client
[00007faf5b5d8580] lua stream error: Couldn't extract youtube video URL, please check for updates to this script
[00007faf5b44b570] main playlist: playlist is empty
The youtube.lua, I got it by downloading the file from internet :
curl "http://git.videolan.org/?p=vlc.git;a=blob_plain;f=share/lua/playlist/youtube.lua;hb=HEAD" -o /Applications/VLC.app/Contents/MacOS/share/lua/extensions/youtube.lua
Which works on my ubuntu, but not in my Mac: I am wondering if this is not the correct version for Mac OS. And so, which file should be put there ?
If I look on the VLC Lua directory, I find :
/Applications/VLC.app/Contents/MacOS/share/lua/extensions$ ls -l
total 192
-rw-r--r--# 1 romain admin 72K Aug 14 2019 VLSub.luac
-rw-r--r-- 1 root admin 22K Oct 15 13:35 youtube.lua
the youtube.lua is the new script I added, but maybe it was another one to put there ?
Probably a bit late here now, but in any case:
You need to take the youtube.lua from here: https://github.com/videolan/vlc/blob/master/share/lua/playlist/youtube.lua
Then rename it to youtube.luac and place it in the directory (for MacOS) /Applications/VLC.app/Contents/MacOS/share/lua/playlist
I would recommend renaming the old one and keeping it in case something goes awry.
At least on my computer this worked and I can now open YouTube videos in VLC again.
Have you tried the 3.0.11.1 release? https://get.videolan.org/vlc/3.0.11.1/macosx/vlc-3.0.11.1.dmg
You're correct that youtube.lua would be the correct file, though the issue might come from other parts of the code depending on it. FYI, since you are running a stable VLC build, the code you should look at is https://code.videolan.org/videolan/vlc-3.0/-/blob/master/share/lua/playlist/youtube.lua.
https://code.videolan.org/videolan/vlc/-/blob/master/share/lua/playlist/youtube.lua is nightly v4 unstable builds (though for the lua script, they are identical).
Additionally, look out for a new release with an updated script soon https://mailman.videolan.org/pipermail/vlc-devel/2020-October/139076.html

Why does using the Seek method in VLC's DBus give so many errors?

I've been trying to use DBus to control VLC and I've managed to get everything working fine but the Seek function that "works" but gives me a ton of errors.
Vlc starting with -v flag and Youtube url link:
VLC media player 3.0.8 Vetinari (revision 3.0.8-0-gf350b6b5a7)
[01623920] main interface error: no suitable interface module
[0159ab58] main libvlc error: interface "globalhotkeys,none" initialization failed
[01623920] dummy interface: using the dummy interface module...
[61d1b068] mp4 demux warning: elst box found
[61d1b068] mp4 demux warning: STTS table of 1 entries
[61d1b068] mp4 demux warning: CTTS table of 33045 entries
[61d1b068] mp4 demux warning: STTS table of 1 entries
[6157f788] mmal_codec decoder: VCSM init succeeded: Legacy
[615f5710] faad decoder warning: decoded zero sample
[62602618] gles2 generic error: parent window not available
[62602130] mmal_xsplitter vout display error: Failed to open Xsplitter:opengles2 module
[62602618] xcb generic error: window not available
[62602130] mmal_xsplitter vout display error: Failed to open Xsplitter:xcb_x11 module
VLC log when I try to use Seek:
[62602618] mmal_vout generic warning: Unsupported control query 4
[6157f788] main decoder error: buffer deadlock prevented
[016295c0] main video output warning: picture is too late to be displayed (missing 43 ms)
[01615ae0] main audio output warning: playback too late (61289): up-sampling
[01615ae0] main audio output warning: timing screwed (drift: 125557 us): stopping resampling
[01615ae0] main audio output warning: playback too late (134644): up-sampling
[01615ae0] main audio output warning: playback way too late (185671): flushing buffers
[01615ae0] pulse audio output warning: starting late (-13368 us)
[01615ae0] main audio output warning: playback way too early (-562329): playing silence
[01615ae0] main audio output warning: playback too late (63592): up-sampling
[01615ae0] main audio output warning: playback way too late (316071): flushing buffers
[01615ae0] pulse audio output warning: starting late (-11502 us)
[01615ae0] main audio output warning: playback way too early (-724374): playing silence
[01615ae0] main audio output warning: playback too late (64426): up-sampling*
I'm using vlc for youtube streaming and the DBus call is:
function omxdbus {
dbus-send --type=method_call --reply-timeout=550 --
dest=org.mpris.MediaPlayer2.vlc /org/mpris/MediaPlayer2 $*
}
omxdbus org.mpris.MediaPlayer2.Player.Seek int64:$offset >/dev/null
Offset being time in microseconds (im using 10 000 000 to skip 10sec).
Everything is running on Raspbian lite on a Raspberry 2b. I've searched a lot for the problem but nothing shows up. (Note: vlc is actually able to jump the 10 sec just fine (1/2 sec delay)).
Thanks in advance!

spdecode in simple-pt responds with 'error trace stream does not match query' Intel Processor Trace

I am a newbie using Intel PT for the trace.
I have read Intel PT manual and started to use it with simple-pt to understand how Intel PT works.
sptcmd command in simple-pt works and generates ptout.N with following command.
sudo ./sptcmd -c ls ls
When I use sptdecode as follows:
sudo ./sptdecode --sideband ptout.sideband --pt ptout.0
I get the following response:
TIME DELTA INSNs OPERATION
50:0: error trace stream does not match query
50: sync forward: trace stream does not match query
I have tried with boot argument of nopti as mentioned on simple-pt Git repo.
Additional information about setup which maybe relevant:
Compiled and built simple-pt from Git repo https://github.com/andikleen/simple-pt.
Using libipt by building from latest Git repo https://github.com/01org/processor-trace.
Using Ubuntu - 16.04
I am not sure what I am missing. Any help or pointers are appreciated.

Resources