playflash (mediaplayer instead slow player in your browser)

Stuff that has yet to be sorted into a category.
Message
Author
User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

playflash (mediaplayer instead slow player in your browser)

#1 Post by MU »

Flash movies embedded in webpages often are very slow, as these players do not support hardware accelleration.
So you might prefer, to see them in your mediaplayer.

This is a very small script, that is placed in /root/Startup/ and (/root/autostart for Muppy).

You must restart X or click on it to activate it.

It scans /tmp/ every 5 seconds for a Flash* file.
If it is detected, your mediaplayer is run with this file.

Default player is mplayer, if that is not available, gxine is used.
You can edit the script to set another defaultplayer.

To test it:
visit:
http://www.golem.de/0809/62664.html

Click on the embedded Video to start it.
Click on the stop-icon, to stop it.
Now it will be buffered, but it is not shown in the slow player.
Wait 5 seconds, and your mediaplayer should start and show it.

Mark
Attachments
playflash.pet
(569 Bytes) Downloaded 2004 times
[url=http://murga-linux.com/puppy/viewtopic.php?p=173456#173456]my recommended links[/url]

User avatar
mikeb
Posts: 11297
Joined: Thu 23 Nov 2006, 13:56

#2 Post by mikeb »

Hmm good old trick is that one....I wonder perhaps you could add function to give a 'save as' option too...seems like a popular request...and as a script would remain very lightweight.


mike

magerlab
Posts: 739
Joined: Sun 08 Jul 2007, 20:08

#3 Post by magerlab »

thak you Mark!
i also see that i can see that video is in /temp :D
will 5 sec interval affect cpu of old machines?

User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

#4 Post by MU »

no, 5 seconds should be ok.
To check it, type in a console:
top

That displays the running programs sorted by cpu-usage.


---------------------
A save-option could be done, it could be a good exercise for people who want to learn writing tools with bash and Xdialog.
I'm too busy at moment to write it on my own.

Mark
[url=http://murga-linux.com/puppy/viewtopic.php?p=173456#173456]my recommended links[/url]

User avatar
Flash
Official Dog Handler
Posts: 13071
Joined: Wed 04 May 2005, 16:04
Location: Arizona USA

#5 Post by Flash »

I installed the .pet, then discovered that if I pause a youtube video while it is playing, it will continue to load into /tmp and the Flash file in /tmp will play in gxine when I click it. It seems that I have to either delete it from /tmp or move it somewhere else before the next one will save in /tmp.

John Doe
Posts: 1681
Joined: Mon 01 Aug 2005, 04:46
Location: Michigan, US

#6 Post by John Doe »

regarding 5 seconds: perhaps 5 seconds isn't enough time to buffer on slower server streams and/or client connections...

this is a cool idea MU but a couple thoughts regarding potential problems that will arise.

1-not every flash file that lands in /tmp is desired media. there are menus, ads and other "site parts" written in flash. these will launch also.

2-even if there is only one flash object on the page that is desired media, it will most likely also auto play in the browser flash plug-in. with both playing, it would overload an older machine (900mhz, like I'm on) for sure.

my thoughts on a "perfect solution" for the problem you are trying to solve.

a custom moz plugin that displays a standard gui with three options:

1-save as
2-play
3-display

internally the plugin would function as follows:

1 - ask for location and output the binary stream there

2 - dump binary stream as unique file name to /tmp and launch 'defaultmediaplayer' with said unique file name.

3 - unload itself and load flash player plugin for display (good for site menus or sites in 100% flash). I don't even know if this is possible, just saying how it could be easily accomplished.


in closing...
UP YOURS ADOBE!!!! I'm sick of your crappy plugin!!

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#7 Post by technosaurus »

...or maybe couple this with the Flashblock plugin for some real speed?

User avatar
mikeb
Posts: 11297
Joined: Thu 23 Nov 2006, 13:56

#8 Post by mikeb »

Flash has to be loaded as it is this that downloads the flv not the browser directly....usually as a randomly named file..so blocking flashplayer won't work.

This will continue until it is complete or the page is navigated away from.

Perhaps a better way to detect would be to locate the file in temp that is steadily growing... (unless mu is already doing that)...

I will have a play with this

mike

edit..alternative approach
http://bashscripts.org/viewtopic.php?t=210

User avatar
mikeb
Posts: 11297
Joined: Thu 23 Nov 2006, 13:56

#9 Post by mikeb »

Ok that link is a little out of date....
here and updated version...given the you tube url it downloads the flv and plays it with a media player...flash player not needed....something to chew on

mike

Code: Select all

#!/bin/bash

wget -c -S -O tmp.flv `curl -s $1 | grep swfArgs | awk '{print $7 "get_video?video_id=" $11 "&t=" $19}' | tr -d '",'` &

vlc tmp.flv

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#10 Post by technosaurus »

@mikeb vlc --> gxine (in the posted code) for default puppy?

@all - This might be a perfect addition to FirePup

User avatar
mikeb
Posts: 11297
Joined: Thu 23 Nov 2006, 13:56

#11 Post by mikeb »

Just a serving suggestion.....a dialog could be added.....vlc can be gmplayer/gxine etc.

By the way it seems that if &fmt=18 is added to the url then the original video is downloaded.

mike
edit
hmm...seems like www.youtube.com rejects curl but uk.youtube.com works

I used dfa=`echo $dfa | sed 's/www/uk/'` where dfa = address to work round this.

User avatar
mikeb
Posts: 11297
Joined: Thu 23 Nov 2006, 13:56

#12 Post by mikeb »

Ok..still with the topic i hope...

I made a simple script to test loading/playing vids from youtube .
Also does straight downloads too....plus the 'you tube(s)' button tries to download the original movie...usually mp4 format ....there is the option to play the download with default player.

Now combining this with a browser rather than copying and pasting links would be neat step.

have fun

mike

not happy with sleep being used to buffer the start but works for test.

Edit :- Ok seems you tube have added an ad into the url string so here's an updated version. By the way I am using the uk url rather than us as www returns nothing wuth curl (?!!)
Attachments
YouTubeTest_v2.tar.gz
(997 Bytes) Downloaded 923 times

User avatar
E2001
Posts: 45
Joined: Fri 12 Dec 2008, 17:10

#13 Post by E2001 »

I'm not trying to to rain on anyone's parade, but...

If you use firefox as your browser, there are many plugins that allow you to download embedded media. I use one called: Video DownloadHelper. It can extract pretty much anything. Not automatic, tho.

Sorry if I missed the point.

stifiling
Posts: 388
Joined: Sun 30 Dec 2007, 03:56

#14 Post by stifiling »

does this still work? was able to get it to go before, now it's not on 4.1.3

User avatar
swiatmar
Posts: 248
Joined: Sat 09 Aug 2008, 19:33
Location: Danube, AT

#15 Post by swiatmar »

Hi!!

I don't really know why, but it doesn't work on my computer. I have installed this pet and somehow nothing is happening. I am running puppy 4.2
regards
mar

User avatar
swiatmar
Posts: 248
Joined: Sat 09 Aug 2008, 19:33
Location: Danube, AT

#16 Post by swiatmar »

ok :)
everything is fine now- it is working :)
regards mar

stifiling
Posts: 388
Joined: Sun 30 Dec 2007, 03:56

#17 Post by stifiling »

what did you do to get it to work? went back to flash 9? that's the solution that's working for me. do you have it working w/flash 10??

User avatar
mikeb
Posts: 11297
Joined: Thu 23 Nov 2006, 13:56

#18 Post by mikeb »

what did you do to get it to work? went back to flash 9? that's the solution that's working for me. do you have it working w/flash 10??
we since with some sites they seem to be using a new option of streaming media to ram rather than disk so that would most likely be the reason.....just means more use of internet bandwidth really

mike

User avatar
swiatmar
Posts: 248
Joined: Sat 09 Aug 2008, 19:33
Location: Danube, AT

#19 Post by swiatmar »

yes-it works on my puppy with flash 10. But I'm using xine instead of mplayer. Somehow mplayer doesn't work.

stifiling
Posts: 388
Joined: Sun 30 Dec 2007, 03:56

#20 Post by stifiling »

I've got this back working so nicely that i had to share. using flash 10.

I'm using the seamonkey 2.0 browser, and installed the greasemonkey add on from:
http://xsidebar.mozdev.org/modifiedmisc ... easemonkey

also this youtube userscript which adds "&fmt=18" automatically to the end of each youtube url. what that does is download the file to your /tmp folder as mp4, rather then flv and it can now be opened in VLC. got the youtube userscript from:
http://userscripts.org/scripts/show/29881

this in my opinion is the best way to do youtube. it's not cumbersome like those downloaders...nor do you have to experience the choppiness that we're all too familiar with.

i couldn't get it to work in xine, gxine, or mplayer.

playflash.pet + seamonkey/firefox + greasemonkey add on + youtube userscript + VLC = clear, easy, and fast youtube viewing.

maybe not too easy, but for people using linux....definitely not hard.

Post Reply