FOSDEM 2025
Ramiro Polla
SD card (file system) corruption
ePirat, 2018
Broken experimental encoder
"Is it possible to edit the motion vectors in a video file?"
with motion vectors
Bytes:
52 C1 D2 [...]
Bitstream:
01000100 10000100 11000001
01000100 10000100 11000001
get_bits1():
0 not_coded
01000100 10000100 11000001
get_vlc2():
1 cbpc
01000100 10000100 11000001
get_vlc2():
00010 cbpy
01000100 10000100 11000001
get_vlc2():
get_bits1():
get_bits(5):
01
0 MV delta x (3)
00010
01000100 10000100 11000001
get_vlc2():
get_bits1():
get_bits(5):
01
1 MV delta y (-1)
00000
01000100 10000100 11000001
Input:
01000100 10000100 11000001
01000100 10000100 11000001
get_bits1():
0 put_bits(0)
0
Output:
01000100 10000100 11000001
get_vlc2():
1 put_bits(1)
01
01000100 10000100 11000001
get_vlc2():
00010 put_bits(00010)
0100010
01000100 10000100 11000001
get_vlc2():
get_bits1():
get_bits(5):
01
0 put_bits(01000010)
00010
01000100 1000010
01000100 10000100 11000001
get_vlc2():
get_bits1():
get_bits(5):
01
1 put_bits(01100000)
00000
01000100 10000100 11000001
01000100 10000100 1100000
0put_bits(01000010)
00010 put_bits(1)
Input:
01000100 10000100 11000001
01000100 10000100 11000001
get_bits1():
0 put_bits(0)
0
Output:
01000100 10000100 11000001
get_vlc2():
1 put_bits(1)
01
01000100 10000100 11000001
get_vlc2():
00010 put_bits(00010)
0100010
0100010
01000100 10000100 11000001
get_vlc2():
get_bits1():
get_bits(5):
01
0
00010
01000101
01000100 10000100 11000001
get_vlc2():
get_bits1():
get_bits(5):
01
1 put_bits(01100000)
00000
01000100 10000100 11000001
01000101 01100000
0 put_bits(1)
export function glitch_frame(frame)
{
// get the forward motion vectors
const fwd_mvs = frame.mv?.forward;
if ( !fwd_mvs )
return;
// clear horizontal element of all motion vectors
for ( let i = 0; i < fwd_mvs.length; i++ )
{
// loop through all rows
const row = fwd_mvs[i];
for ( let j = 0; j < row.length; j++ )
{
// loop through all macroblocks
const mv = row[j];
mv[0] = 0; // this sets the horizontal motion vector to zero
}
}
}
mv_sink_and_rise.js
change filter type from "up" to "avg"
from pixels to bitstream
Kaspar Ravel and Thomas Collet
Thomas Collet
Sébastien Brias
Let's go for a 🍺 later today and talk about glitch art!