LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 02-11-2011, 12:09 PM   #1
jsteel
Member
 
Registered: Mar 2007
Location: England
Distribution: Arch
Posts: 392

Rep: Reputation: 34
Controlling media from the command line


Hi,

I want a media player that I can control from the command line. Ideally I would like it to have a GUI option, but I need to be able to run a command to "pause it", "play the next track in the playlist" etc. The player will be playing some media, then from another terminal I want to control the current instance.

What are my options? I'd prefer it not to be an mpd client if possible.

Thanks
 
Old 02-11-2011, 01:30 PM   #2
corp769
LQ Guru
 
Registered: Apr 2005
Location: /dev/null
Posts: 5,818

Rep: Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007
XMMS. GUI, yet you can control it from the command line.

Code:
Usage: xmms [options] [files] ...

Options:
--------

  -h, --help			Display this text and exit.
  -n, --session			Select XMMS session (Default: 0)
  -r, --rew			Skip backwards in playlist
  -p, --play			Start playing current playlist
  -u, --pause			Pause current song
  -s, --stop			Stop current song
  -t, --play-pause		Pause if playing, play otherwise
  -f, --fwd			Skip forward in playlist
  -e, --enqueue			Don't clear the playlist
  -Q, --queue			Add file(s) to playlist and queue

  -S, --toggle-shuffle[=SWITCH] Toggle the 'shuffle' flag.
  -R, --toggle-repeat[=SWITCH]  Toggle the 'repeat' flag.
  -A, --toggle-advance[=SWITCH] Toggle the 'no playlist advance' flag.

  SWITCH may be either 'on' or 'off'

  -m, --show-main-window	Show the main window.
  -i, --sm-client-id		Previous session ID
  -v, --version			Print version number and exit.
  -q, --quit			Close remote session.
 
Old 02-11-2011, 01:37 PM   #3
jsteel
Member
 
Registered: Mar 2007
Location: England
Distribution: Arch
Posts: 392

Original Poster
Rep: Reputation: 34
Brilliant! Works a treat. Thank you.
 
Old 02-11-2011, 01:38 PM   #4
corp769
LQ Guru
 
Registered: Apr 2005
Location: /dev/null
Posts: 5,818

Rep: Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007
No problem. Mark as solved and give rep or whatever :P
 
Old 02-11-2011, 02:10 PM   #5
jsteel
Member
 
Registered: Mar 2007
Location: England
Distribution: Arch
Posts: 392

Original Poster
Rep: Reputation: 34
Will do. I just realised XMMS doesn't to video. Audio was my main concern, but it would be nice to have something that does both.
 
Old 02-11-2011, 02:13 PM   #6
corp769
LQ Guru
 
Registered: Apr 2005
Location: /dev/null
Posts: 5,818

Rep: Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007
Xine and mplayer would be your best bet then.
 
Old 02-11-2011, 02:18 PM   #7
sag47
Senior Member
 
Registered: Sep 2009
Location: Raleigh, NC
Distribution: Ubuntu, PopOS, Raspbian
Posts: 1,899
Blog Entries: 36

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
After googling "terminal media player" the following came up.

http://ubuntuforums.org/showthread.php?t=791921
 
Old 02-11-2011, 02:21 PM   #8
jsteel
Member
 
Registered: Mar 2007
Location: England
Distribution: Arch
Posts: 392

Original Poster
Rep: Reputation: 34
Do xine and MPlayer allow commands to be given from another terminal?

The Rhythmbox suggestion is good thanks, but again this is just an audio application rather than audio and video.
 
Old 02-11-2011, 02:37 PM   #9
sag47
Senior Member
 
Registered: Sep 2009
Location: Raleigh, NC
Distribution: Ubuntu, PopOS, Raspbian
Posts: 1,899
Blog Entries: 36

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
What exactly are you attempting to accomplish by controlling it from the terminal?
 
Old 02-11-2011, 02:39 PM   #10
corp769
LQ Guru
 
Registered: Apr 2005
Location: /dev/null
Posts: 5,818

Rep: Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007
Hey man, I came across this. Check it out and let me know if it is of any use for you. If not, I can keep doing some research, I don't mind at all.

EDIT: Oops, forgot the link... http://nino.me.uk/?p=330

Last edited by corp769; 02-11-2011 at 02:41 PM.
 
Old 02-11-2011, 02:43 PM   #11
jsteel
Member
 
Registered: Mar 2007
Location: England
Distribution: Arch
Posts: 392

Original Poster
Rep: Reputation: 34
Quote:
Originally Posted by sag47 View Post
What exactly are you attempting to accomplish by controlling it from the terminal?
Key bindings in openbox; so "s" will issue the command to stop the music. I know most players have key bindings of their own but I want fine control.
 
Old 02-12-2011, 12:48 AM   #12
retrodanny
Member
 
Registered: Jun 2009
Location: México
Distribution: Slackware
Posts: 38

Rep: Reputation: 2
mplayer
 
  


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
Unknown media type in command line kabith Linux - Newbie 1 03-19-2009 06:06 PM
LXer: Secrets for controlling VirtualBox from the command line LXer Syndicated Linux News 0 10-29-2008 01:40 PM
Controlling NetworkManager from command line? MikeyCarter Linux - Software 1 07-11-2008 09:09 PM
Help controlling the network from the command line Tortanick Debian 2 01-17-2007 10:57 AM
Command line based Media Player OmnipotentOscar Linux - Software 1 02-01-2005 07:31 AM

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

All times are GMT -5. The time now is 07:22 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