LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 09-19-2011, 08:32 PM   #1
AaZmaNd
LQ Newbie
 
Registered: Sep 2011
Posts: 3

Rep: Reputation: Disabled
Question Movie player capable to poweroff the system


Hi!

I recently switched to linux from windows and currently I watch the movies in Totem Movie Player. Everything is fine but I miss two features.
1. On windows, I can set Media Player Classic to shut down the computer when it finishes to play the movie/playlist.
2. Also there is a sound "normalization" option, which "lowers" the sound volume for the louder moments in the movie and then restores it back.

Is there any movie player for linux with such features, or at least with the first one available?

Thanks!
 
Old 09-19-2011, 08:47 PM   #2
corp769
LQ Guru
 
Registered: Apr 2005
Location: /dev/null
Posts: 5,818

Rep: Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007
Hello,

For your first question, you could always run your media player, with the options you need and the file you want played, from a terminal, and append the poweroff command at the end, as such:
Code:
mplayer <options> file_to_play.avi && poweroff
As far as your second question, I know for sure that VLC has the option for sound normalization.

Cheers,

Josh

Edit - See this link for a reference - http://www.thefreewindows.com/2499/n...of-vlc-player/
 
1 members found this post helpful.
Old 09-20-2011, 07:17 AM   #3
AaZmaNd
LQ Newbie
 
Registered: Sep 2011
Posts: 3

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by corp769 View Post
Hello,

For your first question, you could always run your media player, with the options you need and the file you want played, from a terminal, and append the poweroff command at the end, as such:
Code:
mplayer <options> file_to_play.avi && poweroff
This is acceptable, thanks!
 
Old 09-20-2011, 07:35 AM   #4
cascade9
Senior Member
 
Registered: Mar 2011
Location: Brisneyland
Distribution: Debian, aptosid
Posts: 3,753

Rep: Reputation: 935Reputation: 935Reputation: 935Reputation: 935Reputation: 935Reputation: 935Reputation: 935Reputation: 935
Quote:
normalise the volume

Adding -af volnorm to the command line will maximise the volume of the audio track, without distorting.
http://everydaylht.com/howtos/multimedia/mplayer/

Never used it myself.
 
Old 09-20-2011, 06:55 PM   #5
corp769
LQ Guru
 
Registered: Apr 2005
Location: /dev/null
Posts: 5,818

Rep: Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007
Quote:
Originally Posted by cascade9 View Post
I haven't either, but that is why I made the reference to VLC - I used it a while back, and it worked as advertised for me.
 
Old 09-20-2011, 07:12 PM   #6
Nominal Animal
Senior Member
 
Registered: Dec 2010
Location: Finland
Distribution: Xubuntu, CentOS, LFS
Posts: 1,723
Blog Entries: 3

Rep: Reputation: 948Reputation: 948Reputation: 948Reputation: 948Reputation: 948Reputation: 948Reputation: 948Reputation: 948
Quote:
Originally Posted by corp769 View Post
For your first question, you could always run your media player, with the options you need and the file you want played, from a terminal, and append the poweroff command at the end
An excellent suggestion; I recommend you do that if possible.

There exists an another approach. For example, you might want to shut down only after all programs in a specific set have all exited. In this case, you'd use a script, which regularly checks the process list, and if there are none of the required processes running, it shuts down the machine.

Such a script is very simple to write. This one takes the list of commands (to watch) as command line parameters. If you supply none, it does nothing.
Code:
#!/bin/bash
# Interval in seconds to wait between checks
SECONDS="5"

# Do nothing if no commands specified.
[ $# -gt 0 ] || exit 0

# Construct a ps command:
CMD=(ps)
while [ $# -gt 0 ]; do
    CMD=("${CMD[@]}" "-C" "$1")
    shift 1
done
CMD=("${CMD[@]}" "-o" "pid=")

# Use a background subshell
(
        # Check until no processes found.
        while [ -n "$(${CMD[@]})" ]; do
            sleep $SECONDS
        done

        # Shutdown
        poweroff

) &
For example, if you save the above as poweroff-without , and set it executable with chmod 0755 poweroff-without then running
Code:
./poweroff-without mplayer firefox-bin
will shut down your computer when neither mplayer nor firefox are running. It checks every five seconds, so allow for a five-second delay, though.

Scripts like that can be extended easily. For example, you might want it to cancel the poweroff completely, if you run some other command -- say in case you forgot the poweroff was activated.

If this is a recurring use case (I mean with many programs), it should be a rather simple but fun exercise to write a GTK+ Python/Ruby/Perl/C++ tool or widget, which presents a menu of running (and non-running known) programs you could select. There might be people in the Programming forum willing to help write such a program. (Just use the external 'ps' command to do the process listing and checking, and the rest is quite simple.)
 
1 members found this post helpful.
Old 09-20-2011, 07:26 PM   #7
corp769
LQ Guru
 
Registered: Apr 2005
Location: /dev/null
Posts: 5,818

Rep: Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007
Hey Rod, that's a good one too. I have a script somewhat similar to that within one of my backups, I should find it and post it up. Honestly, to the OP, he could do whatever he would like, but as far as running multiple commands, your script would be an easier way, due to the fact that using && with other commands would need to finish executing the first command.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Movie Player and Dragon Player not working in Kubuntu 10.04 Lucid Lynx Jim VE7ROX Linux - Newbie 2 09-20-2010 04:49 PM
LXer: Vista Capable Lawsuit is Too Capable LXer Syndicated Linux News 0 11-23-2008 08:50 AM
Need help w/ movie player on 64-bit system bmcneely0 Linux - General 1 04-04-2006 01:56 PM
Good console music player capable of streams? Moses420ca Linux - Software 1 10-26-2005 04:05 AM
Is Python as capable as Perl for system administration? johnMG Programming 10 02-07-2005 02:11 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:52 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration