This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
CrazedProgrammer's profile picture

Video Player - Watch Rick Roll in ComputerCraft!

Started by CrazedProgrammer, 27 May 2015 - 06:53 PM
CrazedProgrammer #1
Posted 27 May 2015 - 08:53 PM
Have you ever wanted to play a video in ComputerCraft?
Well now you can!
Video:
[media]http://www.youtube.com/watch?v=i_OIWoDUOEI[/media]

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 on 28 May 2015 - 04:53 PM
Creator #2
Posted 27 May 2015 - 09:10 PM
This is actually amazing. You deserve a +1.
flaghacker #3
Posted 27 May 2015 - 09:34 PM
Looks nice, but I think you managed to mess up the "controls" section of your post :P/>.

And, as I already said somewhere else, awesome idea to "create" more colors!
CrazedProgrammer #4
Posted 27 May 2015 - 09:34 PM
This is actually amazing. You deserve a +1.
Thanks!
CrazedProgrammer #5
Posted 27 May 2015 - 09:45 PM
Looks nice, but I think you managed to mess up the "controls" section of your post :P/>.

And, as I already said somewhere else, awesome idea to "create" more colors!
Thanks!
I hope I fixed the "controls" section correctly.
flaghacker #6
Posted 27 May 2015 - 11:05 PM
Looks nice, but I think you managed to mess up the "controls" section of your post :P/>/>.

And, as I already said somewhere else, awesome idea to "create" more colors!
Thanks!
I hope I fixed the "controls" section correctly.

Aha, I see. I didn't understand what you meant at first. It clearer now…
Bomb Bloke #7
Posted 28 May 2015 - 02:47 AM
Did you record your video then add the sound later, or…?
nitrogenfingers #8
Posted 28 May 2015 - 03:10 AM
Wow that dithering…

Nice work man :)/>
Cranium #9
Posted 28 May 2015 - 05:17 AM
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.
Bomb Bloke #10
Posted 28 May 2015 - 05:52 AM
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 #11
Posted 28 May 2015 - 06:31 AM
Did you record your video then add the sound later, or…?
Yes.
It is impossible to play real audio files with Computercraft.

Wow that dithering…

Nice work man :)/>
Thanks!
CrazedProgrammer #12
Posted 28 May 2015 - 06:40 AM
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.
Thanks!
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 #13
Posted 28 May 2015 - 07:01 AM
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.
Only changes are written to the file.
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 #14
Posted 28 May 2015 - 10:33 AM
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:

Spoilerhttp://www.youtube.com/watch?v=Nt2PB0k_W8o

By dividing the sound clip into tons of eg ~3-5 second snippets, even resuming should be quite simple from there.
Edited on 28 May 2015 - 08:38 AM
CrazedProgrammer #15
Posted 28 May 2015 - 07:19 PM
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[media]http://www.youtube.com/watch?v=Nt2PB0k_W8o[/media]

By dividing the sound clip into tons of eg ~3-5 second snippets, even resuming should be quite simple from there.
Thanks for explaining!
biggest yikes #16
Posted 30 May 2015 - 01:54 AM
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 on 30 May 2015 - 12:04 AM
CrazedProgrammer #17
Posted 30 May 2015 - 11:06 AM
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.
Thanks!
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 on 30 May 2015 - 09:08 AM
Shefla #18
Posted 30 May 2015 - 01:18 PM
This is actually amazing.
Love how you made 256 colors out of 16.
CrazedProgrammer #19
Posted 30 May 2015 - 02:44 PM
This is actually amazing.
Love how you made 256 colors out of 16.
Thanks!
biggest yikes #20
Posted 30 May 2015 - 02:49 PM
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.
Thanks!
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.
I know about why it decreases file size, but what do you mean by 256 colors? I thought there were 16.
CrazedProgrammer #21
Posted 30 May 2015 - 03:12 PM
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.
Thanks!
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.
I know about why it decreases file size, but what do you mean by 256 colors? I thought there were 16.
There are 16 possible colors in ComputerCraft, but I use both text and background colors to create 16 * 16 = 256 colors.
Creator #22
Posted 30 May 2015 - 03:26 PM
Tecnically you have a combination of numberOfPrintableChars*16*16, which would be around 256*numberOfPrintableChars.
Pyuu #23
Posted 30 May 2015 - 04:38 PM
Simply, amazing.
There is just a ton of quality work being done in CC compared to it's earlier years.
Raising my expectations, now I'm getting excited about what I can see here.
biggest yikes #24
Posted 30 May 2015 - 07:00 PM
Tecnically you have a combination of numberOfPrintableChars*16*16, which would be around 256*numberOfPrintableChars.
AFAIK only the number sign is used
CrazedProgrammer #25
Posted 30 May 2015 - 09:21 PM
Simply, amazing.
There is just a ton of quality work being done in CC compared to it's earlier years.
Raising my expectations, now I'm getting excited about what I can see here.
Thanks!
You can raise your expectations because I'm working on a freaking 3D graphics API!
Creator #26
Posted 30 May 2015 - 09:52 PM
Simply, amazing.
There is just a ton of quality work being done in CC compared to it's earlier years.
Raising my expectations, now I'm getting excited about what I can see here.
Thanks!
You can raise your expectations because I'm working on a freaking 3D graphics API!

That is something exciting! I tried once, better not talk about it.
Selim #27
Posted 31 May 2015 - 12:03 AM
It is impossible to play real audio files with Computercraft.

You could also use Computronic's Tape Drives to play sound.
HPWebcamAble #28
Posted 31 May 2015 - 12:17 AM
I know about why it decreases file size, but what do you mean by 256 colors? I thought there were 16.

