Log in

View Full Version : D2V Witch: cross-platform D2V creator


Pages : 1 2 [3]

jackoneill
1st December 2019, 14:46
Thanks.
Does GUI demux works only without audio, should it be?

Demuxing the audio happens while indexing for the first time. Demuxing the video happens after that.

It's kind of shitty.

stax76
30th May 2020, 20:50
On Windows is it required that d2vsource.dll is in the plugin auto load folder? In that case I would like to request a way using it without the auto load folder. Load it from PATH and also alternatively load it via command line option.

jackoneill
1st June 2020, 21:00
On Windows is it required that d2vsource.dll is in the plugin auto load folder? In that case I would like to request a way using it without the auto load folder. Load it from PATH and also alternatively load it via command line option.

I'm pretty sure I rely on VapourSynth's autoloading, yes. (Everywhere, not just on Windows.)

I suppose I could try loading it from PATH. What about loading from the same location as d2vwitch.exe? Would that be okay?

Do you still need the command line option if it's loading from PATH or the location of d2vwitch.exe? I would rather keep the command line options for command line usage (with no graphical interface).

stax76
1st June 2020, 23:10
PATH would be preferred.

If you call LoadLibrary("d2vsource.dll") then Windows searches in PATH.

This would also search in PATH:

std.LoadPlugin('d2vsource.dll', altsearchpath = True)

Only same folder would be OK, even if I want to use different folders, still a soft link could be used.

I wouldn't need a command line option then.

Pat357
5th June 2020, 17:47
Searching PATH would fail in case of a mixed VS 32bit/64bit setup.
The VS 64bit would fail if the 32bit d2vsource.dll comes before the 64bit d2vsource.dll in PATH, and the VS 32bit setup would fail if the 64bit DLL is the first found in PATH.

stax76
5th June 2020, 18:49
Searching PATH would fail in case of a mixed VS 32bit/64bit setup.
The VS 64bit would fail if the 32bit d2vsource.dll comes before the 64bit d2vsource.dll in PATH, and the VS 32bit setup would fail if the 64bit DLL is the first found in PATH.

If I remember right then Windows continues searching PATH after a failure until it finds a DLL that succeeds to load.

Apps can put the needed paths per process on top.

Opinion: x86 is a waste of time anyway.

stax76
7th June 2020, 16:57
Not sure if anybody has interest in this type of thing, to fix the prompt issue the file mpv.com or mpvnet.com can be renamed to d2vwitch.com and be placed next to d2vwitch.exe.

https://github.com/mpv-player/mpv/blob/master/osdep/win32-console-wrapper.c

stax76
7th June 2020, 21:15
There are CLI issues, d2v creation works using cmd.exe, powershell.exe and wt.exe manually by entering the command line in the console, the d2v file is OK and output is shown on screen but when executed from staxrip the progress output ends up in the d2v file, two times.

0%
0%
1%
removed
99%
99%
0%
0%
1%
2%
removed
98%
99%
DGIndexProjectFile16
2
C:\Users\JD\Desktop\vts_01_1.vob
C:\Users\JD\Desktop\vts_01_2.vob

Stream_Type=1
MPEG_Type=2
iDCT_Algorithm=6
YUVRGB_Scale=1
Luminance_Filter=0,0
Clipping=0,0,0,0
Aspect_Ratio=16:9
Picture_Size=720x576
Field_Operation=0
Frame_Rate=25000 (25/1)
Location=0,0,0,0

d00 5 0 2062 0 0 0 f2 f2 d2 f2 f2 e2 f2 f2 e2 f2 f2 e2 f2 f2 e2

And staxrip don't receive any output.

I can work around this by wrapping it in cmd like so:

file: cmd.exe
args: /S /C "command line"

staxrip does cmd.exe wrapping all the time for command lines that do piping so it's a well-supported scenario. Wrapping D2V Witch with cmd.exe the d2v file is OK and I can use that for now but staxrip still don't receive any output which would be useful to show progress, without progress staxrip might appear unresponsive while indexing.

staxrip can:

read stdout and stderr
read stdout and stderr from cmd.exe
read stdout and stderr from GUI tools, DGIndex does it

So there must be issues in the D2V Witch console code.

jackoneill
8th June 2020, 11:41
It prints all messages to stderr. If you give it "-" as the file name then it prints the d2v file to stdout.

stax76
8th June 2020, 15:05
I try to understand the issue and could need some help, here is what I tried in cmd:


C:\Users\JD\Desktop>d2vwitch --output test.d2v test.vob > out.txt

Video frames seen: 827 0%
Progressive: 827
Top field first: 827
Repeat: 0


C:\Users\JD\Desktop>d2vwitch --output test.d2v test.vob 2> err.txt

