[MPlayer-users] play only first 30 seconds of a song

The Wanderer inverseparadox at comcast.net
Mon Apr 5 18:23:21 CEST 2004


rwk at americom.com wrote:

>>> $ mplayer song.mp3 -endpos 30 -really-quiet -oac pcm -vc null -vo
>>> null Unknown option on the command line: endpos
>> 
>> '-endpos' is not a mplayer option, but a mencoder option.
>> 
>>> P.S.  I am actually trying to get the first 30 seconds of the
>>> .mp3 back into .mp3 format.  If there is a better way to do this
>>> I would appreciate any suggestions.
>> 
>> I only know how to extract the whole audio stream:
>> 
>> mplayer -dumpaudio -dumpfile outfile.mp3 -vo null infile.avi
> 
> This is the wrong direction...  I want to convert the first 30
> seconds of a VBR .mp3 file to .wav.  Is this possible with mplayer or
> mencoder?

I don't think so, no. MEncoder is a video encoder, not an audio encoder.
About the best you can do is

mencoder -oac pcm -novideo -endpos 30 filename.mp3 -o filename.avi

and then

mplayer -vo null -vc dummy -dumpaudio -dumpfile filename.wav filename.avi

but that's clunky, by no means guaranteed to work, and you ought to be
able to do it more easily and perhaps better with a program which is
actually intended to do audio encoding, rather than one which does it as
a side thing to make video encoding work easier.

-- 
       The Wanderer

Warning: Simply because I argue an issue does not mean I agree with any
side of it.

A government exists to serve its citizens, not to control them.




More information about the MPlayer-users mailing list