It is currently March 29th, 2024, 7:30 am

Feature Suggestion

Report bugs with the Rainmeter application and suggest features.
User avatar
pashaak
Posts: 7
Joined: October 25th, 2019, 3:11 am

Feature Suggestion

Post by pashaak »

One thing that is badly needed in Rainmeter is Video measures and meters. It would be really cool to incorporate live video, TV, Movies even just the ability to handle .mp4 and .avi files would be nice. Is anyone working on this???
~ "Things are only impossible until they are done"
User avatar
Jeff
Posts: 326
Joined: September 3rd, 2018, 11:18 am

Re: Feature Suggestion

Post by Jeff »

You can handle AVI files with MagickMeter
https://github.com/khanhas/MagickMeter/wiki/File

If you want something more advanced, you can fake a video window using ffplay, I'm 100% you can use something like Powershell (or make a plugin yourself) to parent the ffplay window to a Rainmeter hWnd window and it just moves with the window (if it doesn't work like that just get the skin window process and set the ffplay window position every update)
User avatar
Jeff
Posts: 326
Joined: September 3rd, 2018, 11:18 am

Re: Feature Suggestion

Post by Jeff »

Depends on the file size really, something like a 1920x1080 meter/window will probably be okay, more than okay actually, but if you go above 2000x2000 (at least the point where it starts lagging on my machine), good f-ing luck bottlenecking your CPU, GPU, RAM and Rainmeter's amazing D2D to GDI+ conversion (at least that's what I imagine will happen)
This is why you sould totally parent the ffplay window to the Rainmeter skin window process
User avatar
Yincognito
Rainmeter Sage
Posts: 7029
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Feature Suggestion

Post by Yincognito »

Jeff wrote: September 3rd, 2020, 2:20 pm Depends on the file size really, something like a 1920x1080 meter/window will probably be okay, more than okay actually, but if you go above 2000x2000 (at least the point where it starts lagging on my machine), good f-ing luck bottlenecking your CPU, GPU, RAM and Rainmeter's amazing D2D to GDI+ conversion (at least that's what I imagine will happen)
This is why you sould totally parent the ffplay window to the Rainmeter skin window process
I contributed to a plugin for the "old" Sony Vegas doing automatic scene recognition using the ffmpeg / ffplay approach several years ago. I guess that as long as you have an appropriate "canvas" to display what ffmpeg provides and a way of communicating or integrating between ffmpeg and the other software (Rainmeter, in this case), I don't see why it shouldn't work.

So far, one can easily open or play a video, assuming he has Python installed (I'm not sure it is required, but haven't tried using a simple batch file yet). This little code in Rainmeter:

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1

[MeasureRun]
Measure=Plugin
Plugin=RunCommand
Parameter=#@#play.py
OutputType=ANSI
State=Hide
StartInFolder=#@#
DynamicVariables=1

[MeterRun]
Meter=String
FontSize=11
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1
Text=Click to Play Video
LeftMouseUpAction=[!CommandMeasure MeasureRun "Run"]

[MeterResult]
Meter=String
MeasureName=MeasureRun
Y=10R
FontSize=14
FontColor=255,255,255,255
AntiAlias=1
along with this basic Python script:

Code: Select all

import subprocess as sub
dbFile = "file.mp4"
open_dbFile = "ffplay {0} -window_title {1} -left 50 -top 50 -nostats".format(dbFile, "DB_file")
sub.Popen(open_dbFile)
will open and play a "file.mp4" video file, assuming that this file is, along with the FFMPEG files (i.e. ffmpeg.exe, ffplay.exe and ffprobe.exe) and the "play.py" Python script file are in the @Resources folder of the skin.

Of course, integrating such things as "measures" and such into Rainmeter will need a bit more than the above, but I think it wouldn't be outrageously complicated to have a strictly basic open & play behavior. Maybe the "canvas" / "container" used in the case the Image meters could be used here as well.

Naturally, I could be wrong in what I said, but I have some doubts about it.

EDIT: No need for the Python script, a simple Parameter=ffplay "file.mp4" -window_title {1} -left 50 -top 50 -nostats in [MeasureRun] above is enough. Some text is displayed after exiting, but that's a minor issue, really.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
Yincognito
Rainmeter Sage
Posts: 7029
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Feature Suggestion

Post by Yincognito »

dvo wrote: September 11th, 2020, 5:06 pm how do you open a online file like youtube or a other online video?
Just like local files, as far as I'm aware of, they can't be (yet) integrated into a Rainmeter skin, as in showing the playing window in the skin itself, but you can use the browser for this:

Code: Select all

LeftMouseUpAction=["https://www.youtube.com/watch?v=7mp2GbxhPC4"]
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
Yincognito
Rainmeter Sage
Posts: 7029
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Feature Suggestion

Post by Yincognito »

dvo wrote: September 11th, 2020, 5:56 pm not like that but maybe with ffplay instead of a local file...
FFPlay still needs a file to be able to play (even if the file is not local, but at least extracted from the site), it won't work with plain links (although it can do live streaming, as far as I can tell).
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
Yincognito
Rainmeter Sage
Posts: 7029
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Feature Suggestion

Post by Yincognito »

Ha! I might just make a basic video player skin using ffmpeg, LOL. :sly:
Yes, in a Rainmeter skin - probably able to be controlled and showing info about the video file and all. ;-)

P.S. Can't guarantee its speed though, but it WILL work for sure. If it's just about the functionality and not the speed, no video measure would be needed in Rainmeter.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
Yincognito
Rainmeter Sage
Posts: 7029
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Feature Suggestion

Post by Yincognito »

dvo wrote: September 15th, 2020, 11:06 am uhm if it's working let me see :P
It's already working, otherwise I would have not said what I said. It's only that for now it's just the video part (no audio) and obviously it's still very very simple. In other words, it's functional, but not yet complete. Personally I would like to make it a collaborative effort, but I'm not sure other experienced folks are interested... :confused:
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
Yincognito
Rainmeter Sage
Posts: 7029
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Feature Suggestion

Post by Yincognito »

dvo wrote: September 15th, 2020, 11:06 am uhm if it's working let me see :P
There are two similar approaches on the matter, one from eclectic-tech and one from me posted in this thread, by the way. For now I recommend eclectic-tech's implementation, as it's more or less fully featured. Mine is a work in progress, and a bit more difficult to pursue due to its complete integration with Rainmeter, aka playing the video by Rainmeter itself through a Bitmap meter, instead of playing in a different window (e.g. ffplay.exe's one). In other words, even though mine is fully integrated, it requires doing more of the playing stuff through the skin code compared to eclectic-tech's one, where ffplay.exe handles entirely the playing process.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth