View previous topic :: View next topic |
Author |
Message |
alex.blackbit Advocate
Joined: 26 Jul 2005 Posts: 2397
|
Posted: Wed Jul 25, 2007 9:47 am Post subject: disable output on mplayer [SOLVED] |
|
|
i want to use mplayer for giving out information of different audio files.
the content should NOT be played. i tried with the option "-nosound" which causes that there is no info output too.
the option "-ao null" causes mplayer to be silent, but it plays the file anyway.
is there a way to let mplayer process the file but then NOT play it?
thanks
--alex
Last edited by alex.blackbit on Thu Jul 26, 2007 5:33 am; edited 1 time in total |
|
Back to top |
|
|
i92guboj Bodhisattva
Joined: 30 Nov 2004 Posts: 10315 Location: Córdoba (Spain)
|
Posted: Wed Jul 25, 2007 10:00 am Post subject: Re: disable output on mplayer |
|
|
alex.blackbit wrote: | i want to use mplayer for giving out information of different audio files.
the content should NOT be played. i tried with the option "-nosound" which causes that there is no info output too.
the option "-ao null" causes mplayer to be silent, but it plays the file anyway.
is there a way to let mplayer process the file but then NOT play it?
thanks
--alex |
You could use -oa null -vo null, but that is probably not going to help you, cause it will keep playing, even if you don't see or hear anything. So, the terminal will be locked until you press 'q'. So, I doubt mplayer can be used for this purpose. I don't have any alternative, though I suppose that some video libs around should have a simple tool to identify video files. |
|
Back to top |
|
|
alex.blackbit Advocate
Joined: 26 Jul 2005 Posts: 2397
|
Posted: Wed Jul 25, 2007 10:31 am Post subject: |
|
|
thank you for your answer. however, i did not expect that.
now i thought about doing something like the following: Code: | mplayer file.ext& sleep 2;echo finished | that actually works... i mean, i exists after the 2 seconds (of course), but now i do not get the output i need... the thing between the ===== lines.
is there a way to get that back? |
|
Back to top |
|
|
i92guboj Bodhisattva
Joined: 30 Nov 2004 Posts: 10315 Location: Córdoba (Spain)
|
Posted: Wed Jul 25, 2007 11:40 am Post subject: |
|
|
alex.blackbit wrote: | thank you for your answer. however, i did not expect that.
now i thought about doing something like the following: Code: | mplayer file.ext& sleep 2;echo finished | that actually works... i mean, i exists after the 2 seconds (of course), but now i do not get the output i need... the thing between the ===== lines.
is there a way to get that back? |
Mmm, I am not sure I understood correctly. That command line that you posted, will launch mplayer (as always, actually playing the sound and video), on the background, thanks to the ampersand (&). Then it just sleeps 2 seconds and then echoes a message. It will echo a message after 2 seconds, but that doesn't mean that mplayer will get killed after that time. Actually, it will continue running in the background... So, I am not sure that you are on the right way at all.
Maybe you intended to do something in the lines of:
Code: |
mplayer file.avi &MPID=${!}; echo SLEEPING...; sleep 5; kill $MPID
|
Of course, you still need to bring back the output of mplayer, since it seems to cut it a bit when running in the background. I don't know how to do that, or even if it is possible. |
|
Back to top |
|
|
alex.blackbit Advocate
Joined: 26 Jul 2005 Posts: 2397
|
Posted: Wed Jul 25, 2007 12:00 pm Post subject: |
|
|
thanks for the reply, but i solved the problem in an other way.
i got a reply on the mplayer mailing list. the right option to do what i want is "-frames 0".
have a nice day
--alex |
|
Back to top |
|
|
yngwin Retired Dev
Joined: 19 Dec 2002 Posts: 4572 Location: Suzhou, China
|
Posted: Wed Jul 25, 2007 12:20 pm Post subject: |
|
|
Or use midentify _________________ "Those who deny freedom to others deserve it not for themselves." - Abraham Lincoln
Free Culture | Defective by Design | EFF |
|
Back to top |
|
|
Dottout l33t
Joined: 07 Mar 2006 Posts: 882
|
Posted: Wed Jul 25, 2007 2:52 pm Post subject: |
|
|
also `file' gives a useful output |
|
Back to top |
|
|
|