Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Fri 28 Nov 2014, 08:29
All times are UTC - 4
 Forum index » House Training » HOWTO ( Solutions )
Mplayer play video from the command prompt.
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [8 Posts]  
Author Message
stu90


Joined: 25 Feb 2010
Posts: 1401
Location: England. Dell Inspiron 1501. Dpup

PostPosted: Wed 31 Aug 2011, 09:46    Post subject:  Mplayer play video from the command prompt.  

I was reading the other day that it is possible to play video with mplayer at the command prompt with out being in the graphical desktop (ctrl + alt + backspace) initial test proved this does indeed work on puppy however the video window was not full screen and the usual control + f full screen command doesn't seem to work - so here is a little script i made to play videos full screen, you may need to alter x and y for your own screen resolution.

Name the script clmplayer and put it in PATH /usr/bin /root/my-applications/bin etc.
Code:
#!/bin/bash
tput civis
mplayer -vo fbdev2 -fs -quiet -zoom -x 1280 -y 800 "$@"
tput cnorm && exit


to use type at the command: clmplayer /path/to/media/file.avi

i like to use fbclone for quick file navigation but you can use the Tab key for auto completion of your file name.
Back to top
View user's profile Send private message 
Bruce B


Joined: 18 May 2005
Posts: 11131
Location: The Peoples Republic of California

PostPosted: Mon 05 Sep 2011, 13:50    Post subject:  

I recently found if I use ffplay -fs (-fs is full screen) it will bring the screen to the front.

I also made a script for grabbing multimedia from cache and /tmp

Would you like me to post them here? If not I can do it somewhere else?

No offense either way.

_________________
New! Puppy Linux Links Page
Back to top
View user's profile Send private message 
stu90


Joined: 25 Feb 2010
Posts: 1401
Location: England. Dell Inspiron 1501. Dpup

PostPosted: Mon 05 Sep 2011, 14:40    Post subject:  

Hi Bruce. Sure no problems. Cool
Back to top
View user's profile Send private message 
disciple

Joined: 20 May 2006
Posts: 6458
Location: Auckland, New Zealand

PostPosted: Mon 05 Sep 2011, 19:23    Post subject:  

Can ffplay work when you're not in X?
_________________
DEATH TO SPREADSHEETS
- - -
Classic Puppy quotes
- - -
Beware the demented serfers!
Back to top
View user's profile Send private message 
Bruce B


Joined: 18 May 2005
Posts: 11131
Location: The Peoples Republic of California

PostPosted: Tue 06 Sep 2011, 22:38    Post subject:  

Swell Stu90, I don't want to interfere with another's howto, but this seems as if it might be a helpful addition. This script is for people of a modest or intermediate scripting ability. I won't explain what it does, but if anyone has specific questions, I'll answer them.

Please consider the script as a template for use in locating media files in the cache directory. A template because once understood there are many, many things the user can do to customize and improve it.

Code:
#!/bin/bash

cachedir="/initrd/pup_rw/root/spot/.mozilla/firefox/iof95jww.abuse/Cache"
savedir="/initrd/pup_rw/root/spot/.mozilla/firefox/media"


cd $cachedir
for i in * ; do

    filesize=`stat -c%s $i`
    [ $filesize -lt 300000 ] && continue

    type=`file ${cachedir}/$i`
    echo $type | grep QuickTime &>/dev/null
    if [ "$?" = "0" ] ; then
        ffplay -autoexit -fs ${cachedir}/$i
        mv ${cachedir}/$i ${savedir}/${i}.mov
        continue
    fi


    echo $type | grep Macromedia &>/dev/null
    if [ "$?" = "0" ] ; then
        ffplay -autoexit -fs ${cachedir}/$i
        mv ${cachedir}/$i ${savedir}/${i}.flv
        continue
    fi

    echo $type | grep Microsoft &>/dev/null
    if [ "$?" = "0" ] ; then
        ffplay -autoexit -fs ${cachedir}/$i
        mv ${cachedir}/$i ${savedir}/${i}.wmv
        continue
        fi
done


~

_________________
New! Puppy Linux Links Page
Back to top
View user's profile Send private message 
Bruce B


Joined: 18 May 2005
Posts: 11131
Location: The Peoples Republic of California

PostPosted: Wed 07 Sep 2011, 00:30    Post subject:  

Hints and tips

1) Sometimes I don't know where the media files are. They may not be in Cache or /tmp.

We have some work to do.

2) Often media files have a header instruction to delete. Typically, they delete when you do something like change to view another media or page.

If you watch, you will notice most media players have a download bar. Ideally, it moves faster than the play bar. When the download bar is finished, the media is somewhere on your computer fully downloaded. If you stop the playback after the download is complete, the media is likely not deleted.

3) The script I posted above can also be expanded to search the /tmp directory because a lot of media is downloaded there.

4) I have found media plays better with our media players such as mplayer or ffplay than with the onsite players and the local flashplugins. Our local players use less resources and the aspect ratios will be true. Other benefits such as easy navigation and replay.

~

_________________
New! Puppy Linux Links Page
Back to top
View user's profile Send private message 
Bruce B


Joined: 18 May 2005
Posts: 11131
Location: The Peoples Republic of California

PostPosted: Wed 07 Sep 2011, 00:37    Post subject:  

Stu90's script used tput, but I don't think all Puppy's have tput. In the past I found it was a part of the dev kit.

I've attached tput and a text formatted tput man page for anyone who wants it.

Code:
Archive:  tputpkg.zip
 Length   Method    Size  Cmpr    Date    Time   CRC-32   Name
--------  ------  ------- ---- ---------- ----- --------  ----
    9752  Defl:N     4830  51% 2010-03-07 03:33 7fd562b6  tput
    9648  Defl:N     3655  62% 2008-06-26 17:30 1f1ee461  tput.txt
--------          -------  ---                            -------
   19400             8485  56%                            2 files
tputpkg.zip
Description 
zip

 Download 
Filename  tputpkg.zip 
Filesize  8.58 KB 
Downloaded  137 Time(s) 

_________________
New! Puppy Linux Links Page
Back to top
View user's profile Send private message 
Bruce B


Joined: 18 May 2005
Posts: 11131
Location: The Peoples Republic of California

PostPosted: Wed 07 Sep 2011, 01:45    Post subject:  

Code:
#!/bin/bash

# This script will give meaningful extensions
# to your non flv, mov and wmv files in Cache.
# Run it after the script used to locate the media files
# or append it to that script.


CacheDir="user must fill in"
[ ! -d $CacheDir ] && echo "edit $0" && exit
cd $CacheDir


rm _CACHE_???_

for i in * ; do
   file $i | grep gzip >/dev/null
   if [ "$?" = "0" ] ; then
      mv $i $i.gz
      gzip -d $i.gz
   fi
done


for i in * ; do
   ext=`file $i | awk '{print tolower($2)}'`
   mv $i $i.$ext
done


Happy to answer questions

~

_________________
New! Puppy Linux Links Page
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [8 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » House Training » HOWTO ( Solutions )
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0726s ][ Queries: 12 (0.0126s) ][ GZIP on ]