Each CC pixel can display 2 colors (The background and the text of the pixel)

So 16 * 16 = 256
biggest yikes #29
Posted 31 May 2015 - 02:36 PM
I know about why it decreases file size, but what do you mean by 256 colors? I thought there were 16.

Each CC pixel can display 2 colors (The background and the text of the pixel)

So 16 * 16 = 256


There are 16 possible colors in ComputerCraft, but I use both text and background colors to create 16 * 16 = 256 colors.
HPWebcamAble #30
Posted 31 May 2015 - 05:15 PM
Spoiler
I know about why it decreases file size, but what do you mean by 256 colors? I thought there were 16.

Each CC pixel can display 2 colors (The background and the text of the pixel)

So 16 * 16 = 256


There are 16 possible colors in ComputerCraft, but I use both text and background colors to create 16 * 16 = 256 colors.

Derp didn't look at page 2 :P/>
Edited on 31 May 2015 - 03:15 PM
Pyrif #31
Posted 05 June 2015 - 11:13 PM
I tried downloading the converter, but the Captcha wouldn't load…
;_;
EDIT: Never mind, it turned out to be my AdBlock Plus. :P/>
Edited on 06 June 2015 - 12:09 AM
Geforce Fan #32
Posted 08 June 2015 - 10:30 PM
This got blocked on copyright notice.
Damn.
Creator #33
Posted 08 June 2015 - 10:39 PM
This got blocked on copyright notice.
Damn.

What are you talking about? What got blocked?
Geforce Fan #34
Posted 08 June 2015 - 11:02 PM
This got blocked on copyright notice.
Damn.

What are you talking about? What got blocked?
The video
Creator #35
Posted 08 June 2015 - 11:03 PM
No, why, why does this have to happen, whyyyyyyyyyyyyy?
Bomb Bloke #36
Posted 09 June 2015 - 12:47 AM
Doesn't look blocked to me. Successful counter-claim?
Geforce Fan #37
Posted 09 June 2015 - 02:44 AM
Doesn't look blocked to me. Successful counter-claim?
It's blocked in the Missouri, USA.
It's some sort of region block.
CrazedProgrammer #38
Posted 09 June 2015 - 07:23 AM
Doesn't look blocked to me. Successful counter-claim?
It's blocked in the Missouri, USA.
It's some sort of region block.
Sorry for the inconvenience.
It is fair use but the fascist music labels always find a way.
I don't know if I can fix this.
Bomb Bloke #39
Posted 09 June 2015 - 08:01 AM
Ah, the so-called "land of the free". It'd be funny if it weren't so tragic.

Though yeah, you can try counter-claiming. Though, reading their documentation about "fair use", I must confess your case is shaky. You strike out on the first two of their "factors of fair use", but you might have something with the second two.

Y'know, watching the video again, I notice there's quite a bit of white-hashes-on-black-background, and vice-versa. Is that supposed to be… grey? If so, why isn't it just using one of CC's grey shades?
darkcammo #40
Posted 10 July 2015 - 03:54 PM
Great job on this, it looks great! I Must've been pretty tough to get it looking so good.

My friend is running a server with FTB Infinity and ComputerCraft. In order to upload the video files to my computer in game I would have to access the servers files wouldn't I?
CrazedProgrammer #41
Posted 10 July 2015 - 08:55 PM
Great job on this, it looks great! I Must've been pretty tough to get it looking so good.

My friend is running a server with FTB Infinity and ComputerCraft. In order to upload the video files to my computer in game I would have to access the servers files wouldn't I?
Thanks!
Yeah you'd need to transfer the video manually because it's encoded in a binary format and the http API doesn't support binary data.
biggest yikes #42
Posted 10 July 2015 - 09:08 PM
Yeah you'd need to transfer the video manually because it's encoded in a binary format and the http API doesn't support binary data.
you could try uploading it with Package or just plain old Base64
Edited on 10 July 2015 - 07:12 PM
Bomb Bloke #43
Posted 11 July 2015 - 12:11 AM
Package can certainly handle "binary data", but it goes through Pastebin, which has a 500kb upload limit on guest accounts. Video files for this player tend to be a lot larger than that, so you'd be better off uploading directly to the server if possible.
biggest yikes #44
Posted 11 July 2015 - 04:20 PM
Package can certainly handle "binary data", but it goes through Pastebin, which has a 500kb upload limit on guest accounts. Video files for this player tend to be a lot larger than that, so you'd be better off uploading directly to the server if possible.
wait, package.open uses Pastebin? how does that work?
just reread it >_>
Edited on 11 July 2015 - 02:24 PM
Luca_S #45
Posted 24 December 2015 - 10:45 PM
This video is not availabe in Germany, because it could contain music by SME, over which usage we were not able to agree with the GEMA.

:angry:/> :angry:/> :angry:/> :angry:/> :angry:/> :angry:/> :angry:/> :angry:/> :angry:/> :angry:/>

Not your fault ofc.
HPWebcamAble #46
Posted 26 December 2015 - 04:42 AM
It's blocked in the Missouri, USA.
It's some sort of region block.

This video is not availabe in Germany, because it could contain music by SME, over which usage we were not able to agree with the GEMA

VPN ;)/>

Side note; Not sure if suggesting the use of a VPN is against forum rules?
awyeh1234 #47
Posted 15 October 2016 - 03:41 AM
How do i get the ccv file into the player?
Bomb Bloke #48
Posted 15 October 2016 - 04:23 AM
Run the player and click the L button down in the lower right corner.