How STLtoMP4 Works: Rendering and Encoding in Your Browser
Most online converters upload your file to a server, process it there and send a video back. STLtoMP4 works differently: every step runs on your own device, inside the browser tab. This page explains what happens between dropping a model on the page and downloading the finished MP4, why some choices were made, and what limits follow from them.
Step 1: reading the model file
An STL file is a list of triangles. It stores positions only; there is no colour, no material and no unit. OBJ files can add normals and texture coordinates, and 3MF files are zipped packages that may carry colours, several objects and a unit. The page reads the file with the browser's own file API, so the bytes stay in memory on your device. The model is then centred on its own middle and scaled so the whole shape fits a fixed-size working volume. Scaling here is only for display; it does not change your file.
Step 2: building the scene
The triangles become a mesh that the graphics card can draw through WebGL. The page adds a material, lights and, when shadows are on, a floor that only shows the shadow. The background can be a plain colour, a gradient, a photograph or a simple 3D room. Because the scene is real 3D, changing the camera elevation or the light direction produces correct shading rather than a pasted effect.
Step 3: framing the shot
The camera distance is calculated from the actual silhouette of the model, not from a generic bounding sphere. A flat, wide object is therefore brought closer than a tall, thin one, and the result is centred in the frame. In photo scenes the base of the model is placed on the visible table or floor of the picture, which keeps the object from looking as if it floats.
Step 4: capturing frames
For each frame the page moves either the model (turntable) or the camera (camera tour), renders the scene to a canvas, and hands the pixels to the encoder. The frame count is the frame rate multiplied by the duration, so a 6-second clip at 30 frames per second needs 180 frames. Frames are produced as fast as the device allows; the preview you watch is only a convenience and is not recorded.
Step 5: encoding to MP4
Modern browsers expose a hardware video encoder through the WebCodecs interface. The page feeds it frames and receives compressed H.264 video, which a small JavaScript muxer wraps into an MP4 container. If a browser lacks WebCodecs, the page falls back to a recorder that produces WebM, which many editors and social platforms also accept. You can choose a size limit; the bitrate is then reduced so the file stays below it.
Why your files stay private
Nothing in this pipeline needs a server. The model is never uploaded, and the video is created locally and offered as a download. Settings such as resolution and background are remembered in the browser's local storage so that they are there next time; they can be cleared from the browser's site data at any time. See the privacy policy for the complete list of what the site does store.
Limits that follow from local processing
- Memory. Very large meshes, in the range of several million triangles, can exhaust a phone's memory. Decimate the model first or close other tabs.
- Speed. A laptop with a hardware encoder finishes a short clip in seconds; a low-end phone can take noticeably longer and may need the screen to stay on.
- Resolution. Encoders have maximum frame sizes. 4K output works on many desktops but not on every phone.
- Browser support. Current versions of Chrome, Edge and Safari support the needed features; older browsers may fall back to WebM or fail.
How the camera distance is chosen
Many converters place the camera at a fixed distance, which leaves flat or wide models tiny. STLtoMP4 measures the model instead. It takes the model's real height and its largest radius around the vertical axis, places 28 sample points on the top and bottom rim of that cylinder, and projects them through the camera. A short search then finds the smallest distance at which the projected outline fits the frame at the chosen fill, about 80% of the width or height in plain scenes. Because the turntable spins the model around that axis, the outline never grows during rotation, so the framing stays stable for the whole video.
In scenes with a surface, such as the wood, marble or concrete studio scenes, the base of the model is anchored to the visible surface and the outline is checked against the frame edges as well, so the object appears to stand on the table instead of floating in the middle of the picture.
The safe-frame guarantee on export
Zoom, camera tours and vertical offsets can push part of a model out of the picture. During export the page therefore checks every frame: if any point of the outline crosses a margin of 3.5% of the frame, the camera is moved back slightly and the check repeats, up to twelve times, before the frame is rendered. This applies to video frames, GIF frames and all still views, so every exported file shows the whole object.
How the camera tour is built
The tour is a loop of seven camera positions, described by the camera angle around the model, the elevation and a zoom factor: a three-quarter hero view, a low angle from the right, a high angle over the back, a high rear-left view, a close detail from the left, a slightly low return view and the starting pose again. Each segment holds still for the first fifth of its time and then eases into the next position, so the clip looks calm and loops without a jump. Because the last position equals the first, the exported video can loop seamlessly. See Camera Angles for 3D Model Videos for the reasoning behind each angle.
Measured file-size data
If you want to see how format choices change file size, the site publishes its own measurements: 3D file format sizes and preview format sizes. They are discussed in STL vs 3MF vs OBJ vs PLY and MP4 vs GIF vs WebP.
Frequently asked questions
Does the converter change my original file?
No. The model is only read. Orientation, scale and position changes affect the video, not the source file.
Why is the first frame sometimes dark?
Shadows and environment lighting need one render pass to settle. The page waits for this before recording, but very slow devices may still show it in the preview.
Why does a video render slower than the preview?
Export uses higher resolution, softer shadows and sometimes blurred backgrounds, all of which cost more than the live preview.