tags:

views:

26

answers:

3

I have video files, that I want to pad with a random number of extra bytes, in order to create a different md5 checksum. Is there a way to do that, and keep them playable?

+2  A: 

It depends on the video file format, but you should be able to just add the extra bytes to the end, and most video players should ignore them. Most video formats contain a lot of metadata about the video data (such as "the total video size is X bytes"), so they're robust against this sort of change.

One simple way to do this is to use the >> shell redirection operator to append data, e.g.:

# Add 32 random bytes to the end of the movie.avi
head -c 32 /dev/urandom >> movie.avi
Adam Rosenfield
A: 

Yegor,

It depends entirely on the video format. Look it up on wikipedia, some have a end of file flag byte sequence, simply adding bytes after it will achieve your effect, others will not work out so simply.

Andrew
A: 

Metadata would be a good thing to change. If the file has metadata about the time the film was made or the software used for encoding, changes to those values should not have any effect on the final result. You'd need to specify the format.

Paul Rubel