Difference between revisions of "Template:RK3399 Linux mpv"
(updated by API) |
(updated by API) |
||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
− | === | + | ===Mpv hardware decoding video player=== |
− | + | FriendlyCore comes pre-installed with the ffmpeg-based command line video player mpv, which also includes libmpv.<br /> | |
− | + | The mpv player supports Rockchip MPP video decoder, so it supports 4K hardware decoding. There are many parameters of mpv. In order to simplify the use, we provide a script '''start-mpv'''. After simplification, there is only one parameter: video file name, as follows: | |
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
start-mpv /home/pi/demo.mp4 | start-mpv /home/pi/demo.mp4 | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | + | It should be noted that the pi user needs to log in during playback, because there are no mpv related settings in other users' directories. Of course, you can copy one from the pi user directory. The mpv settings file is stored in the following path: | |
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
/home/pi/.config/mpv/mpv.conf | /home/pi/.config/mpv/mpv.conf | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | mpv. | + | The contents of the mpv.conf file are as follows: |
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
vo=gpu | vo=gpu | ||
Line 20: | Line 20: | ||
audio-device=alsa/default:CARD=rockchiphdmi | audio-device=alsa/default:CARD=rockchiphdmi | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | + | These will be passed as parameters to mpv. When the value of hwdec is rkmpp, it means using hardware decoding, audio-device is used to specify the audio output device, and the default output is to HDMI. You can use the following command to query which audio devices are in the system: | |
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
mpv --audio-device=help | mpv --audio-device=help | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | + | Another important parameter is drm-osd-size. When playing video in full screen, drm-osd-size is specified as the resolution of the screen. This parameter is automatically obtained by start-mpv and passed to mpv, start-mpv script will do one more important thing. It needs to ensure that the libmali library in the system uses the correct version, because mpv renders the image through gbm, so libmali.so needs to use this version: libmali-midgard-t86x -r14p0-gbm.so, which means that this version of mpv can only be used under FriendlyCore, can not be used under X11 Desktop.<br /> | |
− | + | Mpv official use guide:https://github.com/mpv-player/mpv/wiki <br /> |
Latest revision as of 02:34, 21 December 2018
Mpv hardware decoding video player
FriendlyCore comes pre-installed with the ffmpeg-based command line video player mpv, which also includes libmpv.
The mpv player supports Rockchip MPP video decoder, so it supports 4K hardware decoding. There are many parameters of mpv. In order to simplify the use, we provide a script start-mpv. After simplification, there is only one parameter: video file name, as follows:
start-mpv /home/pi/demo.mp4
It should be noted that the pi user needs to log in during playback, because there are no mpv related settings in other users' directories. Of course, you can copy one from the pi user directory. The mpv settings file is stored in the following path:
/home/pi/.config/mpv/mpv.conf
The contents of the mpv.conf file are as follows:
vo=gpu gpu-context=drm hwdec=rkmpp demuxer-max-bytes=41943040 demuxer-max-back-bytes=41943040 drm-osd-plane-id=1 drm-video-plane-id=0 audio-device=alsa/default:CARD=rockchiphdmi
These will be passed as parameters to mpv. When the value of hwdec is rkmpp, it means using hardware decoding, audio-device is used to specify the audio output device, and the default output is to HDMI. You can use the following command to query which audio devices are in the system:
mpv --audio-device=help
Another important parameter is drm-osd-size. When playing video in full screen, drm-osd-size is specified as the resolution of the screen. This parameter is automatically obtained by start-mpv and passed to mpv, start-mpv script will do one more important thing. It needs to ensure that the libmali library in the system uses the correct version, because mpv renders the image through gbm, so libmali.so needs to use this version: libmali-midgard-t86x -r14p0-gbm.so, which means that this version of mpv can only be used under FriendlyCore, can not be used under X11 Desktop.
Mpv official use guide:https://github.com/mpv-player/mpv/wiki