Log in

View Full Version : Partly jerky video


Amit
19th August 2005, 12:32
Hi,

I am trying to convert a Hindi NTSC R1 movie using DIF4U v1.4.0, NuMenu4U v2.0.21, Scenaid v1.7.05 with Scenarist v2.7.

I demuxed the movie by PGC in the 1st attempt and the final movie has partly jerky video as if for about 30 minutes in the movie the field order went bad.

I then tried to scap that encode and started from the begining with demux by CELLID. The movie only has 1 VOBID and 31 CELLIDs. While demuxing DIF4U got crashed and I don't even see a log file. I do have all the files in the folder, I think but I am not sure.

Can someone help me with this problem? When I search this forum I found that DIF4U does not demux by CELLID properly in Version 1.4.0. Can I still demux by PGC and fix this jerky video problem using some kind of AVI Synth script? Or is there any method I can use to fix this problem that you can think off will work?

Thanks in advance,
-Amit

Zeul
19th August 2005, 17:52
If you can find the start and end frame# of the jerky video - sounds like a field order switch - then yes, you can add something into the avs scripts to swap the field order for the specified frame range only.
You could also try demuxing by vobid - it may well be just one vobid that is switched.

Amit
19th August 2005, 23:22
Zeul,

The movie is 100% NTSC i.e. true interlaced. As I said earlier, the movie has just ONE VOBID. I tried demuxing by CELLID but it crashed the DIF4U application.

Can someone provide me with an AVISYNTH script that can detect the field order and change the field order of certain frames?

-Amit

Trahald
21st August 2005, 16:54
i might defer to someone such as scharfis brain

Amit
21st August 2005, 23:35
Trahald,

i might defer to someone such as scharfis brain

Who is Scharifs?

While I was waiting for someone to respond to my problem, I started the whole process from the begining using the DIF4U defaults. DIF4U created 1 BIG file for the VTS movie. I than ran the fieldorder.exe on the M2V file created by DIF4U for all the frames instead of just first 1000 frames. Here's the output from the file written by the fieldorder program:

FIELDORDER - v0.03b, by Hard Code.

SOURCE = D:\Bunty_Aur_Bubly\VTS02\VTS__02_P01.I-TFF.16~9_1.M2V

- Reading up to frame 294183.

Field Order = ODD/TOP/A
TFF = 1 BFF = 0 RFF = 0
TFF = 2 BFF = 0 RFF = 0
TFF = 3 BFF = 0 RFF = 0
TFF = 4 BFF = 0 RFF = 0
.................................
.................................
.................................
TFF = 1097 BFF = 0 RFF = 0
TFF = 1098 BFF = 0 RFF = 0
TFF = 1098 BFF = 1 RFF = 0
TFF = 1099 BFF = 1 RFF = 0
TFF = 1100 BFF = 1 RFF = 1
TFF = 1100 BFF = 2 RFF = 1
TFF = 1100 BFF = 3 RFF = 1
TFF = 1100 BFF = 4 RFF = 1
TFF = 1100 BFF = 5 RFF = 1
.................................
.................................
.................................
Total Frames = 294180

Total TFF = 178442
Total BFF = 115738
Total RFF = 22

Analyzing...

.................................
.................................
.................................

Total Odd / Even = 230805 / 63375 = Odd/Top/A dominant and 0.01% progressive

Time taken = 1952 seconds...

Does the above output makes any sense to someone? The frames keep switching between TFF to BFF and everytime this switch happens the RFF value increases by 1.

Here's the AVISynth I am using:

import("C:\Program Files\DoItFast4U\new.avs\addaudio.avs")
LoadPlugin("C:\Program Files\DoItFast4U\new.avs\mpeg2dec3.dll")
Mpeg2Source("VTS__02_P01.I-TFF.16~9_1.d2v",idct=0)
ConvertToYUY2(interlaced=true)
AddAudio()

I am trying to keep the movie interlaced so that PANS don't stutter. Keeping movie interlaced shows smoother pan.

DIF4U detect the movie as HYBRID and wants to use the following AVISynth:

import("C:\Program Files\DoItFast4U\new.avs\addaudio.avs")
LoadPlugin("C:\Program Files\DoItFast4U\new.avs\mpeg2dec3.dll")
Mpeg2Source("VTS__02_P01.I-TFF.16~9_1.d2v",idct=0)
LoadPlugin("C:\Program Files\DoItFast4U\new.avs\decomb.dll")
Telecide()
Decimate(mode=1,threshold=3)
ConvertToYUY2(interlaced=true)
AddAudio()

Thanks in advance,
-Amit

Amit
21st August 2005, 23:57
As per the guide at http://www.doom9.org/index.html?/decomb.htm, I ran the following AVISynth script on the portion that stutters:

import("C:\Program Files\DoItFast4U\new.avs\addaudio.avs")
LoadPlugin("C:\Program Files\DoItFast4U\new.avs\mpeg2dec3.dll")
Mpeg2Source("VTS__02_P01.I-TFF.16~9_1.d2v",idct=0)
AssumeTFF().SeparateFields()
ConvertToYUY2(interlaced=true)
AddAudio()

The movie stutters. SO I switched the fields

import("C:\Program Files\DoItFast4U\new.avs\addaudio.avs")
LoadPlugin("C:\Program Files\DoItFast4U\new.avs\mpeg2dec3.dll")
Mpeg2Source("VTS__02_P01.I-TFF.16~9_1.d2v",idct=0)
AssumeBFF().SeparateFields()
ConvertToYUY2(interlaced=true)
AddAudio()

AND the movie still stutters on the same frames. Now, I am completely confused. What's the field order? Its neither Top nor Bottom!

-Amit

Zeul
22nd August 2005, 00:41
Not sure why DIF picked Hybrid but that is wrong for sure. If you can determine where the field order changes then you could try adding
trim( xx, xx) to the avs file, and encode in 3 parts - obviously setting the correct field order for each part,then concatenating them.

Edit:
After doing some reading myself, looks like ApplyRange would do the trick
http://www.avisynth.org/Animate

Also do a search for this in the Avisynth forum - there are a lot of posts about this very thing.

Amit
22nd August 2005, 00:56
Zeul,

The field order changes 22 times in this movie nut I only have problem in just 1 section. When I encode the movie with TFF, the movie plays fine even for the sections where the fieldorder is reversed i.e. BFF. At just one section, where neither TFF nor BFF plays fine in AVISynth player using the test AVISynth given in my last post, the encode is bad.

I can probably use DVD Shrink or something like that for just this one movie but I would like to know what is the problem? I think the RFF flags are also playing some role. I just don't know what kind of role they are playing. The RFF flag value increments by 1 everytime the field order is changed.

-Amit

Trahald
22nd August 2005, 02:48
can you post your .d2v.. and can you make a dgindex .d2v and post it as well?

and if you could make a couple mbs available that would be cool.. you can email it to wewk584 at users.sourceforge.net if you dont have hosting available.. id like to take a look. if you can cut it around the switch spot it would be the best (you can cut video with dgindex if you dont have a preferred editor) just select the part you want and hit demux video

Amit
22nd August 2005, 04:25
@Trahald,

You can get the ZIP file from the link given below. Its ~10MB in size.

EDIT: The link to the ZIP file has been removed.

The ZIP file has the D2V file created by DVD2AVI for the complete movie as well as DGIndex file for the complete movie. The DGIndex D2V file is in the DGIndex folder. Inside the DGIndex folder is a folder called CLIP which has a D2V file created by DGIndex for the associated clip. I used DGIndex to create the clip. The clip will start with an actor in yellow tint. This part encodes correctly. Then the movie shows a rotating newspaper followed by two people talking in front of Taj Mahel with lot of crowd. As soon as this rotating newspaper is shown, the encoded file starts to stutter. I checked the D2V file created by DGIndex and the field order is not changing atleast at this point but the encoded video is bad.

I don't know how to find out the frames at which the field order is changing. All I can say is that even though the field order is changing back and forth the movie gets encoded properly, may be because of RFF flags.

I have emailed you the file created by the fieldorder.exe (for the complete movie) at the email address provided by you. I though that might help you debug this probelm.

Thanks for looking into this problem.

-Amit

