Skip to content

Commit

Permalink
server/segment_rpc: save perceptual sig to OS
Browse files Browse the repository at this point in the history
  • Loading branch information
jailuthra committed Aug 30, 2021
1 parent 56cffcd commit 973e60b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions server/segment_rpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,16 @@ func (h *lphttp) ServeSegment(w http.ResponseWriter, r *http.Request) {
Url: uri,
Pixels: res.TranscodeData.Segments[i].Pixels,
}
// Save perceptual signature if generated
if res.TranscodeData.Segments[i].PHash != nil {
pHashFile := name + ".sig"
pHashUri, err := res.OS.SaveData(pHashFile, res.TranscodeData.Segments[i].PHash, nil, 0)
if err != nil {
glog.Error("Could not upload segment signature for ", segData.Seq)
break
}
d.PerceptualHashUrl = pHashUri
}
segments = append(segments, d)
}

Expand Down

0 comments on commit 973e60b

Please sign in to comment.