HOWTO: YouTube on the Raspberry Pi - sans X B-)


165 posts   Page 5 of 7   1, 2, 3, 4, 5, 6, 7
by sim_tcr » Wed Nov 21, 2012 5:57 pm
I did everything exactly you said.
I am able to launch yt without error. On the initial page i see some video list.
I tied to play a video by typing its number, I see a green lengthy box written playing <video url> but nothing happens.

Please help.
http://raspisimon.no-ip.org
Raspberry Pi Model B x 2, Transcend 16GB Class 10, Transcend 8GB Class 4, Nokia Travel Charger ACP-12E 5.7V 800mA, Netgear WNA1000M Wifi Dongle/Ethernet
Posts: 311
Joined: Tue Nov 06, 2012 1:01 pm
Location: Bangalore
by bobbydriver » Thu Nov 22, 2012 8:58 am
How is your screen connected? HDMI or Composite?

You have to make sure the command to output via omxplayer is pointed at the right output.

Everything you describe is normal - except the video should appear on your screen :)
Posts: 45
Joined: Thu Oct 18, 2012 9:06 am
by sim_tcr » Thu Nov 22, 2012 9:05 am
bobbydriver wrote:How is your screen connected? HDMI or Composite?

You have to make sure the command to output via omxplayer is pointed at the right output.

Everything you describe is normal - except the video should appear on your screen :)


I am conneceted to the TV through HDMI.

In __init__.py i have mada below change,

mplayer = subprocess.Popen(
['omxplayer', url.decode('UTF-8').strip()],
stdout = subprocess.PIPE, stderr = subprocess.PIPE)
mplayer.wait()


In the console i type simply 'yt' and it opens with a list of videos, i select one of the video by its number and nothing plays.
http://raspisimon.no-ip.org
Raspberry Pi Model B x 2, Transcend 16GB Class 10, Transcend 8GB Class 4, Nokia Travel Charger ACP-12E 5.7V 800mA, Netgear WNA1000M Wifi Dongle/Ethernet
Posts: 311
Joined: Tue Nov 06, 2012 1:01 pm
Location: Bangalore
by bobbydriver » Thu Nov 22, 2012 11:12 am
If you are using HDMI then the file needs to say

mplayer = subprocess.Popen(
['omxplayer', '-ohdmi', url.decode('UTF-8').strip()],
stdout = subprocess.PIPE, stderr = subprocess.PIPE)
mplayer.wait()

Alternatively - can you try and connect via the composite to SCART see if your output is coming that way?

And finally does an OMXPlayer.log file get written to the directory you start yt from? If so then it might have some clues in it
Posts: 45
Joined: Thu Oct 18, 2012 9:06 am
by sim_tcr » Fri Nov 23, 2012 5:39 am
bobbydriver wrote:If you are using HDMI then the file needs to say

mplayer = subprocess.Popen(
['omxplayer', '-ohdmi', url.decode('UTF-8').strip()],
stdout = subprocess.PIPE, stderr = subprocess.PIPE)
mplayer.wait()

Alternatively - can you try and connect via the composite to SCART see if your output is coming that way?

And finally does an OMXPlayer.log file get written to the directory you start yt from? If so then it might have some clues in it


I tried using composite cable and its doing the same.
There is a omxplayer.log in /home/pi/whitey-0.1/src/yt, But the time stamp of it not accurate (i.e. it is not showing the time as i launched and try to play yt). Any way posting it here.


00:00:00 T:0 DEBUG: DllBcm: Using omx system library
00:00:00 T:0 DEBUG: DllOMX: Using omx system library
00:00:00 T:0 DEBUG: DllAvFormat: Using libavformat system library
00:00:00 T:0 DEBUG: DllAvUtilBase: Using libavutil system library
00:00:00 T:0 DEBUG: DllAvCodec: Using libavcodec system library
00:00:00 T:0 DEBUG: DllAvFormat: Using libavformat system library
00:00:00 T:0 ERROR: COMXPlayer::OpenFile - avformat_open_input http://o-o---preferred---sn-p5qlsn7z--- ... 1c4cf9dec5
http://raspisimon.no-ip.org
Raspberry Pi Model B x 2, Transcend 16GB Class 10, Transcend 8GB Class 4, Nokia Travel Charger ACP-12E 5.7V 800mA, Netgear WNA1000M Wifi Dongle/Ethernet
Posts: 311
Joined: Tue Nov 06, 2012 1:01 pm
Location: Bangalore
by sim_tcr » Sun Nov 25, 2012 1:30 pm
This is still not working. Some one please help me.

