Skip to content

Commit 0ac207a

Browse files
committed
Remove support for DgDecNv
Even though av1an does not distribute any binaries or libraries of DgDecNv, Donald A Graft, the author of DgDecNv, believes us to be in violation of the license and has told us to "fuck off". Therefore, this commit removes DgDecNv support.
1 parent de69c8e commit 0ac207a

File tree

7 files changed

+7
-62
lines changed

7 files changed

+7
-62
lines changed

README.md

-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ Prerequisites:
7171
Optional:
7272

7373
- [L-SMASH](https://github.com/AkarinVS/L-SMASH-Works) VapourSynth plugin for better chunking (recommended)
74-
- [DGDecNV](https://www.rationalqm.us/dgdecnv/dgdecnv.html) Vapoursynth plugin for very fast and accurate chunking, `dgindexnv` executable needs to be present in system path and an NVIDIA GPU with CUVID
7574
- [ffms2](https://github.com/FFMS/ffms2) VapourSynth plugin for better chunking
7675
- [bestsource](https://github.com/vapoursynth/bestsource) Vapoursynth plugin for slow but accurate chunking
7776
- [mkvmerge](https://mkvtoolnix.download/) to use mkvmerge instead of FFmpeg for file concatenation

av1an-core/src/context.rs

+2-5
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ impl Av1anContext {
147147
// generated when vspipe is first called), so it's not worth adding all the extra complexity.
148148
if (self.args.input.is_vapoursynth()
149149
|| (self.args.input.is_video()
150-
&& matches!(self.args.chunk_method, ChunkMethod::LSMASH | ChunkMethod::FFMS2 | ChunkMethod::DGDECNV | ChunkMethod::BESTSOURCE)))
150+
&& matches!(self.args.chunk_method, ChunkMethod::LSMASH | ChunkMethod::FFMS2 | ChunkMethod::BESTSOURCE)))
151151
&& !self.args.resume
152152
{
153153
self.vs_script = Some(match &self.args.input {
@@ -665,10 +665,7 @@ impl Av1anContext {
665665
fn create_encoding_queue(&mut self, scenes: &[Scene]) -> anyhow::Result<Vec<Chunk>> {
666666
let mut chunks = match &self.args.input {
667667
Input::Video(_) => match self.args.chunk_method {
668-
ChunkMethod::FFMS2
669-
| ChunkMethod::LSMASH
670-
| ChunkMethod::DGDECNV
671-
| ChunkMethod::BESTSOURCE => {
668+
ChunkMethod::FFMS2 | ChunkMethod::LSMASH | ChunkMethod::BESTSOURCE => {
672669
let vs_script = self.vs_script.as_ref().unwrap().as_path();
673670
self.create_video_queue_vs(scenes, vs_script)
674671
}

av1an-core/src/lib.rs

-2
Original file line numberDiff line numberDiff line change
@@ -305,8 +305,6 @@ pub enum ChunkMethod {
305305
FFMS2,
306306
#[strum(serialize = "lsmash")]
307307
LSMASH,
308-
#[strum(serialize = "dgdecnv")]
309-
DGDECNV,
310308
#[strum(serialize = "bestsource")]
311309
BESTSOURCE,
312310
}

av1an-core/src/settings.rs

+1-9
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@ use crate::concat::ConcatMethod;
1313
use crate::encoder::Encoder;
1414
use crate::parse::valid_params;
1515
use crate::target_quality::TargetQuality;
16-
use crate::vapoursynth::{
17-
is_bestsource_installed, is_dgdecnv_installed, is_ffms2_installed, is_lsmash_installed,
18-
};
16+
use crate::vapoursynth::{is_bestsource_installed, is_ffms2_installed, is_lsmash_installed};
1917
use crate::vmaf::validate_libvmaf;
2018
use crate::{ChunkMethod, ChunkOrdering, Input, ScenecutMethod, SplitMethod, Verbosity};
2119

@@ -127,12 +125,6 @@ properly into a mkv file. Specify mkvmerge as the concatenation method by settin
127125
"FFMS2 is not installed, but it was specified as the chunk method"
128126
);
129127
}
130-
if self.chunk_method == ChunkMethod::DGDECNV && which::which("dgindexnv").is_err() {
131-
ensure!(
132-
is_dgdecnv_installed(),
133-
"Either DGDecNV is not installed or DGIndexNV is not in system path, but it was specified as the chunk method"
134-
);
135-
}
136128
if self.chunk_method == ChunkMethod::BESTSOURCE {
137129
ensure!(
138130
is_bestsource_installed(),

av1an-core/src/vapoursynth.rs

+1-32
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,6 @@ pub fn is_ffms2_installed() -> bool {
4646
*FFMS2_PRESENT
4747
}
4848

49-
pub fn is_dgdecnv_installed() -> bool {
50-
static DGDECNV_PRESENT: Lazy<bool> =
51-
Lazy::new(|| VAPOURSYNTH_PLUGINS.contains("com.vapoursynth.dgdecodenv"));
52-
53-
*DGDECNV_PRESENT
54-
}
55-
5649
pub fn is_bestsource_installed() -> bool {
5750
static BESTSOURCE_PRESENT: Lazy<bool> =
5851
Lazy::new(|| VAPOURSYNTH_PLUGINS.contains("com.vapoursynth.bestsource"));
@@ -65,8 +58,6 @@ pub fn best_available_chunk_method() -> ChunkMethod {
6558
ChunkMethod::LSMASH
6659
} else if is_ffms2_installed() {
6760
ChunkMethod::FFMS2
68-
} else if is_dgdecnv_installed() {
69-
ChunkMethod::DGDECNV
7061
} else if is_bestsource_installed() {
7162
ChunkMethod::BESTSOURCE
7263
} else {
@@ -204,34 +195,12 @@ pub fn create_vs_file(
204195
match chunk_method {
205196
ChunkMethod::FFMS2 => "ffindex",
206197
ChunkMethod::LSMASH => "lwi",
207-
ChunkMethod::DGDECNV => "dgi",
208198
ChunkMethod::BESTSOURCE => "json",
209199
_ => return Err(anyhow!("invalid chunk method")),
210200
}
211201
)))?;
212202

213-
if chunk_method == ChunkMethod::DGDECNV {
214-
// Run dgindexnv to generate the .dgi index file
215-
let dgindexnv_output = temp.join("split").join("index.dgi");
216-
217-
Command::new("dgindexnv")
218-
.arg("-h")
219-
.arg("-i")
220-
.arg(source)
221-
.arg("-o")
222-
.arg(&dgindexnv_output)
223-
.output()?;
224-
225-
let dgindex_path = dgindexnv_output.canonicalize()?;
226-
load_script.write_all(
227-
format!(
228-
"from vapoursynth import core\n\
229-
core.max_cache_size=1024\n\
230-
core.dgdecodenv.DGSource(source={dgindex_path:?}).set_output()"
231-
)
232-
.as_bytes(),
233-
)?;
234-
} else if chunk_method == ChunkMethod::BESTSOURCE {
203+
if chunk_method == ChunkMethod::BESTSOURCE {
235204
load_script.write_all(
236205
format!(
237206
"from vapoursynth import core\n\

av1an/src/main.rs

+1-7
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,9 @@ fn version() -> &'static str {
4444
* VapourSynth Plugins
4545
systems.innocent.lsmas : {}
4646
com.vapoursynth.ffms2 : {}
47-
com.vapoursynth.dgdecodenv : {}
4847
com.vapoursynth.bestsource : {}",
4948
isfound(vapoursynth::is_lsmash_installed()),
5049
isfound(vapoursynth::is_ffms2_installed()),
51-
isfound(vapoursynth::is_dgdecnv_installed()),
5250
isfound(vapoursynth::is_bestsource_installed())
5351
)
5452
}
@@ -336,10 +334,6 @@ pub struct CliOpts {
336334
/// cause artifacts in the piped output). Slightly faster than lsmash for y4m input. Requires the ffms2 vapoursynth plugin to be
337335
/// installed.
338336
///
339-
/// dgdecnv - Very fast, but only decodes AVC, HEVC, MPEG-2, and VC1. Does not require intermediate files.
340-
/// Requires dgindexnv to be present in system path, NVIDIA GPU that support CUDA video decoding, and dgdecnv vapoursynth plugin
341-
/// to be installed.
342-
///
343337
/// bestsource - Very slow but accurate. Linearly decodes input files, very slow. Does not require intermediate files, requires the BestSource vapoursynth plugin
344338
/// to be installed.
345339
///
@@ -355,7 +349,7 @@ pub struct CliOpts {
355349
/// segment - Create chunks based on keyframes in the source. Not frame exact, as it can only split on keyframes in the source.
356350
/// Requires intermediate files (which can be large).
357351
///
358-
/// Default: lsmash (if available), otherwise ffms2 (if available), otherwise DGDecNV (if available), otherwise bestsource (if available), otherwise hybrid.
352+
/// Default: lsmash (if available), otherwise ffms2 (if available), otherwise bestsource (if available), otherwise hybrid.
359353
#[clap(short = 'm', long, help_heading = "Encoding")]
360354
pub chunk_method: Option<ChunkMethod>,
361355

docs/CLI.md

+2-6
Original file line numberDiff line numberDiff line change
@@ -239,10 +239,6 @@
239239
Slightly faster than lsmash for y4m input. Requires the ffms2 vapoursynth plugin to
240240
be installed.
241241
242-
dgdecnv - Very fast, but only decodes AVC, HEVC, MPEG-2, and VC1. Does not require intermediate files.
243-
Requires dgindexnv to be present in system path, NVIDIA GPU that support CUDA video decoding, and dgdecnv vapoursynth plugin
244-
to be installed.
245-
246242
bestsource - Very slow but accurate. Linearly decodes input files. Does not require intermediate files, requires the BestSource vapoursynth plugin
247243
to be installed.
248244
@@ -260,9 +256,9 @@
260256
segment - Create chunks based on keyframes in the source. Not frame exact, as it can
261257
only split on keyframes in the source. Requires intermediate files (which can be large).
262258
263-
Default: lsmash (if available), otherwise ffms2 (if available), otherwise DGDecNV (if available), otherwise bestsource (if available), otherwise hybrid.
259+
Default: lsmash (if available), otherwise ffms2 (if available), otherwise bestsource (if available), otherwise hybrid.
264260
265-
[possible values: segment, select, ffms2, lsmash, dgdecnv, bestsource, hybrid]
261+
[possible values: segment, select, ffms2, lsmash, bestsource, hybrid]
266262
267263
--chunk-order <CHUNK_ORDER>
268264
The order in which av1an will encode chunks

0 commit comments

Comments
 (0)