potuz
Posts: 7
Joined: Sun Jul 23, 2017 10:47 am

[SOLVED] omxplayer plays webm from youtube, but not streams

Sun Jul 23, 2017 10:53 am

If I download a video from youtube with youtube-dl like this one today:

Code: Select all

$ youtube-dl https://www.youtube.com/watch?v=mpUuGiWJH9I
And then play the mkv downloaded with

Code: Select all

$ omxplayer -o hdmi output.mkv
Everything works fine. However trying to play the same video with

Code: Select all

$ omxplayer -o hdmi $(youtube-dl -g https://www.youtube.com/watch?v=mpUuGiWJH9I)
which: no xset in (/usr/local/bin:/usr/bin:/bin:/opt/bin:/usr/armv7a-hardfloat-linux-gnueabi/gcc-bin/5.4.0:/opt/vc/bin)
which: no xrefresh in (/usr/local/bin:/usr/bin:/bin:/opt/bin:/usr/armv7a-hardfloat-linux-gnueabi/gcc-bin/5.4.0:/opt/vc/bin)
have a nice day ;)
And no error message (besides the irrelevant ones on xset and xrefresh) is shown. What could I be doing wrong?
Last edited by potuz on Wed Aug 02, 2017 12:21 pm, edited 1 time in total.

User avatar
topguy
Posts: 7313
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: omxplayer plays webm from youtube, but not streams

Mon Jul 24, 2017 8:58 am

You should probably pick a compatible format. youtube-dl pick automatically seperate video and audio streams and multiplexes them to MKV container.
The principle is shown below but I have no way to test since my Pi is headless.

Code: Select all

pi@raspberrypi:~ $ youtube-dl -g https://www.youtube.com/watch?v=mpUuGiWJH9I
https://r6---sn-8xouxav-vnal.googlevideo.com/videoplayback?id=9a952e1a25891fd2&itag=136&source=youtube&requiressl=yes&initcwndbps=3442500&mn=sn-8xouxav-vnal&mm=31&ms=au&ei=cLV1WYbcNY-aYezfg8gI&pl=20&mv=m&ratebypass=yes&mime=video/mp4&gir=yes&clen=10625913&lmt=1500746555432262&dur=43.176&mt=1500886307&signature=3F5B28599997E0A4761ACB4B8EE140BEAE6BF73B.479C9FAE11756ACD463E95334CC32C7E107DFC8C&key=dg_yt0&ip=92.62.44.131&ipbits=0&expire=1500907984&sparams=ip,ipbits,expire,id,itag,source,requiressl,initcwndbps,mn,mm,ms,ei,pl,mv,ratebypass,mime,gir,clen,lmt,dur
https://r6---sn-8xouxav-vnal.googlevideo.com/videoplayback?mime=audio%2Fwebm&clen=689332&ipbits=0&requiressl=yes&dur=43.181&ms=au&mv=m&mt=1500886307&itag=251&mn=sn-8xouxav-vnal&signature=146749490525056E6AD0C9CF8CF4648630798E3C.D324364336A276E27065DE794BE435EE62A27796&key=yt6&gir=yes&expire=1500907984&id=o-AMBMNScqbEgJBjHO8KYOMCOOpo_ZLTv2qY7bavT6nWZ1&mm=31&lmt=1500747991754099&ip=92.62.44.131&ei=cLV1WeLNFNPCYK6psjg&pl=20&initcwndbps=3442500&source=youtube&sparams=clen%2Cdur%2Cei%2Cgir%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Ckeepalive%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Crequiressl%2Csource%2Cexpire&keepalive=yes&ratebypass=yes