Posted from lynx command line browser :-)
http://raspisimon.no-ip.org
Raspberry Pi Model B x 2, Transcend 16GB Class 10, Transcend 8GB Class 4, Nokia Travel Charger ACP-12E 5.7V 800mA, Netgear WNA1000M Wifi Dongle/Ethernet
Posts: 311
Joined: Tue Nov 06, 2012 1:01 pm
Location: Bangalore
by Luutifa » Mon Nov 26, 2012 6:35 pm
I'm having exactly the same problem.
Everything seems to work fine, but the video just won't start (after the green box has showed up), and it goes back to the yt menu like nothing happened.

omxplayer seems to work flawlessly with anything else.

I think this might be because of the small space in my sdcard, but I don't think that a 40sec yt video can take anything like a 100Mb.

I'll try again, once I get my 8Gb sdcard, and a better (1.5a) power supply.

Heres my log (omxplayer):

Code: Select all
00:00:00 T:0   DEBUG: DllBcm: Using omx system library
00:00:00 T:0   DEBUG: DllOMX: Using omx system library
00:00:00 T:0   DEBUG: DllAvFormat: Using libavformat system library
00:00:00 T:0   DEBUG: DllAvUtilBase: Using libavutil system library
00:00:00 T:0   DEBUG: DllAvCodec: Using libavcodec system library
00:00:00 T:0   DEBUG: DllAvFormat: Using libavformat system library
00:00:00 T:0   ERROR: COMXPlayer::OpenFile - avformat_open_input http://o-o---preferred---sn-uxap5nvoxg5-ixhl---v18---lscache6.c.youtube.com/videoplayback?upn=svZd2-RhLeU&sparams=algorithm%2Cburst%2Ccp%2Cfactor%2Cgcr%2Cid%2Cip%2Cipbits%2Citag%2Csource%2Cupn%2Cexpire&fexp=914501%2C927200%2C916806%2C900300%2C916611%2C922401%2C920704%2C912806%2C927201%2C925706%2C922403%2C913546%2C913556%2C916805%2C920201%2C901451&ms=au&algorithm=throttle-factor&burst=40&ip=80.221.10.207&itag=35&gcr=fi&sver=3&mt=1353954609&mv=m&source=youtube&key=yt1&ipbits=8&factor=1.25&cp=U0hUSFlSVl9OS0NONF9RTFpDOkJPYVhOY2ZyNTk3&expire=1353978291&id=fce065812cfcb123


And it does show an error.
About "open file".

Thanks for any help, and this great tutorial.
Posts: 14
Joined: Mon Nov 26, 2012 6:20 pm
by bla07 » Mon Nov 26, 2012 9:19 pm
I get the exact same error message! Would it be possible someone to give us clues how to solve this. Cheers
Posts: 2
Joined: Mon Nov 26, 2012 9:16 pm
by xscl100 » Tue Nov 27, 2012 4:38 pm
I'm having the exact same issue, just got my pi today, have installed yt and edited the file for HDMI output, but all I get is the green box saying video is playing, then nothing.
Posts: 1
Joined: Tue Nov 27, 2012 4:36 pm
by Montekuri » Wed Nov 28, 2012 1:57 pm
VIDEO NOT PLAYING - SOLUTION:
We have to install the latest version of whitey and youtube-dl:

Whitey version 0.2 (november 2012)
http://pypi.python.org/pypi/whitey

youtube-dl
https://github.com/rg3/youtube-dl/blob/ ... l?raw=true
User avatar
Posts: 421
Joined: Thu Sep 22, 2011 6:26 pm
by sim_tcr » Wed Nov 28, 2012 2:05 pm
Montekuri wrote:VIDEO NOT PLAYING - SOLUTION:
We have to install the latest version of whitey and youtube-dl:

