This forum has been archived. All content is frozen. Please use KDE Discuss instead.

file_hash - how to calculate, to substitute clip

Tags: None
(comma "," separated)
Daniel06
Registered Member
Posts
1
Karma
0
Hi,

I'd like to know what kind of hash function should I use to calculate new 'file_hash' value. I need to substitute some source clips in my project (clip video, length unchanged, only sound repaired), I've just checked sha1sum (and other sha...) md5sum ...

How to calculate hash for a clip? - to substitute clip in my-project.kdenlive file.

Daniel
ttill
Registered Member
Posts
372
Karma
0
What happens if you just delete the hash value?
I think we should maybe add a option to turn of hashing, as this can also lead to some other problems.
hamoid
Registered Member
Posts
21
Karma
0
I was also interested in generating .kdenlive from Python, so I wanted to find out about the file_hash. I downloaded the source code and it looks like it's using the beginning and end of the file, not the whole file:

// ... DocClipBase::getFileHash ...

if (file.size() > 1000000*2) {
fileData = file.read(1000000);
if (file.seek(file.size() - 1000000))
fileData.append(file.readAll());
} else
fileData = file.readAll();

fileHash = QCryptographicHash::hash(fileData, QCryptographicHash::Md5);



Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Sogou [Bot]