View Full Version : 1080p video screensaver?
cafevincent
27th December 2009, 20:52
I want to create a screen saver that plays a random video. Videos like Baraka, Planet Earth, Chronos, Home, Stargaze, Life, Microcosmos etc would make an awesome screen saver in 1080p instead of the boring still photos I have to use. I'm amazed that Windows 7 doesn't have this feature already.
I have a script that creates a playlist of a folder tree and feeds it to MPC which then opens in full screen and plays it in random order. My first thought was to convert the .cmd into a .exe and then the .exe into a .scr but I'm having difficulty finding a method for the exe to scr part. My programming skills are limited to .cmd scripts.
I'm wondering about all the other ways of doing this. Perhaps there is a screen saver that can load a list or a location of videos or perhaps an .scr file can be created to work as a launcher to mplayerc.exe or the script. I'm sure there is plenty of scenarios I have not even thought about so I would like to hear your ideas.
LoRd_MuldeR
27th December 2009, 23:47
1. You cannot "convert" a batch file (.cmd or .bat) into an executable file. The former is a script file that runs inside an interpreter. The latter contains machine code that can execute natively.
2. You cannot "convert" an executable file (.exe) into a screensaver (.src), because screensavers are executables - just with a different extensions. So you can rename a ".exe" file to a ".src" file.
So what you will need to do is: Write a program that does what your ".cmd" file did (you can do this with C, C++, Pascal or whatever) and then compile it to an executable.
Then store the resulting binary as ".src" file and put it intothe Windows "System32" folder. That's all about it...
scharfis_brain
27th December 2009, 23:56
1. You cannot "convert" a batch file (.cmd or .bat) into an executable file. The former is a script file that runs inside an interpreter.
not entirely true.
Back in good old MS-DOS there was a batch-file compiler called TurboBAT. It turned Batch files into exe or com files.
XhmikosR
27th December 2009, 23:59
Or this (http://www.f2ko.de/English/b2e/index.php) one.
LoRd_MuldeR
28th December 2009, 00:08
not entirely true.
Back in good old MS-DOS there was a batch-file compiler called TurboBAT. It turned Batch files into exe or com files.
Sure. But what does the "batch-file compiler" do? It generates executable code that does the same what the original batch script did. You can call that "conversion", if you like ;)
However by using a fully-fledged programming language, such as C, C++ or Pascal, you will be much more flexible. There are so many things you just cannot do with a simple batch script.
If I wanted to make a screensaver, I'd write a simply GUI application that creates a fullscreen window and calls MPlayer in "slave" mode to render the video inside that window...
cafevincent
28th December 2009, 00:39
Sure. But what does the "batch-file compiler" do? It generates executable code that does the same what the original batch script did. You can call that "conversion", if you like ;)
However by using a fully-fledged programming language, such as C, C++ or Pascal, you will be able much more flexible. There are many things you just cannot do with a simple batch script.
If I wanted to make a screensaver, I'd write a simply GUI application that creates a fullscreen window and calls MPlayer in "slave" mode to render the video inside that window...
As I said my programming skills are limited to batch scripts. I sure wish you wanted to make a screensaver like that, I know it would be much better that way. I will try the exe conversion method tomorrow.
cafevincent
28th December 2009, 01:17
I couldn't sleep so I tried it. This is the script I converted to .exe using Bat to Exe Converter (thanks XhmikosR) and then renamed to .scr (thanks LoRd_MuldeR) and dropped to Windows/System32 folder.
echo reset list >%temp%\ss.m3u
dir/s/b d:\videos\visuals\*.m2ts >>%temp%\ss.m3u
dir/s/b d:\videos\visuals\*.mkv >>%temp%\ss.m3u
dir/s/b d:\videos\visuals\*.mp4 >>%temp%\ss.m3u
if exist "c:\program files\mpc homecinema" cd /d "c:\program files\mpc homecinema"
if exist "c:\program files (x86)\mpc homecinema" cd /d "c:\program files (x86)\mpc homecinema"
start /high mpc-hc %temp%\ss.m3u /new /fullscreen
I'm glad to say it works great! I just wish I knew a command line swich for MPC-HC to use 0% volume or disabled audio. Anyone?
cafevincent
28th December 2009, 02:45
I realized I can use perl to change the Mute=0 value in mpc-hc.ini to disable audio but I found an other problem: The monitor never turns itself off if a video is playing. I couldn't find an option to change that in mpc-hc.ini...
LoRd_MuldeR
28th December 2009, 03:19
Why not use MPlayer?
MPlayer.exe -vo gl:yuv=2 -ao null -fs "C:\Path to Video\Clip.mkv
cafevincent
28th December 2009, 03:21
Why not use MPlayer?
MPlayer.exe -vo gl:yuv=2 -ao null -fs "C:\Path to Video\Clip.mkv
Does it support randomizing my playlist?
LoRd_MuldeR
28th December 2009, 03:27
Does it support randomizing my playlist?
MPlayer plays a single file at a time, the one you pass to it via command-line. Pick a random file in your "screensaver" script/application ;)
cafevincent
28th December 2009, 03:37
MPlayer plays a single file at a time, the one you pass to it via command-line. Pick a random file in your "screensaver" script/application ;)
So I would need to pick a random file from my list of files. I'm sorry but that is beyond my skill level. And I doubt that MPlayer will be able to use DXVA for decoding. MPC does that with flying colors. The randomizing in MPC does suck (not very random) so I'm open to another player.
LoRd_MuldeR
28th December 2009, 03:52
So I would need to pick a random file from my list of files. I'm sorry but that is beyond my skill level.
That's one single line of C code :p
char *filename = list[rand() % count];
And I doubt that MPlayer will be able to use DXVA for decoding.
No, it doesn't. But it should handle 1080p video just fine on a decent CPU ;)
Reimar
28th December 2009, 14:13
MPlayer plays a single file at a time, the one you pass to it via command-line. Pick a random file in your "screensaver" script/application ;)
Uh, no.
mplayer -shuffle file1 file2 file3
will play all files in random order.
mplayer -loop 0 -shuffle file1 file2 file3
will keep playing them forever, playing _all_ of them in random order and then starting from scratch playing again in (a different) random order.
Be careful of where you put the options, options after the file name only apply to that file, options before all the file names apply to all files.
cafevincent
28th December 2009, 15:33
The lack of DXVA in Mplayer is a deal breaker for me because I only have a Athlon 4850e.
LoRd_MuldeR
28th December 2009, 17:47
Uh, no.
mplayer -shuffle file1 file2 file3
will play all files in random order.
mplayer -loop 0 -shuffle file1 file2 file3
will keep playing them forever, playing _all_ of them in random order and then starting from scratch playing again in (a different) random order.
Haha, never used that feature, as I always do file selection in the GUI front-end. But thanks for the info :D
Midzuki
29th December 2009, 11:46
2. You cannot "convert" an executable file (.exe) into a screensaver (.src), because screensavers are executables - just with a different extensions. So you can rename a ".exe" file to a ".src" file.
Not so simple. ;) The screensaver, when called without a "switch", shows its configuration dialog, and when executed with the switch "/s", runs in full-screen mode. By default, the system registry instructs Windows to "configure" the .SCR files via "%1", and to "open" them via "%1 /s".
cafevincent wrote:
This is the script I converted to .exe using Bat to Exe Converter (thanks XhmikosR) and then renamed to .scr (thanks LoRd_MuldeR) and dropped to Windows/System32 folder.
There is no need to place the .SCRs in the system folder.
Screensavers should always be invoked manually ---
--- to proceed otherwise is resource-consuming. :D
LoRd_MuldeR
29th December 2009, 14:03
Not so simple. ;) The screensaver, when called without a "switch", shows its configuration dialog, and when executed with the switch "/s", runs in full-screen mode. By default, the system registry instructs Windows to "configure" the .SCR files via "%1", and to "open" them via "%1 /s".
If he creates the "screensaver" with a batch script (using that "Bat to Exe Converter"), he won't be able to display a configuration dialog anyway. I don't think he intends his screensaver to be configurable at this point. So the most simple&stupid solution is to ignore the command-line params and just launch the video player. That will "work" at least...
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.