You are not logged in.

#1 2014-04-22 08:50:27

cotko
Member
Registered: 2010-02-10
Posts: 16

[solved] mpd play youtube stream

Hi,
I've read mpd could play youtube streams. For example, somebody wrote how to on a blog: http://devbraindom.blogspot.com/2013/11 … n-mpd.html
I've been trying this out before I found the blog and it wasn't working but now it seems like it actually should work and apparently I'm missing something out here. If I try exact same thing written on the blog:
mpc add `youtube-dl -f140 -g http://www.youtube.com/watch?v=HS5fHWmzqIg` (note f=140, 141does not exist any more)
and then try to play it: mpc play
the status returned by mpd is:
ERROR: Failed to decode https://r3---s...

What am I missing? I have all gstreamer codecs installed..

Last edited by cotko (2014-04-24 00:01:18)

Offline

#2 2014-04-22 15:49:34

Rasi
Member
From: Germany
Registered: 2007-08-14
Posts: 1,914
Website

Re: [solved] mpd play youtube stream

i tried with vlc, mpv, mplayer. none of these can play back the stream that results from that command...

Also mpd does not use gstreamer at all, so having that installed surely won't help tongue

Last edited by Rasi (2014-04-22 15:49:57)


He hoped and prayed that there wasn't an afterlife. Then he realized there was a contradiction involved here and merely hoped that there wasn't an afterlife.

Douglas Adams

Offline

#3 2014-04-22 16:11:42

emeres
Member
Registered: 2013-10-08
Posts: 1,570

Re: [solved] mpd play youtube stream

firefox $(youtube-dl -f140 -g 'http://www.youtube.com/watch?v=HS5fHWmzqIg')

works though. [ youtube-dl-git ]
Use code tags.

Offline

#4 2014-04-22 16:39:30

cotko
Member
Registered: 2010-02-10
Posts: 16

Re: [solved] mpd play youtube stream

@Rasi vlc works for me:

vlc $(youtube-dl -f140 -g 'http://www.youtube.com/watch?v=HS5fHWmzqIg')

that's why it's strange that mpd doesn't..

Offline

#5 2014-04-22 21:18:33

phoxmeh
Member
Registered: 2012-03-20
Posts: 10

Re: [solved] mpd play youtube stream

I use mpv with

mpv $(youtube-dl -g "<url>")

works fine. I don't think mpd could play video considering it's music player daemon. >.>

Offline

#6 2014-04-22 21:30:30

progandy
Member
Registered: 2012-05-17
Posts: 5,266

Re: [solved] mpd play youtube stream

Maybe mpd has some problems with the SSL ciphers used by youtube. youtube videos only support RC4-SHA which is disabled in curl by default as far as I know.


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

#7 2014-04-23 23:58:04

cotko
Member
Registered: 2010-02-10
Posts: 16

Re: [solved] mpd play youtube stream

ok I found it.. stupid:)
mpd cant resolve https, so --prefer-insecure flag is needed for youtube-dl
you must also check first all the formats and select the one which is audio only
example:

youtube-dl  -F sTPtBvcYkO8

gives:

171         webm      audio only  DASH webm audio , audio@ 48k (worst)
140         m4a       audio only  DASH audio , audio@128k
160         mp4       144p        DASH video , video only
242         webm      240p        DASH webm 
133         mp4       240p        DASH video , video only
243         webm      360p        DASH webm 
134         mp4       360p        DASH video , video only
17          3gp       176x144     
36          3gp       320x240     
5           flv       400x240     
43          webm      640x360     
18          mp4       640x360     (best)

so you can only play 171 and 140 formats:

mpc add $(youtube-dl --prefer-insecure -g -f140 sTPtBvcYkO8)

Offline

#8 2015-01-23 13:18:48

SUK
Member
Registered: 2009-09-28
Posts: 19

Re: [solved] mpd play youtube stream

Hi. Looks like
a) MPD can play HTTPs streams - currently I am playing something beginning with https
b) At some videos is available format 141 - audio only with pretty higher bitrate than 140. But always returns https URL

But sometimes (which happens also with 140) it plays few seconds and resumes on next song in playlist...

Offline

#9 2015-01-26 21:01:32

cotko
Member
Registered: 2010-02-10
Posts: 16

Re: [solved] mpd play youtube stream

@SUK: have you tried playing the one which skips after a few seconds with --prefer-insecure flag? Just curious if it skips too or not..

Offline

Board footer

Powered by FluxBB