| Author |
Message |
stu90

Joined: 25 Feb 2010 Posts: 1401 Location: England. Dell Inspiron 1501. Dpup
|
Posted: Thu 10 Feb 2011, 13:34 Post subject:
Howto - play youtube videos in Mplayer |
|
Updated script and guide
If you use old version just delete it from /root/my-applications/bin and copt this one to there.
-----------------------------------------------------------------
Updated script v4 and guide
Step 1.
First download this file vid.gz
(updated script v4) http://dl.dropbox.com/u/3009188/vid.gz
Step 2.
Move (Drag & Drop) the archived file vid.gz to the directory /root/my-applications/bin
Step 3.
Now mouse click on the vid.gz file and decompress in is current location /root/my-applications/bin
Step 4.
(Drag & Drop) the vid file in /root/my-applications/bin to your desktop - you can add a custom icon of your choosing by: right mouse button click > File 'vid' > Set icon.. then (Drag & Drop) your icon into the dialog box.
To use.
Go to some popular video streaming site such as Youtube find the video/s you wish to watch click on Play then immediately pause the video - now minimize your browser and click on the vid icon on your desktop, your video should now play in Mplayer.
You can also start the video from terminal by using the command: vid
Or add a launcher in your panel / taskbar by directing the launcher to /root/my-applications/bin/vid
save videos.
after video/s have played a little GUI pop up giving you the option to save files or exit with out saving - GUI will time out after 20 seconds if you don;t select an option no video will be saved.
Default save location is /root you can change the save location by right clicking of the vid Script > File 'vid' > Open as text and enter your save location in between the quotes on line four.
If no videos are found in /tmp the save GUI will still pop up just exit it or leave it to time out on its own.
Tips.
P key to play / pause
Q key to Quit
F key to toggle full screen
arrow keys to skip forwards / backwards
cheers.
Last edited by stu90 on Sat 12 Feb 2011, 12:44; edited 4 times in total
|
|
Back to top
|
|
 |
gcmartin
Joined: 14 Oct 2005 Posts: 2630 Location: Earth
|
Posted: Thu 10 Feb 2011, 14:33 Post subject:
|
|
Thanks. I have been looking for this type of method to handle playback on low memory machines ("Jerky play when watching in a browser") This solves that.
If you update this script, would you add a feature to move file to somewhere other than temp/tmp.
Anyway Thank you for sharing a very useful piece of work
_________________ Get ACTIVE; Create Circles; Do those good things which benefit the people's needs!
We are all related ... Its time to show that we know this!
Google's Puppy Search Engine
Last edited by gcmartin on Sat 12 Feb 2011, 04:26; edited 1 time in total
|
|
Back to top
|
|
 |
keniv
Joined: 06 Oct 2009 Posts: 145 Location: Scotland
|
Posted: Thu 10 Feb 2011, 17:05 Post subject:
|
|
Hi stu90
I like this little program. It works well on an old laptop. Lets me watch a smooth version of video then I rename and move from /tmp any I want to keep. I tried to play the flash that the BBC use in iPlayer but had no luck. I am not sure how the BBCs stuff works but thought it was worth a try.
Regards,
Ken.
|
|
Back to top
|
|
 |
stu90

Joined: 25 Feb 2010 Posts: 1401 Location: England. Dell Inspiron 1501. Dpup
|
Posted: Fri 11 Feb 2011, 16:39 Post subject:
|
|
See first post for latest update.
Last edited by stu90 on Sat 12 Feb 2011, 10:35; edited 1 time in total
|
|
Back to top
|
|
 |
stu90

Joined: 25 Feb 2010 Posts: 1401 Location: England. Dell Inspiron 1501. Dpup
|
Posted: Fri 11 Feb 2011, 16:46 Post subject:
Re: Online Video Playback via Mplayer |
|
| gcmartin wrote: | Thanks. I have been looking for this type of method to handle playback on low memory machines ("Jerky play when watching in a browser") This solves that.
If you update this script, would you add a feature to move file to somewhere other than temp/tmp.
Anyway Thank you for sharing a very useful piece of work |
Hi gcmartin,
See update in post three.
| keniv wrote: | Hi stu90
I like this little program. It works well on an old laptop. Lets me watch a smooth version of video then I rename and move from /tmp any I want to keep. I tried to play the flash that the BBC use in iPlayer but had no luck. I am not sure how the BBCs stuff works but thought it was worth a try.
Regards,
Ken. |
Hello keniv,
Yes i don;t know how you would save such files as they don;t seems to save anything in /tmp - same with the 4od and ITV videos as well.
|
|
Back to top
|
|
 |