Whitey version 0.2 (november 2012)
http://pypi.python.org/pypi/whitey

youtube-dl
https://github.com/rg3/youtube-dl/blob/ ... l?raw=true


Can you explain how do we latest version of whitey and youtube-dl?
http://raspisimon.no-ip.org
Raspberry Pi Model B x 2, Transcend 16GB Class 10, Transcend 8GB Class 4, Nokia Travel Charger ACP-12E 5.7V 800mA, Netgear WNA1000M Wifi Dongle/Ethernet
Posts: 311
Joined: Tue Nov 06, 2012 1:01 pm
Location: Bangalore
by dirkk0 » Wed Nov 28, 2012 6:23 pm
Code: Select all
sudo youtube-dl -U
worked for me. Thanks for this great post.
Posts: 1
Joined: Wed Nov 28, 2012 6:22 pm
by sim_tcr » Thu Nov 29, 2012 3:37 am
dirkk0 wrote:
Code: Select all
sudo youtube-dl -U
worked for me. Thanks for this great post.


I am all set now. Thank you.
http://raspisimon.no-ip.org
Raspberry Pi Model B x 2, Transcend 16GB Class 10, Transcend 8GB Class 4, Nokia Travel Charger ACP-12E 5.7V 800mA, Netgear WNA1000M Wifi Dongle/Ethernet
Posts: 311
Joined: Tue Nov 06, 2012 1:01 pm
Location: Bangalore
by mjsbeaton » Thu Nov 29, 2012 2:22 pm
sudo youtube-dl -U

works for me too, as the missing step.

NB, the '-ohdmi' option only affects where the *sound* goes (omxplayer command line help says exactly this); e.g. I am using DVI from the HDMI port, and I want the video to go via the HDMI port but the sound via the headphone jack, and this only works if I don't specify '-ohdmi'.
Posts: 7
Joined: Wed Oct 31, 2012 3:34 pm
by Luutifa » Sat Dec 01, 2012 4:16 pm
Updated whitey, and yt-downloader (or whatever it was)
Does whitey0.2 need any tweaking in the source?
I don't think it does.

But still, doesn't work. I did remove the ", '-ohdmi'" from _init_.py, but can that do any bad?

I get:
OSError: [Errno 8] Exec format error
Posts: 14
Joined: Mon Nov 26, 2012 6:20 pm
by sim_tcr » Sat Dec 01, 2012 4:23 pm
Luutifa wrote:Updated whitey, and yt-downloader (or whatever it was)
Does whitey0.2 need any tweaking in the source?
I don't think it does.

But still, doesn't work. I did remove the ", '-ohdmi'" from _init_.py, but can that do any bad?

I get:
OSError: [Errno 8] Exec format error


I thing you go to run the python setup script again.

Correct syntax is mentioned in the beginning of this thread
http://raspisimon.no-ip.org
Raspberry Pi Model B x 2, Transcend 16GB Class 10, Transcend 8GB Class 4, Nokia Travel Charger ACP-12E 5.7V 800mA, Netgear WNA1000M Wifi Dongle/Ethernet
Posts: 311
Joined: Tue Nov 06, 2012 1:01 pm
Location: Bangalore
by Luutifa » Sat Dec 01, 2012 4:57 pm
sim_tcr wrote:
Luutifa wrote:Updated whitey, and yt-downloader (or whatever it was)
Does whitey0.2 need any tweaking in the source?
I don't think it does.

But still, doesn't work. I did remove the ", '-ohdmi'" from _init_.py, but can that do any bad?

I get:
OSError: [Errno 8] Exec format error


I thing you go to run the python setup script again.

Correct syntax is mentioned in the beginning of this thread


Actually, I solved my problem by manually upgrading youtube-dl (sudo youtube-dl -U didn't do it for some reason), and starting with "yt --player omxplayer"

I was able to watch "Charlie bit my finger" :)
Posts: 14
Joined: Mon Nov 26, 2012 6:20 pm
by djdisc » Sat Dec 01, 2012 10:03 pm
Hi, im also getting the Error

