HydrogenAudio

Hosted Forums => foobar2000 => 3rd Party Plugins - (fb2k) => Topic started by: sammoth on 2020-09-06 20:38:41

Title: foo_mpv - Video Player component based on mpv
Post by: sammoth on 2020-09-06 20:38:41
This component allows playing local video files in foobar2000 using libmpv.

It is not a foobar decoder, it will just play the video for files that foobar is already playing via other input components. You may need to install other decoders or foo_input_ffmpeg (https://www.foobar2000.org/components/view/foo_input_ffmpeg) to play certain files.

Features
- Video player can be a default UI element, columns UI panel or a separate window
- On-screen control on the video
- Fullscreen mode
- Generates video thumbnails as album art, with optional manual thumbnail chooser
- Video panels can act as an album art viewer when no video is present to avoid wasting space
- Reads mpv.conf and input.conf
- Provides some interfaces for integrating mpv Lua scripts with foobar2000

Home and readme (https://github.com/sammoth/foo_mpv)
Download (https://github.com/sammoth/foo_mpv/releases/latest)

(https://i.imgur.com/mMT2quv.png)
Title: Re: foo_mpv - Video Player component based on mpv
Post by: arch21 on 2020-09-07 06:35:49
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!.
Title: Re: foo_mpv - Video Player component based on mpv
Post by: Sickid on 2020-09-07 15:05:45
The MKV/WEBM/FLV file cannot be played.
What is the list with previews below in your screenshot?

Title: Re: foo_mpv - Video Player component based on mpv
Post by: sammoth on 2020-09-07 15:11:19
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
Title: Re: foo_mpv - Video Player component based on mpv
Post by: Sergey77 on 2020-09-07 17:47:28
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!
Title: Re: foo_mpv - Video Player component based on mpv
Post by: sammoth on 2020-09-07 18:06:27
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.
Title: Re: foo_mpv - Video Player component based on mpv
Post by: Sergey77 on 2020-09-07 18:52:11
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.
Title: Re: foo_mpv - Video Player component based on mpv
Post by: sammoth on 2020-09-07 19:07:54
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.
Title: Re: foo_mpv - Video Player component based on mpv
Post by: dwmartin0906 on 2020-09-08 19:42:11
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?
Title: Re: foo_mpv - Video Player component based on mpv
Post by: sammoth on 2020-09-08 21:57:00
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
Title: Re: foo_mpv - Video Player component based on mpv
Post by: dwmartin0906 on 2020-09-08 23:47:51
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.
Title: Re: foo_mpv - Video Player component based on mpv
Post by: Johnny Blade on 2020-09-09 00:21:53
Hi there.

Does It play all video extensions (.wmv, .avi, .mpg...)?
Title: Re: foo_mpv - Video Player component based on mpv
Post by: sammoth on 2020-09-09 01:14:49
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.
Title: Re: foo_mpv - Video Player component based on mpv
Post by: Johnny Blade on 2020-09-09 03:55:49
Thank you very much!
Title: Re: foo_mpv - Video Player component based on mpv
Post by: koupa on 2020-09-09 18:47:11
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.
Title: Re: foo_mpv - Video Player component based on mpv
Post by: sammoth on 2020-09-09 19:25:57
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 (https://www.foobar2000.org/components/view/foo_input_ffmpeg) component
Title: Re: foo_mpv - Video Player component based on mpv
Post by: koupa on 2020-09-11 18:05:55
It should play if foobar can play the audio. Foobar should be able to play them if you install and configure the ffmpeg decoder (https://www.foobar2000.org/components/view/foo_input_ffmpeg) 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.
Title: Re: foo_mpv - Video Player component based on mpv
Post by: sammoth on 2020-09-14 14:24:04
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 (https://github.com/sammoth/foo_mpv/releases)
Title: Re: foo_mpv - Video Player component based on mpv
Post by: Sergey77 on 2020-09-14 16:41:19
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.
Title: Re: foo_mpv - Video Player component based on mpv
Post by: sammoth on 2020-09-14 16:55:22
- 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.
Title: Re: foo_mpv - Video Player component based on mpv
Post by: sammoth on 2020-09-14 16:59:46
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.
Title: Re: foo_mpv - Video Player component based on mpv
Post by: Sergey77 on 2020-09-14 17:58:02
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).
Title: Re: foo_mpv - Video Player component based on mpv
Post by: du22y on 2020-09-14 18:15:02
@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.
Title: Re: foo_mpv - Video Player component based on mpv
Post by: Sickid on 2020-09-14 18:41:51
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.

Title: Re: foo_mpv - Video Player component based on mpv
Post by: sammoth on 2020-09-14 18:58:06
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
Title: Re: foo_mpv - Video Player component based on mpv
Post by: du22y on 2020-09-14 20:24:38
@sammoth
Thank you for listening to the requests!
I did as I wanted with the aspect ratio, thanks.
Sorry for my bad English.

And I completely forgot one more small request) if it is possible of course.
In full-screen video mode, is it possible to make the previous / next track switching area on the sides of the window as in the screenshot. It will be very convenient to switch tracks on touch screens.
Title: Re: foo_mpv - Video Player component based on mpv
Post by: sammoth on 2020-09-14 21:29:28
And another moment when embedding a window in CUI, there is a frame around the window, is it possible to remove or disable it?

I released a fix for this (https://github.com/sammoth/foo_mpv/releases)

In full-screen video mode, is it possible to make the previous / next track switching area on the sides of the window as in the screenshot. It will be very convenient to switch tracks on touch screens.

I am still thinking about how to approach more input options, but I'll keep touch screens in mind.
Title: Re: foo_mpv - Video Player component based on mpv
Post by: Sergey77 on 2020-09-15 15:05:41
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?
You are right, the log information was incomplete.
The attachment is now updated.
Started playback a file by pressing Play.
Title: Re: foo_mpv - Video Player component based on mpv
Post by: sammoth on 2020-09-15 15:24:28
You are right, the log information was incomplete.
The attachment is now updated.
Started playback a file by pressing Play.

Thank you, I think I can work out the issue now
Title: Re: foo_mpv - Video Player component based on mpv
Post by: du22y on 2020-09-15 21:02:14
And another moment when embedding a window in CUI, there is a frame around the window, is it possible to remove or disable it?

I released a fix for this (https://github.com/sammoth/foo_mpv/releases)

In full-screen video mode, is it possible to make the previous / next track switching area on the sides of the window as in the screenshot. It will be very convenient to switch tracks on touch screens.

I am still thinking about how to approach more input options, but I'll keep touch screens in mind.
Thank you.

Sometimes the video doesn't pause.
The audio track is paused(foobar2000 is paused) and the video continues to run. I don't know how to reproduce this yet, it happens somehow randomly.
Title: Re: foo_mpv - Video Player component based on mpv
Post by: sammoth on 2020-09-15 21:19:28
Sometimes the video doesn't pause.
The audio track is paused(foobar2000 is paused) and the video continues to run. I don't know how to reproduce this yet, it happens somehow randomly.

Thank you for reporting, I can reproduce this by unpausing and pausing quickly in succession.
Title: Re: foo_mpv - Video Player component based on mpv
Post by: sammoth on 2020-09-15 21:21:00
BTW
facets can't show any screenshots.

I will add a thumbnail generator in the next version
Title: Re: foo_mpv - Video Player component based on mpv
Post by: Sergey77 on 2020-09-16 17:17:59
Please test the behavior of the component when using Skip Track.
When the bookmark is triggered, the video is paused and the audio playback continues.
Title: Re: foo_mpv - Video Player component based on mpv
Post by: sammoth on 2020-09-16 17:48:16
Please test the behavior of the component when using Skip Track.
When the bookmark is triggered, the video is paused and the audio playback continues.

Thanks, fixed in the next version
Title: Re: foo_mpv - Video Player component based on mpv
Post by: sammoth on 2020-09-21 20:05:26
New release:

- Thumbnail support, thumbnails will be generated as album art if enabled. The thumbnails will be generated for any grouping, so it is not as strict as the normal album art reader about a group having only one image. You can have thumbnails for individual tracks and groups at the same time. Like this:
(https://i.imgur.com/J94qINN.png)

- Thumbnails are cached in a SQLite db in the the profile directory
- You can limit thumbnail generation to certain files using foobar search query syntax
- You can choose a thumbnail from a video manually (right click->Utilities->Choose Thumbnail). The chosen thumbnail should usually be generated correctly but sometimes a slightly different timestamp may be chosen if the video has broken timestamps, broken index, or for some other reason mpv's timestamps don't agree with those I get from ffmpeg. Note that generating a custom thumbnail the first time is much slower (until it's cached)
- There is an option to search for 'good' thumbnails automatically instead of just choosing a certain time. The algorithm isn't very smart and it's quite slow, but it may avoid choosing entirely black or white frames. Sometimes it seems to choose worse frames though, in particular it likes to choose frames which were incorrectly decoded and have lots of noise
- Option to choose how the video frame moves between panels
- Some syncing bugs are fixed
- Fixed some incompatibilities with foo_skip component
- Fixed some issuses with pause state being set incorrectly

Download (choose the fb2k-component file) (https://github.com/sammoth/foo_mpv/releases)
Title: Re: foo_mpv - Video Player component based on mpv
Post by: dwmartin0906 on 2020-09-22 04:22:07
I just wanted to thank you for the thumbnail feature.  It works great with Facets.  Before, if I wanted thumbnails, I had to open an explorer window and play the video in an external player.  Now I can do it all in Foobar.  And the ability to create your own thumbnail is fantastic.
Title: Re: foo_mpv - Video Player component based on mpv
Post by: Sergey77 on 2020-09-22 15:22:15
@sammoth,
- probably you need to slightly correct the behavior of the component when processing thumbnails.
After the thumbnail is generated, it should continue to be displayed even if the "Generate video thumbnail as artwork " option is disabled. Otherwise, the "Remove custom thumbnail..." option is not work since the thumbnail is displayed again after deletion.
- it looks like the "Cover type to provide" option is always set to the "All" mode.
- the display of the contents of the component settings window on the right needs to be corrected (see the picture). For a screen resolution of 1920 x 1080.

- I suggest for future releases to add the ability to switch the audio track.

Thank you very much for your component!
Title: Re: foo_mpv - Video Player component based on mpv
Post by: sammoth on 2020-09-22 15:46:29
Thank you for your feedback,

- probably you need to slightly correct the behavior of the component when processing thumbnails.
After the thumbnail is generated, it should continue to be displayed even if the "Generate video thumbnail as artwork " option is disabled. Otherwise, the "Remove custom thumbnail..." option is not work since the thumbnail is displayed again after deletion.

Hmm, maybe I do not understand the problem but I think this is working as intended for me. If "Generate video thumbnail as artwork" is disabled, we don't check the cache for existing images because the feature is completely disabled. Maybe I should rename the option to make it more clear. This is intentional because it means there won't be any extra load or slowdown looking for thumbnails for people who want to use the video player feature only.

If you use "Remove custom thumbnail time" while thumbnails are disabled, it still deletes the custom set time, and the default thumbnail will be rengenerated once thumbnails are re-enabled. Are you seeing something different?

- it looks like the "Cover type to provide" option is always set to the "All" mode.
- the display of the contents of the component settings window on the right needs to be corrected (see the picture). For a screen resolution of 1920 x 1080.

Yes I can reproduce these.

- I suggest for future releases to add the ability to switch the audio track.

This can only be implemented in foobar, it is not possible in my component as I am not decoding the audio. However, for MKV files, if you are using foobar's native MKV decoder, you can switch the audio track by right clicking on a file, Utilities->Select stream. Many types of file can be converted to MKV without loss of quality using  MKVToolNix, so you can potentially remux your files with multi-track audio to MKV to allow changing audio track.
Title: Re: foo_mpv - Video Player component based on mpv
Post by: Rollin on 2020-09-22 16:45:44
However, for MKV files, if you are using foobar's native MKV decoder, you can switch the audio track by right clicking on a file, Utilities->Select stream.
Actually, this works with foo_input_ffmpeg too and not only for mkv.
Title: Re: foo_mpv - Video Player component based on mpv
Post by: Rollin on 2020-09-22 16:48:13
del
Title: Re: foo_mpv - Video Player component based on mpv
Post by: Sergey77 on 2020-09-22 17:01:35
If you use "Remove custom thumbnail time" while thumbnails are disabled, it still deletes the custom set time, and the default thumbnail will be rengenerated once thumbnails are re-enabled. Are you seeing something different?
You're right. I really misunderstood this feature and was hasty with a comment, sorry.
Quote
This can only be implemented in foobar, it is not possible in my component as I am not decoding the audio. However, for MKV files, if you are using foobar's native MKV decoder, you can switch the audio track by right clicking on a file, Utilities->Select stream.
Yes, this method would be convenient for me. But for some unknown reason, I cannot select an alternative audio stream. Although my mkv video file has two audio tracks.

Title: Re: foo_mpv - Video Player component based on mpv
Post by: sammoth on 2020-09-22 17:06:53
Yes, this method would be convenient for me. But for some unknown reason, I cannot select an alternative audio stream. Although my mkv video file has two audio tracks.

I'm not sure what could cause it not to work, maybe ask on the core Support forum. That aspect is completely handled by the core decoder components, so if it's not showing all the streams that sounds like a bug.

You're right. I really misunderstood this feature and was hasty with a comment, sorry.

No problem! I have changed the name of the preference so it's a bit less confusing.
Title: Re: foo_mpv - Video Player component based on mpv
Post by: VlaKor on 2020-09-22 18:56:23
Not play: Opening track for playback: "E:\Movies\Ded.2012.XviD.IPTVRip.Files-x.avi"
Unable to open item for playback (Unsupported file format):
"E:\Movies\Ded.2012.XviD.IPTVRip.Files-x.avi"
Opening track for playback: "E:\Movies\Иди и смотри.1985.mkv" / index: 15
Unable to open item for playback (Unsupported audio track format):
"E:\Movies\Иди и смотри.1985.mkv" / index: 15
Title: Re: foo_mpv - Video Player component based on mpv
Post by: Rollin on 2020-09-22 19:05:11
Not play: Opening track for playback: "E:\Movies\Ded.2012.XviD.IPTVRip.Files-x.avi"
Unable to open item for playback (Unsupported file format):
"E:\Movies\Ded.2012.XviD.IPTVRip.Files-x.avi"
Opening track for playback: "E:\Movies\Иди и смотри.1985.mkv" / index: 15
Unable to open item for playback (Unsupported audio track format):
"E:\Movies\Иди и смотри.1985.mkv" / index: 15
For avi you need foo_input_ffmpeg. What audio format in mkv: ac3, dts? Install decoders for them or use foo_input_ffmpeg also for mkv.
Title: Re: foo_mpv - Video Player component based on mpv
Post by: sammoth on 2020-09-22 19:49:11
Small update (https://github.com/sammoth/foo_mpv/releases) with some of the above bugs fixed
Title: Re: foo_mpv - Video Player component based on mpv
Post by: VlaKor on 2020-09-22 21:14:01
Not play: Opening track for playback: "E:\Movies\Ded.2012.XviD.IPTVRip.Files-x.avi"
Unable to open item for playback (Unsupported file format):
"E:\Movies\Ded.2012.XviD.IPTVRip.Files-x.avi"
Opening track for playback: "E:\Movies\Иди и смотри.1985.mkv" / index: 15
Unable to open item for playback (Unsupported audio track format):
"E:\Movies\Иди и смотри.1985.mkv" / index: 15
For avi you need foo_input_ffmpeg. What audio format in mkv: ac3, dts? Install decoders for them or use foo_input_ffmpeg also for mkv.
Огромное спасибо. Дошло ))
Title: Re: foo_mpv - Video Player component based on mpv
Post by: SergPuh.68 on 2020-09-23 14:48:19
Thank you for your hard work!
The YouTube Source component perfectly copes with all the tasks set for viewing content from YouTube, but it is very bad at syncing audio and video when viewing from other sources.I use Foobar2000 to view m3u8 IPTV playlists.If you implement synchronization for HLS in your component in the future, it will be fantastic!
Title: Re: foo_mpv - Video Player component based on mpv
Post by: sammoth on 2020-09-23 15:06:25
I use Foobar2000 to view m3u8 IPTV playlists.If you implement synchronization for HLS in your component in the future, it will be fantastic!

I think this probably isn't possible to do unfortunately. The youtube component works quite differently because it inserts itself as the decoder/input for both audio and video, so it can synchronise everything even when it is a live stream. This component has mpv read the file separately, so it might not be possible to synchronise with foobar.

However, I can have a look. Do you have an example m3u8 playlist, or somewhere I can find one?
Title: Re: foo_mpv - Video Player component based on mpv
Post by: Sergey77 on 2020-09-23 16:21:00
Small update (https://github.com/sammoth/foo_mpv/releases) with some of the above bugs fixed
confirmed.

However, I can have a look. Do you have an example m3u8 playlist, or somewhere I can find one?
For example these:

Code: [Select]
http://wma10.fluidstream.net/CompanyTV/_definst_/mp4:livestream_720p/playlist.m3u8
http://bitcdn-kronehit.bitmovin.com/v2/hls/chunklist_b3128000.m3u8
Title: Re: foo_mpv - Video Player component based on mpv
Post by: SergPuh.68 on 2020-09-23 17:23:15
However, I can have a look. Do you have an example m3u8 playlist, or somewhere I can find one?
[/quote]
Title: Re: foo_mpv - Video Player component based on mpv
Post by: sammoth on 2020-09-23 17:51:14
Thanks, yes I don't think it will work unfortunately. Foobar just reports the time since playback started, so there's no way this component could sync the video and audio as mpv might not start playback at the same time.
Title: Re: foo_mpv - Video Player component based on mpv
Post by: Rollin on 2020-09-25 19:19:02
Is it possible to make smoothmotion i.e.
Code: [Select]
interpolation
tscale=oversample
work with this component?
Title: Re: foo_mpv - Video Player component based on mpv
Post by: sammoth on 2020-09-25 19:36:52
Is it possible to make smoothmotion i.e.
Code: [Select]
interpolation
tscale=oversample
work with this component?

No, because mpv has to be in 'audio' video-sync mode. If you look at the descriptions for every other video-sync mode, they basically work by resampling the audio continuously to allow it to speed up and slow down slightly. In the case of this component foobar is handling the audio playback so we have no control of audio playback speed, we just have to sync the video to the audio clock. So the video frame timing will never be as smooth as a real video player.

edit: I guess you could try enabling it and see if it works at all, though. I'm not sure exacly what would happen. I'm guessing mpv would try to lock to the display and start adjusting its audio clock to stay in sync. The component will see it's drifting away from foobar's clock and tell it to speed up/slow down. Once the speed is far enough away from normal, it will decide it's too far off to sync with the display and you'll get frame repeats/drops, defeating the purpose.
Title: Re: foo_mpv - Video Player component based on mpv
Post by: Fabcore on 2020-09-25 22:47:07
Hi, after the installation, i noticed that foobar2000 seems to lock the audio files, so sometimes i can't delete or make modifications.
i solved uninstalling this component.
Is it a bug indeed in the component?
thanks
Title: Re: foo_mpv - Video Player component based on mpv
Post by: sammoth on 2020-09-26 00:09:03
Hi, after the installation, i noticed that foobar2000 seems to lock the audio files, so sometimes i can't delete or make modifications.
i solved uninstalling this component.
Is it a bug indeed in the component?
thanks

Thank you for reporting, yes it is a bug. Could you try the fix (https://github.com/sammoth/foo_mpv/releases) I just uploaded please.
Title: Re: foo_mpv - Video Player component based on mpv
Post by: sammoth on 2020-09-29 10:57:25
New release. This version lets you use the video panel/window as an album art view when there is no active video, so that it can replace the album art viewer in a layout and not take up space with a blank panel when you're just playing music.

Also various bug fixes in the thumbnailer and player.

Download (https://github.com/sammoth/foo_mpv/releases)
Title: Re: foo_mpv - Video Player component based on mpv
Post by: arch21 on 2020-09-29 11:12:12
I see foobar2000 UI completely freeze when closing video window
Title: Re: foo_mpv - Video Player component based on mpv
Post by: sammoth on 2020-09-29 11:21:00
I see foobar2000 UI completely freeze when closing video window

Ugh I'm sorry I missed that. Please try the updated fixed version
Title: Re: foo_mpv - Video Player component based on mpv
Post by: arch21 on 2020-09-29 11:29:13
yes, that fixed it. thanks :)
Title: Re: foo_mpv - Video Player component based on mpv
Post by: sammoth on 2020-10-01 19:51:50
New release (https://github.com/sammoth/foo_mpv/releases)

The player now has an on-screen control like mpv. It's basically the same as mpv's but simplified a bit to make it work with the component. You can enable/disable it globally or per-UI element.

This pretty much completes the features I wanted to implement in this component!
Title: Re: foo_mpv - Video Player component based on mpv
Post by: arch21 on 2020-10-02 07:31:32
I see the timer on OSC start from 08;00:00. could you check it?
Title: Re: foo_mpv - Video Player component based on mpv
Post by: arch21 on 2020-10-02 09:53:11
it seems because of os.date function in lua script
Title: Re: foo_mpv - Video Player component based on mpv
Post by: sammoth on 2020-10-02 09:59:57
Hmm I can't reproduce it. You mean the time on the left that shows the current play time? I can see that the time when you hover over the seekbar is incorrect on files with chapters but can't reproduce the playback time being wrong. It is the same for every video file, starting at 8 hours?
Title: Re: foo_mpv - Video Player component based on mpv
Post by: arch21 on 2020-10-02 10:06:25
I think you also could reproduce by changing your time zone then restart foobar2000. I tried temporarily change my time zone and yes, it changed accordingly to my system time zone setting
Title: Re: foo_mpv - Video Player component based on mpv
Post by: sammoth on 2020-10-02 10:08:45
I think you also could reproduce by changing your time zone then restart foobar2000.

Oh you're right! I need to learn lua a bit better...
Title: Re: foo_mpv - Video Player component based on mpv
Post by: sammoth on 2020-10-02 10:32:40
Please try the update. Thanks for reporting and finding the problem
Title: Re: foo_mpv - Video Player component based on mpv
Post by: Awesomeo on 2020-10-02 13:10:52
Any timeline for CUI panel?
Title: Re: foo_mpv - Video Player component based on mpv
Post by: sammoth on 2020-10-02 13:27:43
Any timeline for CUI panel?

CUI panel was already implemented, I just can't update the first post
Title: Re: foo_mpv - Video Player component based on mpv
Post by: arch21 on 2020-10-02 15:32:43
It looks good now. thanks.
Title: Re: foo_mpv - Video Player component based on mpv
Post by: dwmartin0906 on 2020-10-03 00:03:02
Hi.  You've really done a great job with this component.  The OSC is great.  I was wondering how much trouble it would be to add a volume control.  It would really be useful when in full screen mode.  Just a thought.
Title: Re: foo_mpv - Video Player component based on mpv
Post by: sammoth on 2020-10-03 00:12:33
Hi.  You've really done a great job with this component.  The OSC is great.  I was wondering how much trouble it would be to add a volume control.  It would really be useful when in full screen mode.  Just a thought.

Yes I think so, the original OSC has a volume control you can adjust with the mouse wheel. I could add that back.
Title: Re: foo_mpv - Video Player component based on mpv
Post by: dwmartin0906 on 2020-10-03 08:35:15
Thank you for your quick reply.  That would be great if it wasn't too much trouble.  I do have a couple of other suggestions concerning playing multiple files from a playlist based on what MPV does, but they are JUST suggestions.  I am NOT asking you to implement them unless you think they would be worth the effort.  The first one would be to grey out the appropriate skip forward/backward button when reaching the end/beginning instead of closing the player when you go past the end or beginning.  The other one would be to briefly display the playlist, indicating which title is playing, when skipping forward or backward.  This one is probably way too much effort, but I'm just tossing it out there.  Either way, I'm just grateful you are willing to share this great component and am perfectly happy with it the way it is.  I now use it instead of the youtube video player since I only play local files.

As a side note, are you aware of the mpv.net player?  It uses the MPV engine, but has a ton of additional features and options.  I use it now instead of VLC when playing videos outside of FB2K.  Thank you again for all your effort.
Title: Re: foo_mpv - Video Player component based on mpv
Post by: sammoth on 2020-10-03 10:30:26
The first one would be to grey out the appropriate skip forward/backward button when reaching the end/beginning instead of closing the player when you go past the end or beginning.

I think the current behaviour just mimics foobar - the next/prev button are always enabled in foobar and pressing next at the end of a playlist will end playback. Also consider that even at the end of the playlist it might be possible to go 'next' because in the simple case playback order might be on Random, but also any component could be adding behaviour to change what plays next, such as filling the playlist with more random tracks when it's finished or such. As we can't know what will happen when pressing next I think it makes sense to just mimic foobar and let it handle it.

The other one would be to briefly display the playlist, indicating which title is playing, when skipping forward or backward.

This one probably isn't that hard, we could just show the next and previous few tracks when changing track manually.

I am aware of mpv.net but haven't used it much. Are there any features in particular you think would be worth copying?
Title: Re: foo_mpv - Video Player component based on mpv
Post by: SergPuh.68 on 2020-10-03 11:25:50
I would like to see support for playing not only local files but also Internet videos.
Title: Re: foo_mpv - Video Player component based on mpv
Post by: dwmartin0906 on 2020-10-03 11:51:55
I hadn't thought of the complexities that FB2K adds to the mix, but that makes sense.  Your MPV is great just the way it is, although the volume adjustment would be handy if it didn't take much effort.  I think others might find it useful too.  As for mpv.net, it's additional features are more applicable to a stand alone player.  It has dozens of options and settings, rivaling that of VLC.  If you ever get bored, check it out sometime.  Thanks again.
Title: Re: foo_mpv - Video Player component based on mpv
Post by: dwmartin0906 on 2020-10-03 16:26:48
Hi.  I have just one more item on my wish list, and then I'll stop bugging you.  How hard would it be to have the cursor disappear after about a second, except when directly over the OSC, like MPV does?  OK, I'm done.  Thanks again.
Title: Re: foo_mpv - Video Player component based on mpv
Post by: sammoth on 2020-10-03 16:35:26
Hi.  I have just one more item on my wish list, and then I'll stop bugging you.  How hard would it be to have the cursor disappear after about a second, except when directly over the OSC, like MPV does?  OK, I'm done.  Thanks again.

Oh yes, I do mean to add that still
Title: Re: foo_mpv - Video Player component based on mpv
Post by: sammoth on 2020-10-03 21:33:44
New release (https://github.com/sammoth/foo_mpv/releases)

Mouse wheel input is now passed through to mpv, and the volume control is added back. You can also set bindings for the mouse wheel in the input.conf file (<profile_folder>/mpv/input.conf), see the manual (https://mpv.io/manual/master/#input-conf) for reference. Note that most playback commands are different, as they have to be passed to foobar as script-messages instead of controling mpv directly. The commands you can use are:

foobar-pause
foobar-prev
foobar-next
foobar-volup
foobar-voldown
foobar-seekback
foobar-seekforward

For example I have set in input.conf:

Code: [Select]
WHEEL_UP script-message foobar-seekback
WHEEL_DOWN script-message foobar-seekforward

You can also create any configuration profile and it will be visible in the video context menu to apply at runtime. See the manual (https://mpv.io/manual/master/#runtime-profiles) for more info. Profiles are only applied when selected, never restored (as in "profile-restore" option). You could use this to rotate videos, change aspect ratios, etc.

For example in mpv/mpv.conf:

Code: [Select]
[test profile 1]
hue=-50

[test profile 2]
hue=50

[reset]
hue=0

Note that you can also set most OSC options the standard way, which is to create a file "mpv/script-opts/osc.conf" containing options, explained here (https://github.com/mpv-player/mpv/blob/master/DOCS/man/osc.rst). In particular the 'box' OSC style might be better for touch screens, eg. in osc.conf add:

Code: [Select]
layout=box
Title: Re: foo_mpv - Video Player component based on mpv
Post by: dwmartin0906 on 2020-10-04 03:07:24
Your latest version works great.  And with the information you provided I was able to make some minor adjustments to suit my own personal tastes.  I can now adjust the volume from anywhere on the screen, not just with the OSC volume control.  I also changed the dead zone so the OSC doesn't pop up until I'm directly over it and changed the seek bar style to bar instead of diamond.  Since I only play local files, I can now get rid of the youtube component altogether.  Thank you so much.
Title: Re: foo_mpv - Video Player component based on mpv
Post by: jdycus on 2020-10-09 12:33:43
New release (https://github.com/sammoth/foo_mpv/releases)

Mouse wheel input is now passed through to mpv, and the volume control is added back. You can also set bindings for the mouse wheel in the input.conf file (<profile_folder>/mpv/input.conf), see the manual (https://mpv.io/manual/master/#input-conf) for reference. Note that most playback commands are different, as they have to be passed to foobar as script-messages instead of controling mpv directly. The commands you can use are:

foobar-pause
foobar-prev
foobar-next
foobar-volup
foobar-voldown
foobar-seekback
foobar-seekforward

For example I have set in input.conf:

Code: [Select]
WHEEL_UP script-message foobar-seekback
WHEEL_DOWN script-message foobar-seekforward

You can also create any configuration profile and it will be visible in the video context menu to apply at runtime. See the manual (https://mpv.io/manual/master/#runtime-profiles) for more info. Profiles are only applied when selected, never restored (as in "profile-restore" option). You could use this to rotate videos, change aspect ratios, etc.

For example in mpv/mpv.conf:

Code: [Select]
[test profile 1]
hue=-50

[test profile 2]
hue=50

[reset]
hue=0

Note that you can also set most OSC options the standard way, which is to create a file "mpv/script-opts/osc.conf" containing options, explained here (https://github.com/mpv-player/mpv/blob/master/DOCS/man/osc.rst). In particular the 'box' OSC style might be better for touch screens, eg. in osc.conf add:

Code: [Select]
layout=box

How do I send video to external screen, preferably with a hotkwy? Thank you
Title: Re: foo_mpv - Video Player component based on mpv
Post by: sammoth on 2020-10-09 12:42:59
How do I send video to external screen, preferably with a hotkwy? Thank you

Hi, at the moment it is not possible due to oversight on my part. You can open the popup and maximise it on the external screen to show the video there, but the fullscreen mode will always appear on the main monitor. It will be fixed in the next version. I can also add a menu item so you can assign a hotkey for opening fullscreen there directly.
Title: Re: foo_mpv - Video Player component based on mpv
Post by: jdycus on 2020-10-09 14:44:31
How do I send video to external screen, preferably with a hotkwy? Thank you

Hi, at the moment it is not possible due to oversight on my part. You can open the popup and maximise it on the external screen to show the video there, but the fullscreen mode will always appear on the main monitor. It will be fixed in the next version. I can also add a menu item so you can assign a hotkey for opening fullscreen there directly.

Thank you. This is a most useful plugin.
Title: Re: foo_mpv - Video Player component based on mpv
Post by: sammoth on 2020-10-10 14:08:13
Regarding some bug report I can see on the Russian forum:

The album art view should follow the logic of the option in Preferences->Display->Selection viewers. If this is set to 'prefer currently playing track', the artwork should show the now playing track. It work this way in ColumnsUI too, so it might not match the ColumnsUI artwork panel, as that has its own logic that I haven't copied. If foo_mpv behaves differently to the Default UI artwork panel, that is a bug.

(https://i.imgur.com/BPjT7XO.png)

If the player seems to stop working, could you enable the option Advanced Preferences->Playback->mpv->Enable verbose console logging. Then reproduce the issue again, and copy the Console output.

Regarding slow loading of thumbnails in other album art viewers: it shouldn't freeze the UI. I think every part of the loading and decoding should be abortable in the latest version. However, if the album art viewer doesn't load the artwork asynchronously, it could freeze the UI as the thumbnailer is inherently slower that loading most other types of artwork. In particular, in the DarkOne theme, the artwork panel uses the WSH Panel function GetAlbumArtV2 to load the artwork which I think is blocking. In the spider monkey panel documentation (https://theqwertiest.github.io/foo_spider_monkey_panel/assets/generated_files/docs/html/utils.html#.GetAlbumArtV2) it recommends using the async version of this function instead. So, I think it is the artwork panel's responsibility not to freeze the UI when loading a thumbnail. I am guessing that might be the issue. That artwork script could be updated to hopefully fix it.

(https://i.imgur.com/QBQNOt4.png)
Title: Re: foo_mpv - Video Player component based on mpv
Post by: koupa on 2020-10-10 19:55:46
I'm trying to assign the wheel double click to work as a modifier for the next item but I can't find the appropriate key.

My input.conf has

WHEEL_UP script-message foobar-seekback
WHEEL_DOWN script-message foobar-seekforward
MOUSE_BTN0_DBL script-message foobar-next

but I have tried various numbers on the last command with no success
Title: Re: foo_mpv - Video Player component based on mpv
Post by: sammoth on 2020-10-10 20:00:19
I think middle mouse clicks aren't passed through. If you wait for the next version it handles input a bit differently and everything should work, it will be ready in a day or two.
Title: Re: foo_mpv - Video Player component based on mpv
Post by: jdycus on 2020-10-10 20:06:16
I think middle mouse clicks aren't passed through. If you wait for the next version it handles input a bit differently and everything should work, it will be ready in a day or two.

Here's hoping "Send Video To External Monitor" will make it!
Title: Re: foo_mpv - Video Player component based on mpv
Post by: sammoth on 2020-10-13 02:19:04
New release (https://github.com/sammoth/foo_mpv)

- foo_acfu integration for update checking https://acfu.3dyd.com/
- Add option to control which files are played using a search query. By default, only files foobar identifies as having a video stream will be played. You could change the query or disable this if you are using some input component which does not provide $info(video_codec). This should improve the responsiveness of the artwork display as it will not try to load every file as a video before falling back to artwork.
- Option to disable/enable the video from the main menu. Instead of using this for automating enabling/disabling the video, if possible it would be better to use the above mentioned query feature as it will always apply before an attempt is made to load the video, whereas an external script may be applied afterwards.
- Add ability to restart mpv to reload configuration from the UI, to toggle fullscreen or open fullscreen on any particular monitor from the main menu (hold shift->View menu->mpv Commands).
- The fullscreen window will by default appear on the same monitor as the window it was created from.
- You can drag the mouse on the OSC seekbar like in standalone mpv, however seeking is heavier on the CPU and disk than with standalone mpv due to the nature of the plugin, so it might be laggy unless your PC and disk are fast.
- The popup uses foobar's icon.
- Some basic mpv options can be set from the preferences.
- Artwork mode updates if the artwork is updated (eg. choosing a new video thumbnail).
- Stub artwork is loaded if set
- You can edit mpv.conf and input.conf from the preferences, and default files will be created if none exist in the first instance.
- In panel mode, all mouse input is passed through to mpv and can be mapped in input.conf except right mouse button which is reserved for the context menu.
- In popup mode or fullscreen, keyboard input is also passed to mpv (except escape always exits fullscreen).
- Fix a bug when playing non-local files in foobar where the player would get stuck on "Preload" and not show artwork.
- Fixed issue where the displayed artwork wouldn't match the default UI art viewer.
- Network access is disabled in ffmpeg, maybe this will alleviate some hung threads or stuck artwork panels, though I couldn't reproduce this and I don't think it should be necessary. Feedback welcome. If 'stop playback when not visible' was causing problems, maybe try once more with this release.
- The OSC script will be loaded only if the file <mpv profile>/scripts/osc.lua doesn't exist. This allows you to customise the OSC while still using the preferences for it in foobar, such as enabling/disabling it per-UI-element.

- Syntax for script-messages has changed slightly, you will need to update input.conf. You can use the helpers for adding input commands in the preferences page, or reset input.conf to the default in the preferences to see some examples. You can map foobar menu or context menu commands (for the playing track) from input.conf allowing you to map any action from the player window.

- For more advanced scripting purposes, it is possible to register a titleformatting script by sending the script-message "foobar register-titleformat <script>". This title format will then be published whenever it changes for the currently displayed track via the script-message
"foobar titleformat <result>"

These two things can be used in lua scripts, eg. customising the OSC, to get information for display about the now playing track. As an example I have included a custom version of the OSC in the source tree that has a 'loved' heart button, that turns red when the current track has %loved%=1, and can be clicked to change the loved status by invoking a context menu command to run a Masstagger script, which updates the tag. To use it you would copy it to <foobar profile>/mpv/scripts/osc.lua

Please report any issues!
Title: Re: foo_mpv - Video Player component based on mpv
Post by: dwmartin0906 on 2020-10-13 05:44:07
I've been checking out your newest version and everything seems to be working great.  I was pleased to see you added options for everything I had in osc.conf and that the cursor is now hiding.  You've obviously put a great deal of effort into this.  Thank you very much.
Title: Re: foo_mpv - Video Player component based on mpv
Post by: q269800598 on 2020-10-13 06:22:53
That's great. the latest version has added new features. Thank you very much for your dedication.
Title: Re: foo_mpv - Video Player component based on mpv
Post by: arch21 on 2020-10-13 07:37:04
something wrong when changing "Separate from main window" or "Always on-top" option with latest beta, I don't know how to explain but should be noticeable
my existing configuration files displayed in one line
 
Title: Re: foo_mpv - Video Player component based on mpv
Post by: sammoth on 2020-10-13 10:03:34
something wrong when changing "Separate from main window" or "Always on-top" option with latest beta, I don't know how to explain but should be noticeable
my existing configuration files displayed in one line

Hmm I don't notice anything different with the separate/always on top options, what's it doing that's strange?

And yes sorry, because I use the basic old edit box in the preferences it only recognises Windows-style line endings. You can fix manually once or if you have Notepad++ you can fix it here

(https://i.imgur.com/YXrweWO.png)
Title: Re: foo_mpv - Video Player component based on mpv
Post by: arch21 on 2020-10-13 10:13:11
https://drive.google.com/uc?id=18ry5A8Ny4f3aggBZkJjGdk4G372eAaBH
sometimes freeze
Title: Re: foo_mpv - Video Player component based on mpv
Post by: sammoth on 2020-10-13 10:40:25
OK thanks, I can reproduce it, I will fix it today
Title: Re: foo_mpv - Video Player component based on mpv
Post by: sammoth on 2020-10-13 13:30:41
I'm not sure if I fixed it entirely, but please try the update
Title: Re: foo_mpv - Video Player component based on mpv
Post by: Sergey77 on 2020-10-13 14:32:51
New release (https://github.com/sammoth/foo_mpv)
Awesome evolution of the component!
I will test it with interest!
@sammoth,
thanks for your hard work.
Title: Re: foo_mpv - Video Player component based on mpv
Post by: arch21 on 2020-10-13 15:15:38
I'm not sure if I fixed it entirely, but please try the update
thanks for quick fix, seems fine now.
Title: Re: foo_mpv - Video Player component based on mpv
Post by: arch21 on 2020-10-14 16:29:40
I just realized there is nothing displayed on popup window title.
Title: Re: foo_mpv - Video Player component based on mpv
Post by: keko311 on 2020-10-16 00:27:47
- Add option to control which files are played using a search query. By default, only files foobar identifies as having a video stream will be played. You could change the query or disable this if you are using some input component which does not provide $info(video_codec). This should improve the responsiveness of the artwork display as it will not try to load every file as a video before falling back to artwork.
I have a video with the av1 codec, foobar plays it correctly if I uncheck the option but the plugin does not generate the thumbnail.
Thanks for your work !
Title: Re: foo_mpv - Video Player component based on mpv
Post by: arch21 on 2020-10-16 14:43:46
I see stats.lua can be activated on latest 0.6.4 beta by set keybinding manually on input.conf
for example
Code: [Select]
i script-binding stats/display-stats
I script-binding stats/display-stats-toggle
only popup window and fullscreen mode can accept keyboard input
Title: Re: foo_mpv - Video Player component based on mpv
Post by: sammoth on 2020-10-16 18:08:16
I have a video with the av1 codec, foobar plays it correctly if I uncheck the option but the plugin does not generate the thumbnail.
Thanks for your work !

Hi, you don't have to disable the option completely if you don't want. You can change it to include more files in the search query. For example include all files with an avi extension too:

Code: [Select]
"$info(video_codec)" PRESENT OR "$ext(%filename_ext%)" IS avi

or play files that you have manually tagged with an IS_VIDEO tag

Code: [Select]
"$info(video_codec)" PRESENT OR "%IS_VIDEO%" PRESENT

The thumbnail issue I can reproduce, it looks like ffmpeg doesn't find the right decoder.

I just realized there is nothing displayed on popup window title.

Noted, I broke it at some point.
Title: Re: foo_mpv - Video Player component based on mpv
Post by: sammoth on 2020-10-17 13:20:24
v0.6.5

Fixed: popup title.
Not fixed: AV1 thumbnails won't work yet. The technical reason is that the ffmpeg bulid I am using doesn't support AV1 yet (vcpkg) and I don't want to change to build it myself at the moment.

This release has experimental and bad support for non-local files.
- Live streams will still not synchronise properly, fixing this is still not simple.
- You can enable it for foo_youtube items or any non-local item in Advanced Preferences->Playback->mpv. You can use the option 'Ignore filter query' so that it will try to play every non-local file, ignoring the "Only play files matching" option.
- You must place youtube-dl.exe into <foobar profile>/mpv. I don't think there is any way to tell mpv where to look for youtube-dl so I don't think I can point it at a global youtube-dl install. You could try symlinking it to another place maybe. I expect it works if youtube-dl is in your %PATH%
- You don't really get any visual feedback yet about what mpv is doing when loading youtube-dl, and nothing much in the Console, so it might be confusing why it isn't working. You should be able to tell from mpv.log afterwards.
- At least for me, it doesn't work in Linux/Wine. The libmpv thread loading youtube-dl just freezes and the player will stop working and need to be killed. It also doesn't work in standalone mpv so might not be easily fixable. If it does work for you please let me know!
- It will still use the same aggressive logic to synchronise audio/video, with no clever handling of slow network conditions. This works very well on Youtube for example, with fast enough internet, but if the video won't download fast enough you could get messed up playback as the component constantly tries to fix video sync but the network can't catch up. By default it will start loading the video 4 seconds after the current playback time to give some time for the file to start downloading. You can change this in advanced preferences.
- If you have foo_youtube video player also visible, or foo_youtube is somehow set to download the video, you will be downloading the video stream twice. For some sites, where the website only streams audio+video together, you might always be downloading the audio and video twice, which is pretty bad, it's just a limitation of the simple way this is implemented.
Title: Re: foo_mpv - Video Player component based on mpv
Post by: Sergey77 on 2020-10-17 18:29:54
v0.6.5
@sammoth,
Thanks for your responsiveness to users and trying to implement streaming video playback.
Playing YouTube clips works pretty well.
Currently, the highest quality YouTube video is selected for playback by default. This has a limitation on slow computers.
It might be sufficient to add a youtube-dl configuration window, similar to the mpv.conf and input.conf windows. In which the user can set the video resolution and codec.
HLS streams in my playlist are played but not synchronized.
Title: Re: foo_mpv - Video Player component based on mpv
Post by: sammoth on 2020-10-17 18:38:53
mpv is handling launching youtube-dl, so its options for quality should work, see here (https://mpv.io/manual/master/#options-ytdl-format) and here (https://github.com/ytdl-org/youtube-dl/blob/master/README.md#format-selection) (yes it's kind of complicated). Note that you probably want to use strings that just match video streams.

For example for playing 720p only put in mpv.conf

Code: [Select]
ytdl-format="bestvideo[height=720]"
Title: Re: foo_mpv - Video Player component based on mpv
Post by: Sergey77 on 2020-10-17 19:12:13
mpv is handling launching youtube-dl, so its options for quality should work, see here (https://mpv.io/manual/master/#options-ytdl-format) and here (https://github.com/ytdl-org/youtube-dl/blob/master/README.md#format-selection) (yes it's kind of complicated). Note that you probably want to use strings that just match video streams.

For example for playing 720p only put in mpv.conf

Code: [Select]
ytdl-format="bestvideo[height=720]"
Thanks, this tip helped.
Is it possible to set only a specific codec to play YouTube videos, for example, only H264?
since my computer does not play vp9 video codec properly.
Title: Re: foo_mpv - Video Player component based on mpv
Post by: sammoth on 2020-10-17 19:30:23
Maybe try
Code: [Select]
bestvideo[height<=720][vcodec*=avc]
Title: Re: foo_mpv - Video Player component based on mpv
Post by: Sergey77 on 2020-10-17 19:45:16
Maybe try
Code: [Select]
bestvideo[height<=720][vcodec*=avc]
Yes, that's what I need. Thanks!
Title: Re: foo_mpv - Video Player component based on mpv
Post by: dwmartin0906 on 2020-10-19 12:49:45
Hi.  Would it be feasible to have MPV automatically pop up when a video is played?  I suspect this would take more effort than it is worth, but decided to ask anyway just in case you thought it might be worthwhile.  Thank you again for this great component.
Title: Re: foo_mpv - Video Player component based on mpv
Post by: sammoth on 2020-10-19 13:00:23
Seems possible. Pop up automatically when there is video to play and disappear when there isn't? It would make most sense to have a menu entry to toggle it as I guess you would only want it on sometimes.
Title: Re: foo_mpv - Video Player component based on mpv
Post by: dwmartin0906 on 2020-10-19 17:27:39
What you described is exactly how the youtube video player works and the only feature I miss since switching over to MPV.  It would be a nice to have if you can find the time and hopefully something others would find useful.
Title: Re: foo_mpv - Video Player component based on mpv
Post by: caeza on 2020-10-21 15:09:38
I can't play videos in wmv format, I get audio but the video doesn't play ... please help ... thank you very much for this fantastic plugin
Title: Re: foo_mpv - Video Player component based on mpv
Post by: sammoth on 2020-10-21 15:17:08
I can't play videos in wmv format, I get audio but the video doesn't play ... please help ... thank you very much for this fantastic plugin

Does it play if you disable the preference 'Only play files matching pattern'?

If not could you enable mpv's log (Advanced Preferences->Playback->mpv->Enable mpv log file), then restart foobar and try playing the file again. Then close foobar (which should make sure the log is saved) and message me the log file which should be in <foobar profile folder>/mpv/mpv.log
Title: Re: foo_mpv - Video Player component based on mpv
Post by: caeza on 2020-10-21 15:49:07
I can't play videos in wmv format, I get audio but the video doesn't play ... please help ... thank you very much for this fantastic plugin

Does it play if you disable the preference 'Only play files matching pattern'?

If not could you enable mpv's log (Advanced Preferences->Playback->mpv->Enable mpv log file), then restart foobar and try playing the file again. Then close foobar (which should make sure the log is saved) and message me the log file which should be in <foobar profile folder>/mpv/mpv.log

I solved the problem by applying your suggestion ... thank you very much
Title: Re: foo_mpv - Video Player component based on mpv
Post by: sammoth on 2020-10-21 15:50:13
OK, it's probably better to re-enable "only play files matching pattern" but change the pattern to include wmv files, like:

Code: [Select]
"$info(video_codec)" PRESENT OR "$ext(%filename_ext%)" IS wmv
Title: Re: foo_mpv - Video Player component based on mpv
Post by: arch21 on 2020-10-21 16:37:33
yes, wmv won't open by default, I wonder why. Enabling verbose console logging, I got "mpv: Not loading path file://<file_path>". Where this video codec value come from?

I just tested again, I guess based from v1.4.1 changelog
- Added %video_codec% info for Matroska and MP4 files.
for wmv, I had to disable internal wma decoder, use ffmpeg decoder instead, reload info from file(s), then I get video codec, video available.
 


Title: Re: foo_mpv - Video Player component based on mpv
Post by: sammoth on 2020-10-21 16:46:25
I guess it's provided to foobar by whichever decoder/input component is responsible for opening the file on its side. Maybe some input components don't implement it.
Title: Re: foo_mpv - Video Player component based on mpv
Post by: arch21 on 2020-10-21 16:50:32
yes, just edit my comment above about my found. thanks
btw I will use your solution instead
Title: Re: foo_mpv - Video Player component based on mpv
Post by: SergPuh.68 on 2021-02-24 14:19:05
Hello.I can't understand why the mpv Video component doesn't work on my D: drive?(no image,no covers)On disk C: everything works fine on external media!What could be the reason?
Title: Re: foo_mpv - Video Player component based on mpv
Post by: caeza on 2021-02-26 05:58:59
Hello everyone, I would like to know how I do to hide the edges of the window and that only the video remains in the window mode ... thank you very much
Title: Re: foo_mpv - Video Player component based on mpv
Post by: Adil on 2021-04-12 03:00:40
Hi there.

What means that:

Code: [Select]
mpv: libav error for open input: Invalid argument

How can I fixe it? Thanks in advance.
Title: Re: foo_mpv - Video Player component based on mpv
Post by: SergPuh.68 on 2021-05-10 09:39:03
Why is the video not loading?
Title: Re: foo_mpv - Video Player component based on mpv
Post by: annalise on 2021-05-21 09:21:44
Hi there.

What means that:

Code: [Select]
mpv: libav error for open input: Invalid argument

How can I fixe it? Thanks in advance.

I'm also getting this error spam in console, it seems to occur whenever a track is selected in any playlist view. What's strange is that I removed the panel from my config, but it's still spamming.
Title: Re: foo_mpv - Video Player component based on mpv
Post by: Adil on 2021-05-21 14:52:05
Unfortunately, it seems that this topic is somewhat abandoned ... I hope it is for a certain time, I really like this component.
SimplePortal 1.0.0 RC1 © 2008-2021