Mplayer custom shortcut

Source: Internet
Author: User

Mplayer is a very powerful player. At least in Linux, most videos can be played. I have been using mplayer, and it is very good.

Generally, I call mplayer directly on the command line to play a movie. But when using it, I feel a little uncomfortable: If you want to fast forward, you can only press the direction key. In general, if you press the direction key, your hand will leave the keyboard.

It seems uncomfortable. Now I also have some VI operations, which I like very much about the JK key. So I thought, could we use the JK key to implement fast forward and return?

Then I searched the internet for related content. There were very few posts about mplayer custom buttons. Fortunately, I learned from some posts that the mplayer key control is stored in the file/etc/mplayer/input. conf:

Right seek + 10
Left seek-10
Down seek-60
Up seek + 60
Pgup seek 1, 600
Pgdwn seek-1, 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
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

 

The above is part of the content in input. conf. We can see that many commonly used buttons are defined here.

But how can I modify the buttons? A simple method is to directly modify the file. This is acceptable, as mentioned in the comments section at the beginning of this file: you can modify the file to configure the mplayer button.

But I don't want to modify this file of mplayer. Software in Linux has one feature. Generally, there is a global configuration file (usually under the etc directory ), at the same time, you can write your own configuration files in your home directory to meet your requirements. If your configuration conflicts with the global configuration, your configuration file overwrites the corresponding configuration in the global configuration file. vim and bash are the features of this configuration file. So I thought, does mplayer also look like this? Take care of him. Try it. Then I copied the input. conf file to the configuration directory of mplayer ~ /. Mplayer. Then, the input. conf is simply modified. The JK key is used to replace the quick return and block import functions, namely:

K seek + 10
J seek-10
# Switch_audio # Switch audio streams
# I osd_show_property_text "$ {filename}" # display filename in OSD
# P osd_show_progression
# F vo_fullscreen
# T vo_ontop # toggle video window ontop of other windows
# S screenshot # Take a PNG screenshot with-VF screenshot
# S will take a PNG screenshot of every frame

After saving the file, open the mplayer test.

Now it's just a simple configuration. You can modify this file continuously when thinking about other usage.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.