-
Notifications
You must be signed in to change notification settings - Fork 0
/
copy.go
25 lines (20 loc) · 950 Bytes
/
copy.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package ffmpeg
type CopyTranscoder struct {
transcoder *Transcoder
}
func NewCopyTranscoder() *CopyTranscoder {
return &CopyTranscoder{NewTranscoder()}
}
func (ct *CopyTranscoder) Transcode(input TranscoderInput, output TranscoderOutput) (TranscodeJob, error) {
return ct.transcoder.Transcode(input, output)
}
func Copy(input TranscoderInput, output TranscoderOutput) (TranscodeJob, error) {
transcoder := NewCopyTranscoder()
output.output().options = append(output.output().options, CopyOutput())
return transcoder.Transcode(input, output)
}
func UpdateMetadata(media TranscoderInput, metadata TranscoderInput, image TranscoderInput, output TranscoderOutput) (TranscodeJob, error) {
transcoder := NewTranscoder()
output.output().options = append(output.output().options, CopyOutput())
return transcoder.Transcode(media, metadata, image, MapOption(0), MapMetadataOption(1), MapOption(2), DispositionOption(2, "attached_pic"), output)
}