diff -Nru ffcvt-1.5.05/debian/changelog ffcvt-1.6.1/debian/changelog --- ffcvt-1.5.05/debian/changelog 2020-11-11 22:07:47.000000000 +0000 +++ ffcvt-1.6.1/debian/changelog 2021-01-10 15:55:22.000000000 +0000 @@ -1,14 +1,14 @@ -ffcvt (1.5.05-1build2) hirsute; urgency=medium +ffcvt (1.6.1-1) unstable; urgency=medium - * No-change rebuild using new golang + * New upstream version 1.6.1 + * enable concatenating videos into one + * use shellescape protection to ffprobe command + * fix: - out-of-date-standards-version + - upstream-metadata-missing-bug-tracking + - package-uses-old-debhelper-compat-version + - unused-override statically-linked-binary - -- Steve Langasek Wed, 11 Nov 2020 22:07:47 +0000 - -ffcvt (1.5.05-1build1) groovy; urgency=medium - - * No-change rebuild using new golang - - -- Steve Langasek Tue, 22 Sep 2020 08:49:35 +0000 + -- Tong Sun Sun, 10 Jan 2021 15:55:22 +0000 ffcvt (1.5.05-1) unstable; urgency=medium diff -Nru ffcvt-1.5.05/debian/control ffcvt-1.6.1/debian/control --- ffcvt-1.5.05/debian/control 2020-09-22 08:49:35.000000000 +0000 +++ ffcvt-1.6.1/debian/control 2021-01-02 22:35:51.000000000 +0000 @@ -1,16 +1,15 @@ Source: ffcvt Section: utils Priority: optional -Maintainer: Ubuntu Developers -XSBC-Original-Maintainer: Debian Go Packaging Team +Maintainer: Debian Go Packaging Team Uploaders: Tong Sun -Build-Depends: debhelper-compat (= 12), +Build-Depends: debhelper-compat (= 13), ronn (>= 0.8.0-2~), dh-golang, golang-any, easygen Rules-Requires-Root: no -Standards-Version: 4.4.1 +Standards-Version: 4.5.1 Homepage: https://github.com/suntong/ffcvt Vcs-Browser: https://salsa.debian.org/go-team/packages/ffcvt Vcs-Git: https://salsa.debian.org/go-team/packages/ffcvt.git diff -Nru ffcvt-1.5.05/debian/ffcvt.lintian-overrides ffcvt-1.6.1/debian/ffcvt.lintian-overrides --- ffcvt-1.5.05/debian/ffcvt.lintian-overrides 2020-01-01 18:38:55.000000000 +0000 +++ ffcvt-1.6.1/debian/ffcvt.lintian-overrides 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -# All go language packages are statically linked, see #947630 -statically-linked-binary diff -Nru ffcvt-1.5.05/debian/upstream/metadata ffcvt-1.6.1/debian/upstream/metadata --- ffcvt-1.5.05/debian/upstream/metadata 2020-01-01 18:38:55.000000000 +0000 +++ ffcvt-1.6.1/debian/upstream/metadata 2021-01-02 22:36:56.000000000 +0000 @@ -1,3 +1,5 @@ Security-Contact: Debian Go Packaging Team Repository-Browse: https://salsa.debian.org/go-team/packages/ffcvt +Bug-Database: https://salsa.debian.org/go-team/packages/ffcvt/issues +Bug-Submit: https://salsa.debian.org/go-team/packages/ffcvt/issues/new Repository: https://salsa.debian.org/go-team/packages/ffcvt.git diff -Nru ffcvt-1.5.05/ffcvt.go ffcvt-1.6.1/ffcvt.go --- ffcvt-1.5.05/ffcvt.go 2020-01-01 22:37:59.000000000 +0000 +++ ffcvt-1.6.1/ffcvt.go 2021-01-09 16:05:46.000000000 +0000 @@ -263,12 +263,12 @@ } } - args := encodeParametersS(encodeParametersA(encodeParametersV( - []string{"-i", inputName}))) + args := []string{"-i", inputName} + args = append(args, strings.Fields(Opts.OptExtra)...) + args = encodeParametersS(encodeParametersA(encodeParametersV(args))) if Opts.Force { args = append(args, "-y") } - args = append(args, strings.Fields(Opts.OptExtra)...) args = append(args, flag.Args()...) args = append(args, outputName) debug(Opts.FFMpeg+" "+strings.Join(args, " "), 1) @@ -301,12 +301,12 @@ stat, err := file.Stat() file.Close() checkError(err) - //fmt.Println("File size is ", stat.Size()) - if stat.Size() == 0 { + // fmt.Printf("Size of file '%s' is %d\n", outputName, stat.Size()) + if stat.Size() <= 500 { err := os.Remove(outputName) checkError(err) } - debug("Zero-sized output file '"+outputName+"' removed.", 1) + debug("Failed output file '"+outputName+"' removed.", 1) } else { originalSize := fileSize(inputName) @@ -345,8 +345,9 @@ func probeFile(inputName string) (string, error) { out := &bytes.Buffer{} - cmd := exec.Command("sh", "-c", Opts.FFProbe+" "+inputName+ - " 2>&1 | grep 'Stream #'") + cmdFFProbe := Opts.FFProbe + " " + Quote(inputName) + " 2>&1 | grep 'Stream #'" + debug("Probing with "+cmdFFProbe, 2) + cmd := exec.Command("sh", "-c", cmdFFProbe) cmd.Stdout = out cmd.Stderr = out err := cmd.Run() diff -Nru ffcvt-1.5.05/README.e.md ffcvt-1.6.1/README.e.md --- ffcvt-1.5.05/README.e.md 2020-01-01 22:37:59.000000000 +0000 +++ ffcvt-1.6.1/README.e.md 2021-01-09 16:05:46.000000000 +0000 @@ -34,13 +34,13 @@ The detailed guide to choose/provide proper parameters to `ffcvt` have been moved to [wiki](https://github.com/suntong/ffcvt/wiki/). For example, -- [HEVC vs VP9](https://github.com/suntong/ffcvt/wiki/WebM-(VP9)-Encoding#hevc-vs-vp9) -- [Preset Method Comparison](https://github.com/suntong/ffcvt/wiki/HEVC-(x265)-Encoding#preset-method-comparison) -- [The CRF Comparison](https://github.com/suntong/ffcvt/wiki/HEVC-(x265)-Encoding#the-crf-comparison) -- [Example 1: YouTube Encoding](https://github.com/suntong/ffcvt/wiki/Example-1:-YouTube-Encoding) -- [Example 2: Talk Encoding](https://github.com/suntong/ffcvt/wiki/Example-2:-Talk-Encoding) +- [HEVC vs VP9](https://github.com/suntong/ffcvt/wiki/KB:-WebM-(VP9)-Encoding#hevc-vs-vp9) +- [HEVC Preset Method Comparison](https://github.com/suntong/ffcvt/wiki/KB:-HEVC-(x265)-Encoding#preset-method-comparison) +- [The HEVC CRF Comparison](https://github.com/suntong/ffcvt/wiki/KB:-HEVC-(x265)-Encoding#the-crf-comparison) +- [Example 1: YouTube Encoding](https://github.com/suntong/ffcvt/wiki/Example:-YouTube-Encoding) +- [Example 2: Talk Encoding](https://github.com/suntong/ffcvt/wiki/Example:-Talk-Encoding) -Please check them out in the [wiki](https://github.com/suntong/ffcvt/wiki/). +Please check them out in the [wiki](https://github.com/suntong/ffcvt/wiki/), and for other documents like "Most used ffmpeg options", "How to crop a video", etc. ## Download/Install diff -Nru ffcvt-1.5.05/README.md ffcvt-1.6.1/README.md --- ffcvt-1.5.05/README.md 2020-01-01 22:37:59.000000000 +0000 +++ ffcvt-1.6.1/README.md 2021-01-09 16:05:46.000000000 +0000 @@ -44,10 +44,14 @@ Flags: -t target type: webm/x265-opus/x264-mp3/youtube (FFCVT_T) - -aes audio encoding method set (FFCVT_AES) -ves video encoding method set (FFCVT_VES) - -aea audio encoding method append (FFCVT_AEA) + -aes audio encoding method set (FFCVT_AES) + -ses subtitle encoding method set (FFCVT_SES) + -vep video encoding method prepend (FFCVT_VEP) + -aep audio encoding method prepend (FFCVT_AEP) + -sep subtitle encoding method prepend (FFCVT_SEP) -vea video encoding method append (FFCVT_VEA) + -aea audio encoding method append (FFCVT_AEA) -abr audio bitrate (64k for opus, 256k for mp3) (FFCVT_ABR) -crf the CRF value: 0-51. Higher CRF gives lower quality (28 for x265, ~ 23 for x264) (FFCVT_CRF) @@ -65,6 +69,7 @@ -an no audio, output video only (FFCVT_AN) -vn no video, output audio only (FFCVT_VN) -vss video: same size (FFCVT_VSS) + -lang language selection for audio stream extraction (FFCVT_LANG) -o more options that will pass to ffmpeg program (FFCVT_O) -ato-opus audio encode to opus, using -abr (FFCVT_ATO_OPUS) -vto-x265 video video encode to x265, using -crf (FFCVT_VTO_X265) @@ -76,6 +81,7 @@ -force overwrite any existing none-empty file (FFCVT_FORCE) -debug debugging level (FFCVT_DEBUG) -ffmpeg ffmpeg program executable name (FFCVT_FFMPEG) + -ffprobe ffprobe program execution (FFCVT_FFPROBE) -version print version then exit (FFCVT_VERSION) Details: @@ -86,6 +92,8 @@ copy audio codec -aea string audio encoding method append + -aep string + audio encoding method prepend -aes string audio encoding method set -an @@ -107,14 +115,22 @@ input file name (either -d or -f must be specified) -ffmpeg string ffmpeg program executable name (default "ffmpeg") + -ffprobe string + ffprobe program execution (default "ffprobe -print_format flat") -force overwrite any existing none-empty file + -lang string + language selection for audio stream extraction (default "eng") -n no exec, dry run -nc no clobber, do not queue those already been converted -o string more options that will pass to ffmpeg program -p par2create, create par2 files (in work directory) + -sep string + subtitle encoding method prepend + -ses string + subtitle encoding method set -suf string suffix to the output file names -sym @@ -125,6 +141,8 @@ copy video codec -vea string video encoding method append + -vep string + video encoding method prepend -version print version then exit -ves string @@ -150,13 +168,13 @@ The detailed guide to choose/provide proper parameters to `ffcvt` have been moved to [wiki](https://github.com/suntong/ffcvt/wiki/). For example, -- [HEVC vs VP9](https://github.com/suntong/ffcvt/wiki/WebM-(VP9)-Encoding#hevc-vs-vp9) -- [Preset Method Comparison](https://github.com/suntong/ffcvt/wiki/HEVC-(x265)-Encoding#preset-method-comparison) -- [The CRF Comparison](https://github.com/suntong/ffcvt/wiki/HEVC-(x265)-Encoding#the-crf-comparison) -- [Example 1: YouTube Encoding](https://github.com/suntong/ffcvt/wiki/Example-1:-YouTube-Encoding) -- [Example 2: Talk Encoding](https://github.com/suntong/ffcvt/wiki/Example-2:-Talk-Encoding) +- [HEVC vs VP9](https://github.com/suntong/ffcvt/wiki/KB:-WebM-(VP9)-Encoding#hevc-vs-vp9) +- [HEVC Preset Method Comparison](https://github.com/suntong/ffcvt/wiki/KB:-HEVC-(x265)-Encoding#preset-method-comparison) +- [The HEVC CRF Comparison](https://github.com/suntong/ffcvt/wiki/KB:-HEVC-(x265)-Encoding#the-crf-comparison) +- [Example 1: YouTube Encoding](https://github.com/suntong/ffcvt/wiki/Example:-YouTube-Encoding) +- [Example 2: Talk Encoding](https://github.com/suntong/ffcvt/wiki/Example:-Talk-Encoding) -Please check them out in the [wiki](https://github.com/suntong/ffcvt/wiki/). +Please check them out in the [wiki](https://github.com/suntong/ffcvt/wiki/), and for other documents like "Most used ffmpeg options", "How to crop a video", etc. ## Download/Install diff -Nru ffcvt-1.5.05/shellescape.go ffcvt-1.6.1/shellescape.go --- ffcvt-1.5.05/shellescape.go 1970-01-01 00:00:00.000000000 +0000 +++ ffcvt-1.6.1/shellescape.go 2021-01-09 16:05:46.000000000 +0000 @@ -0,0 +1,51 @@ +/* +shellescape provides the Quote to escape arbitrary +strings for a safe use as command line arguments in the most common +POSIX shells. +The Python package which this work was inspired by can be found +at https://pypi.python.org/pypi/shellescape. +*/ +package main + +/* +The functionality provided by Quote could be helpful +in those cases where it is known that the output of a Go program will +be appended to/used in the context of shell programs' command line arguments. +*/ + +import ( + "regexp" + "strings" +) + +var pattern *regexp.Regexp + +func init() { + pattern = regexp.MustCompile(`[^\w@%+=:,./-]`) +} + +// Quote returns a shell-escaped version of the string s. The returned value +// is a string that can safely be used as one token in a shell command line. +func Quote(s string) string { + if len(s) == 0 { + return "''" + } + + if pattern.MatchString(s) { + return "'" + strings.ReplaceAll(s, "'", "'\"'\"'") + "'" + } + + return s +} + +// QuoteCommand returns a shell-escaped version of the slice of strings. +// The returned value is a string that can safely be used as shell command arguments. +func QuoteCommand(args []string) string { + l := make([]string, len(args)) + + for i, s := range args { + l[i] = Quote(s) + } + + return strings.Join(l, " ") +} diff -Nru ffcvt-1.5.05/.travis.yml ffcvt-1.6.1/.travis.yml --- ffcvt-1.5.05/.travis.yml 2020-01-01 22:37:59.000000000 +0000 +++ ffcvt-1.6.1/.travis.yml 2021-01-09 16:05:46.000000000 +0000 @@ -1,6 +1,9 @@ # -*- yaml -*- language: go +arch: + - amd64 + - ppc64le env: global: