View Full Version : How to read a d2v file
real.finder
19th April 2022, 20:23
CD2VPropFix
dgindex already has fix option that on by default
https://i.postimg.cc/1z54Kw8Y/Screenshot-2022-04-19-222331.png (https://postimages.org/)
Ceppo
19th April 2022, 21:13
The name mislead you, run it and use PropShow() :)
For TFF, I mean that we don't know if it is TFF or BFF if Field = 0. And on the other forum the author said that you need both flags for the job. And more we have the better :)
real.finder
19th April 2022, 21:25
The name mislead you, run it and use PropShow() :)
I see, but why almost all frames are PureInterlaced?
For TFF, I mean that we don't know if it is TFF or BFF if Field = 0. And on the other forum the author said that you need both flags for the job. And more we have the better :)
maybe the new RFF property can be set to either 0 which mean no RFF or 1 which mean RFF with TFF or 2 which mean RFF with no TFF, edit: or 1 which mean RFF with no TFF or 2 which mean RFF with TFF
Ceppo
20th April 2022, 11:16
I see, but why almost all frames are PureInterlaced?
If all frames of the cycle are flagged with fieldbased > 0, the cycle is pure interlaced. Still you need the iiiii pattern to get a 60i. Otherwise is uuuuu.
If you are using my pokemon source that is, if not please share the source.
maybe the new RFF property can be set to either 0 which mean no RFF or 1 which mean RFF with TFF or 2 which mean RFF with no TFF, edit: or 1 which mean RFF with no TFF or 2 which mean RFF with TFF
Either we do 3210 flag as it is meant to be read or we get them both separate. I prefer the latter.
Ceppo
20th April 2022, 18:27
//
Fix'd, I replaced get line with ifile >> line; go figures how getline works with that much amount of data :)
Ceppo
21st April 2022, 18:57
@real.finder
any luck with the new d2vsource? I don't know if it is my source but I get strange flags.
real.finder
21st April 2022, 22:10
@real.finder
any luck with the new d2vsource? I don't know if it is my source but I get strange flags.
how strange?
Ceppo
22nd April 2022, 16:52
Like two consecutive "3" and such which don't make any sense :(
real.finder
22nd April 2022, 18:37
Like two consecutive "3" and such which don't make any sense :(
maybe ask dg for help? http://rationalqm.us/board/viewtopic.php?f=7&t=1157&p=15628#p15628 I think he may be interested also in adding these frame properties to dgsource
Ceppo
22nd April 2022, 19:39
He already got the skill to do it if he wanted. He doesn't need a nub help (me).
Also, I think the problem is if we honor the pulldown the flags get confused since in the source there are 4 frames, if there are 2 RFF flags 2 fields get repeated and you get the fifth frame and you get your 29.970 telecined source.
real.finder
22nd April 2022, 20:24
I don't think he cares. He already got the skill to do it if he wanted. He doesn't need a nub help (me).
I didn't mean you help him but he help you :)
I mention dgsource since no one but him can update it since it closed-source, also as incentivize for him to help you more and make it common (standard) so other plugins will take the same path
Also, I think the problem is if we honor the pulldown the flags get confused since in the source there are 4 frames, if there are 2 RFF flags 2 fields get repeated and you get the fifth frame and you get your 29.970 telecined source.
this is not a problem rather it is the normal case, maybe you can take some ideas from tfm?
real.finder
22nd April 2022, 22:34
ok I did try play with it, according to my understanding of http://rationalqm.us/board/viewtopic.php?p=15627&sid=efe069d7b13d400d15d9e4d4367f6223#p15627
this should do it
D = DoubleWeave()
M = CTelecine()
Q = M.CPostProcessing()
ScriptClip("""
ATOP = PropGetInt("_EncodedFrameTop")
ABOT = PropGetInt("_EncodedFrameBottom")
FIELD = PropGetInt("_FieldBased")
rff = PropGetInt("_RepeatedFirstFrame", offset=-1)
tff = PropGetInt("_TopFieldFirst", offset=-1)
FIELD != 0 ? Q.Subtitle("Not Soft",400) : \
ATOP != ABOT ? D.DuplicateFrame(0).SelectEven().Subtitle("Soft Match",400) : last.Subtitle("No Match",400)
FIELD == 0 && IsCombedTIVTC() ? M.Subtitle("Bad Soft",400) : last
rff == 1 && tff == 1 && FIELD == 0 ? propSet("_ToDecimate", 1) : propSet("_ToDecimate", 0)
""")
but d2vsource _RepeatedFirstFrame (typo (https://github.com/Asd-g/MPEG2DecPlus/issues/9#issuecomment-1105880684)) and _TopFieldFirst seems need more work to do it :) since it kinda random I think...
btw, DG seems care about this, just try and ask him in his forum, he told me he will not post in doom9 anymore
Ceppo
23rd April 2022, 14:32
@real.finder
The true course of action is to use ignore pulldown and detect VFR and do field matching/deinterlacing for post telecine editing.
The last D2V source, with ff=true, seems to do the job, I will make a plugin to read those and see if I can detect correctly VFR with the available props. Then I will post in his forum to see if he wants to update the DG family (in the case I'm successful).
gonca
23rd April 2022, 17:12
Then I will post in his forum to see if he wants to update the DG family (in the case I'm successful).
I think he is already aware, if you check
Ceppo
23rd April 2022, 17:44
Thanks, I didn't check. He will probably do a better job than me.
gonca
23rd April 2022, 20:57
You should keep working on your plug in
I am sure that each will have its advantages
And he is still asking for feedback
Ceppo
24th April 2022, 15:02
I run into a problem, I'm unable to get an accurate timestamp, and I'm always off of a few seconds. The problem is how to handle the following cases:
3 28
0 29
1 30
2 31
3 32
0 33
1 34
2 35
3 36
0 37
1 38
2 39
3 40
0 41
1 42
2 43
3 44
0 45
1 46
2 47
3 48
0 49
1 50
2 51
2 52
2 53
2 54
3 55
0 56
0 57
1 58
2 59
3 60
0 61
1 62
2 63
3 64
So, since I have 9001 things to do at the same time, I can't enter zen mode to figure out how to handle those cases, if I just 29.970 them the video gets shorter, if I ignore them it gets longer, someone has an idea? The whole file https://www.mediafire.com/file/b3t1qzl5hoxsmno/CD2VFR.txt/file
Ceppo
25th April 2022, 01:47
I woke up to smoke and I got it in 5 minutes. Nailed it! :D
I got what I wanted thanks everyone for the help :)
real.finder
26th April 2022, 18:13
I woke up to smoke and I got it in 5 minutes. Nailed it! :D
I got what I wanted thanks everyone for the help :)
can we got the plugin to test with?
Ceppo
26th April 2022, 19:03
I actually found a better way. You don't even need DGIndex.
ffmpeg.exe -i "concat:VTS_01_1.VOB|VTS_01_2.VOB|VTS_01_3.VOB|VTS_01_4.VOB" -c copy combined.m2v
Merge the vob files into a m2v.
Then:
ffvideosource("combined.m2v",timecodes="vfr.txt")
The m2v file actually has the timecode file saved into the stream. I noticed it with mediainfo. I guessed it was a timecode and it was.
ffvideosource is x2 faster than d2v import plugins, but has worst seeking if you jump to random frames. The encoder will call them linearly so this is not an issue.
real.finder
26th April 2022, 19:41
but has worst seeking if you jump to random frames. The encoder will call them linearly so this is not an issue.
it is issue, if you search in doom9 you will see how bad it is, especially since we don't use the encoder alone as we use some filters and many filters are Temporal so it need frames from earlier and later
if you don't like DGIndex then you have https://github.com/dubhater/D2VWitch
Ceppo
26th April 2022, 19:44
Well you get the timecode with ffvideosource and then you encode it D2V source. I used CQTGMC with ffvideosource which calls 7 frames for frames and I had no issue at all.
real.finder
26th April 2022, 19:51
even so, don't forget we may use trim! even ffvideosource Developer (myrsloik) would not recommend this, and if you care for the speed it's from new MPEG2 decoder that use multi threads
so with D2VWitch and https://github.com/dwbuiten/d2vsource you should get same speed or even faster since avs d2vsource still use old MPEG2 decoder that single thread
Ceppo
26th April 2022, 21:44
I see, I will give it a try then :)
real.finder
27th April 2022, 00:47
I see, I will give it a try then :)
also it bad since we need to cut the "vfr.txt" if we did trim, also it will have the same problems of post telecine editing (https://github.com/Asd-g/MPEG2DecPlus/issues/9#issuecomment-1107638503), so what the point aside from unneeded speed (MPEG2 decode already so fast even in very old cpu)?
Ceppo
27th April 2022, 02:56
also it bad since we need to cut the "vfr.txt" if we did trim,
That's why python exists, to do that kind of things, it's just a frame shift, I don't think you are going to cut in the middle, and even so it's still possible to script it :)
And about speed, well maybe is unneeded, but it's still an alternative.
real.finder
27th April 2022, 03:08
That's why python exists, to do that kind of things, it's just a frame shift, I don't think you are going to cut in the middle, and even so it's still possible to script it :)
And about speed, well maybe is unneeded, but it's still an alternative.
I know that we can cut it (I did in avspmod macro) but that old classic avs way
edit:
I don't think you are going to cut in the middle
there are cases that need cut in the middle :)
Zetti
30th April 2022, 13:48
DG have released a test release with flags:
http://rationalqm.us/board/viewtopic.php?p=15680#p15680
Katie Boundary
9th May 2022, 13:11
"ignore" should not be used anyway
That's not quite accurate. "Ignore" is a great diagnostic tool. It's also functionally identical to "Honor" if you're dealing with 100% pure NTSC content, and it can be paired with AssumeFPS(24000,1001) if you're dealing with 100% film content. It's also useful if sync with the original audio isn't necessary and you just need raw short clips for music videos, fake trailers, et cetera.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.