Intanto grazie delle risposte. Non vorrei sporcare troppo il topic di dafrasaga andando un po' fuori tema, ma magari il discorso può servire anche a lui.
Il fatto è che in questo ambito (sfruttamento risorse video) le cose si sono evolute e personalmente non sono aggiornato...
Sono partito dal pratico e ho provato a riprodurre un video sia con Mplayer che con MPV. Ecco cosa è venuto fuori:
Codice: Seleziona tutto
mplayer Desktop/i_am_legend-1080p_blu-ray_trailer/I\ Am\ Legend\ -\ Trailer.mp4
MPlayer 1.2.1-5.3.0 (C) 2000-2016 MPlayer Team
Playing Desktop/i_am_legend-1080p_blu-ray_trailer/I Am Legend - Trailer.mp4.
libavformat version 56.40.101 (internal)
libavformat file format detected.
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x55bf86a60aa0]Protocol name not provided, cannot determine if input is local or a network protocol, buffers and access patterns cannot be configured optimally without knowing the protocol
[lavf] stream 0: video (h264), -vid 0
[lavf] stream 1: audio (aac), -aid 0, -alang und
VIDEO: [H264] 1920x816 24bpp 23.976 fps 7979.5 kbps (974.1 kbyte/s)
Clip info:
major_brand: isom
minor_version: 1
compatible_brands: isom
creation_time: 2008-12-01 05:16:01
Load subtitles in Desktop/i_am_legend-1080p_blu-ray_trailer/
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
libavcodec version 56.60.100 (internal)
Selected video codec: [ffh264] vfm: ffmpeg (FFmpeg H.264)
==========================================================================
==========================================================================
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
AUDIO: 48000 Hz, 6 ch, floatle, 258.3 kbit/2.80% (ratio: 32290->1152000)
Selected audio codec: [ffaac] afm: ffmpeg (FFmpeg AAC (MPEG-2/MPEG-4 Audio))
==========================================================================
AO: [alsa] 48000Hz 2ch floatle (4 bytes per sample)
Starting playback...
Movie-Aspect is 2.35:1 - prescaling to correct movie aspect.
VO: [vdpau] 1920x816 => 1920x816 Planar YV12
[ASPECT] Warning: No suitable new res found!
[ASPECT] Warning: No suitable new res found!
A: 1.6 V: 1.6 A-V: 0.000 ct: 0.000 0/ 0 23% 18% 1.2% 4 0
Exiting... (Quit)
Quindi, Mplayer sta effettivamente usando usa VDPAU.
Vediamo cosa succede con MVP:
Codice: Seleziona tutto
$ mpv Desktop/i_am_legend-1080p_blu-ray_trailer/I\ Am\ Legend\ -\ Trailer.mp4
Playing: Desktop/i_am_legend-1080p_blu-ray_trailer/I Am Legend - Trailer.mp4
(+) Video --vid=1 (*) (h264 1920x816 23.976fps)
(+) Audio --aid=1 --alang=und (*) (aac 6ch 48000Hz)
AO: [pulse] 48000Hz 5.1 6ch float
VO: [opengl] 1920x816 yuv420p
AV: 00:00:00 / 00:02:03 (0%) A-V: 0.000
Ecco che qua qualcosa non torna perchè usa "opengl"
Riporto di seguito i files di configurazione di vdpau, mpv e mplayer:
Codice: Seleziona tutto
$ grep -v ^# /etc/profile.d/vdpau.sh | sed /^$/d
export VDPAU_LOG=0
export VDPAU_DRIVER="nvidia"
$ grep -v ^# .config/mpv/mpv.conf|sed /^$/d
cache-default=853600
ytdl-format=bestvideo[height<=?1080]+bestaudio/best
$ grep -v ^# .mplayer/config|sed /^$/d
Quindi nè per mplayer nè per mpv ho specificato quale "driver video" usare. Tuttavia Mplayer di suo sceglie vdpau, mentre MPV opta per opengl.
Ok, la cosa è risolvibile facilmente: volendo usare vdpau anche con MPV lo si "forza" specificando il "vo=vdpau":
Codice: Seleziona tutto
$ grep -v '^$\|^#' .config/mpv/mpv.conf
vo=vdpau
cache-default=853600
ytdl-format=bestvideo[height<=?1080]+bestaudio/best
Ed ecco che adesso anche MPV usa vdpau:
Codice: Seleziona tutto
$ mpv Desktop/i_am_legend-1080p_blu-ray_trailer/I\ Am\ Legend\ -\ Trailer.mp4
Playing: Desktop/i_am_legend-1080p_blu-ray_trailer/I Am Legend - Trailer.mp4
(+) Video --vid=1 (*) (h264 1920x816 23.976fps)
(+) Audio --aid=1 --alang=und (*) (aac 6ch 48000Hz)
AO: [pulse] 48000Hz 5.1 6ch float
VO: [vdpau] 1920x816 yuv420p
[vo/vdpau] Compositing window manager detected. Assuming timing info is inaccurate.
AV: 00:00:01 / 00:02:03 (0%) A-V: 0.000
Exiting... (Quit)
Ma il file "/etc/profile.d/vdpau.sh" a cosa serve precisamente?
Perchè sia togliendo il commento da "nvidia" che lasciandolo non ho notato differenze, ad esempio pur avendolo decommentato MPV senza specifiche impostazioni usava opengl come output video e non vdpau (ho eseguito lo script dalla stessa shell da cui ho poi avviato mpv e in effetti l'unica cosa che cambia è il contenuto della variabile VDPAU_DRIVER che risulta appunto "nvidia").
PS.
Ho provato a specificare l'opzione -hwdec=vdpau (insieme a -vo=vdpau) ed effettivamente aggiungendo quella il carico della CPU è visibilmente più basso: su desktop hop un plasmoide che mostra il grafico del carico della CPU e aggiungendo quel parametro sta sotto il 10%, mentre senza arriva al 30%).
Ho provato anche -hwdec=cuda (che però richiede -vo=opengl) tuttavia ottengo un warning:
Forse serve ricompilare MPV con qualche opzione particolare o qualcosa del genere... mi informerò.
Spero in qualche commento e risposta ulteriore alle domande che ho posto sopra.
Saluti!