gcmartin
Joined: 14 Oct 2005 Posts: 2630 Location: Earth
|
Posted: Sat 12 Feb 2011, 04:48 Post subject:
Online Video Playback via Mplayer instead of Browser |
|
If I understand, correctly, | Quote: | | "vid" looks in /tmp for a known video format that it will launch. | Is that true? (How does it identify a multimedia for playback?) | Quote: | | If a site somehow was able to direct a video to your system into some other folder; say /root or anywhere else, "vid" may not be able to find it. | Is that true? | Quote: | | And, I would assume that if one was on a website where your browser is used to directly display audio-video content directly from the server (i.e server-side Java) thru your browser, "vid" would not be able to detect this. | Is that true? | Quote: | | Thus, items that are handled thru the browser via HTML5 or thru Adobe Flash would not be detected by "vid". | Is that true?
Correct me if any of this is wrong.Thanks, again, for your good work.
P.S. Your script is so small, why compress it? That would reduce a step that newbies would get wrong. Its a thought, not a request; per se.
_________________ Get ACTIVE; Create Circles; Do those good things which benefit the people's needs!
We are all related ... Its time to show that we know this!
Google's Puppy Search Engine
|
|
Back to top
|
|
 |
stu90

Joined: 25 Feb 2010 Posts: 1401 Location: England. Dell Inspiron 1501. Dpup
|
Posted: Sat 12 Feb 2011, 10:35 Post subject:
|
|
New update v.4 see first post
Hi gcmartin,
vid will search for a string in file name - for instance 'Flash' for Youtube Vimeo etc - v4 will also search for other strings like 'mp3' now as well - so you could in /tmp have a flash video, avi video, and an mp3 audio, vid will detect each and play/save them.
You could add what ever string you like see line 7-13 and line 15 & 22.
vid will search /tmp by default but you can change it to search a different directory if you wish say ./downloads instead of /tmp - see line 6 of script.
I don;t know how you would have it search multiple directories say /tmp & /root ?
BBC html5 if the file is encrypted or if there is no media file for vid to find in a directory it wont play that file.
I put vid in archive file because dropbox for some reason changes the format to a .txt file - so after some one downloaded to get the script to work they would need to rename it.
cheers.
|
|
Back to top
|
|
 |
stu90

Joined: 25 Feb 2010 Posts: 1401 Location: England. Dell Inspiron 1501. Dpup
|
Posted: Sun 13 Feb 2011, 16:09 Post subject:
|
|
have re written most of this Script - after files have played a dialog will pop up with a list of files found / played and option to save files. If no files found you should get another popup saying no file found that will time out or click ok.
Default save location is /root/vid default search location is /tmp both can be changes if you open script as text.
v5 http://dl.dropbox.com/u/3009188/vid.gz
|
|
Back to top
|
|
 |
umair
Joined: 25 Dec 2010 Posts: 144 Location: KUST Kohat, Pakistan
|
Posted: Thu 15 Dec 2011, 13:09 Post subject:
|
|
Hi Stu90:
I used ur script, but it gaves me the error: (I m posting he screenshot when I clciked on the vid icon also when I type the vid in the path).
I m using Lupu525 on my old P-III, 512 MB RAM 20 HDD with FRUGAL Install.
any Idea?
Thnx in advance.
Regards
Umair
| Description |
|

Download |
| Filename |
3.png |
| Filesize |
334.53 KB |
| Downloaded |
150 Time(s) |
|
|
Back to top
|
|
 |
stu90

