I need to keep the correct output of avconv command:
filetype=`avconv -i first.mp3 2>&1`
echo $filetype
the results is an incorrect output. like this:
avconv version 11-6:11-2, Copyright (c) 2000-2014 the Libav developers built on Oct 19 2014 21:50:10 with gcc 4.9.1 (Debian 4.9.1-15) [mp3 @ 0x9c22840] max_analyze_duration 5000000 reached [mp3 @ 0x9c22840] Estimating duration from bitrate, this may be inaccurate Guessed Channel Layout for Input Stream #0.0 : stereo Input #0, mp3, from 'first.mp3': Duration: 00:03:33.55, start: 0.000000, bitrate: 49 kb/s Stream #0.0: Audio: mp3, 22050 Hz, 2 channels, s16p, 49 kb/s At least one output file must be specified
avconv
. BTW, don't useecho
to display arbitrary data, useprintf
. Also"$()"
is preferred over the use of backticks, as mentioned in the answer to your earlier question. – PM 2Ring Dec 14 '14 at 12:13