pi@raspberrypi ~ $ yt
Traceback (most recent call last):
File "/usr/local/bin/yt", line 9, in <module>
load_entry_point('whitey==0.1', 'console_scripts', 'yt')()
File "/usr/local/lib/python2.7/dist-packages/whitey-0.1-py2.7.egg/yt/__init__.py", line 16, in main
ui.run()
File "/usr/local/lib/python2.7/dist-packages/whitey-0.1-py2.7.egg/yt/__init__.py", line 56, in run
curses.wrapper(self._curses_main)
File "/usr/lib/python2.7/curses/wrapper.py", line 43, in wrapper
return func(stdscr, *args, **kwds)
File "/usr/local/lib/python2.7/dist-packages/whitey-0.1-py2.7.egg/yt/__init__.py", line 100, in _curses_main
self._run_pager()
File "/usr/local/lib/python2.7/dist-packages/whitey-0.1-py2.7.egg/yt/__init__.py", line 227, in _run_pager
self._play_video(c - ord('1'))
File "/usr/local/lib/python2.7/dist-packages/whitey-0.1-py2.7.egg/yt/__init__.py", line 254, in _play_video
play_url(url)
File "/usr/local/lib/python2.7/dist-packages/whitey-0.1-py2.7.egg/yt/__init__.py", line 364, in play_url
stdout = subprocess.PIPE, stderr = subprocess.PIPE)
File "/usr/lib/python2.7/subprocess.py", line 679, in __init__
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1249, in _execute_child
raise child_exception
OSError: [Errno 2] Datei oder Verzeichnis nicht gefunden


Is there any solution? - Thank you for your help!
Posts: 1
Joined: Sat Dec 01, 2012 9:58 pm
by Luutifa » Sun Dec 02, 2012 4:30 pm
djdisc wrote:Hi, im also getting the Error

pi@raspberrypi ~ $ yt
Traceback (most recent call last):
File "/usr/local/bin/yt", line 9, in <module>
load_entry_point('whitey==0.1', 'console_scripts', 'yt')()
File "/usr/local/lib/python2.7/dist-packages/whitey-0.1-py2.7.egg/yt/__init__.py", line 16, in main
ui.run()
File "/usr/local/lib/python2.7/dist-packages/whitey-0.1-py2.7.egg/yt/__init__.py", line 56, in run
curses.wrapper(self._curses_main)
File "/usr/lib/python2.7/curses/wrapper.py", line 43, in wrapper
return func(stdscr, *args, **kwds)
File "/usr/local/lib/python2.7/dist-packages/whitey-0.1-py2.7.egg/yt/__init__.py", line 100, in _curses_main
self._run_pager()
File "/usr/local/lib/python2.7/dist-packages/whitey-0.1-py2.7.egg/yt/__init__.py", line 227, in _run_pager
self._play_video(c - ord('1'))
File "/usr/local/lib/python2.7/dist-packages/whitey-0.1-py2.7.egg/yt/__init__.py", line 254, in _play_video
play_url(url)
File "/usr/local/lib/python2.7/dist-packages/whitey-0.1-py2.7.egg/yt/__init__.py", line 364, in play_url
stdout = subprocess.PIPE, stderr = subprocess.PIPE)
File "/usr/lib/python2.7/subprocess.py", line 679, in __init__
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1249, in _execute_child
raise child_exception
OSError: [Errno 2] Datei oder Verzeichnis nicht gefunden


Is there any solution? - Thank you for your help!



Make sure you have the newest versions, and RUN IT LIKE:
Code: Select all
yt --player omxplayer
Posts: 14
Joined: Mon Nov 26, 2012 6:20 pm
by EdwinJ85 » Sun Dec 16, 2012 11:50 am
Hi everyone,

I've managed to get omxplayer working with youtube-dl, but the original feburary version mentioned at the start of this article didn't work, apparently the youtube web api has changed, so you need the latest version.

I have installed yt, but every time I run it and choose a video I get this error?


