Console

mplayer(通過控制台)並不總是顯示音頻文件持續時間 - 如何改變行為?

  • September 2, 2018

我主要使用 mplayer 從 Linux 控制台播放音頻文件。大多數時候,mplayer 會愉快地向我展示文件的持續時間和到目前為止的執行時間(注意:我已經暫停了兩次播放,只是為了讓我複制/粘貼輸出):

jim@brisbane /public/podcasts/AmateurRadio/Linux in the Ham Shack $ mplayer lhs150.ogg 
MPlayer 1.2.1 (Debian), built with gcc-5.3.1 (C) 2000-2016 MPlayer Team
mplayer: could not connect to socket
mplayer: No such file or directory
Failed to open LIRC support. You will not be able to use your remote control.

Playing lhs150.ogg.
libavformat version 56.40.101 (external)
libavformat file format detected.
[lavf] stream 0: audio (vorbis), -aid 0, LHS Episode #150: The Sesquicentennial
Load subtitles in ./
==========================================================================
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
libavcodec version 56.60.100 (external)
AUDIO: 44100 Hz, 1 ch, floatle, 80.0 kbit/5.67% (ratio: 10000->176400)
Selected audio codec: [ffvorbis] afm: ffmpeg (FFmpeg Vorbis)
==========================================================================
AO: [pulse] 44100Hz 1ch floatle (4 bytes per sample)
Video: no video
 =====  PAUSE  =====
A:  16.4 (16.3) of 5404.9 ( 1:30:04.9)  0.4% 

您可以在上面看到,我在 5404.9 中是 16.4 秒,但更重要的是,我可以看到在這種情況下播客的持續時間是 1:30:04.9。

jim@brisbane ~/hobart/server/podcasts/MUSIC/PODCASTS/Linux in the Ham Shack $ mp lhs203.ogg 
MPlayer 1.2.1 (Debian), built with gcc-5.3.1 (C) 2000-2016 MPlayer Team
mplayer: could not connect to socket
mplayer: No such file or directory
Failed to open LIRC support. You will not be able to use your remote control.

Playing lhs203.ogg.
libavformat version 56.40.101 (external)
libavformat file format detected.
[mjpeg @ 0x7f6a2fda03c0]Changeing bps to 8
[lavf] stream 0: audio (vorbis), -aid 0, LHS Episode #203: Choosing Your Linux Distribution
[lavf] stream 1: video (mjpeg), -vid 0
VIDEO:  [MJPG]  300x300  0bpp  90000.000 fps    0.0 kbps ( 0.0 kbyte/s)
Load subtitles in ./
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
libavcodec version 56.60.100 (external)
Selected video codec: [ffmjpeg] vfm: ffmpeg (FFmpeg MJPEG)
==========================================================================
==========================================================================
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
AUDIO: 44100 Hz, 1 ch, floatle, 80.0 kbit/5.67% (ratio: 10000->176400)
Selected audio codec: [ffvorbis] afm: ffmpeg (FFmpeg Vorbis)
==========================================================================
AO: [pulse] 44100Hz 1ch floatle (4 bytes per sample)
Starting playback...
[mjpeg @ 0x7f6a2fda03c0]Changeing bps to 8
Movie-Aspect is 1.00:1 - prescaling to correct movie aspect.
VO: [vdpau] 300x300 => 300x300 Planar YV12 
Movie-Aspect is 1.00:1 - prescaling to correct movie aspect.
VO: [vdpau] 300x300 => 300x300 Planar YV12 
No pts value from demuxer to use for frame!
pts after filters MISSING
A:3615.6 V:  53.8 A-V:3561.850 ct:  0.025   0/  0  0%  0%  2.4% 0 0 1.50x 
 =====  PAUSE  =====

這一集的不同之處在於彈出一個帶有播客徽標的小視窗(Linux in the Ham Shack),因此 mplayer 似乎將其視為某種影片文件而不是純音頻文件。但是,還要注意,輸出不再顯示文件的持續時間。事實上,文字顯示完全不同。

我不需要文本顯示相同,但​​我確實想查看剩餘時間。有什麼方法可以強制它工作嗎?

如果您想要範例音頻文件,我在 Ham Shack 劇集 #150 和 #203 中使用了 Linux。(除了作為聽眾之外,我與這個播客沒有任何關係。)

我執行 Debian/Ubuntu/Mint,但作業系統似乎與此無關。

建議?謝謝!

只需禁用影片輸出:

mplayer -novideo lhs243.ogg

引用自:https://unix.stackexchange.com/questions/466397