Skip to main content
Topic: foo_mpv - Video Player component based on mpv (Read 2553 times) previous topic - next topic
0 Members and 3 Guests are viewing this topic.

foo_mpv - Video Player component based on mpv

This component allows playing video in foobar using an embedded mpv instance.



Features
- Local files only
- Aims to quickly and very accurately sync video to the audio (improvements likely)
- Supports files with chapters/subsongs
- DefaultUI element and popup (ColumnsUI panel later)
- Fullscreen via double click
- Works in Wine
- Can read mpv.conf from <Profile Folder>/mpv/mpv.conf

NB: go easy on the options in mpv.conf, don't override any of the options set by the component or weird things might happen. Good options to set might be scaling, video filters, deinterlacing, etc. For example:

Code: [Select]
vf-append=bwdif:deint=1
scale=ewa_lanczos

Try combining with the ffmpeg decoder component to play most video files, though mkv files may work best with the native decoder.

Home
Download

Re: foo_mpv - Video Player component based on mpv

Reply #1
Thanks a lot. I have been waiting for this component. I use mpv everyday. Nice to see it supports h/w decoding, external and embedded subtitles, portable config which all basic thing I need. Good job!.

Re: foo_mpv - Video Player component based on mpv

Reply #2
The MKV/WEBM/FLV file cannot be played.
What is the list with previews below in your screenshot?


Re: foo_mpv - Video Player component based on mpv

Reply #3
The MKV/WEBM/FLV file cannot be played.
What is the list with previews below in your screenshot?

Does foobar play the file normally?

If so please enable mpv's log: in Advanced preferences->Playback->mpv enable both options for logging, then restart playback and check the contents of foobar's console and mpv's log, <Profile Folder>/mpv/mpv.log.

If the log doesn't exist try stopping and restarting playback.

The component is facets

Re: foo_mpv - Video Player component based on mpv

Reply #4
Noted: video does not start playing if the video window is defined as the UI Element of the layout.
To start video playback in this case, you must select any other tab and then select in the main menu: "View/mpv Video".

And a few suggestions for future versions:
- add the ability to change the background of the UI Element of the video window
- include the component as the name "video decoder" in the list of other decoders in the preferences window
- add integration with youtube-dl
- add the ability to play video streams

Thanks to the developer for this component!
I wish you success in the development of the project and soon placement the component in the official repository!

Re: foo_mpv - Video Player component based on mpv

Reply #5
Noted: video does not start playing if the video window is defined as the UI Element of the layout.
To start video playback in this case, you must select any other tab and then select in the main menu: "View/mpv Video".

Thanks for the report. I can reproduce the case where the video won't start if the video tab isn't selected on startup, I think this is what you mean?

And a few suggestions for future versions:
- add the ability to change the background of the UI Element of the video window

Noted.

- include the component as the name "video decoder" in the list of other decoders in the preferences window
- add integration with youtube-dl
- add the ability to play video streams

mpv isn't actually decoding any audio for foobar so it's not necessary to be in the decoder list.

Regarding youtube, it might be possible to implement playing youtube streams in a simple way, to use as an alternative video player for the current youtube component. mpv already supports playing youtube videos, so it might be possible to have the existing youtube component download only audio and feed it to foobar, and simultaneously have mpv fetch and play the video. I will look into it at a later date.

Re: foo_mpv - Video Player component based on mpv

Reply #6
I can reproduce the case where the video won't start if the video tab isn't selected on startup, I think this is what you mean?
The video does not start when the video tab is selected.
To start playing the video, I need to select another tab and then select "View / Video in mpv format".

Regarding youtube, it might be possible to implement playing youtube streams in a simple way, to use as an alternative video player for the current youtube component. mpv already supports playing youtube videos, so it might be possible to have the existing youtube component download only audio and feed it to foobar, and simultaneously have mpv fetch and play the video. I will look into it at a later date.
I meant HLS video streams. The current youtube component does not sync video and audio well enough when playing these streams.

Re: foo_mpv - Video Player component based on mpv

Reply #7
The video does not start when the video tab is selected.
To start playing the video, I need to select another tab and then select "View / Video in mpv format".

OK understood. Could you attach a screenshot of your layout?

I meant HLS streams. The youtube component has problems with the synchronization of video and sound when playing these streams.