Video frames seen: 827 0%
Progressive: 827
Top field first: 827
Repeat: 0


So first I redirected stdout to out.txt file, I get a correct d2v file, some text printed on screen and an empty out.txt file.

Next I redirected stderr to err.txt file, I get a correct d2v file, again the same text on screen and again an empty file.

So redirection does not work at all and I'm not really understanding why, I hope somebody can give a clue what's going on, otherwise I might need some time to figure this out.

jackoneill
8th June 2020, 15:43
I try to understand the issue and could need some help, here is what I tried in cmd:


C:\Users\JD\Desktop>d2vwitch --output test.d2v test.vob > out.txt

Video frames seen: 827 0%
Progressive: 827
Top field first: 827
Repeat: 0


C:\Users\JD\Desktop>d2vwitch --output test.d2v test.vob 2> err.txt

Video frames seen: 827 0%
Progressive: 827
Top field first: 827
Repeat: 0


So first I redirected stdout to out.txt file, I get a correct d2v file, some text printed on screen and an empty out.txt file.

Next I redirected stderr to err.txt file, I get a correct d2v file, again the same text on screen and again an empty file.

So redirection does not work at all and I'm not really understanding why, I hope somebody can give a clue what's going on, otherwise I might need some time to figure this out.

I assume it's because d2vwitch.exe is not a console application. It just uses a hack to print stuff to the console. Does the same happen if you use the renamed mpv.com?

stax76
8th June 2020, 16:15
d2vwitch.com --output test.d2v test.vob 2> err.txt

Exactly the same undesirable result.

DGIndex is a GUI app and prints to the console and staxrip received the output without problems and both mpv and mpv.net are also GUI apps and print to the console all over the place and redirection works.

mpvnet.exe --aaa > out.txt

works, content of out.txt:

[mpv.net] error setting property: aaa = yes
[mpv.net] property not found

mpv.net writes error messages to stdout, it could be changed easily but I don't think it matters.

mpv.net (C#) just calls System.Console.WriteLine and mpv (C) something like printf, it's not a hack and works.


edit:

mpv.net calls AttachConsole(-1 /*ATTACH_PARENT_PROCESS*/) only when the env var _started_from_console exists, the com wrapper sets this env var, that means it's not even required to call AttachConsole since mpvnet.exe --aaa > out.txt works, maybe have a look in the DGIndex code if it can be found, it's GPL, search for console and print.


edit2:

I will further investigate it in case you don't have much time, the topic interests me.

jackoneill
10th June 2020, 17:35
Here is v4 (https://github.com/dubhater/D2VWitch/releases/tag/v4):


* Fix crash when demuxing the video using the graphical interface.
* Fix bad d2v output when calculating the audio delays. This bug
probably affected anyone who used the graphical interface whether
demuxing audio tracks or not, plus anyone who used the command line
interface to demux audio tracks. The result was d2v files with the
wrong number of frames and possibly visible decoding errors. This
bug was introduced in v3.
* If d2vsource.dll is not found in VapourSynth's autoload locations,
try to load it from PATH and the location of d2vwitch.exe. This
is for Windows only.


I couldn't compile it the usual way (for reasons I haven't figured out), so I switched to Qt and ffmpeg packages compiled by someone else. They are not compiled specifically for this program, so you're getting a lot of libraries that D2V Witch doesn't use, but it can't start without them. ¯\_(ツ)_/¯

stax76
10th June 2020, 18:49
Thanks for the new version.

I confirm that PATH loading works and I've modified staxrip accordingly.

Selur
11th June 2020, 19:37
Thanks, but ... Whoa, I'll stick with the old d2vwitch no need for x264, x264 and all the other encoding libraries, it now includes a whole FFmpeg with tons of dependencies.
(I only use it for the MPEG-1/2 d2v creation nothing else.)
Something really seems to be wrong with all those ffmpeg related dependencies.

Cu Selur

stax76
11th June 2020, 20:20
I stay with the old too because of the size but Selur, it never appeared that you are concerned about the size, for instance you include DGIndex.exe two times and countless other files two times, overall 1,3 GB disc space and over 5000 files.

Selur
12th June 2020, 07:45
Main size comes from the model based ai and cuda base suff in Hybrid, other than that I try to keep it small if possible. :)
Hybrid has to include tons of dependencies due to Hybrid able to be portable, DGIndex is once included for Vapoursynth and once for Avisynth.
I personally like tools minimalistic and I'm no fan of small tools that do a job well to expand into gui suites like StaxRip, Hybrid, MeGui,...

stax76
12th June 2020, 13:31
Main size comes from the model based ai and cuda base suff in Hybrid

