Skip to content

Commit 5f2225c

Browse files
author
feos
committed
support pixel_type="RGB24" for multi-segment
1 parent dac9935 commit 5f2225c

2 files changed

Lines changed: 9 additions & 5 deletions

File tree

encode.avs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@ SetFilterMTMode("DEFAULT_MT_MODE", MT_MULTI_INSTANCE)
55
AddAutoloadDir("MAINSCRIPTDIR/programs/plugins")
66
Import(ScriptDir() + "programs/functions.avsi")
77

8-
AviSource("movie.avi")
8+
# "RGB24" for FFV1, "AUTO" for the rest
9+
pixelType = "RGB24"
10+
11+
AviSource("movie.avi", pixel_type=pixelType)
912

1013
# Dolphin (with FFMPEG). Use FFV1 patch for dumping:
1114
# https://github.com/vadosnaprimer/dolphin/releases
@@ -201,7 +204,7 @@ resized = hq && !hd \
201204
: Lanczos4Resize(width, height)
202205

203206
# If ms enabled, we use parameters of "resized" to apply to all segments
204-
resized = ms ? resized.AppendSegment(ms_base, ms_start, ms_end, ms_format, resizer).ConvertToRGB32() : resized
207+
resized = ms ? resized.AppendSegment(ms_base, ms_start, ms_end, ms_format, resizer, pixelType).ConvertToRGB32() : resized
205208

206209
# Logo
207210
logoVideo = ImageSource(file=file, start=0, end=int((resized.FrameRate * 2) - 1), fps=resized.FrameRate) \

programs/functions.avsi

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@ function AppendSegment(
55
\ int first_val,
66
\ int last_val,
77
\ string format,
8-
\ string resizer
8+
\ string resizer,
9+
\ string pix_type
910
\){
1011
filename = base + string(first_val, format) + ".avi"
11-
result = AviSource(filename).Eval(resizer + """Resize(sample.width, sample.height)""")
12+
result = AviSource(filename, pixel_type=pix_type).Eval(resizer + """Resize(sample.width, sample.height)""")
1213
return (first_val < last_val) \
13-
? result + sample.AppendSegment(base, first_val+1, last_val, format, resizer) \
14+
? result + sample.AppendSegment(base, first_val+1, last_val, format, resizer, pix_type) \
1415
: result
1516
}
1617

0 commit comments

Comments
 (0)