Roblox Video Player (Not Maintained)

the audio moderation system is broken to be honest. I lost 70 robux to moderation thinking audio was distorted

2 Likes

Alright so, I have a question

Are the bits pre-placed or are they being placed every frame? You could just do 80x60 bits pre-placed and color them to the closest color they’re at

Cap it at 30 fps and it should be good

2 Likes

Each pixel (ImgeLabel) is generated beforehand depending on the resolution. For the colour detection, I wrote a python program to encode each frame with each pixel position and RGB value into LUA syntax. The python program can also decrease the video’s resolution and FPS.

30FPS might be a problem. 80 X 60 X 3 X 30 X Seconds (Width X Height X RGB X FPS X Seconds) is a lot of lines. The only thing you can cut down is its width, height and FPS.

I’ve updated the place. It now uses the pixel method.

I’m still working on a way to split the data so that I can import it without crashing studio.

I’m planning to release all of this after it’s done.

2 Likes

What if you load the data to the client before the video loads, and then use that data? Like just a loading screen showing how much data is left of the video(s) which are playable

When it’s loaded you can play it with better performance, right?

2 Likes

The loading/playback isn’t what I’m worried about tho. It’s the uploading of video data into studio itself. Roblox Studio cannot handle a few million lines of code being pasted in at once. I’ll need to split the code in my python program, upload it in parts and merge it again in roblox studio.

2 Likes

Maybe take a look at this thread

2 Likes

I wanted to turn this into an actual game like a movie theater , but for obvious reasons I can’t(TOS and legal reasons and all)

I’d have to make my own movies or maybe I could use public domain movies, but I’m not entirely sure

5 Likes

Mhm, i was reading the comments earlier

You could also ask the directors for permission to use it, or you could try n like stream your own videos

2 Likes

Hey, i wonder if you can make the output of the display using NPC, lol

idk just for fun? like in this video

6 Likes

then why roblox moderate my anime girl instead the anime boy isn’t moderated :123:

3 Likes

I’m slowly getting there :eyes: https://gyazo.com/37fb4f7f3fdd50fb49688eac25726332

This uses a web server tho so it might be a little more difficult to setup.

1 Like

ayyyy niceeee

I don’t mind how hard is it to set up as long I learn new thing with this, then it going to be good

2 Likes

Update! I’ve managed to encode an entire video without uploading each frame/image into roblox itself.

Here’s an example:

It isn’t exactly synced, but there is an option to do so.

Keep in mind that this only works locally. This means that this project can only run in roblox studio, not the roblox player. Roblox has a HTTP get request limitation that I’ve not found a way around. Please inform me of any other way I can get past this. (Other than sending requests in chunks and enforcing a cooldown).

Anyways, onto the setup.

Things you need:

  1. Get the code and roblox place file from this GitHub repository. In it, you should find a folder named “Resources”.

  2. Any Integrated Development Environment (IDE). I use Visual Studio.

  3. Install the Flask python library

Setup:

  1. Open up the “Resources” folder with your IDE
    image

  2. Place the video (.mp4) you want to encode into the “Videos” folder
    image

  3. Create an empty text (.txt) file in the “PixelData” folder and name it whatever you want. I’d suggest naming it somthing similar or the same as the video title for convenience.
    image

  4. In the “PixelDataEncoder” python file (.py), you should find this line of code near the bottom.


    There are 3 commas separating the 4 information/arguments that you need to input into here.
    Arguments:
    i) Video file location, just change “BadApple” to whatever you named your video.

    ii) Resolution multiplier. Values less than 1 will decrease the resolution while values more than 1 will cause unnecessary lag. Stick to values 1 and below which is a positive number.

    iii) Frames Per Second. Pretty self explanatory. You can check your video’s frame per second by right clicking the .mp4 file in your file explorer, selecting “Properties” and going to the “Details” tab.


    iv) Colour. Put “True” if you’d like your video in colour and “False” if you’d like it to be a grey scale. File sizes with grey scale will be smaller (Remember this option).

  5. Find this line of code and change it to the location of the empty text file you’ve created.
    image

  6. If all inputs are properly inserted, run the code and this should pop up.
    image

    Ensure that “Encryption Completed” pops up before closing the console. Otherwise, the encoded data will not save.

    IMPORTANT NOTE: DO NOT OPEN THE TEXT FILE, YOU WILL FREEZE OR MAYBE EVEN CRASH YOUR IDE. You can try to, but that’s your call.

You have now encoded your video into pixels. We’ll work on the web server next.

  1. Open up the python file named “WebServer”.
    image

Find this line and change the file path to your encoded text file’s path. After changing, run the code and leave it running whenever you need to play a video. (Remember, this version only runs locally. This means that it’ll only work if the web server and roblox is using the same IP address)(I might be wrong)

The web server should be done. Finally, let’s set everything up in roblox studio.

  1. In the roblox place file (.rbxl), open up the data module script which is at “ServerScriptService” > “FilmHandlerPixels” > “PixelFilmData”.
    image

Find this section of code, change the configurations accordingly.


Things to note:
i) Remember what you put for “Title” as the code will use this to find the correct set of data.

ii) If you have disabled colour during the encoding process in python, you should disable it here too.

iii) If you have a sound id, “FPS” is not required and vice versa. Put SoundId as nil if you do not have a sound id. The FPS option didn’t work properly the last time I tested it, but who knows what will happen. Using a sound id is the preferred method.

iv) PlaybackSpeed will affect the playback speed of the entire video (audio and display).

v) A positive sound offset will drag the audio (play it later), while a negative sound offset will play the audio ahead (play it earlier). This is in seconds.

  1. Open up the “FilmHandlerPixels” script, scroll all the way down and find this line
    image
    image
    There are 2 arguments for you to configure here.
    Arguments:
    i) Film title. This is the same “Title” you’ve inserted into the module script.

    ii) Monitor name. This can be found in a folder named “Monitors” under workspace. Change the name if you wish.
    image

  2. Run roblox studio. Give it some time to get and decode the data. The output should look like this.

External Credits
Web Server Code by @WhosThatGuy_Guys

After all that, everything should be good to go! Feel free to let me know if anything is missing or if you have any questions.

I’ve tried using replit to host the code online and UptimeRobot to ping replit every few minutes to keep it running. But roblox’s request limit is still an issue sooooo

I’ve decided to move on from Roblox and Roblox development. It has been a fun few years and this platform has really shaped me into who I am today. I’ll definitely come back someday, just not anytime soon. I’ll still be active on the dev forums tho. Really, thank you all for being so supportive!

17 Likes

This is not going to be performant at all (trust me, I’ve made a roblox screenshare which runs at a whopping 128x72 2fps. Any higher resolution and your ping skyrockets to 200k)

Still cool though!

Though if it only works locally anyway you should probably use Pillow and pythoncv and import rbxtemp images, that would make this more performant and give it a higher resolution.

5 Likes

it CAN be performant if you make it binary, which is what i did and it can run fast enough
the biggest problem right now is updating pixels without lag
ping is also very stable
i also capped fps to 8 because of the request limit, but i thought of a solution (will add soon)

5 Likes

Updating pixels without lag was my problem too.
Though I do wonder - how’d you make it pure binary? From what I know Roblox requests only parse text

2 Likes

no thats a lie, it can return bytes too (they are all on a string)
get them with string.byte

2 Likes

it’s possible to run on client (gui) ? (using image methode)

3 Likes

and for convert video to png simply use shotcut

3 Likes

It should be possible, you just have to change the surface gui to a screen gui, and you’ll have to make some (or all) aspects local.

1 Like