I think live streams might be beyond the scope of this component, as there is no absolute 'current playback position' that can be synchronised between foobar/mpv if they are both reading from a livestream separately. It would depend whether foobar exposes the stream's current timestamp to components, but I don't think it does.

Re: foo_mpv - Video Player component based on mpv

Reply #8
Hi.  I'm apparently doing something wrong.  I installed the plug-in in the usual manner using Foobar 1.6 on Windows 10 1903 and it does show up in my component list.  But when I run it from either the view menu or as a DUI UI element I just get a blank screen and the error message "Error: Could not load mpv-1.dll: error code 126" is written to the console.  I copied the MPV folder containing mpv-1.dll to the profile folder and also tried moving it to the main Foobar folder.  I also tried copying just the dll itself to these folders.  I am using a portable install and wonder if that could be the problem.  Any suggestions?

Re: foo_mpv - Video Player component based on mpv

Reply #9
Hi.  I'm apparently doing something wrong.  I installed the plug-in in the usual manner using Foobar 1.6 on Windows 10 1903 and it does show up in my component list.  But when I run it from either the view menu or as a DUI UI element I just get a blank screen and the error message "Error: Could not load mpv-1.dll: error code 126" is written to the console.  I copied the MPV folder containing mpv-1.dll to the profile folder and also tried moving it to the main Foobar folder.  I also tried copying just the dll itself to these folders.  I am using a portable install and wonder if that could be the problem.  Any suggestions?

It should install to the right place if you install it by dragging the whole zip onto foobar's component window (or browsing to it using the Install button). The mpv folder containing mpv-1.dll should be in the same folder as the component dll, so I think for a portable install it should be like
<foobar folder>\profile\user-components\foo_mpv\mpv\mpv-1.dll
<foobar folder>\profile\user-components\foo_mpv\foo_mpv.dll

Re: foo_mpv - Video Player component based on mpv

Reply #10
Thank you very much, that did it.  I think I may have just installed the foo_mpv dll instead of the zip file.  Thank you for developing this component and making it available to all of us.

Re: foo_mpv - Video Player component based on mpv

Reply #11
Hi there.

Does It play all video extensions (.wmv, .avi, .mpg...)?

Re: foo_mpv - Video Player component based on mpv

Reply #12
Hi there.

Does It play all video extensions (.wmv, .avi, .mpg...)?

For any file you play in foobar, it will ask mpv to try and play it. If there is no video track because it's music, mpv will just idle until the next track plays. So yes it should play anything mpv can normally play.

Re: foo_mpv - Video Player component based on mpv

Reply #13
Thank you very much!

Re: foo_mpv - Video Player component based on mpv

Reply #14
I'm not able to see AVI or MPG at all. As I remember they are not supported from F2K codebase. It would be perfect since I have many videoclips from older times.

And also it's much quicker than youtube. OK not the same functionality but an important step.

Re: foo_mpv - Video Player component based on mpv

Reply #15
I'm not able to see AVI or MPG at all. As I remember they are not supported from F2K codebase. It would be perfect since I have many videoclips from older times.

And also it's much quicker than youtube. OK not the same functionality but an important step.

It should play if foobar can play the audio. Foobar should be able to play them if you install and configure the ffmpeg decoder component

Re: foo_mpv - Video Player component based on mpv

Reply #16
It should play if foobar can play the audio. Foobar should be able to play them if you install and configure the ffmpeg decoder component

I thought that the component would auto-configure it shelf. I was wrong. I did what it should be done ad now I'm ready.

Re: foo_mpv - Video Player component based on mpv

Reply #17
New release v0.2

-Faster and more accurate synchronisation when seeking and starting playback. Should be reasonably close to standalone mpv now
-Context menu added to the video
-Columns UI panel
-Only one instance of the video plays at a time, and it moves to the largest currently visible panel or the popup window as you change tabs or resize your layout
-Option to pin the video to any one panel temporarily
-Popup window can optionally remain visible when foobar is minimized
-Option to set the popup window title via title formatting
-Option to set the background colour

Please report any issues here or on Github

Download

Re: foo_mpv - Video Player component based on mpv

Reply #18
Everything works great!
Timely start of .vob video playback was achieved by decreasing the value "Hard sync ..." = 1000 ms.