You mean waifu2x? I've not included it because it's too big and filters can be integrated via customization, it's not well documented so only power users might understand how to do the configuration.

Selur
12th June 2020, 15:13
Yup, all the waifu2x variants, VapourSynth-BilateralGPU, weights for nnedi3, mainly models opencv and cuda dependencies are all rather large.

stax76
12th June 2020, 15:52
StaxRip is:

650 MB disc space
194 MB download
198 tools, half or so added by Revan

I guess the size is OK, there were few complaints in the past.

People that don't use staxrip can use the docs to see what tools it uses:

https://staxrip.readthedocs.io/generated/tools.html

It does not show the size though, not sure if it's interesting for many people, maybe I add it, the Apps dialog has a feature to show a grid with Excel or Out-GridView (https://raw.githubusercontent.com/stax76/Get-MediaInfo/master/GridView.png).

Blue_MiSfit
12th June 2020, 19:29
Just out of curiosity, what's the use case for d2v files these days? ffvideosource seems to open all MPEG-2 variants I've tried.

ChaosKing
12th June 2020, 19:33
ffms2 and mpeg are not very good friends https://forum.doom9.org/showthread.php?t=176231

Jukus
12th June 2020, 19:51
Sometimes can find mpeg2 video, when using d2v the wrong index is obtained, but with ffms2 the correct one.

jackoneill
12th June 2020, 20:13
Just out of curiosity, what's the use case for d2v files these days? ffvideosource seems to open all MPEG-2 variants I've tried.

People still have DVDs to decode, apparently. You need something that treats the collection of VOBs as a single file, otherwise you lose some frames (and synchronisation, probably) if you open them individually with ffms2.

Sometimes can find mpeg2 video, when using d2v the wrong index is obtained, but with ffms2 the correct one.

If you were using D2V Witch v3, that might have been due to one of the bugs fixed in v4. If the index is still wrong with v4, you should report it.

stax76
12th June 2020, 20:36
For PAL DVDs which are typically progressive the best route was always MakeMKV and then open it with ffms2 or L-Smash, this route was extremely reliable, probably it still is, other older routes often failed by causing issues, for instance with subtitle sync, there were still ways but not as simple as using MakeMKV.

Jukus
12th June 2020, 20:37
If you were using D2V Witch v3, that might have been due to one of the bugs fixed in v4. If the index is still wrong with v4, you should report it.
A distinctive feature of these videos is that mediainfo shows that the bottom field first, but in fact the first is top. If need a sample, now I do not have it.

Personally, I always use d2v in the first place, otherwise there may be problems with skipping frames and the wrong frame order. Only if d2v gives the wrong result, then I use ffms2.

Selur
12th June 2020, 20:40
Just out of curiosity, what's the use case for d2v files these days?
opening DVDs is the main usage for it here.

stax76
15th June 2020, 15:43
Thank you HolyWu!

Jukus
15th June 2020, 16:57
If you were using D2V Witch v3, that might have been due to one of the bugs fixed in v4. If the index is still wrong with v4, you should report it.
If do remux to m2v using ffmpeg, and there will be such errors in the log, then d2witch will not be able to make the correct index for this video.

...
[mpeg2video @ 0x55bdad62db80] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 94245 >= 94243
[mpeg2video @ 0x55bdad62db80] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 94245 >= 94244
[mpeg2video @ 0x55bdad62db80] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 94245 >= 94245
Last message repeated 1 times
[mpeg2video @ 0x55bdad62db80] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 94248 >= 94246
[mpeg2video @ 0x55bdad62db80] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 94248 >= 94247
[mpeg2video @ 0x55bdad62db80] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 94248 >= 94248
Last message repeated 1 times
[mpeg2video @ 0x55bdad62db80] pts (94249) < dts (94250) in stream 0
[mpeg2video @ 0x55bdad62db80] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 94249 >= 94249
[mpeg2video @ 0x55bdad62db80] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 94252 >= 94250
...

Jukus
15th June 2020, 17:52
v5 was released, I checked, now everything is indexed correctly :thanks:
Still support mkv for convenience :)

jackoneill
16th June 2020, 17:29
v5 was released, I checked, now everything is indexed correctly :thanks:


Even the files with these errors from ffmpeg?

[mpeg2video @ 0x55bdad62db80] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 94245 >= 94243

Jukus
16th June 2020, 19:19
Even the files with these errors from ffmpeg?

[mpeg2video @ 0x55bdad62db80] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 94245 >= 94243

Yes, now these files are indexed correctly.

Jukus
1st August 2024, 17:51
Incompatible with ffmpeg7, if I understand correctly

https://github.com/dubhater/D2VWitch/issues/16