yt -player omxplayer
Traceback (most recent call last):
File "/usr/local/bin/yt", line 9, in <module>
load_entry_point('whitey==0.1', 'console_scripts', 'yt')()
File "/usr/local/lib/python2.7/dist-packages/whitey-0.1-py2.7.egg/yt/__init__.py", line 16, in main
ui.run()
File "/usr/local/lib/python2.7/dist-packages/whitey-0.1-py2.7.egg/yt/__init__.py", line 56, in run
curses.wrapper(self._curses_main)
File "/usr/lib/python2.7/curses/wrapper.py", line 43, in wrapper
return func(stdscr, *args, **kwds)
File "/usr/local/lib/python2.7/dist-packages/whitey-0.1-py2.7.egg/yt/__init__.py", line 100, in _curses_main
self._run_pager()
File "/usr/local/lib/python2.7/dist-packages/whitey-0.1-py2.7.egg/yt/__init__.py", line 227, in _run_pager
self._play_video(c - ord('1'))
File "/usr/local/lib/python2.7/dist-packages/whitey-0.1-py2.7.egg/yt/__init__.py", line 254, in _play_video
play_url(url)
File "/usr/local/lib/python2.7/dist-packages/whitey-0.1-py2.7.egg/yt/__init__.py", line 364, in play_url
stdout = subprocess.PIPE, stderr = subprocess.PIPE)
File "/usr/lib/python2.7/subprocess.py", line 679, in __init__
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1249, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory

Any ideas?
Getting doom to run is my "Hello World".
Posts: 208
Joined: Wed Feb 01, 2012 4:44 pm
by moocow1452 » Sat Dec 22, 2012 9:09 pm
Figured it out, from the top;

marktbaldridge wrote:
So, we have to download it here: https://github.com/rg3/youtube-dl/raw/2012.02.27/youtube-dl
Code: Select all
wget https://github.com/rg3/youtube-dl/raw/2012.02.27/youtube-dl


Then we have to manually install it:
Code: Select all
chmod +x youtube-dl
cp youtube-dl /usr/bin/youtube-dl


Now we need to install python's setup tools. And BTW, don't worry, this is all small stuff. You won't clutter up your SD card. :)
Code: Select all
sudo apt-get install python-setuptools


Next we need to download and extract yt which is an awesome python console utility for playing youtube videos.
Code: Select all
wget http://pypi.python.org/packages/source/w/whitey/whitey-0.1.tar.gz
tar -zxvf whitey-0.1.tar.gz


But DON"T INSTALL YET! We need to tell yt to use omxplayer not mplayer because that doesn't work on the RP.

Code: Select all
wget https://dl.dropbox.com/u/33311875/__init__.py
cp __init__.py whitey-0.1/src/yt/__init__.py


Next, navigate so that you are in the main whitey folder, and then install:
Code: Select all
sudo python setup.py install


Finally run "sudo youtube-dl -U" until it says it needs to update once more. Wait for it to finish, then do it again, because it's a liar and a cheat, and you have to wait for it to say "youtube-dl is up-to-date (2012.12.11)"

Then you should be able to just run ~$ yt and watch the magic happen!


Stuff in red is my work, including the easy paste of __init__.py, and running "sudo youtube-dl -U" Anyway, I think it's just about brain proof at this point.
Posts: 24
Joined: Wed Apr 04, 2012 10:03 pm
by Zhara » Sun Dec 23, 2012 5:59 pm
Hi guys,
i tried do this but the best cast was only sound, but not from hdmi...
This is the message i get:
Code: Select all
Traceback (most recent call last):
  File "/usr/local/bin/yt", line 9, in <module>
    load_entry_point('whitey==0.2', 'console_scripts', 'yt')()
  File "/usr/local/lib/python2.7/dist-packages/whitey-0.2-py2.7.egg/yt/__init__.py", line 28, in main
    ui.run()
  File "/usr/local/lib/python2.7/dist-packages/whitey-0.2-py2.7.egg/yt/__init__.py", line 71, in run
    curses.wrapper(self._curses_main)
  File "/usr/lib/python2.7/curses/wrapper.py", line 43, in wrapper
    return func(stdscr, *args, **kwds)
  File "/usr/local/lib/python2.7/dist-packages/whitey-0.2-py2.7.egg/yt/__init__.py", line 115, in _curses_main
    self._run_pager()
  File "/usr/local/lib/python2.7/dist-packages/whitey-0.2-py2.7.egg/yt/__init__.py", line 242, in _run_pager
    self._play_video(c - ord('1'))
  File "/usr/local/lib/python2.7/dist-packages/whitey-0.2-py2.7.egg/yt/__init__.py", line 269, in _play_video
    play_url(url,self._player)
  File "/usr/local/lib/python2.7/dist-packages/whitey-0.2-py2.7.egg/yt/__init__.py", line 382, in play_url
    play_url_omxplayer(url)
  File "/usr/local/lib/python2.7/dist-packages/whitey-0.2-py2.7.egg/yt/__init__.py", line 394, in play_url_omxplayer
    player.wait()
  File "/usr/lib/python2.7/subprocess.py", line 1291, in wait
    pid, sts = _eintr_retry_call(os.waitpid, self.pid, 0)
  File "/usr/lib/python2.7/subprocess.py", line 478, in _eintr_retry_call
    return func(*args)


