Changes of Revision 60
ffxvid.changes
Changed
x
1
2
-------------------------------------------------------------------
3
+Fri Oct 18 04:56:00 UTC 2019 - neutrino8@opensuse.org
4
+
5
+- Update to version 1.4.7
6
+ * Bugfix: use correct video track for crop preview with MPlayer
7
+ * Bugfix: missing ;; in the additional container formats code
8
+ * Renamed variable SCAN_MULTIPLE_VID_TRACKS to SCAN_MULTI_VID_TRACKS
9
+ * Some reordering in the config file
10
+ * Set Catmull-Rom as default Bicubic/Spline tuning
11
+ * Add LPCM detection for audio copy
12
+ * Support the mp4/m4v containers
13
+ * Add support for cover art for the mp4/m4v/mov containers.
14
+ Requires MP4Box from GPAC
15
+ * Some code optimization
16
+
17
+-------------------------------------------------------------------
18
Thu Oct 17 05:40:00 UTC 2019 - neutrino8@opensuse.org
19
20
- Update to version 1.4.6
21
ffxvid.spec
Changed
18
1
2
3
4
Name: ffxvid
5
-Version: 1.4.6
6
+Version: 1.4.7
7
Release: 0
8
Summary: A small shell script for encoding to H.264 with ffmpeg
9
License: GPL-2.0+
10
11
Requires: ffmpeg
12
Requires: bc
13
Requires: MPlayer
14
+Requires: gpac
15
BuildRoot: %{_tmppath}/%{name}-%{version}-build
16
BuildArch: noarch
17
18
ffxvid-1.4.6.tar.gz/ChangeLog -> ffxvid-1.4.7.tar.gz/ChangeLog
Changed
20
1
2
+2019-10-18 - ffxvid 1.4.7
3
+ * Bugfix: use correct video track for crop
4
+ preview with MPlayer
5
+ * Bugfix: missing ;; in the additional container
6
+ formats code
7
+ * Renamed variable SCAN_MULTIPLE_VID_TRACKS to
8
+ SCAN_MULTI_VID_TRACKS
9
+ * Some reordering in the config file
10
+ * Set Catmull-Rom as default Bicubic/Spline tuning
11
+ * Add LPCM detection for audio copy
12
+ * Support the mp4/m4v containers
13
+ * Add support for cover art for the mp4/m4v/mov
14
+ containers. Requires MP4Box from GPAC
15
+ * Some code optimization
16
+
17
2019-10-17 - ffxvid 1.4.6
18
* Support the WMV container format
19
20
ffxvid-1.4.6.tar.gz/ffxvid -> ffxvid-1.4.7.tar.gz/ffxvid
Changed
298
1
2
#
3
# Small script to encode to Xvid video using FFmpeg.
4
# Author: Grozdan "microchip" Nikolov <neutrino8@opensuse.org>
5
-# Version: 1.4.6
6
-# Date: 2019-10-17
7
+# Version: 1.4.7
8
+# Date: 2019-10-18
9
#
10
# ffx264 is free software ; you can redistribute it and/or modify
11
# it under the terms of the GNU General Public License as published by
12
13
brown() { echo -e "\e[0;33m$1\e[0;39;49m"; }
14
error() { echo -e "\e[1;31m$1\e[0;39;49m"; }
15
16
-version="1.4.6"
17
+version="1.4.7"
18
19
CFG="$HOME/.ffxvid"
20
-cfgversion="10"
21
+cfgversion="11"
22
23
genconfig_func() {
24
cat<<EOF>>"$CFG"
25
26
27
# Container format extension
28
# Leave empty to ask each time
29
+# Supported are:
30
+# avi/mkv/mp4/m4v/mov/wmv
31
CONFMT=""
32
33
# Scan for multiple video tracks?
34
-SCAN_MULTIPLE_VID_TRACKS="y"
35
+SCAN_MULTI_VID_TRACKS="y"
36
37
# Nice value (0-19)
38
NICE="19"
39
40
#
41
SCALER=""
42
43
-# Support FPS conversion?
44
-VID_FPS_CONVERT="y"
45
-
46
# Video filters
47
VID_DENOISE="y"
48
VID_DEBLOCK="y"
49
50
VID_HDR_TO_SDR="y"
51
VID_PIXEL_FORMAT="y"
52
VID_COLORSPACE="y"
53
+VID_FPS_CONVERT="y"
54
55
# Audio filters
56
AUD_NORMALIZE="y"
57
58
FFMPEG=""
59
FFPROBE=""
60
MPLAYER=""
61
+MP4BOX=""
62
63
# Add a custom comment to your encodes
64
# Leave empty to disable/ask each time
65
66
fi
67
fi
68
69
+if [ ! -z "$MP4BOX" ]; then
70
+ if [ ! -x "$MP4BOX" ]; then
71
+ error "-> MP4Box is missing from your system!"
72
+ error "-> Check the config in '$CFG'"
73
+ echo
74
+ exit 1
75
+ fi
76
+else
77
+ MP4BOX="$(which MP4Box 2>/dev/null)"
78
+ if [ ! -x "$MP4BOX" ]; then
79
+ error "-> MP4Box is missing from your system!"
80
+ echo
81
+ exit 1
82
+ fi
83
+fi
84
+
85
BC="$(which bc 2>/dev/null)"
86
if [ ! -x "$BC" ]; then
87
error "-> Utility 'bc' is missing from your system!"
88
89
CONFMT="$(echo "$CONFMT" | tr '[:upper:]' '[:lower:]')"
90
if [ ! -z "$CONFMT" ]; then
91
case "$CONFMT" in
92
- mov) movflags="-movflags +faststart" ;;
93
+ mp4|m4v|mov) movflags="-movflags +faststart" ;;
94
avi|mkv|wmv) true ;;
95
*)
96
error "-> Xvid video not supported by the chosen container!"
97
98
input="$(readlink -e "$input")"
99
fi
100
101
-if [ "$SCAN_MULTIPLE_VID_TRACKS" = "y" ]; then
102
+if [ "$SCAN_MULTI_VID_TRACKS" = "y" ]; then
103
printf "Scan for Multiple Video Tracks? [y/N]: "
104
read mvt
105
if [ "$mvt" = "y" -o "$mvt" = "Y" ]; then
106
107
fi
108
109
if [ -z "$CONFMT" ]; then
110
- printf "Which Container Format to use? [avi/mkv/mov/wmv - default is avi]: "
111
+ printf "Which Container Format to Use? [avi/mkv/mp4/m4v/mov/wmv - default is avi]: "
112
read confmt
113
test -z "$confmt" && CONFMT="avi" || CONFMT="$confmt"
114
fi
115
116
if [ ! -z "$remuxcon" ]; then
117
container_func() {
118
case "$1" in
119
- avi|mov|wmv)
120
+ avi|mp4|m4v|mov|wmv)
121
green "-> Note: additional container $i supports the following audio codecs:"
122
;;
123
esac
124
case "$1" in
125
+ mp4) green "-> ac3|eac3|dts|aac|fdk-aac|mp3|vorbis|flac|copy" ;;
126
+ m4v) green "-> ac3|aac|fdk-aac|alac|copy" ;;
127
mov) green "-> ac3|eac3|dts|aac|fdk-aac|mp3|vorbis|alac|copy" ;;
128
avi) green "-> ac3|dts|aac|fdk-aac|mp3|vorbis|wmav1|wmav2|pcm|flac|copy" ;;
129
- wmv) green "-> ac3|eac3|dts|aac|fdk-aac|mp3|vorbis|wmav1|wmav2|flac|copy"
130
+ wmv) green "-> ac3|eac3|dts|aac|fdk-aac|mp3|vorbis|wmav1|wmav2|flac|copy" ;;
131
other)
132
error "-> Xvid video not supported by the $i container!"
133
- error "-> Supported containers are: avi, mov, mkv, wmv"
134
+ error "-> Supported containers are: avi, mp4, m4v, mov, mkv, wmv"
135
echo
136
exit 1
137
;;
138
139
mkv)
140
green "-> Note: additional container $i supports all the audio codecs"
141
;;
142
+ mp4) container_func mp4 ;;
143
+ m4v) container_func m4v ;;
144
mov) container_func mov ;;
145
avi) container_func avi ;;
146
wmv) container_func wmv ;;
147
148
test ! -z "$comment" && COMMENT="$comment"
149
fi
150
151
-if [ "$CONFMT" = "mkv" ]; then
152
+case "$CONFMT" in
153
+ mkv|mp4|m4v|mov)
154
printf "Specify a Cover Image in JPG/PNG format [press 'Enter' to skip]: "
155
read -e cover
156
if [ ! -z "$cover" ]; then
157
158
exit 1
159
;;
160
esac
161
- METACOVER="-attach \"$(readlink -e "$cover")\" -metadata:s:t mimetype=\"image/$img\""
162
+ case "$CONFMT" in
163
+ mkv) METACOVER="-attach \"$(readlink -e "$cover")\" -metadata:s:t mimetype=\"image/$img\"" ;;
164
+ *) MP4COVER="-itags cover=\"$(readlink -e "$cover")\"" ;;
165
+ esac
166
+ if [ ! -z "$remuxcon" ]; then
167
+ for i in $remuxcon; do
168
+ case "$i" in
169
+ mp4|m4v|mov) MP4COVER2="-itags cover=\"$(readlink -e "$cover")\"" ;;
170
+ esac
171
+ done
172
+ fi
173
fi
174
fi
175
-fi
176
+ ;;
177
+esac
178
179
case "$encmode" in
180
[1-2]p)
181
182
read vbtr
183
test -z "$vbtr" && vbitrate="8000k" || vbitrate="${vbtr}k"
184
;;
185
- *|"")
186
+ ""|cq)
187
if [ -z "$CQ" ]; then
188
printf "Specify a CQ Value for the Encoding [0-31 - default is 2]: "
189
read cq
190
191
else
192
startpos="$timepos"
193
fi
194
- $MPLAYER "$input" -vf rectangle=$crop_preview -noconfig all -nocache -ao null -ss $startpos -endpos 10 >/dev/null 2>&1
195
+ $MPLAYER "$input" -vid $vidtrack -vf rectangle=$crop_preview -noconfig all -nocache -ao null -ss $startpos -endpos 10 >/dev/null 2>&1
196
fi
197
fi
198
printf "Are you Satisfied with the Crop Area? [y/N]: "
199
200
echo " 3 -> Cubic B-Spline (1.00, 0.00)"
201
echo " 4 -> Custom"
202
echo
203
- printf "Specify the Scaler Tuning option [default is 0]: "
204
+ printf "Specify the Scaler Tuning Option [default is 1]: "
205
read swstune
206
case "$swstune" in
207
- 0|"") swsparam0=":param0=0.00"; swsparam1=":param1=0.60" ;;
208
- 1) swsparam0=":param0=0.00"; swsparam1=":param1=0.50" ;;
209
+ 0) swsparam0=":param0=0.00"; swsparam1=":param1=0.60" ;;
210
+ 1|"") swsparam0=":param0=0.00"; swsparam1=":param1=0.50" ;;
211
2) swsparam0=":param0=0.33"; swsparam1=":param1=0.33" ;;
212
3) swsparam0=":param0=1.00"; swsparam1=":param1=0.00" ;;
213
4)
214
215
# all the audio codecs supported by the script
216
for c in $CONFMT $remuxcon; do
217
case "$c" in
218
+ mp4)
219
+ case "${acodec[i]}" in
220
+ pcm|libopus|opus|truehd|alac|wmav1|wmav2) conerror_func ;;
221
+ esac
222
+ ;;
223
+ m4v)
224
+ case "${acodec[i]}" in
225
+ eac3|dts|vorbis|flac|pcm|libopus|opus|truehd|wmav1|wmav2) conerror_func ;;
226
+ esac
227
+ ;;
228
mov)
229
case "${acodec[i]}" in
230
pcm|libopus|opus|wmav1|wmav2|truehd|flac) conerror_func ;;
231
232
test "${aindex[i]}" = "-1" && aindex[i]="0"
233
234
GETAUDCDC[i]="$($FFPROBE -i "$input" -v quiet -select_streams a:${aindex[i]} -show_streams -of default=noprint_wrappers=1 | grep '^codec_name' | awk -F= '{print $2}')"
235
- GETAUDBTR[i]="$($FFPROBE -i "$input" -v quiet -select_streams a:${aindex[i]} -show_streams -of default=noprint_wrappers=1 | grep '^bit_rate' | awk -F= '{print $2}')"
236
- GETAUDSR[i]="$($FFPROBE -i "$input" -v quiet -select_streams a:${aindex[i]} -show_streams -of default=noprint_wrappers=1 | grep '^sample_rate' | awk -F= '{print $2}')"
237
- GETAUDCL[i]="$($FFPROBE -i "$input" -v quiet -select_streams a:${aindex[i]} -show_streams -of default=noprint_wrappers=1 | grep '^channel_layout' | awk -F= '{print $2}')"
238
239
if [ ! -z "${GETAUDCDC[i]}" ]; then
240
+ GETAUDBTR[i]="$($FFPROBE -i "$input" -v quiet -select_streams a:${aindex[i]} -show_streams -of default=noprint_wrappers=1 | grep '^bit_rate' | awk -F= '{print $2}')"
241
+ GETAUDSR[i]="$($FFPROBE -i "$input" -v quiet -select_streams a:${aindex[i]} -show_streams -of default=noprint_wrappers=1 | grep '^sample_rate' | awk -F= '{print $2}')"
242
+ GETAUDCL[i]="$($FFPROBE -i "$input" -v quiet -select_streams a:${aindex[i]} -show_streams -of default=noprint_wrappers=1 | grep '^channel_layout' | awk -F= '{print $2}')"
243
+
244
get_audio_profile_func() {
245
GETAUDPROF[i]="$($FFPROBE -i "$input" -v quiet -select_streams a:${aindex[i]} -show_streams -of default=noprint_wrappers=1 | grep '^profile' | awk -F= '{print $2}')"
246
}
247
+
248
case "${GETAUDCDC[i]}" in
249
ac3) GETAUDCDC[i]="AC-3" ;;
250
eac3) GETAUDCDC[i]="E-AC-3" ;;
251
252
wmav2) GETAUDCDC[i]="WMAv2" ;;
253
opus) GETAUDCDC[i]="Opus" ;;
254
pcm*) GETAUDCDC[i]="PCM" ;;
255
+ lpcm*) GETAUDCDC[i]="LPCM" ;;
256
flac) GETAUDCDC[i]="FLAC" ;;
257
alac) GETAUDCDC[i]="ALAC" ;;
258
*) GETAUDCDC[i]="$(echo "${GETAUDCDC[i]}" | tr '[a-z]' '[A-Z]')" ;;
259
260
fi
261
encoder_func $encmode >> "$OUTFILE"
262
echo "" >> "$OUTFILE"
263
+case "$CONFMT" in
264
+ mp4|m4v|mov)
265
+ if [ ! -z "$MP4COVER" ]; then
266
+ case "$CONFMT" in
267
+ mp4|m4v) hint="-hint" ;;
268
+ esac
269
+ echo "$MP4BOX -add \"$OUTPUT\" $MP4COVER -mpeg4 $hint -new \"${OUTPUT%.*}_tmp$$.$CONFMT\" >/dev/null 2>&1" >> "$OUTFILE"
270
+ echo "rm -f \"$OUTPUT\"" >> "$OUTFILE"
271
+ echo "mv -f \"${OUTPUT%.*}_tmp$$.$CONFMT\" \"$OUTPUT\"" >> "$OUTFILE"
272
+ fi
273
+ ;;
274
+esac
275
if [ ! -z "$remuxcon" ]; then
276
for i in $remuxcon; do
277
echo "" >> "$OUTFILE"
278
279
*) echo "$FFMPEG -i \"$OUTPUT\" -map 0 -c copy $strict \"${OUTPUT%.*}.$i\" >/dev/null 2>&1" >> "$OUTFILE" ;;
280
esac
281
echo "test \"\$?\" = \"0\" && green \"-> Done\" || red \"-> Failed!\"" >> "$OUTFILE"
282
+ case "$i" in
283
+ mp4|m4v|mov)
284
+ if [ ! -z "$MP4COVER2" ]; then
285
+ case "$i" in
286
+ mp4|m4v) hint2="-hint" ;;
287
+ esac
288
+ echo "" >> "$OUTFILE"
289
+ echo "$MP4BOX -add \"${OUTPUT%.*}.$i\" $MP4COVER2 -mpeg4 $hint2 -new \"${OUTPUT%.*}.$i-tmp$$\" >/dev/null 2>&1" >> "$OUTFILE"
290
+ echo "rm -f \"${OUTPUT%.*}.$i\"" >> "$OUTFILE"
291
+ echo "mv -f \"${OUTPUT%.*}.$i-tmp$$\" \"${OUTPUT%.*}.$i\"" >> "$OUTFILE"
292
+ fi
293
+ ;;
294
+ esac
295
done
296
echo "echo" >> "$OUTFILE"
297
fi
298
ffxvid-1.4.6.tar.gz/preset.txt -> ffxvid-1.4.7.tar.gz/preset.txt
Changed
7
1
2
# Constant quantizer
3
CQ="2"
4
5
-XVIDPARAMS="-flags +mv4+aic+cgop -bf 2 -mbd 2 -mpeg_quant 1 -variance_aq 1 -trellis 1"
6
+XVIDPARAMS="-flags +mv4+aic+cgop -me_quality 6 -bf 2 -mbd 2 -mpeg_quant 1 -variance_aq 1 -trellis 1"
7