2017-07-25 175 views
0

我想從ffprobe test.mp3的輸出中提取行Duration: 00:03:51.05, start: 0.025056, bitrate: 131 kb/s如何提取只包含持續時間的持續時間?

ffprobe test.mp3 |grep Duration 

所有行都輸出與我所需的行,如何只輸出我所需的行?

+0

這可能有所幫助:https://trac.ffmpeg.org/wiki/FFprobeTips – Cyrus

回答

1

|改爲2>&1 |將stderr重定向到stdout。

0

ffprobe test.mp3 2> & 1 | awk -F'[,]''/ Duration/{print $ 4}'
00:03:51.05