Can anyone help me?
Posts: 4
Joined: Sun Dec 23, 2012 5:23 pm
by Crazydrift » Mon Dec 24, 2012 11:57 pm
it works great!

@bbond007
i want your script, it sounds epic.
Posts: 1
Joined: Mon Dec 24, 2012 11:44 pm
by moocow1452 » Thu Dec 27, 2012 3:08 pm
Think I finally got a project for coding, I want to see if I can hack together a Blip and a Put.io version of youtube-dl, to get my channel awesome fix from that sort of interphase, since xbmc is a PITA to set up properly. No clue how to do it, but such is life.
Posts: 24
Joined: Wed Apr 04, 2012 10:03 pm
by pipuppy » Tue Jan 01, 2013 9:29 am
Hi folks,

Just wanted to say "thanks" to all the contributions for this thread, I followed the instructions quoted and aside from no sound with the hdmi everything worked with "jaw dropping" results. The raspi/TV combination is now the best YT viewer I have in the house. Watching some of the BBC HD Dr-Who trailers was just like watching live HD-TV, awesome!

I resolved the lack of audio via the hdmi by adding the '-ohdmi' after the omxplayer command as directed in one of the earlier postings,. The only "issue" I had was that no matter what I changed in the init.py file nothing seemed to happen until I re-installed the files (after editing) then everything worked OK.

Thanks again folks and a happy & peaceful 2013 to you all.

pipuppy

moocow1452 wrote:Figured it out, from the top;

marktbaldridge wrote:
So, we have to download it here: https://github.com/rg3/youtube-dl/raw/2012.02.27/youtube-dl
Code: Select all
wget https://github.com/rg3/youtube-dl/raw/2012.02.27/youtube-dl


Then we have to manually install it:
Code: Select all
chmod +x youtube-dl
cp youtube-dl /usr/bin/youtube-dl


Now we need to install python's setup tools. And BTW, don't worry, this is all small stuff. You won't clutter up your SD card. :)
Code: Select all
sudo apt-get install python-setuptools


Next we need to download and extract yt which is an awesome python console utility for playing youtube videos.
Code: Select all
wget http://pypi.python.org/packages/source/w/whitey/whitey-0.1.tar.gz
tar -zxvf whitey-0.1.tar.gz


But DON"T INSTALL YET! We need to tell yt to use omxplayer not mplayer because that doesn't work on the RP.

Code: Select all
wget https://dl.dropbox.com/u/33311875/__init__.py
cp __init__.py whitey-0.1/src/yt/__init__.py


Next, navigate so that you are in the main whitey folder, and then install:
Code: Select all
sudo python setup.py install


Finally run "sudo youtube-dl -U" until it says it needs to update once more. Wait for it to finish, then do it again, because it's a liar and a cheat, and you have to wait for it to say "youtube-dl is up-to-date (2012.12.11)"

Then you should be able to just run ~$ yt and watch the magic happen!


Stuff in red is my work, including the easy paste of __init__.py, and running "sudo youtube-dl -U" Anyway, I think it's just about brain proof at this point.
Posts: 15
Joined: Fri Aug 24, 2012 12:51 pm