Skip to content

Commit 66fcd2f

Browse files
committed
accurate progress for preview mode
1 parent 57e3ff0 commit 66fcd2f

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

‎convert.go‎

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,13 @@ func Convert(infile string, outfile string, codec string) {
6969
// convertWithProgress uses the ffmpeg `-progress` option with a unix-domain socket to report progress
7070
func convertWithProgress(inFileName string, outFileName string, ffmpegArgs ffmpeg.KwArgs) {
7171
a, err := ffmpeg.Probe(inFileName)
72-
if err != nil {
73-
panic(err)
74-
}
75-
totalDuration, err := probeDuration(a)
76-
if err != nil {
77-
panic(err)
72+
CheckError(err)
73+
74+
// get duration of video (3 seconds if preview mode)
75+
totalDuration := 3.00
76+
if !Preview {
77+
totalDuration, err = probeDuration(a)
78+
CheckError(err)
7879
}
7980

8081
Cmd = ffmpeg.Input(inFileName).

‎readme.md‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,3 @@ webvids --update
5757

5858
- check that ffmpeg / required codecs are installed
5959
- allow selection of preset for faster / slower encoding
60-
- accurate progress for preview mode

0 commit comments

Comments
 (0)
⌂ 换网址