LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 02-11-2010, 07:43 PM   #1
sirpelidor
Member
 
Registered: Oct 2003
Location: Madison
Distribution: mdk 8.2, 9.0, 9.2, slack 9.1
Posts: 403

Rep: Reputation: 30
newbie: trying to use pipe or awk to work with mplayer


Hi,

I have a text file containing the URL I wanted for mplayer to play. Currently, I play those in commend line using the following steps:

1)cat playlist
2)use mouse to highlight the link
3)type: mplayer then click both left/right mouse button

I was hoping if I can do this in comment line without mouse. I've tried the following without luck

(assume there's only 1 address in the text file)

1) cat playlist |mplayer
2) cat playlist |awk '{print $1}'| mplayer

Thank you.
 
Old 02-11-2010, 08:12 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,978
Blog Entries: 11

Rep: Reputation: 879Reputation: 879Reputation: 879Reputation: 879Reputation: 879Reputation: 879Reputation: 879
Hard to say w/o knowing the structure of the playlist ....
something like


cat playlist | xargs -i mplayer {}


may work
 
Old 02-12-2010, 02:13 AM   #3
sirpelidor
Member
 
Registered: Oct 2003
Location: Madison
Distribution: mdk 8.2, 9.0, 9.2, slack 9.1
Posts: 403

Original Poster
Rep: Reputation: 30
Hi Tinkster,

cat playlist | xargs -i mplayer {} works like champs!

One thing I noticed, however, mplayer appeared to play in the background hence I was unable to end the stream with the "q" key (had to use ctrl-C then you will see mplayer's PID stuck in ps and can't be kill). Have you experienced that issue?

As for the structure of the playlist, consider the following example:

Code:
tux@esceo:~$ cat playlist
http://scfire-dtc-aa01.stream.aol.com/stream/1005
tux@esceo:~$
Thank you.
 
Old 02-12-2010, 03:41 AM   #4
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,978
Blog Entries: 11

Rep: Reputation: 879Reputation: 879Reputation: 879Reputation: 879Reputation: 879Reputation: 879Reputation: 879
Can't say I've used mplayer to play urls at all, I'm afraid, so
wouldn't know how it handles this. Does mplayer terminate when
you invoke that individually from the command-line? E.g.,
mplayer http://scfire-dtc-aa01.stream.aol.com/stream/1005
 
Old 02-12-2010, 11:19 AM   #5
sirpelidor
Member
 
Registered: Oct 2003
Location: Madison
Distribution: mdk 8.2, 9.0, 9.2, slack 9.1
Posts: 403

Original Poster
Rep: Reputation: 30
Yea, in commend line, if you do mplayer <whatever>, you should be able to terminate the program by hitting the "q" key.

Seems like this is mplayer issue more then command line issue, I guess I will figure that out somewhere else

Thank you very much, Tinkster.
 
  


Reply

Tags
comment, line, mplayer


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Slack 12.1 - pipe key doesn't work in Brazilian keyboard lucmove Slackware 1 09-17-2008 01:22 PM
tilde, pipe keys don't work on my dell laptop. glarbl_blarbl Linux - Laptop and Netbook 3 05-20-2007 03:54 PM
how to pipe/redirect awk output into a variable? johnpaulodonnell Linux - Newbie 2 01-25-2007 06:54 AM


All times are GMT -5. The time now is 01:37 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration