Datamoshing

—「0X://Explanation」
less of a process and more of a tutorial. should give anyone full tools to datamosh. here's some tests/projets i've done with datamoshing: 1975 music video test, stock footage test, and the middle of this edit

back a page

Pt. 1: Basics

i'm gunna start by just trying to explain the gist of what even happens when datamoshing, well at least this specific type, because knowing what actually happens will give you better intuition to pick good clips and understand how they work together. at its core, datamoshing is a process of manipulating the data of (usually) video files to achieve certain visual/auditory effects when decoded. this reason this is possible is because of how video compression works. ever wonder why two videos with the same length can be vastly different sizes? it's because each frame of video isn't actually being saved, but most frames are saved as the difference from the last frame. this is what we are going to be targeting.

the frames that save every pixel of a picture are called i-frames (intra-coded), these are able to be displaeyd on their own, and without reliance from other information, since its literally a whole picture. the other type of frames are p-frames (predictive) and b-frames (bi-predictive). these do not store full pictures, but instead describe the differences between this frame and the last one, meaning that they cant be dispayed properly without the original full picture.

this is where datamoshing comes in. assuming you've seen an example or watched any of my work with them (though i always give them a ton of post processing effects so its less stark sorry), you'll see that it appears as if the previous image is being stretched and fancily mapped onto the current video (when done right). this is because all that datamoshing is is [wow english is cool] the deletion of i-frames, causing the p-frames and b-frames to utilize the wrong reference, creating the mosh effect.

Pt. 2: The Rest

to achieve this specific effect, we will use Avidemux, specifically version 2.5.6, because newer version will likely view what we are trying to do as an error. well launch the software and then [open] the video you want to mosh.

next, avidemux might show some "errors" just click [no] to all of them

again, [no]

now we need to copy the video under a new codec, so select [mpeg-4 asp (xvid)]

next we need to make sure our video will playback when we are done. change [maximum i-frame interval:] to [99999999]. this will ensure the video can be played back, even if there is only one i-frame every 99999999 frames (you know since we are deleting basically all the i-frames)

next just [save] the video, no need to add a .mp4 extension as avidemux will be able to open the file regardless

now just wait for it to do its thing...

now i'm hoping i can trust you to re[open] the video and say [no] to the errors without pictures. after opening the video, select [copy] instead of [mpeg-4 asp (xvid)] since we dont need to change it this time.

now its i-frames time. some controls you need to know (after clicking down on the bottom bar)
[up arrow] - advance one i-frame
[down arrow] - retreat one i-frame
[right arrow] - advance one frame
[left arrow] - retreat one frame
using those controls, locate the first i-frame (should be the start of the video). we must keep the first i-frame or there would be no starting point, so advance one i-frame [up arrow]. now here click the [A] button (on the bottom bar, not your keyboard), to start a selection at this frame.

now advance one frame [right arrow] and hit the [B] button (again, on the bottom bar), to wrap the selection on the other side.

now just click the delete key [del] and that i-frame has been removed. you can advance and retreat to see it won't find that frame any more. just repeat this steps for as many i-frames as you want (except the first one) and your video will be moshed in no time. now just hit [save]

make sure to include the .mp4 extension this time

select [no] to anything avidemux asks, specifically making a smart copy

and that's it, open your video file (some programs might not be able to open it now) and view your beautiful creation. if you wanna post it or smth, i'd recommend running it through a video editing program and exporting it as a healthy, no longer damaged, file.

a last little note, you want clips with slow(ish) movement and relatively related darkness/brightness, if it's too fast, the moshing will have already returned to the original image (as lots of p-frames and b-frames were apparently present) and if the brigthness is too widly different between clips, there will be soooooo many p-frames and b-frames that its basically an i-frame at that point and you won't be able to see any moshing. also if you're trying to sync this up with music, it can get really frusturating as the amount of time lost doesn't feel conistent to me (like it doesn't seem like just the amount of frames i took out??) but maybe you'll have better luck that i did~
hope you learned something and are now able to make something cool!


back a page

┈ ren ​♡