pi@raspberrypi:~ $ youtube-dl -F https://www.youtube.com/watch?v=mpUuGiWJH9I
[youtube] mpUuGiWJH9I: Downloading webpage
[youtube] mpUuGiWJH9I: Downloading video info webpage
[youtube] mpUuGiWJH9I: Extracting video information
[youtube] mpUuGiWJH9I: Downloading MPD manifest
[info] Available formats for mpUuGiWJH9I:
format code  extension  resolution note
139          m4a        audio only DASH audio   48k , m4a_dash container, mp4a.40.5@ 48k (22050Hz), 252.47KiB
249          webm       audio only DASH audio   52k , opus @ 50k, 264.37KiB
250          webm       audio only DASH audio   68k , opus @ 70k, 344.09KiB
171          webm       audio only DASH audio  106k , vorbis@128k, 533.36KiB
140          m4a        audio only DASH audio  127k , m4a_dash container, mp4a.40.2@128k (44100Hz), 671.71KiB
251          webm       audio only DASH audio  133k , opus @160k, 673.18KiB
278          webm       256x144    144p  107k , webm container, vp9, 30fps, video only, 513.06KiB
160          mp4        256x144    DASH video  113k , avc1.4d400c, 30fps, video only, 551.48KiB
133          mp4        426x240    DASH video  249k , avc1.4d4015, 30fps, video only, 1.18MiB
242          webm       426x240    240p  259k , vp9, 30fps, video only, 1.14MiB
243          webm       640x360    360p  475k , vp9, 30fps, video only, 2.10MiB
134          mp4        640x360    DASH video  647k , avc1.4d401e, 30fps, video only, 2.79MiB
244          webm       854x480    480p  836k , vp9, 30fps, video only, 3.67MiB
135          mp4        854x480    DASH video 1180k , avc1.4d401f, 30fps, video only, 5.15MiB
247          webm       1280x720   720p 1643k , vp9, 30fps, video only, 7.10MiB
136          mp4        1280x720   DASH video 2327k , avc1.4d401f, 30fps, video only, 10.13MiB
17           3gp        176x144    small , mp4v.20.3, mp4a.40.2@ 24k
36           3gp        320x180    small , mp4v.20.3, mp4a.40.2
43           webm       640x360    medium , vp8.0, vorbis@128k
18           mp4        640x360    medium , avc1.42001E, mp4a.40.2@ 96k
22           mp4        1280x720   hd720 , avc1.64001F, mp4a.40.2@192k (best)

pi@raspberrypi:~ $ youtube-dl -f 22 -g https://www.youtube.com/watch?v=mpUuGiWJH9I
https://r6---sn-8xouxav-vnal.googlevideo.com/videoplayback?ip=92.62.44.131&mime=video%2Fmp4&pl=20&source=youtube&mv=m&dur=43.235&expire=1500908125&ms=au&ipbits=0&mm=31&mn=sn-8xouxav-vnal&id=o-APkWQG92RfYKnKbixRh2sCPUhZBBWhY_7e_5BNKXHzf7&key=yt6&initcwndbps=11010000&requiressl=yes&sparams=dur%2Cei%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Cratebypass%2Crequiressl%2Csource%2Cexpire&lmt=1500746619499578&itag=22&mt=1500886356&signature=6047C01583F43CF7F28D8514EE29C380053657A3.3683990EEAE7BBF52B5DE112C518037A51BFF4C3&ratebypass=yes&ei=_bV1WdjQKKu6Y9Trk_AE


gkreidl
Posts: 6345
Joined: Thu Jan 26, 2012 1:07 pm
Location: Germany

Re: omxplayer plays webm from youtube, but not streams

Mon Jul 24, 2017 12:00 pm

Using youtube-dl with "-f best" option will give you a stream which contains both video and audio.
Minimal Kiosk Browser (kweb)
Slim, fast webkit browser with support for audio+video+playlists+youtube+pdf+download
Optional fullscreen kiosk mode and command interface for embedded applications
Includes omxplayerGUI, an X front end for omxplayer

potuz
Posts: 7
Joined: Sun Jul 23, 2017 10:47 am

Re: omxplayer plays webm from youtube, but not streams

Sun Jul 30, 2017 6:49 pm

The situation is the same with -f best, -f mp4 or choosing specifically each format. Unfortunately the video I used for the demonstration no longer exists in youtube, but trying with the following video I have the same problem:

Code: Select all