Trahald
22nd August 2005, 19:00
well. you are right about the rff.. normally rffs are only used in progressive so it doesnt have much effect except adding 1/2 a frame. in interlace its actually changing the field order decoding wise.. i tested something to create the issue and it worked.. meaning i edited the .d2v and changed one of the 2's into a 3 (2 == tff/norff and 3 == tff/withrff) and past my edit the field order 'appeared' to reverse (during playback the flags written to the .d2v file are used for this info not the flags in the file) i tested with the separatefields() avs test but without using the assume part which undoes the fake switch. so anyways.. im hoping the opposite will work.. i attached your original .d2v with changes.. see if it works any better...

heres an example of what i did.. if the original read

0 0 0 0 0 2 2 2 2 basically 5 bffs and 4 tff frames.. i changed it to

0 0 0 0 1 2 2 2 2 4 bffs 1 bff/rff and 4 tff which effectively makes it all the same field order decode wise

i changed it in 4 spots lba lines 1b7b29 20f478 26d7d1 and 31689e(which is like 20 frames from the end prolly credits).. assuming all 4 needed fixing.. if it works better but still has a bad spot then maybe they all didnt need fixing.. you can undo them one at a time and test the playback

that video file is very unusual and not something you will often see...

heres the new .d2v

Amit
22nd August 2005, 21:52
@Trahald,

Thanks for looking into this. Right now I am in my office. As soon as I get back home, I will give it a try.

As far as the video stream being unusal, if this can be detected in fixed in the expected new release of DIF4U, I will be the most happy person. The company who makes these DVDs is the largest content provider with 70% market share in Hindi (Indian) movies. They keep trying things make our life difficult. And if they find that this works, I am expecting all new releases from them having the same video stream.

Anyway, I will let you know in couple of hours.

-Amit

Amit
24th August 2005, 04:04
@Trahald,

You are great. It worked. The whole movie is encoded properly. If you don't mind me asking, can you tell me how did you figure out that you needed to change those value at those places? The reason I am asking is so that if this happend again, I can do it on my own instead of giving you the trouble.

Also I want to know did DGMPGDec created the correct D2V file? If not, can you tell the author to look into this thread and if possible fix the program to handle this kind of movies specially now that v1.4.8 of DIF4U will be supporting DGMPGDec.

Thanks a lot for your help,
-Amit

@Zeul,

On this same movie using NuMenu4u v2.0.21 if I reencode the menu using a Q of 50 with 4 Passes and 2000 Avg Bitrate for CCE I get the encoded menu VTS as ~312MB (Original is ~640MB) but if I choose Q of 60 everything else same as the pevious encode the encoded menu VTS is now ~900MB.

Although I was able to convert this movie after great help from Trahald, I though I should let you know about this peculiar case. I always thought that increasing the Q reduces the quality and hence brings the size down instead of making the size bigger than original!

Just in case you want me to run any kind of tests on this movie, please respond in this thread.

Thanks
-Amit

Guest
24th August 2005, 04:44
LOL. :)

Trahald has invented a manual way of doing what my original tool called Fix D2V does! In DGIndex, make the D2V and then use Tools/Fix D2V to automatically correct illegal transitions in the D2V file. Then use the fixed D2V instead of the original.

(BTW, the clip you uploaded has no issues. All I see is some field blending, but there are no field order inversions in that clip. It would prevent people from wasting their time if you ensured that your sample clips actually showed the problem.)

Here is the log of fixes made on your D2V file:

D2V Fix Output

Illegal transition: 0 -> 2
d00 5 0 3688453512 0 0 b0 b0 90 b0 b0 a0 b0 b0 a0 b0 b0 a0 b0 b0 a0
d00 5 0 3688596440 0 0 b2 b2 92 b2 b2 a2 b2 b2 a2 b2 b2 a2 b2 b2 a2
corrected...
d00 5 0 3688453512 0 0 b0 b0 90 b0 b0 a0 b0 b0 a0 b0 b0 a0 b0 b0 a1
d00 5 0 3688596440 0 0 b2 b2 92 b2 b2 a2 b2 b2 a2 b2 b2 a2 b2 b2 a2