- is it possible to display statistics like the i / I key in MPV? (see pic.)
- in future versions of the component, it would be useful to see the state of audio / video synchronization during playback.

Re: foo_mpv - Video Player component based on mpv

Reply #19
- is it possible to display statistics like the i / I key in MPV? (see pic.)
- in future versions of the component, it would be useful to see the state of audio / video synchronization during playback.

You should be able to run scripts by reenabling load-scripts option (maybe I shouldn't disable that). You can also re-enable the default stats script by re-enabling the option "load-stats-overlay". However it won't be visible because no input is passed through to mpv from the component, so you can't trigger it, making it useless. You could modify the script to be always visible but there probably isn't any nice way to trigger it manually at the moment. As an alternative some statistics are shown in the context menu already, though.

You can see detailed information about the A/V sync in the console if you enable the 'verbose console logging' advanced preference.

Re: foo_mpv - Video Player component based on mpv

Reply #20
Timely start of .vob video playback was achieved by decreasing the value "Hard sync ..." = 1000 ms.

Actually, if this made a big difference I would be interested if you could post some output of the verbose console logging when playback starts.

Re: foo_mpv - Video Player component based on mpv

Reply #21
Changing the parameter affects the time from starting playback until the first frame is displayed.
But changing the parameter "Minimum time ..." = 1 sec.
I attach verbose logging with different settings of these parameters.

- It would be great to allow the mpv.log file content to be output to the fb2k console (as an option).

Re: foo_mpv - Video Player component based on mpv

Reply #22
@sammoth
Thank you so much for this wonderful component!
Everything works as it should.
A small request to add some functions:
 - hide the mouse cursor in full screen (if possible)
 - single mouse click full screen / restore the video window (if possible)

And another moment when embedding a window in CUI, there is a frame around the window, is it possible to remove or disable it?
(Screenshot at the bottom of the message)

I am hardly familiar with MPV player and I have a question about aspect ratio, is it possible to disable this function? It is necessary in order to stretch the video to the entire window.

Re: foo_mpv - Video Player component based on mpv

Reply #23
The MKV/WEBM/FLV file cannot be played.
What is the list with previews below in your screenshot?

Does foobar play the file normally?

If so please enable mpv's log: in Advanced preferences->Playback->mpv enable both options for logging, then restart playback and check the contents of foobar's console and mpv's log, <Profile Folder>/mpv/mpv.log.

If the log doesn't exist try stopping and restarting playback.

The component is facets

The video will be played for 0.3 seconds, and then an error message will pop up: Unable to open item for playback (Corrupted file or unsupported format):
"....mkv"

The time and size of the video are not visible in the list.

BTW
facets can't show any screenshots.


Re: foo_mpv - Video Player component based on mpv

Reply #24
The video will be played for 0.3 seconds, and then an error message will pop up: Unable to open item for playback (Corrupted file or unsupported format):
"....mkv"

This is an error from foobar's decoder. This component isn't a decoder so it is not related. You could try installing the ffmpeg decoder component and setting it to play mkv files, as it's a little more forgiving of corrupt files than foobar's native decoder.

BTW
facets can't show any screenshots.

You can generate thumbnails yourself and associate them with your videos as album art in the usual ways.

Changing the parameter affects the time from starting playback until the first frame is displayed.
But changing the parameter "Minimum time ..." = 1 sec.
I attach verbose logging with different settings of these parameters.

The '10 second' file looks strange, I think that's a bug where mpv is incorrectly paused. But is that the start of the log? Normally there would be some information before, like 'mpv: Loading item...'. Did you start playback in that test by just double clicking a file or pressing play in foobar?

- hide the mouse cursor in full screen (if possible)
 - single mouse click full screen / restore the video window (if possible)

Yes good idea

And another moment when embedding a window in CUI, there is a frame around the window, is it possible to remove or disable it?
(Screenshot at the bottom of the message)

Oops I missed that, yes I will remove it.


I am hardly familiar with MPV player and I have a question about aspect ratio, is it possible to disable this function? It is necessary in order to stretch the video to the entire window.

Yes you can set either "panscan=1.0" or "no-keepaspect" in mpv.conf depending on whether you want the video to zoom and crop or just stretch and squish the aspect ratio

 
SimplePortal 1.0.0 RC1 © 2008-2020