Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
12th October 2019, 20:41 | #1 | Link |
Registered User
Join Date: Oct 2019
Posts: 3
|
ERROR using NNEDI in FFMPEG
I’ve been testing the various deinterlacing filters in FFMPEG, and no matter what I try, NNEDI fails to initialize.
NNEDI requires the use of a binary filter file for the “weights”, which FFMPEG provides a link to here: https://github.com/dubhater/vapoursy...i3_weights.bin Problem is there are NO instructions on where to install this file in relation to FFMPEG. I’ve tried placing the file in the main FFMPEG folder, as well as in the various sub folders. Nothing works, as FFMPEG is unable to locate the weights file and keeps giving the following error message: [mpeg2video @ 000001a1b34f0740] ignoring pic cod ext after 0 [Parsed_nnedi_1 @ 000001a1b39b4ac0] No weights file provided, aborting! [AVFilterGraph @ 000001a1b3aa2b80] Error initializing filter 'nnedi' with args'weights=./nnedi3_weights.bin:deint=interlaced' Error reinitializing filters! Failed to inject frame into filter network: Invalid argument Error while processing the decoded data for stream #0:0 Conversion failed! The FFMPEG formula I'm using is: ffmpeg -i SC_EP-08.mp4 -c:v libx264 -preset ultrafast -tune animation -crf 1 -vf "fieldmatch,nnedi=weights='./nnedi3_weights.bin':deint=interlaced,decimate" -acodec copy ivtc_TEST-07_SC_EP-08.mp4 In the code above, I’ve listed the location of the weights file as “./”. The only place I could find a formula for using NNEDI with FFMPEG was here: https://github.com/kfrn/ffmpeg-thing...interlacing.md In that article they list the location for the weights file in the formula as “./”. I’m not sure what that location means. I’ve tried removing the “./” in the call, as well as inputting the direct file URL for the weights file on my machine. Nothing works. I keep getting the same error message. I’ve been able to do all other types of editing, conversion, encoding, etc. in FFMPEG. It is just NNEDI that is giving me issues. What am I doing wrong? NOTE: I need to get NNEDI working in FFMPEG, NOT AVIsynth, as I’m editing and encoding with MP4 files only. Last edited by N.ROM.anova; 12th October 2019 at 20:44. |
12th October 2019, 21:41 | #2 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,994
|
".\" or "./" is current directory, maybe specify full path to it eg "D:\\nnedi=weights='./nnedi3_weights.bin".
If ffmpeg.exe is being used via PATH environment variable, then perhaps current directory is relative to that (Ie same directory as ffmpeg.exe). Or, maybe is relative to current directory of calling script/cmd/bat file. So, just to test out that it does work at all, try fullpath, eg (put it in "D:\"). Code:
ffmpeg -i SC_EP-08.mp4 -c:v libx264 -preset ultrafast -tune animation -crf 1 -vf "fieldmatch,nnedi=weights='D:/nnedi3_weights.bin':deint=interlaced,decimate" -acodec copy ivtc_TEST-07_SC_EP-08.mp4 EDIT: see here:- https://forum.videohelp.com/threads/...0p#post2465082 Look like maybe mistake in your command, ie not Code:
nnedi=weights='./nnedi3_weights.bin' or nnedi=weights='D:/nnedi3_weights.bin' Code:
nnedi='./nnedi3_weights.bin' or nnedi='D:/nnedi3_weights.bin' EDIT: Maybe you were correct after all (although it has no path, may not be a filename, just a name):- Code:
[21:39:08 CEST] <furq> you need the weights file listed there [21:39:25 CEST] <furq> or alternatively just use yadif, it's much faster and it looks reasonably good [21:39:51 CEST] <furq> but yeah if you do use nnedi then -vf nnedi=weights=nnedi3_weights.bin
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? Last edited by StainlessS; 12th October 2019 at 22:26. |
12th October 2019, 23:28 | #3 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,994
|
This works (well dont crash or throw error, I did not have an interlaced clip handy and did not wait till completion).
With "nnedi3_weights.bin" in root of windows "D:\" drive, and test command file in "D:\Test.Cmd" FFMpeg.Exe in "C:\BIN\", and system environment has "C:\BIN\" added to PATH variable. D:\Test.Cmd Code:
ffmpeg -i Parade.avi -c:v libx264 -vf "nnedi=nnedi3_weights.bin,format=yuv420p" -preset fast -crf 23 out.mp4 Did not work when I tried with "nnedi3_weights.bin" in "C:\BIN", same directory as FFMPEG. EDIT: This forum is bloody awful for entering backSlash, they get swallowed up when not in code block, you gotta keep entering two backslashes, and if you edit, you gotta go back and replace all of the double backslashes again. It seems that when ffmpeg docs use "nnedi=weight", the weight part is just a placeholder for "nnedi3_weights.bin", and where name should be inserted, dont know if it is intended to be a filename with path (I did not get it to work with a path). EDIT: It was real slow (no way that slow in Avisnyth, I'm gettin 3.8 FPS, 480x360 clip, on Core Duo 2.88GHz [maybe I did something wrong]).
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? Last edited by StainlessS; 13th October 2019 at 00:00. |
13th October 2019, 00:23 | #4 | Link |
Registered User
Join Date: Oct 2019
Posts: 3
|
THANK YOU StainlessS! That did the trick!
So the simplified answer for anyone else looking for a solution is that the NNEDI weights file has to be saved on the same drive where the files being converted are also stored. The bin file can be placed into either the same directory or at the root. the NNEDI weights file will not work if it is on the same drive that FFMPEG is installed in (or so it seems at this point in time). If placing the files in the same directory, then the weights part of the NNEDI command is: nnedi=weights='./nnedi3_weights.bin'" If placing them in the root, then the weights part of the NNEDI is: nnedi=weights='nnedi3_weights.bin' |
Tags |
deinterlace filters, ffmpeg, nnedi, nnedi3 |
Thread Tools | Search this Thread |
Display Modes | |
|
|