[MPV Awesome] Tại sao là mpv? Cài đặt mpv
MPV là gì?
Ngày xa xưa, cái thời là còn là mạng ADSL, thời còn là hoàng kim của .torrent với HDVNbits và VietTorrent, cái thời mà vnsharing vẫn còn là người tốt và vn-zoom vẫn còn sống, thì giang hồ mạng chỉ dùng chung 1 bộ võ công K-Lite Mega Codec Pack - là 1 bộ pack các loại codec để xem phim nghe nhạc đủ các thể loại. Người ta truyền tai nhau các loại hướng dẫn config (splliter gì, decoder nào, shader thế nào, output ra sao…) làm sao để xem phim cho ĐẸP, vì đây là cái thời mới từ DVD-Rip(tầm 700MB/phim) lên HD (mà còn phải phân vân là nên chọn mHD, 720p, 1080i hay 1080p…, ông nào cao nhân nắm nhiều acc private tracker thì còn chọn team RIP (encode) là DON, TayTO hay HDBits…).
Bây giờ thì các bộ K-Lite không còn quá phổ biến nữa vì nó quá nhiều thứ phải quan tâm, từ codec đến spliter rồi shader, chỉ cái hiển thị phụ đề cũng có vài option để chỉnh, trong khi đó lại còn không portable, chỉ có cái trình xem phim MPC-HC đi kèm trong bộ là có backup config. Giang hồ lại chuyển qua KMPlayer (thằng này có nhiều tính năng hay ho như là xem phim 3D - tuy chỉ là cái loại 3D ghép 2 cái hình màu xanh - đỏ mà còn phải đeo kính, hiển thị 2 phụ đề… nhưng rồi lại được đính kèm 1 đống các loại quảng cáo) rồi VLC (nhẹ mà xấu), hay GomPlayer, PotPlayer…
Sau khi thử 1 lô các loại trình xem phim thì mình đã dừng lại ở MPV. MPV Player được biết đến với tính đơn giản, nhiều định dạng đa phương tiện được hỗ trợ và hiệu suất cao. Nó có sẵn cho các hệ điều hành khác nhau, bao gồm Linux, Mac và Windows. Trình phát đa phương tiện này cung cấp một giao diện tối giản và nhẹ, tập trung vào việc cung cấp trải nghiệm phát lại mượt mà và hiệu quả. Nó hỗ trợ các định dạng âm thanh và video, bao gồm các định dạng phổ biến như MP4, MP3, AVI, MKV và FLAC.
- Ưu điểm
Mã nguồn mở(Thực ra mã nguồnđónghaymởnó không quan trọng đến thế, Chrome cũng (giả vờ!) là mã mở mà nó tệ vãi :poop:)- Nhanh, gọn, nhẹ
- Có khả năng mở rộng
- Portable
- Nhanh, gọn, nhẹ
- Nhược điểm
- Tốn thời gian cài đặt (Duy nhất lần đầu tiên): Không có
Next,Next,Yes,Finishgì hết, tất cả phải làm bằng tay
Cài đặt MPV1
Project website: mpv.io
Windows
Xem builds on the official website
Linux
1
sudo apt-get install mpv
Raspberry Pi 3B+
Xem this document.
macOS
⚠️ Không sử dụng
homebrew-> quá trình biên dịch mất rất nhiều thời gian và tốn nhiều dung lượng cho các dependencies.
Xem builds on the official website
Mở link https://laboratory.stolendata.net/~djinn/mpv_osx/
Hoạt động được trên Catalina mặc dù không được liệt kê!
Giải nén mpv-0.XX.0.tar.gz
Kéo mpv.app tới /Applications
Sau đó mở Terminal tạo một symlink đến tập nhị phân mpv bên trong /usr/local/bin:
1
ln -s /Applications/mpv.app/Contents/MacOS/mpv /usr/local/bin/mpv
Điều này sẽ làm cho lệnh mpv hoạt động trên Terminal (vì /usr/local/bin thường xuyên nằm trong $PATH) và dmt-proc sẽ dễ dàng truy vấn
Kết quả
1
mpv --version
Bạn sẽ thấy một cái gì đó như thế này:
1
2
3
4
5
6
7
8
9
10
mpv 0.32.0 Copyright © 2000-2020 mpv/MPlayer/mplayer2 projects
built on Fri Jan 31 11:28:05 CET 2020
ffmpeg library versions:
libavutil 56.31.100
libavcodec 58.54.100
libavformat 58.29.100
libswscale 5.5.100
libavfilter 7.57.100
libswresample 3.5.100
ffmpeg version: 4.2.2
Cấu trúc thư mục mpv chuẩn
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
.
├── mpv.exe
├── yt-dlp.exe
├── yt-dlp.conf
├── ffmpeg.exe
├── ffprobe.exe
├── phantomjs.exe
└── portable_config
├── input.conf
├── mpv.conf
├── fonts
├── scripts
├── script-opts
├── script-modules
└── shaders
Sample ./portable_config/mpv.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
#Cach su dung: Xoa # o doan #abc=xyz o dau dong de kich hoat nhung doan config mau
###########
# General #
###########
# Custom config
log-file="~/Library/Logs/mpv.log"
#Bat len neu muon giong PiP cua trinh duyet, geometry=x50% nen chuyen thanh geometry=x25%
#ontop # video player always on top
osd-on-seek=no
osd-font-size=24
#osd-duration=100
keep-open=yes
force-window=immediate
no-focus-on-open
geometry=x50%
load-unsafe-playlists=yes
user-agent='Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/116.0'
force-seekable=yes
hr-seek=yes
hr-seek-framedrop=yes
#########
# uosc #
#########
# required so that the 2 UIs don't fight each other
osc=no
# uosc provides its own seeking/volume indicators, so you also don't need this
osd-bar=no
# uosc will draw its own window controls if you disable window border
border=no
#########
# Video #
#########
hwdec=auto-copy
vo=libmpv
#Cho he may cui bap, CPU va GPU giam cuc nhieu
tscale=nearest
interpolation=no
scale=bilinear
cscale=bilinear
dscale=bilinear
sws-scaler=fast-bilinear
dither=no
correct-downscaling=no
linear-downscaling=no
sigmoid-upscaling=no
hdr-compute-peak=no
#Bat lam net video, rat ngon CPU va GPU, tuy nhien giup vai video bi nhoe trong dep hon, khong nen bat mac dinh ma nen bat bang phim tat khi can thiet bang input.conf
#scale=ewa_lanczossharp
#cscale=ewa_lanczossharp
#########
# Audio #
#########
#audio-file-auto=fuzzy # play external audio files with same name as video files
#audio-pitch-correction=yes # automatically insert scaletempo when playing with higher speed
volume-max=200 # maximum volume in %, everything above 100 results in amplification
volume=75 # default volume, 100 = unchanged
#########
#Subtitle
#########
#Doi mau, kich co subtitle
#sub-color='#FFFF00' #subtitle color in rgb
#sub-shadow-color='#000000' #shadow color
#sub-font='Noto Sans' #set font
#sub-bold=yes
#sub-font-size=60
#sub-pos=95 #subtitle position 5 percent above the bottom of the screen
#sub-fix-timing=yes
#########
# Cache #
#########
cache-pause
cache=yes
#cache-on-disk=yes # Bat len neu may it RAM, chuyen cache xuong o dia
#cache-default=80000 # size in KB (80MB) -- Increase if you have buffering issues
#cache-backbuffer=80000 # size in KB
#cache-initial=0 # start playback when your cache is filled up with x kB
cache-secs=600 # how many seconds of audio/video to prefetch if the cache is active
demuxer-thread=yes
#demuxer-max-bytes=50MiB
demuxer-max-back-bytes=50MiB
demuxer-readahead-secs=600
#########
# Network #
#########
network-timeout=100
stream-lavf-o-append=reconnect_on_http_error=4xx,5xx
stream-lavf-o-append=reconnect_delay_max=30
stream-lavf-o-append=reconnect_streamed=yes
#stream-lavf-o-append=reconnect_on_network_error=yes
#########
# YTDL #
#########
ytdl-raw-options-append=no-check-certificates=
ytdl-raw-options-append=yes-playlist=
#ytdl-raw-options-append=extractor-args=youtube:player_skip=webpage,configs,js;player_client=android,web;lang=vi,en
#Chuyen sang Youtube VN may chu Youtube tra lai CDN gan Viet Nam, co the gay loi/thay doi ?
#ytdl-raw-options-append=extractor-args=youtube:lang=vi,en,ja
ytdl-raw-options-append=sub-langs=en,en-US,eng,vi,vi-VN,vie,ja,ja-JP,jap,live_chat
ytdl-raw-options-append=write-sub=
ytdl-raw-options-append=write-auto-sub=
ytdl-raw-options-append=mark-watched=
ytdl-raw-options-append=add-metadata=
#Danh dau da xem khong can plugin markwatched.lua https://voz.vn/t/tong-hop-nhung-addon-chat-cho-firefox-pc-mobile.682181/post-25727088
#ytdl-raw-options-append=cookies-from-browser=firefox:_ĐƯỜNG_DẪN_PROFILE_FIREFOX_VÀO_ABOUT:SUPPORT_OPEN_PROFILE_
#ytdl-raw-options-append=mark-watched=
#########
# Profile #
#########
#Chi tiet: https://voz.vn/t/tong-hop-nhung-addon-chat-cho-firefox-pc-mobile.682181/post-24149834
#Luon de phan nay o cuoi file mpv.conf
[quality-youtube]
profile-cond=path:match"youtube" ~= nil or filename:match"youtube" ~= nil or filename:match"/live$" ~= nil
profile-restore=copy
ytdl-format=bestvideo[container*=dash][proto*=http_dash_segments][height<=?720][fps<=?30][vcodec!=?vp9]+bestaudio/best
[quality-twitter]
profile-cond=path:match"twitter" ~= nil or filename:match"twitter" ~= nil or path:match"video.twimg" ~= nil or filename:match"video.twimg" ~= nil
profile-restore=copy
#ytdl-format=bestvideo[height<=?360]+bestaudio/best
#ytdl-format=bestvideo[proto*=hls]+bestaudio/best
ytdl-format=hls-197/hls-783/hls-475/hls-80
#ytdl-format=hls-783/hls-475/hls-197/hls-80
#hls-783/hls-475/hls-197/hls-80
[stream-no-ytdl]
profile-cond=string.find(path, '.m3u') ~= nil or string.find(path, '.mpd') ~= nil or string.find(path, '.mp4') ~= nil or string.find(path, 'googlevideo.') ~= nil or string.find(path, '.jpg') ~= nil or string.find(path, '.png') ~= nil
profile-restore=copy-equal
ytdl=no
#EOF