Joined: 25 Feb 2010 Posts: 1401 Location: England. Dell Inspiron 1501. Dpup
|
Posted: Thu 15 Dec 2011, 15:19 Post subject:
|
|
| umair wrote: | Hi Stu90:
I used ur script, but it gaves me the error: (I m posting he screenshot when I clciked on the vid icon also when I type the vid in the path).
I m using Lupu525 on my old P-III, 512 MB RAM 20 HDD with FRUGAL Install.
any Idea?
Thnx in advance.
Regards
Umair |
Hello umair,
try in terminal:
chmod +x /path/to/script
Flash has undergone some changes since this script was written - it no longer stores videos in /tmp for easy access so if you are using a new version of flash this script may no longer work.
If you are using a newer flash version try pasting the code below to the bottom of your /root/.bashrc file.
| Code: |
function flashvideo () {
VID=$(stat -c %N /proc/*/fd/* 2>&1|awk -F[\`\'] '/lash/{print$2}')
mplayer -autosync 30 -mc 2.0 -cache 1000 $VID
}
|
then in terminal run the command: ~/.bashrc to reload.
Now start streaming video in web browser then pause it - open a new terminal window and enter the command: flashvideo
this should now play the video in mplayer.
|
|
Back to top
|
|
 |
keniv
Joined: 06 Oct 2009 Posts: 145 Location: Scotland
|
Posted: Fri 16 Dec 2011, 10:03 Post subject:
|
|
Hi stu90
I am using 528 on an old Toshiba laptop PIII 800MHz 320MB. I have followed your instructions above but after typing flashvideo in a new terminal I get "command not found". I have checked that I copied and pasted your script correctly. I tried rebooting my machine but got the the same result. Assuming I can get it to work would it just be a matter of changing "mplayer" to "vlc" in your script to get it to play in vlc or is there more to it than this? Also is it possible to save a copy of the video?
Regards,
Ken.
|
|
Back to top
|
|
 |
stu90

Joined: 25 Feb 2010 Posts: 1401 Location: England. Dell Inspiron 1501. Dpup
|
Posted: Fri 16 Dec 2011, 11:12 Post subject:
|
|
| keniv wrote: | Hi stu90
I am using 528 on an old Toshiba laptop PIII 800MHz 320MB. I have followed your instructions above but after typing flashvideo in a new terminal I get "command not found". I have checked that I copied and pasted your script correctly. I tried rebooting my machine but got the the same result. Assuming I can get it to work would it just be a matter of changing "mplayer" to "vlc" in your script to get it to play in vlc or is there more to it than this? Also is it possible to save a copy of the video?
Regards,
Ken. |
Hello keniv,
I have not used Lucid 528 but i think i read somewhere it has roxterm as default terminal? if so instead try using urxvt terminal in the Menu.
If this doesn't work make sure you have reloaded .bashrc file - but make sure to type the flashvideo command in a new terminal window.
I don't use vlc i imagine it will work though - you will probibly need to change the mplayer line to something like:
vlc $VID or what ever the vlc command might be to play a video file from the command line.
Don't forget though to reload the .bashrc file every time you make changes to it and try the command in a new terminal window so the changes take effect.
|
|
Back to top
|
|
 |
keniv
Joined: 06 Oct 2009 Posts: 145 Location: Scotland
|
Posted: Fri 16 Dec 2011, 12:47 Post subject:
|
|
Hi stu90
Thanks for your quick reply. Typing the flashvideo command into the urxvt terminal did the trick. I tried your suggestion to get the video to play using vlc but it did not work. I tried to find the command to get vlc to play a video from a terminal by typing vlc --help. Although this gave me a large list of vlc commands I could not find an appropriate one. As you probably realize I am not very sure what I am doing in this respect but I will play about a bit and see if I can get it to work. However, I am quite happy it works with mplayer. This is a good way to play flash video smoothly on old hardware like my laptop. If I play it through the browser it's jerky. Is it possible to save a copy of the video using this method?
Thanks again,
Ken.
|
|
Back to top
|
|
 |
umair
Joined: 25 Dec 2010 Posts: 144 Location: KUST Kohat, Pakistan
|
Posted: Sat 17 Dec 2011, 03:56 Post subject:
|
|
| stu90 wrote: |
Flash has undergone some changes since this script was written - it no longer stores videos in /tmp for easy access so if you are using a new version of flash this script may no longer work.
If you are using a newer flash version try pasting the code below to the bottom of your /root/.bashrc file.
Code:
function flashvideo () {
VID=$(stat -c %N /proc/*/fd/* 2>&1|awk -F[\`\'] '/lash/{print$2}')
mplayer -autosync 30 -mc 2.0 -cache 1000 $VID
}
then in terminal run the command: ~/.bashrc to reload.
Now start streaming video in web browser then pause it - open a new terminal window and enter the command: flashvideo
this should now play the video in mplayer. |
hi stu90:
1st of all thnx alot for quick response. I used your above method and WOW
works perfectly. U Rocks
Now I m able to play youtube with full screen without any problem on my old system.
once again thnx.
Regards
UMAIR
|
|
Back to top
|
|
 |
|