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.

 

Go Back   Doom9's Forum > General > Newbies

Reply
 
Thread Tools Search this Thread Display Modes
Old 12th October 2019, 21:41   #1  |  Link
N.ROM.anova
Registered User
 
Join Date: Oct 2019
Posts: 2
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 21:44.
N.ROM.anova is offline   Reply With Quote
Old 12th October 2019, 22:41   #2  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 7,363
".\" 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
good luck.

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'
but
Code:
nnedi='./nnedi3_weights.bin'
or
nnedi='D:/nnedi3_weights.bin'
EDIT: Its used here under linux, but its not clear whether it is a path or not:- https://forum.shotcut.org/t/technica...isited/8311/35

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
Similar question was already asked on Doom9, got no replies at all.
__________________
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 23:26.
StainlessS is online now   Reply With Quote
Old 13th October 2019, 00:28   #3  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 7,363
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
From CLI in root of "D:\", I ran Test.Cmd,

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 01:00.
StainlessS is online now   Reply With Quote
Old 13th October 2019, 01:23   #4  |  Link
N.ROM.anova
Registered User
 
Join Date: Oct 2019
Posts: 2
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'
N.ROM.anova is offline   Reply With Quote
Reply

Tags
deinterlace filters, ffmpeg, nnedi, nnedi3

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 13:28.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.