View Full Version : D2V Witch: cross-platform D2V creator
jackoneill
16th January 2016, 22:01
https://github.com/dubhater/D2VWitch
Now with a graphical interface.
an3k
18th January 2016, 12:07
Missing dependencies?vapoursynth@encoder:~/D2VWitch$ make -j$(nproc)
CXX src/D2VWitch.o
CXX src/D2V.o
CXX src/FakeFile.o
CXX src/FFMPEG.o
CXX src/MPEGParser.o
src/D2VWitch.cpp: In function ‘bool selectAudioStreamsById(AVFormatContext*, std::vector<int>&)’:
src/D2VWitch.cpp:88:59: error: no matching function for call to ‘std::vector<int>::erase(__gnu_cxx::__normal_iterator<const int*, std::vector<int> >)’
audio_ids.erase(audio_ids.cbegin() + j);
^
src/D2VWitch.cpp:88:59: note: candidates are:
In file included from /usr/include/c++/4.8/vector:69:0,
from src/D2VWitch.cpp:24:
/usr/include/c++/4.8/bits/vector.tcc:134:5: note: std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::erase(std::vector<_Tp, _Alloc>::iterator) [with _Tp = int; _Alloc = std::allocator<int>; std::vector<_Tp, _Alloc>::iterator = __gnu_cxx::__normal_iterator<int*, std::vector<int> >; typename std::_Vector_base<_Tp, _Alloc>::pointer = int*]
vector<_Tp, _Alloc>::
^
/usr/include/c++/4.8/bits/vector.tcc:134:5: note: no known conversion for argument 1 from ‘__gnu_cxx::__normal_iterator<const int*, std::vector<int> >’ to ‘std::vector<int>::iterator {aka __gnu_cxx::__normal_iterator<int*, std::vector<int> >}’
/usr/include/c++/4.8/bits/vector.tcc:146:5: note: std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::erase(std::vector<_Tp, _Alloc>::iterator, std::vector<_Tp, _Alloc>::iterator) [with _Tp = int; _Alloc = std::allocator<int>; std::vector<_Tp, _Alloc>::iterator = __gnu_cxx::__normal_iterator<int*, std::vector<int> >; typename std::_Vector_base<_Tp, _Alloc>::pointer = int*]
vector<_Tp, _Alloc>::
^
/usr/include/c++/4.8/bits/vector.tcc:146:5: note: candidate expects 2 arguments, 1 provided
src/D2V.cpp: In member function ‘bool D2V::engage()’:
src/D2V.cpp:332:13: warning: ‘void av_free_packet(AVPacket*)’ is deprecated (declared at /home/vapoursynth/include/libavcodec/avcodec.h:4056) [-Wdeprecated-declarations]
av_free_packet(&packet);
^
src/D2V.cpp:332:35: warning: ‘void av_free_packet(AVPacket*)’ is deprecated (declared at /home/vapoursynth/include/libavcodec/avcodec.h:4056) [-Wdeprecated-declarations]
av_free_packet(&packet);
^
src/D2V.cpp:344:13: warning: ‘void av_free_packet(AVPacket*)’ is deprecated (declared at /home/vapoursynth/include/libavcodec/avcodec.h:4056) [-Wdeprecated-declarations]
av_free_packet(&packet);
^
src/D2V.cpp:344:35: warning: ‘void av_free_packet(AVPacket*)’ is deprecated (declared at /home/vapoursynth/include/libavcodec/avcodec.h:4056) [-Wdeprecated-declarations]
av_free_packet(&packet);
^
src/D2V.cpp:348:9: warning: ‘void av_free_packet(AVPacket*)’ is deprecated (declared at /home/vapoursynth/include/libavcodec/avcodec.h:4056) [-Wdeprecated-declarations]
av_free_packet(&packet);
^
src/D2V.cpp:348:31: warning: ‘void av_free_packet(AVPacket*)’ is deprecated (declared at /home/vapoursynth/include/libavcodec/avcodec.h:4056) [-Wdeprecated-declarations]
av_free_packet(&packet);
^
make: *** [src/D2VWitch.o] Error 1
make: *** Waiting for unfinished jobs....
vapoursynth@encoder:~/D2VWitch$
Are_
18th January 2016, 12:44
I don't think so, it compiles fine with gcc-5.3.0 but fails with gcc-4.8.5 here, maybe 4.8.x is more nitpicking about something in the code. Don't you have a more recent compiler to try?
an3k
18th January 2016, 12:49
I don't think so, it compiles fine with gcc-5.3.0 but fails with gcc-4.8.5 here, maybe 4.8.x is more nitpicking about something in the code. Don't you have a more recent compiler to try?
No, this is the most recent version on Ubuntu Server 14.04.3 LTS and everything else (including some other projects from dubhater) compile just fine.
jackoneill
18th January 2016, 13:12
I'd say it's a C++11 thing, as in, your compiler doesn't have full support, because it's old. Replace cbegin with begin.
sl1pkn07
18th January 2016, 13:21
@ank3
most recent in your distro no mean most recent in upstream. the latest version available (stable) for public is the version gcc 5.3.0, your distro (Trusty Tahr) ship gcc 4.8.2
an3k
18th January 2016, 15:02
Is D2VWitch Closed GOP aware and knows how to handle these correctly? http://www.mpucoder.com/guides/delaymyth.html
jackoneill
18th January 2016, 15:19
Is D2VWitch Open GOP aware and knows how to handle these correctly?
It is aware. Open GOPs and B frames that can't be decoded without the previous GOP will be marked as such.
Edit: having read the linked page, there is one addition to my answer: D2V Witch assumes that B frames always require two reference frames, even though it's not always true.
jackoneill
30th July 2016, 10:51
Here is D2V Witch with a graphical interface, for anyone interested in testing:
https://ulozto.net/!zJ7H7xnPK/d2vwitch-v2-win32-7z
https://ulozto.net/!jdzfP34kh/d2vwitch-v2-win64-7z
Updated readme.rst: https://github.com/dubhater/D2VWitch/blob/master/readme.rst
Let me know what you think.
* Rename the executable from ``D2VWitch`` to ``d2vwitch`` because no
one likes typing commands with capital letters in them.
* Remux LPCM audio into Wave 64 instead of producing unusable audio
files.
* Guess the channel layout for LPCM audio on DVDs based on the number
of channels, instead of saying it has zero channels.
* Fix occasional crash when demuxing LPCM audio.
* Give audio files proper extensions instead of ``.audio``.
* Add option ``--input-range``, which sets the YUVRGB_Scale field
according to the video's colour range. Make it default to limited
range.
* Add a graphical interface, launched when no command line parameters
are supplied.
On an unrelated topic: I have this impression that D2V Witch is faster than DGIndex. Has anyone compared them in Windows?
Mystery Keeper
30th July 2016, 12:27
Audio demux failed, and there's no preview, even though d2vsource was loaded.
Are_
30th July 2016, 12:28
Looking nice, I have some suggestions (and bugs) though:
It would be nice to enable drag and drop for the input box.
Once you "cut" a video you can't go any-more back to the main window if you plan to cut various scenes.
If the very last frame is selected when cutting an error is thrown, "avformat_open_input() failed: Invalid data found when processing input", because it lets you select one frame more.
The VOB I tested had a PCM audio track, when I did demux it I always got a 104 Bites garbage file instead of an actual audio file.
mariush
30th July 2016, 12:32
I took the liberty of uploading the files to a file host without ads and timers :
Win32: http://savedonthe.net/download/878/D2VWitch-v2-win32.html
Win64: http://savedonthe.net/download/879/D2VWitch-v2-win64.html
Feel free to upload your future files there, there's no files deleted unless it's problem with disk space (unlikely) and files are not being downloaded.
Tiny disclaimer even though it's not needed (because i don't make money off it) : I own the website above.
jackoneill
30th July 2016, 17:34
New binaries:
http://savedonthe.net/download/880/D2VWitch-v2-win32.html
http://savedonthe.net/download/881/D2VWitch-v2-win64.html
The ffmpeg included in the binaries was missing some components needed for LPCM demuxing. That's fixed now.
Audio demux failed, and there's no preview, even though d2vsource was loaded.
If this still happens, I'll need more info. A sample plus anything printed in the box at the bottom.
Looking nice, I have some suggestions (and bugs) though:
It would be nice to enable drag and drop for the input box.
Once you "cut" a video you can't go any-more back to the main window if you plan to cut various scenes.
If the very last frame is selected when cutting an error is thrown, "avformat_open_input() failed: Invalid data found when processing input", because it lets you select one frame more.
The VOB I tested had a PCM audio track, when I did demux it I always got a 104 Bites garbage file instead of an actual audio file.
1. Files can be dropped onto the window now.
2. I haven't decided how to make it possible to index a new file after demuxing some video. However, it is possible to demux several pieces of the same video one after the other, without reopening D2V Witch.
3. It no longer lets you select "extra" frames.
4. Demuxing LPCM audio with the graphical interface works now.
I took the liberty of uploading the files to a file host without ads and timers :
Win32: http://savedonthe.net/download/878/D2VWitch-v2-win32.html
Win64: http://savedonthe.net/download/879/D2VWitch-v2-win64.html
Feel free to upload your future files there, there's no files deleted unless it's problem with disk space (unlikely) and files are not being downloaded.
Tiny disclaimer even though it's not needed (because i don't make money off it) : I own the website above.
Thanks. I'll use it.
jackoneill
31st July 2016, 09:28
Okay, I added some menus. You can use that to open another video from the demuxing page.
http://savedonthe.net/download/882/D2VWitch-v2-win32.html
http://savedonthe.net/download/883/D2VWitch-v2-win64.html
Mystery Keeper
31st July 2016, 18:45
Nothing was printed. I would tell if anything was. First it printed that d2vsource was not loaded. I figured I had to move d2vsource.dll to the standard folder. I usually load plugins from independent special folder. Sorry, but for several more days I shan't be able to provide samples. Oh, and the video was an NTSC .vob with LPCM stereo sound.
jackoneill
9th December 2016, 21:13
No one has complained about anything in a while, so here is v2: https://github.com/dubhater/D2VWitch/releases/tag/v2. It's pretty much the same as the last preview.
* Rename the executable from "D2VWitch" to "d2vwitch" because no one likes typing commands with capital letters in them.
* Remux LPCM audio into Wave 64 instead of producing unusable audio files.
* Guess the channel layout for LPCM audio on DVDs based on the number of channels, instead of saying it has zero channels.
* Fix occasional crash when demuxing LPCM audio.
* Give audio files proper extensions instead of .audio.
* Add option --input-range, which sets the YUVRGB_Scale field according to the video's colour range. Make it default to limited range.
* Add a graphical interface, launched when no command line parameters are supplied.
Sangan
18th December 2016, 22:07
I am having serious problems compiling this on a mac ... Mac OS Sierra. it mainly hangs with this at the ./configure step (the ./autogen.sh runs through smooth):
Package Qt5Core was not found in the pkg-config search path.
Perhaps you should add the directory containing `Qt5Core.pc'
to the PKG_CONFIG_PATH environment variable
No package 'Qt5Core' found
checking for QT5WIDGETS... no
configure: error: Package requirements (Qt5Widgets) were not met:
No package 'Qt5Widgets' found
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
Alternatively, you may set the environment variables QT5WIDGETS_CFLAGS
and QT5WIDGETS_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
And I am totally at a loss. I brew installed qt5, but from what I found on the net, qt5 for some reason doesnt want to install with neither the said widget nor the core, and because it doesn''t affect homebrew, there is only a cryptic work around I don't understand...
Would you kindly be able to try make binaries for Mac too? If you find the time?
jackoneill
19th December 2016, 13:34
I am having serious problems compiling this on a mac ... Mac OS Sierra. it mainly hangs with this at the ./configure step (the ./autogen.sh runs through smooth):
And I am totally at a loss. I brew installed qt5, but from what I found on the net, qt5 for some reason doesnt want to install with neither the said widget nor the core, and because it doesn''t affect homebrew, there is only a cryptic work around I don't understand...
Would you kindly be able to try make binaries for Mac too? If you find the time?
I have no Apple products.
Is there no Qt5Core.pc anywhere on your computer? Because the error message tells you exactly what you need to do.
Sangan
19th December 2016, 15:22
Actually, there is, yes, I found it (usr/local/Cellar/qt5/5.7.0/lib/pkgconfig/Qt5Core.pc - the Qt5Widgets.pc is there too). So I need to edit the PKG_CONFIG_PATH to set the path right? Where do I do that? (Sorry, I am a real noob with this)
jackoneill
19th December 2016, 17:32
Actually, there is, yes, I found it (usr/local/Cellar/qt5/5.7.0/lib/pkgconfig/Qt5Core.pc - the Qt5Widgets.pc is there too). So I need to edit the PKG_CONFIG_PATH to set the path right? Where do I do that? (Sorry, I am a real noob with this)
It's an environment variable:
PKG_CONFIG_PATH=/usr/local/Cellar/qt5/5.7.0/lib/pkgconfig ./configure
make
Sangan
19th December 2016, 19:11
Cheers, that worked :) . Can it demux audio tracks from a ts like DGindex could?
(I tried with one of my tsses, but it doesn't recognize the audio track to begin with, it only sees the video track. DGIndex kind of messed the audio tracks up too though, it got totally confused with some new headers in the tracks and produces kind of untrimable bullshit though the track plays fine. With MEGui, demuxing the audio with eac3to results in something trimable. I am just so fed up with jumping from mac to wine to Virtualbox/win, which is why I want to try Vapoursyth for encoding. Most elegant would be trimming the audio with something running under MacOS too...)
fAy01
19th December 2016, 20:54
Cheers, that worked :) . Can it demux audio tracks from a ts like DGindex could?
(I tried with one of my tsses, but it doesn't recognize the audio track to begin with, it only sees the video track. DGIndex kind of messed the audio tracks up too though, it got totally confused with some new headers in the tracks and produces kind of untrimable bullshit though the track plays fine. With MEGui, demuxing the audio with eac3to results in something trimable. I am just so fed up with jumping from mac to wine to Virtualbox/win, which is why I want to try Vapoursyth for encoding. Most elegant would be trimming the audio with something running under MacOS too...)
For audio trimming you can use this:
https://github.com/AzraelNewtype/audiocutter
Are_
19th December 2016, 22:12
For audio demuxing/transcoding you can use ffmpeg (https://ffmpeg.org/download.html) or tsmuxer (http://forum.doom9.org/showthread.php?t=168539).
fAy01
19th December 2016, 22:21
Sangan, you'd save yourself a lot of trouble if you were to buy a windows laptop/pc :)
Are_
19th December 2016, 22:32
You'd save yourself a lot of trouble if you were to buy a windows laptop/pc :)
what?
jackoneill
19th December 2016, 22:38
Cheers, that worked :) . Can it demux audio tracks from a ts like DGindex could?
Theoretically. If you give me the first 50 MiB of this transport stream I can have a look at the problem.
Sangan
19th December 2016, 23:40
Theoretically. If you give me the first 50 MiB of this transport stream I can have a look at the problem.
Here it is on mega: https://mega.nz/#!GtgVBbqS!34qyM0F9cYrC6JVxJHvPZdNV73SkwimJkEhiFYyBKyY
Edit:
I have to ad: The issue is neither specific to this ts nor is it specific to this source. Something with the streams has changed on the other end, all the audio tracks have 'grown' in size and pretend to have damaged headers after demuxing in DGIndex (which doesn't give out any errors while demuxing) when trying to trim with Audsub splitter (on VirtualBox/Win). MEGui works solala, it protests when demuxing, but demuxes anyways, though I hear, that it usually protests, not only since something changed on the other end. I also hear that the DGDecIM produces fine demuxed audio tracks, but as I want to get off the multiple systems encoding, I won't try this until there really isn't any other option left.
Sangan
20th December 2016, 10:40
Ooooooh, I see. I am stupid XD. I missed out on ticking that little box where I didn't expect to be one. It demuxes fine now. (Give me a hole to vanish in). The audio track, is there any delay then that I need to take into account or is it set to 0?
Edit: Jupp, there is an unaccounted for delay.
Sangan
20th December 2016, 19:19
@fAy01 . I am trying the audiocutter... I got it right, that this goes, following the example script there straight into my .vps script. But where exactly do I put the audiocutter.py? Somewhere in into the Vaporsynth program folder?... I tried several places, all the wrong ones. The editor when checking the script gives me this: Failed to evaluate the script:
Python exception: No module named 'audiocutter'
Traceback (most recent call last):
File "src/cython/vapoursynth.pyx", line 1491, in vapoursynth.vpy_evaluateScript (src/cython/vapoursynth.c:27905)
File "/Users/yaminoyami/Desktop/5Ds und DM/DM remaster/DM-R-Duelspecial/Duelspecial_DM-GX_167/Encode/167-DM-GX_Duel-Special_TV-T.vpy", line 2, in <module>
import audiocutter
ImportError: No module named 'audiocutter'Failed to evaluate the script:
Python exception: No module named 'audiocutter'
Traceback (most recent call last):
File "src/cython/vapoursynth.pyx", line 1491, in vapoursynth.vpy_evaluateScript (src/cython/vapoursynth.c:27905)
File "/path/to/file.vpy", line 2, in <module>
import audiocutter
ImportError: No module named 'audiocutter'You have any idea or is there a thread that would be more fitting to get help?
fAy01
20th December 2016, 19:36
[QUOTE=Sangan;1790502]@fAy01 . I am trying the audiocutter... I got it right, that this goes, following the example script there straight into my .vps script. But where exactly do I put the audiocutter.py? Somewhere in into the Vaporsynth program folder?... I tried several places, all the wrong ones. The editor when checking the script gives me this: Failed to evaluate the script:
"Installation"
You can safely put audiocutter.py anywhere in your python path, though I recommend creating a scripts folder next to your plugins32 and plugins64 folders, so you can keep the python in the same vicinity as the the compiled plugins you use. You can look at example.vpy to see how you can easily leverage this on windows, though the same principle applies for Linux/OSX with a different path.
Note: Before you leave wherever you're putting the script, check if you can execute mkvmerge from your command line. If you can't, you should edit self.__mkvmerge in __init__ to match the path to your mkvmerge executable. If you're on windows, you should use forward slashes as path delimiters.
Try reading the manual: https://github.com/AzraelNewtype/audiocutter
Sangan
9th January 2017, 11:14
So, some feedback. (I got the audiocutter finally running, though it won't work via vspipe if I go for x264. Well, I run it as a seperate script directly in Python).
Back to D2Witch. From my test streams, to me it looks like it just extracts the audio track. Without giving out a delay or adjusting it. Either I do something wrong (which is always an option, as straight forward as D2Witch is) or it simply can't do this.
jackoneill, could you confirm, if it does adjust the delay and if so, how? (like, I don't see an option and the resulting file looks like it does - it doesn't have a delay in its file name like DGIndex had - but there definitly is a delay that's not adjusted (at least with my streams). The test bit some posts up should have this too.
jackoneill
9th January 2017, 18:49
So, some feedback. (I got the audiocutter finally running, though it won't work via vspipe if I go for x264. Well, I run it as a seperate script directly in Python).
Back to D2Witch. From my test streams, to me it looks like it just extracts the audio track. Without giving out a delay or adjusting it. Either I do something wrong (which is always an option, as straight forward as D2Witch is) or it simply can't do this.
jackoneill, could you confirm, if it does adjust the delay and if so, how? (like, I don't see an option and the resulting file looks like it does - it doesn't have a delay in its file name like DGIndex had - but there definitly is a delay that's not adjusted (at least with my streams). The test bit some posts up should have this too.
The delay isn't even detected, so there is no adjustment.
Can you tell me what delay Wonky_Audio.ts is supposed to have?
Sangan
9th January 2017, 19:38
The delay isn't even detected, so there is no adjustment.
Can you tell me what delay Wonky_Audio.ts is supposed to have?
According to DGIndex: Wonky_Audio PID 110 DELAY -74ms.aac
Megui tells me: Track 2: AAC, 2.0 channels, 256kbps, 48kHz, -724ms (which it tries to shift then, but the outcome is doubtful)
I kind of tend to trust the delay of DGIndex more, or would, if the track would still be usable (at least with AudSub Splitter, which is based on the same Vfr.py as audiocutter and calls MKVMerge, which gives out the errors when using a DGIndex extracted track and none with MeGUI extracted).
I think, generally, D2Witch would be beyond cool, if it could at least read out the delay, so one can work with it.
Mystery Keeper
9th January 2017, 20:27
I also request cutting and direct audio demuxing without conversion, as in DGIndex.
jackoneill
11th January 2017, 10:25
According to DGIndex: Wonky_Audio PID 110 DELAY -74ms.aac
Megui tells me: Track 2: AAC, 2.0 channels, 256kbps, 48kHz, -724ms (which it tries to shift then, but the outcome is doubtful)
And mediainfo tells me -392 ms. lol.
AzraelNewtype
12th January 2017, 05:04
Mediainfo, dgi, and tsmuxer have never agreed about audio delay for me from transport streams. It's kind of maddening.
Sangan
12th January 2017, 10:28
Well, before something with the audio tracks in the streams I use changed around October '16, DGindex was spot on for me. Which is, why I used to trust it. But right now, DGindex' interpretation of the audio track seems to be kind of bullshitty. It can't tell apart mp1/mp3/stereo/mono anymore. Seems to have troubles interpreting the headers.
Sangan
14th January 2017, 17:15
Anyone having a clue how to ad manually a delay in the audiocutter script?
#!/usr/bin/env python3
import vapoursynth as vs
import audiocutter
core = vs.get_core()
ts_file = "file.ts"
ts_in = core.d2v.Source(input='/Users/some/path/some/file.ts.d2v')
ac = audiocutter.AudioCutter()
vid = ac.split(ts_in, [(47813,48709)])
if __name__ == "__main__":
(Indent->) ac.cut_audio(ts_file + '_aud_ac.mka', video_source=ts_file)
Or is there a way at all? (py file of audiocutter: https://github.com/AzraelNewtype/audiocutter/blob/master/audiocutter.py )
I added the delay manually to the .aac file the audiocutter is supposed to search, I tried (name) DELAY -271ms.aac and (name) DELAY -271.aac If I interpret the script for the cutter right, it should detect the delay in the file name. It just doesn't.
fAy01
14th January 2017, 18:34
Anyone having a clue how to ad manually a delay in the audiocutter script?
Or is there a way at all? (py file of audiocutter: https://github.com/AzraelNewtype/audiocutter/blob/master/audiocutter.py )
I added the delay manually to the .aac file the audiocutter is supposed to search, I tried (name) DELAY -271ms.aac and (name) DELAY -271.aac If I interpret the script for the cutter right, it should detect the delay in the file name. It just doesn't.
use quotes, "whatever - DELAY -271.aac"
Sangan
14th January 2017, 19:06
I think, I put it wrong or not clearly... As I interpreted the cutter-script, it picks up the delay from the file name it is supposed to cut. The file name D2Witch generates is like "something.ts.d2v T110 stereo 240 kbps.aac" so I deducted I will have to insert "something.ts.d2v T110 stereo 240 kbps DELAY -271.aac" (or following the pattern DGIndex generated "something.ts.d2v T110 stereo 240 kbps DELAY -271ms.aac"
I cant just put "whatever - DELAY -271.aac" somewhere in my vpy script, I'll get errors without end saying definition or whatever is missing.
In the ac script, in the part below
def cut_audio(self, outfile, video_source=None, audio_source=None):
there is this bit:
delre = re.compile('DELAY ([-]?\d+)', flags=re.IGNORECASE)
ret = delre.search(afile)
delay = '{0}:{1}'.format(tid, ret.group(1)) if ret else None
final_cut = self.__cut_cmd
if delay:
final_cut += " --sync {}".format(delay)
What would I use (or can I use anything at all) to call or trigger this?
Edit: I didn't see anything concerning delay in the example script.
AzraelNewtype
16th January 2017, 06:53
I may not have tested that very thoroughly since I had to start demuxing audio via tsmuxer instead of dgi for a couple reasons (not least of which being that d2vsource is slower than l-smash source). There definitely isn't anything in the script to override that value though.
Selur
30th March 2017, 19:54
both:
"G:\Hybrid\vsfilters\SourceFilter\d2vSource\d2vwitch.exe" --output "H:\Temp\552bf3799f50de80782be5bd932be83e_491.d2v" "F:\TESTCL~1\DVDs\ELEPHA~1\VIDEO_TS"
and
"G:\Hybrid\vsfilters\SourceFilter\d2vSource\d2vwitch.exe" --output "H:\Temp\552bf3799f50de80782be5bd932be83e_491.d2v" "F:\TestClips&Co\DVDs\ElephantsDream\VIDEO_TS"
give me
Failed to open input file 'F:\TestClips&Co\DVDs\ElephantsDream\VIDEO_TS': fopen() failed: Permission denied
Using Vapoursynth 64bit R37 and d2vwitch v2. (same happens with v1)
Also starting the d2vwitch gui and pressing the 'Browse' or 'Add files' button causes a freeze here. Am I missing something? (d2vwitch.exe is alone in a folder, no other files there)
This didn't happen last time I used d2vwitch, but I got no clue what could have changed. (aside from me updating Vapoursynth)
disabling firewall and malwarebytes didn't help either,...
jackoneill
30th March 2017, 20:44
both:
"G:\Hybrid\vsfilters\SourceFilter\d2vSource\d2vwitch.exe" --output "H:\Temp\552bf3799f50de80782be5bd932be83e_491.d2v" "F:\TESTCL~1\DVDs\ELEPHA~1\VIDEO_TS"
and
"G:\Hybrid\vsfilters\SourceFilter\d2vSource\d2vwitch.exe" --output "H:\Temp\552bf3799f50de80782be5bd932be83e_491.d2v" "F:\TestClips&Co\DVDs\ElephantsDream\VIDEO_TS"
give me
Using Vapoursynth 64bit R37 and d2vwitch v2. (same happens with v1)
Also starting the d2vwitch gui and pressing the 'Browse' or 'Add files' button causes a freeze here. Am I missing something? (d2vwitch.exe is alone in a folder, no other files there)
This didn't happen last time I used d2vwitch, but I got no clue what could have changed. (aside from me updating Vapoursynth)
disabling firewall and malwarebytes didn't help either,...
"VIDEO_TS" sounds like a folder. You're supposed to pass the relevant VOB files. D2V Witch currently doesn't guess what files you want to open. It only opens those you pass explicitly, in the order you pass them. (This has always been the case.)
I don't know what the freeze is about. It freezes when you browse to that folder, not when you select the files and click "Open" or whatever, right?
Selur
31st March 2017, 03:42
It freezes directly when I press the 'Browse' or 'Add files' button. I don't get any file dialog.
"VIDEO_TS" sounds like a folder. You're supposed to pass the relevant VOB files.
Ahhh,... that was the problem. Thanks. :)
jackoneill
31st March 2017, 14:10
It freezes directly when I press the 'Browse' or 'Add files' button. I don't get any file dialog.
Ahhh,... that was the problem. Thanks. :)
http://savedonthe.net/download/1821/D2VWitch-fix-file-selector-win64.html
Does this one work?
Selur
31st March 2017, 16:48
Yes, both 'Add files' and 'Browse' now open without crashing.
jackoneill
15th April 2017, 21:58
A test version that might become v3:
http://savedonthe.net/download/1834/D2VWitch-d2vsource-h264-win32.html
http://savedonthe.net/download/1835/D2VWitch-d2vsource-h264-win64.html
The main attraction is H264 support in transport streams and elementary streams.
Test it, maybe, and let me know how it goes.
If you want to compile it:
https://github.com/dubhater/D2VWitch/tree/h264
https://github.com/dubhater/d2vsource
Selur
15th April 2017, 22:13
Is there any gain in using this instead over LSMASHSource or FFMS2, or is it 'just' an alternative?
(alternatives are always good :D, btw. would be nice if mpls files would also be supported :))
Frechdachs
16th April 2017, 12:50
Is there any gain in using this instead over LSMASHSource or FFMS2, or is it 'just' an alternative?
(alternatives are always good :D, btw. would be nice if mpls files would also be supported :))
Neither lsmash nor ffms2 are frame accurate for interlaced h264.
Test it, maybe, and let me know how it goes.
This is the output of the test script from your signature:
Clip has 55828 frames.
Hashing: 99%
Clip hashed.
Requested frame 1, got new frame with hash 92bec1c50ed47b951b3c61c1a07845aa.
Previous requests: 31256 18668 19099 7457 18422 40536 25822 22063 12993 15999 1
Requested frame 3, got new frame with hash 68dbd285aabc4411091783b4e1528ae4.
Previous requests: 48429 20110 51397 36508 49910 32760 21437 24375 7417 1782 3
Requested frame 2, got new frame with hash d81b72522a628d3c28daccbe3f525967.
Previous requests: 36580 18291 10236 40548 16399 19554 42655 40192 10424 50369 2
Test complete.
Worked very well on my test file except for the 2nd, 3rd and 4th frame. Maybe a broken file, I don't know. Those frames look alright in the preview, though.
It's an interlaced h264 transport stream. Both lsmash and ffms2 are completely broken on that one.
Selur
16th April 2017, 14:00
Got a sample d2vwitch.h264 (https://drive.google.com/drive/folders/0B_WxUS1XGCPAUTlILW54VThMTFU?usp=sharing) which the filter can't handle.
Works fine when using LWLibavSource, ffms2 fails on this source too.
Found another one I also uploaded (Trailer 3D_MVC).
jackoneill
16th April 2017, 16:41
Is there any gain in using this instead over LSMASHSource or FFMS2, or is it 'just' an alternative?
(alternatives are always good :D, btw. would be nice if mpls files would also be supported :))
No mpls for you. :(
Selur
16th April 2017, 16:48
Had to ask. :D
May be an option to load multiple files? ;) That would also help with DVD handling; I normally know the vobs/m2ts files, which belong to a specific playlist, and their order and it would help if they could be all indexed and opened in one go. :)
jackoneill
16th April 2017, 17:03
Had to ask. :D
May be an option to load multiple files? ;) That would also help with DVD handling; I normally know the vobs/m2ts files, which belong to a specific playlist, and their order and it would help if they could be all indexed and opened in one go. :)
You can do that with DVDs since v1. Technically you can do it with blurays too, but I just tried and random access doesn't work right. You get the wrong frames.
Selur
16th April 2017, 17:08
Lol, you are right about the DVD thing, I even used that a few times and totally forgot about it. :) Problem with m2ts files is that in a playlist the numbering doesn't have to follow a specific order so autoloading based on the file name would be a bad thing.
jackoneill
16th April 2017, 17:42
Lol, you are right about the DVD thing, I even used that a few times and totally forgot about it. :) Problem with m2ts files is that in a playlist the numbering doesn't have to follow a specific order so autoloading based on the file name would be a bad thing.
Good thing there is no autoloading, then!
New d2vsource decodes 9 and 10 bit h264 too (that d2vwitch.h264 mentioned above). New D2V Witch has two very small fixes. Git history was edited, sorry.
http://savedonthe.net/download/1836/D2VWitch-d2vsource-h264-win64.html
http://savedonthe.net/download/1837/D2VWitch-d2vsource-h264-win32.html
Selur
16th April 2017, 17:49
Thanks! I can confirm that d2vwitch.h264 can now be decoded without a problem. :)
Cu Selur
jackoneill
16th April 2017, 18:20
$ ffplay /tmp/Trailer\ 3D_MVC.mts
<stuff>
[h264 @ 0x7fa370089a40] sps_id 1 out of range
Failed to open file '/tmp/Trailer 3D_MVC.mts' or configure filtergraph
Maybe I need a newer ffmpeg (I have 3.2.2), but I don't feel like updating right now.
ffmpeg 3.3 doesn't decode it either.
Selur
16th April 2017, 18:52
Plays fine with Windows Media Player (filters installed), MPC-HC, MPlayer, but it seems like ffmpeg (ffms2 and LSmashSource) can't handle the file. :( (DGDecNV and DGDecIM can)
jackoneill
16th April 2017, 20:29
Plays fine with Windows Media Player (filters installed), MPC-HC, MPlayer, but it seems like ffmpeg (ffms2 and LSmashSource) can't handle the file. :( (DGDecNV and DGDecIM can)
ffmpeg from git snapshot works.
http://savedonthe.net/download/1838/D2VWitch-d2vsource-h264-win32.html
http://savedonthe.net/download/1839/D2VWitch-d2vsource-h264-win64.html
Selur
16th April 2017, 20:35
Sweat! Works fine! Thanks! :D
lansing
26th July 2018, 00:38
The gui version, when indexing to a existed d2v, there's no prompt warning about overwriting the existing file.
_Al_
22nd February 2019, 08:00
Is there any way to catch that printing progress (1% .... 56%... etc) for dv2witch command line using subprocess in Python, I have no luck to get it to stdout or stderr, or I cannot do it, something like this:
import threading
import subprocess
class Cmd(threading.Thread):
def __init__(self):
threading.Thread.__init__(self)
process = subprocess.Popen(
[d2vwitch, '--output', output, file],
stdout=subprocess.PIPE)
line = ''
for char in iter(lambda: process.stdout.read(1).decode('utf-8'), ''):
line +=char
if char == '\r':
print(line)
line = ''
file = 'C:/HDV TAPE 44/tape 44-2013_09_28-10_29_29.m2t'
d2vwitch = shutil.which('d2vwitch')
output = 'C:/temp/out.d2v'
command = Cmd()
command.start()
command.join()
no problem getting actual d2v, just that progress, I tried stdout, stderr or returncode, and it looks empty.
This is for windows but I tried it on linux and, the same, no luck.
_Al_
22nd February 2019, 20:33
oh, sorry, it is in stderr, it's ok
ChaosKing
28th March 2019, 12:55
I noticed that D2V Witch v2 freezed if I click on File->open video files. Drag and drop works <-- I always used this :D
Runing it via cmd or powershell works too but it looks like the program is still running because it "pauses" at the end with d2vwitch.exe --output abc.d2v VTS_01_CHAPTER_05_1.VOB or just d2vwitch.exe --help
My os: win10 x64 pro 1809
jackoneill
28th March 2019, 13:59
I noticed that D2V Witch v2 freezed if I click on File->open video files. Drag and drop works <-- I always used this :D
Runing it via cmd or powershell works too but it looks like the program is still running because it "pauses" at the end with d2vwitch.exe --output abc.d2v VTS_01_CHAPTER_05_1.VOB or just d2vwitch.exe --help
My os: win10 x64 pro 1809
I think the freezing of the graphical interface will be fixed in the next version, which will be out soon. (I started working on D2V Witch again last week.)
I'm not sure what to do about the pausing when you run it in cmd. It tries to be both a command line application and a graphical application, which is not supported in Windows.
ChaosKing
28th March 2019, 16:56
ok
One small thing: The button "Remove files" should be renamed to "Remove file" as it only removes one file :eek:
ChaosKing
30th March 2019, 01:24
Maybe you can also add some icons like in this fork https://github.com/emako/D2VWitch/releases
It's a nice improvement.
I also noticed that in this mod build there is no "thinking time" when adding a file. Adding a file in V2 always takes some seconds to show if the file is valid or not. In this mod it happens instantaneous.
p.s. No Open files bug :)
jackoneill
30th March 2019, 12:15
Maybe you can also add some icons like in this fork https://github.com/emako/D2VWitch/releases
It's a nice improvement.
I also noticed that in this mod build there is no "thinking time" when adding a file. Adding a file in V2 always takes some seconds to show if the file is valid or not. In this mod it happens instantaneous.
p.s. No Open files bug :)
I don't know how to explain the difference in "thinking time". It's definitely not supposed to take seconds after adding a file. Does it happen with any format, any size?
ChaosKing
30th March 2019, 13:04
Now that I tested it more, yes it seems to happen for all formats and sizes. For example h265.mp4 (18mb) takes 4-5 sec, the gui turns "red". Then I click on remove files and this takes also some sec to remove it. h264.mkv (20mb) or a valid vob file (500mb) is the same. The files are on a m2 ssd :D
It is only "fast" if I add a h265.mkv and a "avformat_open_input failed: invalid data found" appears.
EDIT:
Found your "v3" here https://forum.doom9.org/showthread.php?p=1803882#post1803882
It's the same thing. Drag&drop the file -> gui freezes for some sec -> file is valid and shows mpeg2 video-blah or turns red if invalid.
Edit2:
File->Open files is also working in v3
jackoneill
30th March 2019, 15:39
Now that I tested it more, yes it seems to happen for all formats and sizes. For example h265.mp4 (18mb) takes 4-5 sec, the gui turns "red". Then I click on remove files and this takes also some sec to remove it. h264.mkv (20mb) or a valid vob file (500mb) is the same. The files are on a m2 ssd :D
It is only "fast" if I add a h265.mkv and a "avformat_open_input failed: invalid data found" appears.
I can't reproduce this on a Windows 7 computer with a Pentium 4 CPU and spinning hard drive.
ChaosKing
1st April 2019, 12:00
I can't reproduce this on a Windows 7 computer with a Pentium 4 CPU and spinning hard drive.
Can I help somehow? With a debug build maybe?
jackoneill
1st April 2019, 16:30
Can I help somehow? With a debug build maybe?
Sure. This build will print some timings at the bottom of the window when you add or remove files:
http://savedonthe.net/download/2391/D2VWitch-thinking-time-win64.html
Note that this build is not suitable for other uses. It will crash if you don't use the graphical interface.
ChaosKing
1st April 2019, 16:51
With a VOB file (drag & drop):
[20190401 17:50:02] dropEvent: Getting to line 1308 took 0 ms
[20190401 17:50:02] dropEvent: Getting to line 1312 took 0 ms
[20190401 17:50:02] dropEvent: Getting to line 1316 took 0 ms
[20190401 17:50:02] dropEvent: Getting to line 1321 took 0 ms
[20190401 17:50:02] dropEvent: Getting to line 1323 took 15 ms
[20190401 17:50:02] dropEvent: Getting to line 1326 took 0 ms
[20190401 17:50:02] dropEvent: Getting to line 1328 took 0 ms
[20190401 17:50:02] dropEvent: Getting to line 1333 took 0 ms
[20190401 17:50:02] inputFilesUpdated: Getting to line 208 took 0 ms
[20190401 17:50:02] inputFilesUpdated: Getting to line 220 took 0 ms
[20190401 17:50:02] inputFilesUpdated: Getting to line 222 took 0 ms
[20190401 17:50:15] inputFilesUpdated: Getting to line 224 took 13653 ms
[20190401 17:50:15] inputFilesUpdated: Getting to line 231 took 0 ms
[20190401 17:50:15] inputFilesUpdated: Getting to line 235 took 0 ms
[20190401 17:50:15] inputFilesUpdated: Getting to line 239 took 0 ms
[20190401 17:50:15] inputFilesUpdated: Getting to line 242 took 0 ms
[20190401 17:50:15] inputFilesUpdated: Getting to line 244 took 0 ms
[20190401 17:50:15] inputFilesUpdated: Getting to line 246 took 0 ms
[20190401 17:50:15] inputFilesUpdated: Getting to line 249 took 0 ms
[20190401 17:50:15] inputFilesUpdated: Getting to line 251 took 0 ms
[20190401 17:50:15] inputFilesUpdated: Getting to line 253 took 0 ms
[20190401 17:50:15] inputFilesUpdated: Getting to line 256 took 0 ms
[20190401 17:50:15] inputFilesUpdated: Getting to line 258 took 0 ms
[20190401 17:50:15] inputFilesUpdated: Getting to line 261 took 0 ms
[20190401 17:50:15] inputFilesUpdated: Getting to line 263 took 0 ms
[20190401 17:50:15] inputFilesUpdated: Getting to line 265 took 0 ms
[20190401 17:50:15] inputFilesUpdated: Getting to line 267 took 0 ms
[20190401 17:50:15] inputFilesUpdated: Getting to line 269 took 0 ms
[20190401 17:50:15] inputFilesUpdated: Getting to line 271 took 0 ms
[20190401 17:50:15] inputFilesUpdated: Getting to line 273 took 0 ms
[20190401 17:50:15] inputFilesUpdated: Getting to line 275 took 0 ms
[20190401 17:50:15] inputFilesUpdated: Getting to line 277 took 0 ms
[20190401 17:50:15] inputFilesUpdated: Getting to line 284 took 0 ms
[20190401 17:50:15] dropEvent: Getting to line 1335 took 13653 ms
[20190401 17:50:15] dropEvent: Getting to line 1337 took 0 ms
[20190401 17:50:15] initFormat: Getting to line 56 took 0 ms
[20190401 17:50:15] initFormat: Getting to line 64 took 0 ms
[20190401 17:50:15] initFormat: Getting to line 70 took 0 ms
[20190401 17:50:15] initFormat: Getting to line 82 took 0 ms
[20190401 17:50:15] initFormat: Getting to line 94 took 0 ms
h265.mp4(drag & drop)
[20190401 17:51:57] dropEvent: Getting to line 1308 took 0 ms
[20190401 17:51:57] dropEvent: Getting to line 1312 took 0 ms
[20190401 17:51:57] dropEvent: Getting to line 1316 took 0 ms
[20190401 17:51:57] dropEvent: Getting to line 1321 took 0 ms
[20190401 17:51:57] dropEvent: Getting to line 1323 took 16 ms
[20190401 17:51:57] dropEvent: Getting to line 1326 took 0 ms
[20190401 17:51:57] dropEvent: Getting to line 1328 took 0 ms
[20190401 17:51:57] dropEvent: Getting to line 1333 took 0 ms
[20190401 17:51:57] inputFilesUpdated: Getting to line 208 took 0 ms
[20190401 17:51:57] inputFilesUpdated: Getting to line 220 took 31 ms
[20190401 17:51:57] inputFilesUpdated: Getting to line 222 took 0 ms
[20190401 17:52:23] inputFilesUpdated: Getting to line 224 took 25296 ms
[20190401 17:52:23] inputFilesUpdated: Getting to line 261 took 0 ms
[20190401 17:52:23] inputFilesUpdated: Getting to line 263 took 0 ms
[20190401 17:52:23] inputFilesUpdated: Getting to line 265 took 0 ms
[20190401 17:52:23] inputFilesUpdated: Getting to line 267 took 0 ms
[20190401 17:52:23] inputFilesUpdated: Getting to line 269 took 0 ms
[20190401 17:52:23] inputFilesUpdated: Getting to line 271 took 0 ms
[20190401 17:52:23] inputFilesUpdated: Getting to line 273 took 0 ms
[20190401 17:52:23] inputFilesUpdated: Getting to line 275 took 0 ms
[20190401 17:52:23] inputFilesUpdated: Getting to line 277 took 0 ms
[20190401 17:52:23] inputFilesUpdated: Getting to line 284 took 0 ms
[20190401 17:52:23] dropEvent: Getting to line 1335 took 25327 ms
[20190401 17:52:23] dropEvent: Getting to line 1337 took 0 ms
[20190401 17:52:23] initFormat: Getting to line 56 took 0 ms
[20190401 17:52:23] initFormat: Getting to line 64 took 0 ms
[20190401 17:52:23] initFormat: Getting to line 70 took 0 ms
[20190401 17:52:23] initFormat: Getting to line 82 took 15 ms
[20190401 17:52:23] initFormat: Getting to line 94 took 16 ms
Same VOB file via "Add files":
[20190401 17:53:40] Add files: Getting to line 585 took 6626 ms
[20190401 17:53:40] Add files: Getting to line 591 took 0 ms
[20190401 17:53:40] Add files: Getting to line 603 took 0 ms
[20190401 17:53:40] Add files: Getting to line 605 took 0 ms
[20190401 17:53:40] Add files: Getting to line 610 took 0 ms
[20190401 17:53:40] inputFilesUpdated: Getting to line 208 took 0 ms
[20190401 17:53:40] inputFilesUpdated: Getting to line 220 took 15 ms
[20190401 17:53:40] inputFilesUpdated: Getting to line 222 took 0 ms
[20190401 17:54:03] inputFilesUpdated: Getting to line 224 took 23248 ms
[20190401 17:54:03] inputFilesUpdated: Getting to line 231 took 0 ms
[20190401 17:54:03] inputFilesUpdated: Getting to line 235 took 0 ms
[20190401 17:54:03] inputFilesUpdated: Getting to line 239 took 0 ms
[20190401 17:54:03] inputFilesUpdated: Getting to line 242 took 0 ms
[20190401 17:54:03] inputFilesUpdated: Getting to line 244 took 0 ms
[20190401 17:54:03] inputFilesUpdated: Getting to line 246 took 0 ms
[20190401 17:54:03] inputFilesUpdated: Getting to line 249 took 0 ms
[20190401 17:54:03] inputFilesUpdated: Getting to line 251 took 0 ms
[20190401 17:54:03] inputFilesUpdated: Getting to line 253 took 0 ms
[20190401 17:54:03] inputFilesUpdated: Getting to line 256 took 0 ms
[20190401 17:54:03] inputFilesUpdated: Getting to line 258 took 0 ms
[20190401 17:54:03] inputFilesUpdated: Getting to line 261 took 0 ms
[20190401 17:54:03] inputFilesUpdated: Getting to line 263 took 0 ms
[20190401 17:54:03] inputFilesUpdated: Getting to line 265 took 0 ms
[20190401 17:54:03] inputFilesUpdated: Getting to line 267 took 0 ms
[20190401 17:54:03] inputFilesUpdated: Getting to line 269 took 0 ms
[20190401 17:54:03] inputFilesUpdated: Getting to line 271 took 0 ms
[20190401 17:54:03] inputFilesUpdated: Getting to line 273 took 0 ms
[20190401 17:54:03] inputFilesUpdated: Getting to line 275 took 0 ms
[20190401 17:54:03] inputFilesUpdated: Getting to line 277 took 0 ms
[20190401 17:54:03] inputFilesUpdated: Getting to line 284 took 0 ms
[20190401 17:54:03] Add files: Getting to line 613 took 23263 ms
[20190401 17:54:03] initFormat: Getting to line 56 took 0 ms
[20190401 17:54:03] initFormat: Getting to line 64 took 0 ms
[20190401 17:54:03] initFormat: Getting to line 70 took 0 ms
[20190401 17:54:03] initFormat: Getting to line 82 took 0 ms
[20190401 17:54:03] initFormat: Getting to line 94 took 15 ms
After I added the VOB file I clicked on "Use relative paths" and it also took very long. No log was generated.
And remove the vob file
[20190401 17:59:02] Remove files: Getting to line 622 took 0 ms
[20190401 17:59:02] Remove files: Getting to line 628 took 1 ms
[20190401 17:59:02] Remove files: Getting to line 631 took 0 ms
[20190401 17:59:02] Remove files: Getting to line 633 took 0 ms
[20190401 17:59:15] Remove files: Getting to line 638 took 13540 ms
[20190401 17:59:15] Remove files: Getting to line 642 took 0 ms
jackoneill
1st April 2019, 18:21
I guess it's the NTFS permission checking, which the Qt documentation did promise it would be slow.
You can verify with this build: http://savedonthe.net/download/2392/D2VWitch-thinking-time-win64.html
I added some new timing code, so please try a file before unchecking the "Slow permissions" box, and one after.
ChaosKing
1st April 2019, 19:22
[x] Slow perm. checking
[20190401 20:16:15] dropEvent: Getting to line 1339 took 0 ms
[20190401 20:16:15] dropEvent: Getting to line 1343 took 16 ms
[20190401 20:16:15] dropEvent: Getting to line 1347 took 0 ms
[20190401 20:16:15] dropEvent: Getting to line 1352 took 0 ms
[20190401 20:16:15] dropEvent: Getting to line 1354 took 0 ms
[20190401 20:16:15] dropEvent: Getting to line 1357 took 0 ms
[20190401 20:16:15] dropEvent: Getting to line 1359 took 0 ms
[20190401 20:16:15] dropEvent: Getting to line 1364 took 0 ms
[20190401 20:16:15] inputFilesUpdated: Getting to line 208 took 0 ms
[20190401 20:16:15] inputFilesUpdated: Getting to line 220 took 0 ms
[20190401 20:16:15] inputFilesUpdated: Getting to line 222 took 0 ms
[20190401 20:16:15] d2v_edit.textChanged: Getting to line 710 took 0 ms
[20190401 20:16:15] d2v_edit.textChanged: Getting to line 712 took 0 ms
[20190401 20:16:15] d2v_edit.textChanged: Getting to line 714 took 0 ms
[20190401 20:16:15] d2v_edit.textChanged: Getting to line 716 took 0 ms
[20190401 20:16:15] d2v_edit.textChanged: Getting to line 718 took 0 ms
[20190401 20:16:29] d2v_edit.textChanged: Getting to line 720 took 13585 ms
[20190401 20:16:29] d2v_edit.textChanged: Getting to line 722 took 0 ms
[20190401 20:16:29] d2v_edit.textChanged: Getting to line 724 took 0 ms
[20190401 20:16:29] d2v_edit.textChanged: Getting to line 726 took 0 ms
[20190401 20:16:29] d2v_edit.textChanged: Getting to line 728 took 0 ms
[20190401 20:16:29] inputFilesUpdated: Getting to line 224 took 13585 ms
[20190401 20:16:29] inputFilesUpdated: Getting to line 231 took 0 ms
[20190401 20:16:29] inputFilesUpdated: Getting to line 235 took 0 ms
[20190401 20:16:29] inputFilesUpdated: Getting to line 239 took 0 ms
[20190401 20:16:29] inputFilesUpdated: Getting to line 242 took 0 ms
[20190401 20:16:29] inputFilesUpdated: Getting to line 244 took 0 ms
[20190401 20:16:29] inputFilesUpdated: Getting to line 246 took 0 ms
[20190401 20:16:29] inputFilesUpdated: Getting to line 249 took 0 ms
[20190401 20:16:29] inputFilesUpdated: Getting to line 251 took 0 ms
[20190401 20:16:29] inputFilesUpdated: Getting to line 253 took 0 ms
[20190401 20:16:29] inputFilesUpdated: Getting to line 256 took 0 ms
[20190401 20:16:29] inputFilesUpdated: Getting to line 258 took 0 ms
[20190401 20:16:29] inputFilesUpdated: Getting to line 261 took 0 ms
[20190401 20:16:29] inputFilesUpdated: Getting to line 263 took 0 ms
[20190401 20:16:29] inputFilesUpdated: Getting to line 265 took 0 ms
[20190401 20:16:29] inputFilesUpdated: Getting to line 267 took 0 ms
[20190401 20:16:29] inputFilesUpdated: Getting to line 269 took 0 ms
[20190401 20:16:29] inputFilesUpdated: Getting to line 271 took 0 ms
[20190401 20:16:29] inputFilesUpdated: Getting to line 273 took 0 ms
[20190401 20:16:29] inputFilesUpdated: Getting to line 275 took 0 ms
[20190401 20:16:29] inputFilesUpdated: Getting to line 277 took 0 ms
[20190401 20:16:29] inputFilesUpdated: Getting to line 284 took 0 ms
[20190401 20:16:29] dropEvent: Getting to line 1366 took 13585 ms
[20190401 20:16:29] dropEvent: Getting to line 1368 took 0 ms
[20190401 20:16:29] initFormat: Getting to line 56 took 0 ms
[20190401 20:16:29] initFormat: Getting to line 64 took 0 ms
[20190401 20:16:29] initFormat: Getting to line 70 took 0 ms
[20190401 20:16:29] initFormat: Getting to line 82 took 0 ms
[20190401 20:16:29] initFormat: Getting to line 94 took 0 ms
[ ] Slow perm. checking
[20190401 20:17:54] dropEvent: Getting to line 1339 took 0 ms
[20190401 20:17:54] dropEvent: Getting to line 1343 took 0 ms
[20190401 20:17:54] dropEvent: Getting to line 1347 took 0 ms
[20190401 20:17:54] dropEvent: Getting to line 1352 took 0 ms
[20190401 20:17:54] dropEvent: Getting to line 1354 took 0 ms
[20190401 20:17:54] dropEvent: Getting to line 1357 took 0 ms
[20190401 20:17:54] dropEvent: Getting to line 1359 took 0 ms
[20190401 20:17:54] dropEvent: Getting to line 1364 took 0 ms
[20190401 20:17:54] inputFilesUpdated: Getting to line 208 took 0 ms
[20190401 20:17:54] inputFilesUpdated: Getting to line 220 took 16 ms
[20190401 20:17:54] inputFilesUpdated: Getting to line 222 took 0 ms
[20190401 20:17:54] d2v_edit.textChanged: Getting to line 710 took 0 ms
[20190401 20:17:54] d2v_edit.textChanged: Getting to line 712 took 0 ms
[20190401 20:17:54] d2v_edit.textChanged: Getting to line 714 took 0 ms
[20190401 20:17:54] d2v_edit.textChanged: Getting to line 716 took 0 ms
[20190401 20:17:54] d2v_edit.textChanged: Getting to line 718 took 0 ms
[20190401 20:17:54] d2v_edit.textChanged: Getting to line 720 took 0 ms
[20190401 20:17:54] d2v_edit.textChanged: Getting to line 722 took 0 ms
[20190401 20:17:54] d2v_edit.textChanged: Getting to line 724 took 0 ms
[20190401 20:17:54] d2v_edit.textChanged: Getting to line 726 took 0 ms
[20190401 20:17:54] d2v_edit.textChanged: Getting to line 728 took 0 ms
[20190401 20:17:54] inputFilesUpdated: Getting to line 224 took 0 ms
[20190401 20:17:54] inputFilesUpdated: Getting to line 231 took 0 ms
[20190401 20:17:54] inputFilesUpdated: Getting to line 235 took 0 ms
[20190401 20:17:54] inputFilesUpdated: Getting to line 239 took 0 ms
[20190401 20:17:54] inputFilesUpdated: Getting to line 242 took 0 ms
[20190401 20:17:54] inputFilesUpdated: Getting to line 244 took 0 ms
[20190401 20:17:54] inputFilesUpdated: Getting to line 246 took 0 ms
[20190401 20:17:54] inputFilesUpdated: Getting to line 249 took 0 ms
[20190401 20:17:54] inputFilesUpdated: Getting to line 251 took 0 ms
[20190401 20:17:54] inputFilesUpdated: Getting to line 253 took 0 ms
[20190401 20:17:54] inputFilesUpdated: Getting to line 256 took 0 ms
[20190401 20:17:54] inputFilesUpdated: Getting to line 258 took 0 ms
[20190401 20:17:54] inputFilesUpdated: Getting to line 261 took 0 ms
[20190401 20:17:54] inputFilesUpdated: Getting to line 263 took 0 ms
[20190401 20:17:54] inputFilesUpdated: Getting to line 265 took 0 ms
[20190401 20:17:54] inputFilesUpdated: Getting to line 267 took 0 ms
[20190401 20:17:54] inputFilesUpdated: Getting to line 269 took 0 ms
[20190401 20:17:54] inputFilesUpdated: Getting to line 271 took 0 ms
[20190401 20:17:54] inputFilesUpdated: Getting to line 273 took 0 ms
[20190401 20:17:54] inputFilesUpdated: Getting to line 275 took 0 ms
[20190401 20:17:54] inputFilesUpdated: Getting to line 277 took 0 ms
[20190401 20:17:54] inputFilesUpdated: Getting to line 284 took 0 ms
[20190401 20:17:54] dropEvent: Getting to line 1366 took 16 ms
[20190401 20:17:54] dropEvent: Getting to line 1368 took 0 ms
[20190401 20:17:54] initFormat: Getting to line 56 took 0 ms
[20190401 20:17:54] initFormat: Getting to line 64 took 0 ms
[20190401 20:17:54] initFormat: Getting to line 70 took 0 ms
[20190401 20:17:54] initFormat: Getting to line 82 took 0 ms
[20190401 20:17:54] initFormat: Getting to line 94 took 16 ms
I'll take the fast permission checking :D
jackoneill
4th April 2019, 19:53
It's not dead!
https://github.com/dubhater/D2VWitch/releases/tag/v3
Among other things, this release brings audio delay calculation, automatic indexing of vts_xx_y.vob sequences (in the command line), various bug fixes. The full list: changes.rst (https://github.com/dubhater/D2VWitch/blob/v3/changes.rst).
No H264 support because there are some problems to sort out. (Although no one has complained of any in a long time, so I assume it's mostly fine.) LSmash appears to work fine (https://forum.doom9.org/showthread.php?p=1870019#post1870019), anyway.
ChaosKing
4th April 2019, 20:30
Thx for the new release.
I only saw that d2v had h264 support while reading the previous posts.
Selur
6th April 2019, 21:05
I use it for H.264 and other stuff,.. hoping for support for it to come back. :)
jackoneill
6th April 2019, 21:52
I use it for H.264 and other stuff,.. hoping for support for it to come back. :)
Why do you prefer D2V Witch + the custom d2vsource over the alternatives? Just curious.
Selur
6th April 2019, 22:17
For transportstreams it was more reliable in the past then using FFVideoSource or Libavsource,.. (DGDecNV also was good, but that is only available on Windows)
It's more pythonic question or maybe not, not sure, I try it on windows and I have:
import subprocess
import threading
import shutil
def process(cmd):
subprocess.call(cmd)
d2vwitch = shutil.which('d2vwitch')
index_file = r'C:\.... path ...\test.d2v'
file = r'C:\... path ...\HDV.m2t'
cmd = [d2vwitch] + ['--output', index_file] + [file]
p = threading.Thread(target=process, args=(cmd,))
p.start()
p.join()
I'd just like to see cmd prompt to pop up with 1% ... 57%.... info as if it was run by simple command line in cmd prompt and then after indexing is done, that pop up would be canceled. If I type it manually in cmd prompt it works. But running it from Python script (vapoursynth script) besides creating d2v file that cmd prompt is not showing (with those readings). It also wait for process to be finished but as mentioned, no pop up can be seen.
Is there a way in Python together with d2vwitch.exe to make it work and show cmd prompt (like shell=False running subprocess in Python) wait for process to be done and then cancel that cmd window , script is continuing its further process?
For example ffmsindex.exe works with above example, having no problem.
ChaosKing
1st June 2019, 13:45
You could try it with os.system: return_code = os.system(d2vwitch.exe)
That works, thanks!
import subprocess
import threading
import shutil
def process(cmd):
os.system(cmd)
d2vwitch = shutil.which('d2vwitch')
index_file = r'C:\.... path ...\test.d2v'
file = r'C:\... path ...\HDV.m2t'
cmd = f'{d2vwitch} --output "{index_file}" "{file}"'
p = threading.Thread(target=process, args=(cmd,))
p.start()
p.join()
there is one bug I think, if I put quotes around d2vwitch path, it does not work, only if I type it manually into cmd prompt, but not with os.system within Python, for example:
cmd = f'"{d2vwitch}" --output "{index_file}" "{file}"'
does not work
only:
cmd = f'{d2vwitch} --output "{index_file}" "{file}"'
so it works only without quotes , so there must not be spaces in the d2vwitch path or d2vwitch should be in current directory
ok not sure what is going on, when I put two commands in a row, it works with quotes, so the whole thing:
import threading
import shutil
import os
import sys
def log_err():
err = str(sys.exc_info()[0])+'\n'
err += 'in line ' + str(sys.exc_info()[2].tb_lineno)+'\n'
err += str(sys.exc_info()[1])+'\n'
return err
def process(cmd):
try:
os.system(cmd)
except:
print(log_err())
d2vwitch = shutil.which('d2vwitch')
index_file= r'C:\... path ...\test.d2v'
file = r'C:\... path ...\HDV.m2t'
cmd = 'mode con: cols=30 lines=6 | ' + f'"{d2vwitch}" --output "{index_file}" "{file}"' #for windows to set cmd prompt size
p = threading.Thread(target=process, args=(cmd,))
p.start()
p.join()
print('done indexing: ', index_file)
just correcting a code above if someone tests that, that error catching is a nonsense there.
os.system returns error like ChaosKing posted, if it is 0, process went well, on linux it is a bit different because return suppose to be in 16bit with two 8 bit values, but just for Windows - and using a list slot to pass a return value from inside a thread.
import threading
import shutil
import os
from vapoursynth import core
def process(cmd, result):
return_code = os.system(cmd)
result[0]=return_code
d2vwitch = shutil.which('d2vwitch')
index_file= r'C:\... path ...\test.d2v'
file = r'C:\... path ...\HDV.m2t'
cmd = f'title d2vwitch creating: {index_file} | mode con: cols=60 lines=8 | "{d2vwitch}" --output "{index_file}" "{file}"'
results = [None]
p = threading.Thread(target=process, args=(cmd,results))
p.start()
p.join() #waits for thread to finish
#print(results[0])
if results[0]==0:
print('indexing went well')
clip = core.d2v.Source(index_file)
clip.set_output()
else:
print('indexing failed')
ChaosKing
3rd June 2019, 10:09
Hmm I get only1 value in Ubuntu (wsl) and a debian based distro with this:
user@live-pc:~$ python3 -c "import sys, os; r = os.system('-ls -a'); print('return: ', r)"
return: 0
user@live-pc:~$ python3 -c "import sys, os; r = os.system('ls -a-'); print('return: ', r)"
return: 512
You can also try adding os.WEXITSTATUS(os.system('ls -a'))
One value but packed as two 8bit numbers, https://stackoverflow.com/questions/6466711/what-is-the-return-value-of-os-system-in-python/6466753
I was not sure if return is not zero and still it could be ok, so maybe return >> 8 or use that os.WEXITSTATUS, I will set it up later to try.
for linux, Ubuntu 18.04 this seems to work, I hope it works on other unix systems, but that --disable-factory looks controversial:
os.system ('gnome-terminal --disable-factory -x .... command.....')
that would let terminal to pop up with % information while indexing, and python waits for it to finish, then terminal closes and script goes on.
Return code is still zero if terminal is canceled by user so checking if file exists and it is not empty:
import threading
import shutil
import os
from vapoursynth import core
def process(cmd):
os.system(cmd)
d2vwitch = shutil.which('d2vwitch')
index_file = '/home/your user name/ ... /test.d2v'
file = '/home/your user name/ ... /HDV.m2t'
cmd = 'gnome-terminal --disable-factory --hide-menubar --geometry=90x10 '
cmd += f' --title="d2vwitch creating: {index_file}" '
cmd += f' -x "{d2vwitch}" --output "{index_file}" "{file}"'
p = threading.Thread(target=process, args=(cmd,))
p.start()
p.join()
if not (os.path.isfile(index_file) and os.path.getsize(index_file) > 0):
print('indexing failed')
raise FileNotFoundError("Index file was not created or process was canceled")
clip = core.d2v.Source(index_file)
clip.set_output()
sorry I'm back again about d2vwitch output , live readings about continuing progress :-)
using code from this input https://forum.doom9.org/showthread.php?p=1866410#post1866410 that worked indeed, thru stderr, but it looks like it does not work under windows , linux only, reading live output from subprocess.Popen. Do I suppose to use dgindex under windows, or do I do something wrong?
or this is easier code, again, it works on linux only:
import threading
import subprocess
class Cmd(threading.Thread):
def __init__(self):
threading.Thread.__init__(self)
process = subprocess.Popen(
[d2vwitch, '--output', output, file],
stderr=subprocess.PIPE,
universal_newlines=True)
for line in process.stderr:
print(line)
file = '09_28-10_29_29.m2t'
d2vwitch = shutil.which('d2vwitch')
output = 'out.d2v'
command = Cmd()
command.start()
command.join()
lansing
26th July 2019, 09:36
There's some difference between the default setting for input color range between dgindex and d2v witch, dgindex said to use "pc range" generally while d2v witch said videos are assumed to have limited range. I'm kind of confused.
jackoneill
26th July 2019, 17:00
There's some difference between the default setting for input color range between dgindex and d2v witch, dgindex said to use "pc range" generally while d2v witch said videos are assumed to have limited range. I'm kind of confused.
The setting DGIndex calls "pc range" will have the same effect as the setting that D2V Witch calls "limited range".
In DGIndex the range setting refers to the range of the output video after conversion to RGB. (This must mean that it assumes all input videos will have limited range YUV.)
From the DGIndex manual:
PC scale - Map output RGB to full range: YUV [16, 235(Y)/240(UV)] -> RGB [0, 255]
TV scale - Map output RGB to clipped range: YUV [16, 235(Y)/240(UV)] -> RGB [16, 235]
lansing
26th July 2019, 19:07
So all dvd source should be using "tv range" in d2v witch and "pc range" in dgindex? But what happen if my source is HDTV? Then it will be "pc range" in d2v witch and dgindex not applicable?
jackoneill
26th July 2019, 22:29
So all dvd source should be using "tv range" in d2v witch and "pc range" in dgindex? But what happen if my source is HDTV? Then it will be "pc range" in d2v witch and dgindex not applicable?
I'm pretty sure HDTV is usually limited range as well, just like DVDs. This is just an assumption, though.
If you do encounter a video with full range YUV, you'll need to use the "full range" option in D2V Witch and the "TV range" option in DGIndex.
Note that the range you pick doesn't matter at all in Avisynth. In VapourSynth it only tells d2vsource what value to give the _ColorRange (http://www.vapoursynth.com/doc/apireference.html#reserved-frame-properties) frame property, and you can always override that in the script with SetFrameProp.
_Al_
27th July 2019, 00:47
limited to full can be changed either manually in d2v file:
line is YUVRGB_Scale=1 or YUVRGB_Scale=0
I think it is properly named, it matters if you convert to RGB (preview on screen).
If you just encode to x264, it does not matter.
d2vfile:
DGIndexProjectFile16
1
D:\path\tape 34-2013_12_25-09_03_53.m2t
Stream_Type=2
MPEG2_Transport_PID=810,814,0
Transport_Packet_Size=188
MPEG_Type=2
iDCT_Algorithm=6
YUVRGB_Scale=1
Luminance_Filter=0,0
Clipping=0,0,0,0
.
.
, or programmatically as well, d2v does not need to be indexed again, if you want to keep those d2v files with proper color range to be identified for RGB conversion,
def correct_byte_for_range(d2v_path, input_range):
log = ''
if input_range == 'full': input_range_number = '0'
else: input_range_number = '1'
'''find a line with 'YUVRGB_Scale' in d2v file and change byte for YUVRGB_Scale line to '1' or '0' if needed '''
with open(d2v_path, 'r+') as f:
offset = 0
try:
for line in f:
if line.strip().startswith('YUVRGB_Scale'):
break
offset += len(line)
if offset:
f.seek(offset+13) #'YUVRGB_Scale=0 or 'YUVRGB_Scale=1'
_range = f.read(1)
if _range != input_range_number:
f.seek(0)
f.seek(offset)
f.write(f'YUVRGB_Scale={input_range_number}')
f.close()
log += f"correcting input range byte in d2v file to '{input_range_number}' - '{input_range}'\n"
except:
raise TypeError("Not dv2 index file or not compatible\n"
"correcting input_range byte failed")
return log
lansing
27th July 2019, 01:30
Okay correct me if I get it wrong, so color range is just a flag to tell vs editor to display the right levels on preview, when we're encoding to x264, x264 is just going to ignore that flag and assumed everything to be tv range by default?
_Al_
27th July 2019, 02:16
It has no meaning for x264, x264 uses YUV values that are in your video
but it is used for YUV to RGB conversion
previewing video (and converting to RGB) is a tricky business, it can fool you thinking you have different video than you really have :-)
jackoneill
27th July 2019, 12:12
Okay correct me if I get it wrong, so color range is just a flag to tell vs editor to display the right levels on preview, when we're encoding to x264, x264 is just going to ignore that flag and assumed everything to be tv range by default?
That's mostly right.
If you're piping the video to x264, the flag gets lost and x264 doesn't know anything about the range.
If you're using x264 through a copy of ffmpeg that can open VapourSynth scripts directly, it's possible that the flag makes it to x264.
In any case, x264 only cares about the range because it can mark the video it produces with a flag that tells video players how to convert the encoded video to RGB. x264 has a command line parameter for this called "--range". (It also has parameters for the matrix, primaries, transfer, chroma location, etc.) If you don't use the parameter, x264 will not mark the video in any way and video players will just have to guess. They most likely guess TV range.
Jukus
14th November 2019, 17:59
When I try to use demux, I get crash to desktop, the empty (0 byte) index file and video in the m2v container.
When I run in the terminal, I get the messages:
kf5.kio.core: We got some errors while running testparm "Load smb config files from /etc/samba/smb.conf\nError loading services.\n"
kf5.kio.core: We got some errors while running 'net usershare info'
kf5.kio.core: "Can't load /etc/samba/smb.conf - run testparm to debug it\n"
qt.qpa.xcb: QXcbConnection: XCB error: 3 (BadWindow), sequence: 11792, resource id: 37058093, major code: 40 (TranslateCoords), minor code: 0
Segmentation error (memory stack flushed to disk)
Installed from here:
https://aur.archlinux.org/packages/d2vwitch-git/
Still would like support mkv.
jackoneill
30th November 2019, 15:46
When I try to use demux, I get crash to desktop, the empty (0 byte) index file and video in the m2v container.
When I run in the terminal, I get the messages:
kf5.kio.core: We got some errors while running testparm "Load smb config files from /etc/samba/smb.conf\nError loading services.\n"
kf5.kio.core: We got some errors while running 'net usershare info'
kf5.kio.core: "Can't load /etc/samba/smb.conf - run testparm to debug it\n"
qt.qpa.xcb: QXcbConnection: XCB error: 3 (BadWindow), sequence: 11792, resource id: 37058093, major code: 40 (TranslateCoords), minor code: 0
Segmentation error (memory stack flushed to disk)
Installed from here:
https://aur.archlinux.org/packages/d2vwitch-git/
Still would like support mkv.
Thanks for the report. It's fixed now.
Jukus
30th November 2019, 20:54
Thanks for the report. It's fixed now.
Thanks.
Does GUI demux works only without audio, should it be?
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
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.