Mycroft Community Forum

YouTube Audio Skill - testing and feedback

Thanks for the feedback, and for looking into the clashing playback behaviour.

I would quite like to add to the functionality so that - say - it’s easy to choose between the top few results rather than just always playing the top match.

Patches / PRs welcome!

Hey, thx for this skill.

Just want to ask you or others if you also got a fullscreen (over the cli) when you do:
“play die drei fragezeichen folge 122 original”.

Haven’t actually checkout the HDMI output, but it looks like you have VLC with framebuffer support installed and it plays the actual videostream.

Do you have that with only that stream or all streams?

(I will do some checking for you a bit later as well, to see if I have a framebuffer player as well.)

It is this config:
-Raspberry pi 4 - with 4GB
-Respeaker Mic Array v2.0 (https://www.seeedstudio.com/ReSpeaker-Mic-Array-v2-0.html )
-Picroft Unstable 2019-11-01 Buster image
-Mycroft-Core 19.8.3

I just install the skill and let them install all necessary requirements. VLC was a part of it.
Is there a reason why the skill used vlc instead of other ones? I think NewPipe (the app) used another technique, or?
https://newpipe.schabi.org/ or https://github.com/TeamNewPipe/NewPipe/

BR, suisat

Is it possible to have this skill play the audio on some other audio rendering device? ie. push the url to a different audio device (“Play Clapton Crossroads upstairs”). End devices may be an mpd client, volumio, vlc client on remote computer, chrome cast device, others…?

@suisat I think VLC is used because of the HTTPS connection and possibly the OPUS codec used by Youtube for most “best” audio streams.

Or at least, when I configured my system for it I needed to tweak my VLC install to support openssl for the https connection and needed to add the OPUS codec for it to work. I can imagine that the default mpg123 might be a bit to minimal for it all.

But… Just guessing here.

@pcwii Was wondering the exact same. Chromecast is integrated within Mycroft ini some extend, as I see something mention about it in the audio.log Wondering if you could say;

“play blabla from youtube on chromoecast-name”

Tried it of course, but nope…

1 Like

@j1nx, I did some playing around in my spare time and managed to get some youtube casted to my chromecast. It looks like the discovery portion of pychromecast, pychromecast.get_chromecasts() does not work on systems with more than one network interface as it uses the wrong interface to find the devices?? not sure if this is the mycroft issue or not.

I did have success casting a search with this code here.
https://github.com/pcwii/skill-chromecast/blob/master/tests.py

Yes, you’re right. I think sometimes one of the audio streams might be something that mpg123 could play codec-wise, but from my initial experiments it seemed like vlc was consistently able to cope with the stream URLs pafy / youtube-dl return.

I’d be happy to include an option to use something other than the “best” audio stream, and/or use mpg123 if an appropriate stream is returned… but it looked to me like this might sometimes mean none of the streams returned would be playable for a given search result.

@mcdruid I discovered that if you ask to play something on youtube and there is no audio only streams available, it actually plays a video one.

This should not be a problem, however probably not intentional, so perhaps you need to catch the best-stream == 0 and report back to the user.

(My VLC is configured without screen support, so playing one of those streams gives A LOT of errors on the mycroft-cli-client screen.

Interesting, thanks @j1nx

I mostly use picroft with no video/screen at all and haven’t noticed this.

Do you have any examples of streams / searches which come back with no audio-only streams?

I did file an issue on gitlab the other day when I stumbled across a result which seemed to do something like return null for bestaudio - perhaps that’s relevant:

Not going round to looking at the code yet, but a working test case would be good as I can’t reproduce the issue myself now.

I encountered it once and thought, will save the song. However, YouTube probably logs those things and puts the encoding in a queue of some kind because double checking the song the next day it played without video.

So hard to debug, by just asking it for songs. I believe the best way is to ask for old and / or not so popular songs. Perhaps in your native language if other than English.