Datahäxan
A developer transforms a classic 1922 silent film into a modern art piece by directly manipulating its H.264 data stream. Dissatisfied with the original's entertainment value, the author systematically introduced glitches, color, and melting effects through hex-level edits. This project is a fascinating blend of digital archeology, low-level video encoding, and artistic expression, appealing to HN's appreciation for creative technical solutions.
The Lowdown
The author, akkartik, embarked on a unique project to "glitch" the 1922 silent film Häxan after finding the original difficult to watch. The goal was to introduce modern, psychedelic visual effects by directly manipulating the film's digital representation, specifically its H.264 video data stream, and to add color to the black-and-white footage. This endeavor involved a series of experimental attempts, ultimately leading to a successful method.
- Initial Concept: Inspired by the film's title, the author decided to manipulate the "hexadecimal representation" of the video's binary data stream.
- First Attempt (NULLing Frames): The initial strategy involved NULLing out every 10th frame of the H.264 data. Due to H.264's inter-frame encoding, this resulted in smears, glitches, and image dragging, but no color.
- Second Attempt (YUV Overlay): This involved transcoding to raw YUV420p, adding colorful noise and sine waves, then recompressing. While colorful, it was visually repetitive and created massive file sizes (650MB to 7GB), making further glitching attempts ineffective due to high entropy stabilizing playback.
- Final Successful Method (I-frame Twiddling): The author refined the approach by focusing on H.264 I-frames. Instead of NULLing, they randomly twiddled the least-significant bits, with a bias towards mutations in the chroma data section at the end of the frame. This technique successfully introduced flashes of color and a distinctive "melting" effect on text.
- Watchability: Only 1 out of every 4 frames were modulated to maintain some level of watchability, particularly in VLC.
The author provides instructions for others to replicate the process using ffmpeg and a Python script, noting that each run produces subtly different results due to the random number generator. The project is presented as an enjoyable, psychedelics-optional alternative viewing experience.