Illegal transition: 0 -> 2
d00 5 0 4422810944 0 0 b0 b0 90 b0 b0 a0 b0 b0 a0 b0 b0 a0 b0 b0 a0
d00 5 0 4423141480 0 0 b2 b2 92 b2 b2 a2 b2 b2 a2 b2 b2 a2 b2 b2 a2
corrected...
d00 5 0 4422810944 0 0 b0 b0 90 b0 b0 a0 b0 b0 a0 b0 b0 a0 b0 b0 a1
d00 5 0 4423141480 0 0 b2 b2 92 b2 b2 a2 b2 b2 a2 b2 b2 a2 b2 b2 a2

Illegal transition: 2 -> 0
d00 5 0 5213425760 0 0 b2 b2 92 b2 b2 a2 b2 b2 a2 b2 b2 a2 b2 b2 a2
d00 5 0 5213755040 0 0 b0 b0 90 b0 b0 a0 b0 b0 a0 b0 b0 a0 b0 b0 a0
corrected...
d00 5 0 5213425760 0 0 b2 b2 92 b2 b2 a2 b2 b2 a2 b2 b2 a2 b2 b2 a3
d00 5 0 5213755040 0 0 b0 b0 90 b0 b0 a0 b0 b0 a0 b0 b0 a0 b0 b0 a0

Illegal transition: 0 -> 2
d00 5 0 6631521344 0 0 b0 b0 90 b0 b0 a0 b0 b0 a0 b0 b0 a0 b0 b0 a0
d00 5 0 6631671288 0 0 b2 b2 92 b2 b2 a2 b2 b2 a2 b2 b2 a2 b2 b2 a2
corrected...
d00 5 0 6631521344 0 0 b0 b0 90 b0 b0 a0 b0 b0 a0 b0 b0 a0 b0 b0 a1
d00 5 0 6631671288 0 0 b2 b2 92 b2 b2 a2 b2 b2 a2 b2 b2 a2 b2 b2 a2

Amit
24th August 2005, 13:24
@neuron2,

Thanks for the reply. I did not know that the clip did not have any problem. All I knew is that the problem starts to appear in this part of the clip. It could be some cummilative effect if you cannot find the same problem.

Just one last question. Does this tool exist for the old DVD2AVI or only for the new DGIndex only? And if it exist for the older DVD2AVI, from where can I get a copy of it?

Thanks for your help and I applogize for wasting your time and bandwith :o

-Amit

D3s7
24th August 2005, 13:25
neuron2:

would dgindex have detected this issue up front?

I'm curious if this issue was/would be fixed with that or if fixd2v would still be required (as opposed to dvd2avi (dg))

Guest
24th August 2005, 13:46
Just one last question. Does this tool exist for the old DVD2AVI or only for the new DGIndex only? And if it exist for the older DVD2AVI, from where can I get a copy of it? It's in DGIndex only. I'm curious to know why you are preferring to use DVD2AVI.

Guest
24th August 2005, 13:50
would dgindex have detected this issue up front?
I'm curious if this issue was/would be fixed with that or if fixd2v would still be required DGIndex does not test for illegal transitions or fix them unless you ask it too. It's a good idea to make it automatic.

(as opposed to dvd2avi (dg)) I didn't understand you here.

D3s7
24th August 2005, 13:58
I'm assuming he used dvd2avidg (default in doitfast4u) but he could have used plain ol' dvd2avi

Newest Doitfast4u! will support dgindex.. By "asking" it to, I'm assuming there's a CLI switch for that (without looking at the docs when posting this)

Guest
24th August 2005, 14:00
By "asking" it to, I'm assuming there's a CLI switch for that Nope. There's no way to invoke that through the CLI at this time.

Amit
25th August 2005, 00:51
@neuron2

I'm assuming he used dvd2avidg (default in doitfast4u) but he could have used plain ol' dvd2avi
Yes, I used the one thats included with DIF4U v1.4.0.

-Amit

Guest
25th August 2005, 01:40
Yes, I used the one thats included with DIF4U v1.4.0. I see. Thank you for your clarification.

hoops10
3rd September 2005, 13:50
I have having sort of the same problem, but the jerkiness starts at the beginning of the movie and lasts the entire movie. I used the newest DGDecode along with Scenaid. The movies, which are NTSC, play fine on my computer but once they are burned, the video is jerky the entire movie.