Video Player - Watch Rick Roll in Computer...
CrazedProgrammer 27 May 2015
Have you ever wanted to play a video in ComputerCraft?
Well now you can!
Video:
Downloads:
Video Player: pastebin get W69aKDBh player
VideoConverter
Rick Roll file
Move Your Feet file (high resolution, might be slow)
Buttons:
|| The video is paused, play the video.
|> The video is playing, pause the video.
L Load a video.
X Close the player.
When you click on the time bar at the bottom it skips.
It is recommended that you set the maximum disk space to at least 100 MB in the file %appdata%\.minecraft\config\ComputerCrafÂt.cfg:
I:computerSpaceLimit=100000000
To convert a video to the video player format, you first need to convert the video to
a bunch of JPGs or PNGs using something like the Video to JPG Converter by DVDVideoSoft.
When you've done that, launch the VideoConverter application.
Click on the "Select First Frame" button and select the first image.
Note that all images need to be in a separate directory, so you can't have 2 videos in one directory.
Enter the width, height and FPS in the text fields.
It's recommended that you don't make the video bigger than 50x50 pixels and that it isn't higher than 30 FPS.
The limit is 255 pixels wide and high, 255 FPS and 65536 frames.
At 30 FPS, the maximum length is 36.4 minutes.
When you're done setting the options, click on the "Convert" button and save the video to the folder of your ComputerCraft computer.
It will take a few seconds/minutes and then you're done.
Edited by CrazedProgrammer, 28 May 2015 - 05:53 PM.
Well now you can!
Video:
Downloads:
Video Player: pastebin get W69aKDBh player
VideoConverter
Rick Roll file
Move Your Feet file (high resolution, might be slow)
Buttons:
|| The video is paused, play the video.
|> The video is playing, pause the video.
L Load a video.
X Close the player.
When you click on the time bar at the bottom it skips.
It is recommended that you set the maximum disk space to at least 100 MB in the file %appdata%\.minecraft\config\ComputerCrafÂt.cfg:
I:computerSpaceLimit=100000000
To convert a video to the video player format, you first need to convert the video to
a bunch of JPGs or PNGs using something like the Video to JPG Converter by DVDVideoSoft.
When you've done that, launch the VideoConverter application.
Click on the "Select First Frame" button and select the first image.
Note that all images need to be in a separate directory, so you can't have 2 videos in one directory.
Enter the width, height and FPS in the text fields.
It's recommended that you don't make the video bigger than 50x50 pixels and that it isn't higher than 30 FPS.
The limit is 255 pixels wide and high, 255 FPS and 65536 frames.
At 30 FPS, the maximum length is 36.4 minutes.
When you're done setting the options, click on the "Convert" button and save the video to the folder of your ComputerCraft computer.
It will take a few seconds/minutes and then you're done.
Edited by CrazedProgrammer, 28 May 2015 - 05:53 PM.
flaghacker 27 May 2015
Looks nice, but I think you managed to mess up the "controls" section of your post .
And, as I already said somewhere else, awesome idea to "create" more colors!
And, as I already said somewhere else, awesome idea to "create" more colors!
CrazedProgrammer 27 May 2015
CrazedProgrammer 27 May 2015
flaghacker 27 May 2015
Cranium 28 May 2015
Very nice. I love the dithering on it as well, and the fact that it runs at a fairly high framerate. Do you get any lag while playing it on those monitors?
I can't help but wonder though if you'd be able to run the program from cached memory of the files hosted on a website. Such as reading the file data from GitHub or any other hosted site. Then users can play it that way, rather than having to alter their config files. I think it's worth a shot if you can make it.
I can't help but wonder though if you'd be able to run the program from cached memory of the files hosted on a website. Such as reading the file data from GitHub or any other hosted site. Then users can play it that way, rather than having to alter their config files. I think it's worth a shot if you can make it.
Bomb Bloke 28 May 2015
Cranium, on 28 May 2015 - 04:17 AM, said:
I can't help but wonder though if you'd be able to run the program from cached memory of the files hosted on a website.
Erm, that strikes me as a move in the wrong direction. The RR video is 10mb, for eg. Asking MineCraft servers to do those sort of downloads every time they do playback might be a bit much?
Beats me how many filesize reduction techniques are already in play here - I see filesizes have gone down since posting the initial "Move Your Feet" video, so something's definitely changed to improve matters - but I'd suggest dropping repeated frames, partial frame updates, and perhaps some RLE or something as well.
CrazedProgrammer 28 May 2015
CrazedProgrammer 28 May 2015
Cranium, on 28 May 2015 - 04:17 AM, said:
Very nice. I love the dithering on it as well, and the fact that it runs at a fairly high framerate. Do you get any lag while playing it on those monitors?
I can't help but wonder though if you'd be able to run the program from cached memory of the files hosted on a website. Such as reading the file data from GitHub or any other hosted site. Then users can play it that way, rather than having to alter their config files. I think it's worth a shot if you can make it.
I can't help but wonder though if you'd be able to run the program from cached memory of the files hosted on a website. Such as reading the file data from GitHub or any other hosted site. Then users can play it that way, rather than having to alter their config files. I think it's worth a shot if you can make it.
On those monitors (8x6 blocks 1x text scale) it stays around 20fps with the Rick Roll video.
I only got some miniscule frame drops.
It really depends on how big the video is and how many changes per frame occur.
For example, the Move Your Feet video is 4 times as big and that can lag a little.
The file handling is already slow in CC, I can't imagine that streaming from the web would be better.
I could make it download the entire video into RAM but depending on the internet connection it would also take a very long time.
CrazedProgrammer 28 May 2015
Bomb Bloke, on 28 May 2015 - 04:52 AM, said:
Cranium, on 28 May 2015 - 04:17 AM, said:
I can't help but wonder though if you'd be able to run the program from cached memory of the files hosted on a website.
Erm, that strikes me as a move in the wrong direction. The RR video is 10mb, for eg. Asking MineCraft servers to do those sort of downloads every time they do playback might be a bit much?
Beats me how many filesize reduction techniques are already in play here - I see filesizes have gone down since posting the initial "Move Your Feet" video, so something's definitely changed to improve matters - but I'd suggest dropping repeated frames, partial frame updates, and perhaps some RLE or something as well.
The way the file format works is this (in bytes):
abcddeefghfghfgh...
Header:
a - width
b - height
c - FPS
d - number of frames (+1)
Frame:
e - number of changes
Change:
f - X position
g - Y position
h - color
So it is pretty compressed the way it is.
Bomb Bloke 28 May 2015
CrazedProgrammer, on 28 May 2015 - 05:31 AM, said:
It is impossible to play real audio files with Computercraft.
Not so! A resource pack along with playsound can play most anything. Granted you can't pause/resume that (at least, not to my knowledge), but it wouldn't surprise me if one of the peripheral mods add further options.
Edit:
Actually, looks like you could do it with just the resource pack:
Spoiler
By dividing the sound clip into tons of eg ~3-5 second snippets, even resuming should be quite simple from there.
Edited by Bomb Bloke, 28 May 2015 - 09:38 AM.
CrazedProgrammer 28 May 2015
Bomb Bloke, on 28 May 2015 - 09:33 AM, said:
CrazedProgrammer, on 28 May 2015 - 05:31 AM, said:
It is impossible to play real audio files with Computercraft.
Not so! A resource pack along with playsound can play most anything. Granted you can't pause/resume that (at least, not to my knowledge), but it wouldn't surprise me if one of the peripheral mods add further options.
Edit:
Actually, looks like you could do it with just the resource pack:
Spoiler
By dividing the sound clip into tons of eg ~3-5 second snippets, even resuming should be quite simple from there.
biggest yikes 30 May 2015
Maybe we could have some sort of "ComputerCraft YouTube" where you could upload your .ccv files and view them?
Either way, excellent work
EDIT: It turns out that converting a video to CCV compacts it, the original video file I converted was 92.4 MB and now it's 3.91 MB, but I guess that's because it has to convert it to 16 colors.
Edited by Atenefyr, 30 May 2015 - 01:04 AM.
Either way, excellent work
EDIT: It turns out that converting a video to CCV compacts it, the original video file I converted was 92.4 MB and now it's 3.91 MB, but I guess that's because it has to convert it to 16 colors.
Edited by Atenefyr, 30 May 2015 - 01:04 AM.
CrazedProgrammer 30 May 2015
Atenefyr, on 30 May 2015 - 12:54 AM, said:
Maybe we could have some sort of "ComputerCraft YouTube" where you could upload your .ccv files and view them?
Either way, excellent work
EDIT: It turns out that converting a video to CCV compacts it, the original video file I converted was 92.4 MB and now it's 3.91 MB, but I guess that's because it has to convert it to 16 colors.
Either way, excellent work
EDIT: It turns out that converting a video to CCV compacts it, the original video file I converted was 92.4 MB and now it's 3.91 MB, but I guess that's because it has to convert it to 16 colors.
That would be possible, but I don't know if the http API is fast enough.
The reason why converting a video to CCV decreases file size is that there are less pixels (max 255x255, recommended 50x30) and that it only writes changes in the pixels.
Also, there are a total of 256 colors instead of 16777216, and there is no audio.
Edited by CrazedProgrammer, 30 May 2015 - 10:08 AM.
CrazedProgrammer 30 May 2015
biggest yikes 30 May 2015
CrazedProgrammer, on 30 May 2015 - 10:06 AM, said:
Atenefyr, on 30 May 2015 - 12:54 AM, said:
Maybe we could have some sort of "ComputerCraft YouTube" where you could upload your .ccv files and view them?
Either way, excellent work
EDIT: It turns out that converting a video to CCV compacts it, the original video file I converted was 92.4 MB and now it's 3.91 MB, but I guess that's because it has to convert it to 16 colors.
Either way, excellent work
EDIT: It turns out that converting a video to CCV compacts it, the original video file I converted was 92.4 MB and now it's 3.91 MB, but I guess that's because it has to convert it to 16 colors.
That would be possible, but I don't know if the http API is fast enough.
The reason why converting a video to CCV decreases file size is that there are less pixels (max 255x255, recommended 50x30) and that it only writes changes in the pixels.
Also, there are a total of 256 colors instead of 16777216, and there is no audio.