我搜索了很多关于如何在工作时通过终端播放音乐,并时不时地进行基本的音乐控制,例如快进、快退、下一首、上一首、播放/暂停、停止和退出。但一无所获。我遇到了 SoX,但没有得到任何帮助。后来在 mplayer 手册页中,我发现了很多 cmd_line 选项。
在那里我发现-ss(按秒搜索),-sb(按字节查找),-结束位置(在指定时间后停止)。
我想知道,
- 如何使用这些选项。因为一旦我使用以下方式播放曲目:mplayer 音轨.扩展名终端正在显示剧情细节。
再次,
您能否建议后退、下一个、上一个等选项?
您能否建议任何其他可轻松实现基本音乐播放控制的替代方案?
我如何播放文件并同时在终端中工作?
答案1
基本导航:
你在追求这些基本的MPlayer 的导航键,这些键将在播放剪辑时操作:
Basic keys: (complete list in the man page, also check input.conf)
<- or -> seek backward/forward 10 seconds
down or up seek backward/forward 1 minute
pgdown or pgup seek backward/forward 10 minutes
< or > step backward/forward in playlist
p or SPACE pause movie (press any key to continue)
q or ESC stop playing and quit program
+ or - adjust audio delay by +/- 0.1 second
o cycle OSD mode: none / seekbar / seekbar + timer
* or / increase or decrease PCM volume
x or z adjust subtitle delay by +/- 0.1 second
r or t adjust subtitle position up/down, also see -vf expand
mplayer
当然,这些可以在手册页中看到,但这里演示的少量选择是从在终端窗口中运行命令所显示的列表中获取的。
复杂的导航和控制:
如果你追求更多复杂的input.conf
控制您可以在目录中创建文件$HOME/.mplayer
并在该文件中放置以下详细信息:
##
## MPlayer input control file
##
## You are able to redefine default keyboard/joystick/mouse/LIRC bindings, or
## add new ones here.
## See DOCS/tech/slave.txt for possible commands that can be bound.
## Also see mplayer -input cmdlist for other possible options.
## The file should be placed in the $HOME/.mplayer directory.
##
## If you wish to unbind a key, use key ignore.
## e.g. ENTER ignore
##
RIGHT seek +10
LEFT seek -10
DOWN seek -60
UP seek +60
PGUP seek 600
PGDWN seek -600
m mute
# switch_audio # switch audio streams
+ audio_delay 0.100
= audio_delay 0.100
- audio_delay -0.100
[ speed_mult 0.9091 # scale playback speed
] speed_mult 1.1
{ speed_mult 0.5
} speed_mult 2.0
BS speed_set 1.0 # reset speed to normal
q quit
ESC quit
ENTER pt_step 1 1 # skip to next file
p pause
. frame_step # advance one frame and pause
SPACE pause
HOME pt_up_step 1
END pt_up_step -1
> pt_step 1 # skip to next file
< pt_step -1 # previous
INS alt_src_step 1
DEL alt_src_step -1
o osd
I osd_show_property_text "${filename}" # display filename in osd
P osd_show_progression
z sub_delay -0.1 # subtract 100 ms delay from subs
x sub_delay +0.1 # add
9 volume -1
/ volume -1
0 volume 1
* volume 1
1 contrast -1
2 contrast 1
3 brightness -1
4 brightness 1
5 hue -1
6 hue 1
7 saturation -1
8 saturation 1
( balance -0.1 # adjust audio balance in favor of left
) balance +0.1 # right
d frame_drop
D step_property deinterlace # toggle deinterlacer, requires -vf yadif or kerndeint
r sub_pos -1 # move subtitles up
t sub_pos +1 # down
#? sub_step +1 # immediately display next subtitle
#? sub_step -1 # previous
#? sub_scale +0.1 # increase subtitle font size
#? sub_scale -0.1 # decrease subtitle font size
f vo_fullscreen
T vo_ontop # toggle video window ontop of other windows
w panscan -0.1 # zoom out with -panscan 0 -fs
e panscan +0.1 # in
c capturing # save (and append) file/stream to stream.dump with -capture
s screenshot # take a png screenshot with -vf screenshot
# S will take a png screenshot of every frame
h tv_step_channel 1
l tv_step_channel -1
n tv_step_norm
b tv_step_chanlist
##
## Joystick section
## WARNING: joystick support has to be explicitly enabled at
## compiletime with --enable-joystick
##
JOY_RIGHT seek 10
JOY_LEFT seek -10
JOY_UP seek 60
JOY_DOWN seek -60
JOY_BTN0 pause
JOY_BTN1 osd
JOY_BTN2 volume 1
JOY_BTN3 volume -1
JOY_BTN4 set_menu main
##
## Apple Remote section
##
## To use OSD menu with Apple Remote, set key AR_MENU to any OSD menu command,
## or just comment out the 'AR_MENU osd' line and uncomment the line after it.
##
AR_PLAY pause
AR_PLAY_HOLD quit
AR_NEXT seek 30
AR_NEXT_HOLD seek 120
AR_PREV seek -10
AR_PREV_HOLD seek -120
AR_MENU menu up
#AR_MENU menu cancel
AR_MENU_HOLD mute
AR_VUP volume 1
AR_VDOWN volume -1
##
## OSD Menu movement keys
##
## If you are using only the keyboard it is enough to define one command (like
## "menu up"), because then that single key will display the menu, which can
## then be navigated with the cursor keys and ENTER (defined in menu.conf).
##
## LIRC users should bind each "menu" command to a button on their remote.
##
## The set_menu command directly displays the (sub)menu specified as
## its argument. Usage should be self-explanatory (although not likely
## to be needed), after reading input.conf.
##
#MOUSE_BTN0 menu up
#y menu down
#y menu ok
#y menu cancel
#y menu hide
#y set_menu general_pref
##
## DVDNAV
## Requires dvdnav://
##
UP {dvdnav} dvdnav up # DVDNav UP
DOWN {dvdnav} dvdnav down # DVDNav DOWN
LEFT {dvdnav} dvdnav left # DVDNav LEFT
RIGHT {dvdnav} dvdnav right # DVDNav RIGHT
ESC {dvdnav} dvdnav menu # DVDNav MENU
ENTER {dvdnav} dvdnav select # DVDNav SELECT (ok)
BS {dvdnav} dvdnav prev # DVDNav PREVIOUS menu (in the order chapter->title->root)
AR_VUP {dvdnav} dvdnav up # DVDNav UP
AR_VDOWN {dvdnav} dvdnav down # DVDNav DOWN
AR_PREV {dvdnav} dvdnav left # DVDNav LEFT
AR_NEXT {dvdnav} dvdnav right # DVDNav RIGHT
AR_MENU {dvdnav} dvdnav menu # DVDNav MENU
AR_PLAY {dvdnav} dvdnav select # DVDNav SELECT (ok)
#? seek_chapter -1 # skip to previous dvd chapter
#? seek_chapter +1 # next
##
## Advanced seek
## Uncomment the following lines to be able to seek to n% of the media with
## the Fx keys.
##
#F1 seek 10 1
#F2 seek 20 1
#F3 seek 30 1
#F4 seek 40 1
#F5 seek 50 1
#F6 seek 60 1
#F7 seek 70 1
#F8 seek 80 1
#F9 seek 90 1
#
## Use - to combine multiple keys into a key combination
##
#CTRL-. osd_show_property_text "Playing: ${filename}"
您可以花尽可能多的时间来调整这些选项:)
做点别的事:
至于在播放剪辑时工作:我自己的做法是打开一个新的终端窗口,但另一个选择是在现有的终端窗口中打开另一个选项卡(如果支持的话)。