$ youtube-dl -F https://www.youtube.com/watch?v=W3fkN5xE8wg
[youtube] W3fkN5xE8wg: Downloading webpage
[youtube] W3fkN5xE8wg: Downloading video info webpage
[youtube] W3fkN5xE8wg: Extracting video information
[youtube] W3fkN5xE8wg: Downloading MPD manifest
[info] Available formats for W3fkN5xE8wg:
format code  extension  resolution note
139          m4a        audio only DASH audio   48k , m4a_dash container, mp4a.40.5@ 48k (22050Hz), 2.79MiB
249          webm       audio only DASH audio   52k , opus @ 50k, 2.78MiB
250          webm       audio only DASH audio   69k , opus @ 70k, 3.68MiB
140          m4a        audio only DASH audio  128k , m4a_dash container, mp4a.40.2@128k (44100Hz), 7.44MiB
171          webm       audio only DASH audio  130k , vorbis@128k, 6.75MiB
251          webm       audio only DASH audio  136k , opus @160k, 7.31MiB
160          mp4        256x144    DASH video  115k , avc1.4d400c, 25fps, video only, 6.13MiB
278          webm       256x144    144p  147k , webm container, vp9, 25fps, video only, 6.13MiB
133          mp4        426x240    DASH video  276k , avc1.4d4015, 25fps, video only, 13.93MiB
242          webm       426x240    240p  337k , vp9, 25fps, video only, 14.31MiB
243          webm       640x360    360p  585k , vp9, 25fps, video only, 26.70MiB
134          mp4        640x360    DASH video  644k , avc1.4d401e, 25fps, video only, 33.02MiB
244          webm       854x480    480p 1079k , vp9, 25fps, video only, 48.88MiB
135          mp4        854x480    DASH video 1192k , avc1.4d401e, 25fps, video only, 61.38MiB
247          webm       1280x720   720p 2161k , vp9, 25fps, video only, 98.26MiB
136          mp4        1280x720   DASH video 2378k , avc1.4d401f, 25fps, video only, 118.58MiB
248          webm       1920x1080  1080p 3968k , vp9, 25fps, video only, 174.89MiB
137          mp4        1920x1080  DASH video 4474k , avc1.640028, 25fps, video only, 222.34MiB
17           3gp        176x144    small , mp4v.20.3, mp4a.40.2@ 24k
36           3gp        320x180    small , mp4v.20.3, mp4a.40.2
43           webm       640x360    medium , vp8.0, vorbis@128k
18           mp4        640x360    medium , avc1.42001E, mp4a.40.2@ 96k
22           mp4        1280x720   hd720 , avc1.64001F, mp4a.40.2@192k (best)
$ omxplayer -o hdmi $(youtube-dl -f 22 -g https://www.youtube.com/watch?v=W3fkN5xE8wg)
which: no xset in (/usr/local/bin:/usr/bin:/bin:/opt/bin:/usr/armv7a-hardfloat-linux-gnueabi/gcc-bin/5.4.0:/opt/vc/bin)
which: no xrefresh in (/usr/local/bin:/usr/bin:/bin:/opt/bin:/usr/armv7a-hardfloat-linux-gnueabi/gcc-bin/5.4.0:/opt/vc/bin)
have a nice day ;)
I can play fine the mp4 downloaded from the same video with youtube-dl -f 22

gkreidl
Posts: 6345
Joined: Thu Jan 26, 2012 1:07 pm
Location: Germany

Re: omxplayer plays webm from youtube, but not streams

Sun Jul 30, 2017 8:49 pm

Try quoting the $ expression:
..... "$(youtubedl ...)"
Minimal Kiosk Browser (kweb)
Slim, fast webkit browser with support for audio+video+playlists+youtube+pdf+download
Optional fullscreen kiosk mode and command interface for embedded applications
Includes omxplayerGUI, an X front end for omxplayer

potuz
Posts: 7
Joined: Sun Jul 23, 2017 10:47 am

Re: omxplayer plays webm from youtube, but not streams

Wed Aug 02, 2017 12:20 pm

it ended up being a problem with ffmpeg compiled without openssl support, omxplayer suppress all error messages from ffmpeg and finishes quietly so I didn't realize this was the problem for a while.

Return to “Troubleshooting”