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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
03-10-2009, 12:02 AM
|
#1
|
Member
Registered: Mar 2007
Posts: 192
Rep:
|
Audio Processing Tool Command Line To Extract Play Length?
Does any know of a command line tool to extract the play length of many different audio file formats? I have tried sox, using the following command.
sox a2.wav -n stat
But it does not support the following formats.
.acc, wma
I thought mplayer might be able to do it but I am unsure and can't find how this might be done.
Thanks
|
|
|
03-10-2009, 01:11 AM
|
#2
|
Member
Registered: Nov 2006
Location: Jalandhar, India
Distribution: openSuSE 11.0, Granular 1.0, Mandriva One 2009, Fedora 11
Posts: 60
Rep:
|
mplayer does play the multimedia files well through command-line, but I doubt it could be used to just extract & display the media information of a file (metadata).
|
|
|
03-10-2009, 01:13 AM
|
#3
|
Member
Registered: Nov 2006
Location: Jalandhar, India
Distribution: openSuSE 11.0, Granular 1.0, Mandriva One 2009, Fedora 11
Posts: 60
Rep:
|
Have you check for whether sox's media support could be extended using some plugins or something?
|
|
|
03-10-2009, 09:37 AM
|
#4
|
Member
Registered: Mar 2007
Distribution: Debian
Posts: 547
Rep:
|
this will show you the length in seconds of any media file
Code:
mplayer -vo null -ao null -frames 0 -identify yourmediafile 2>/dev/null | grep ID_LENGTH | awk -F= '{print $2}'
|
|
|
03-10-2009, 09:41 AM
|
#5
|
Member
Registered: Mar 2007
Posts: 192
Original Poster
Rep:
|
anurag_bhd, the closes I can get to this is to install this package "libsox-fmt-all". After reading http://sox.sourceforge.net/soxformat.html it seems like the files format are not supported. If there is another way to "extended using some plugins" I am not sure.
|
|
|
03-10-2009, 09:45 AM
|
#6
|
Member
Registered: Mar 2007
Posts: 192
Original Poster
Rep:
|
almatic, wow thanks that was amazing and what I thought was possible.
Thanks, much
|
|
|
03-10-2009, 09:26 PM
|
#7
|
Member
Registered: Mar 2007
Posts: 192
Original Poster
Rep:
|
almatic, I receive this as the output for my .aac file. The "ID_LENGTH" is not true it is longer than zero seconds. Any other tools or ideas how I might retrieve the play duration?
Code:
MPlayer dev-SVN-r26940
CPU: Intel(R) Xeon(TM) CPU 3.06GHz (Family: 15, Model: 2, Stepping: 7)
CPUflags: MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 1
Compiled with runtime CPU detection.
Playing Back To Basics Modern - 01 Intro (Back To Basics).aac.
ID_VIDEO_ID=0
libavformat file format detected.
AAC file format detected.
ID_AUDIO_ID=0
ID_FILENAME=Back To Basics Modern - 01 Intro (Back To Basics).aac
ID_DEMUXER=aac
ID_AUDIO_FORMAT=MP4A
ID_AUDIO_BITRATE=0
ID_AUDIO_RATE=0
ID_AUDIO_NCH=0
ID_LENGTH=0.00
ID_SEEKABLE=1
==========================================================================
Opening audio decoder: [faad] AAC (MPEG2/4 Advanced Audio Coding)
AUDIO: 44100 Hz, 2 ch, s16le, 128.0 kbit/9.07% (ratio: 16000->176400)
ID_AUDIO_BITRATE=128000
ID_AUDIO_RATE=44100
ID_AUDIO_NCH=2
Selected audio codec: [faad] afm: faad (FAAD AAC (MPEG-2/MPEG-4 Audio) decoder)
==========================================================================
AO: [null] 44100Hz 2ch s16le (2 bytes per sample)
ID_AUDIO_CODEC=faad
Video: no video
Starting playback...
Exiting... (End of file)
[Edit]
I can use faad but I was looking for magical bullet from mplayer. Thanks for all the help.
faad -i Back\ To\ Basics\ \ Modern\ -\ 01\ Intro\ \(Back\ To\ Basics\).aac 2>&1 | grep ADTS | awk '{print int($2)}'
Last edited by lindylex; 03-10-2009 at 11:46 PM.
|
|
|
All times are GMT -5. The time now is 08:20 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|