Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 27th August 2014, 11:34   #1  |  Link
bxyhxyh
Registered User
 
Join Date: Dec 2011
Posts: 349
DVD decimate matching bluray source

I need to overlay bluray video on dvd video. But a bluray is progressive and a dvd is telecined.

If i just call tfm().tdecimate() some frames don't match bluray video.

How can I decimate dvd to match bluray?
bxyhxyh is offline   Reply With Quote
Old 29th August 2014, 13:39   #2  |  Link
LemMotlow
Registered User
 
Join Date: Jul 2011
Location: Tennessee, USA
Posts: 237
Quote:
Originally Posted by bxyhxyh View Post
I need to overlay bluray video on dvd video.
What do you mean by "overlay"?

Quote:
Originally Posted by bxyhxyh View Post
But a bluray is progressive and a dvd is telecined.
That's not correct.

DVD is almost always interlaced or telecined. Depending on who created them, some DVD's are purely progressive but encoded as interlaced. There are several variations.

Standard BlueRay can be interlaced or progressive. 1920x1080 can be progressive if the originals are at progressive film speed (23.97 or 24 fps). 1920x1080 is otherwise interlaced at 29.97 or 25 fps. The same holds true for 1440x1080 BluRay.

1280x720 standard BluRay is always progressive at 23.97, 24, 50, or 59.94 fps.

Standard-definiton BluRay is interlaced or telecined at 25 or 29.97 fps.

There are variations on these standards, meaning that some people make non-standard videos.

http://forum.doom9.org/showthread.php?t=154533

Quote:
Originally Posted by bxyhxyh View Post
If i just call tfm().tdecimate() some frames don't match bluray video.

How can I decimate dvd to match bluray?
Can't answer that. No one knows anything about your source videos.

Last edited by LemMotlow; 29th August 2014 at 13:57.
LemMotlow is offline   Reply With Quote
Old 29th August 2014, 18:18   #3  |  Link
bxyhxyh
Registered User
 
Join Date: Dec 2011
Posts: 349
Quote:
Originally Posted by LemMotlow View Post
What do you mean by "overlay"
Upscale DVD and overlay bluray video on it to get some pixels from DVD source.

Quote:
Originally Posted by LemMotlow View Post
That's not correct.

DVD is almost always interlaced or telecined. Depending on who created them, some DVD's are purely progressive but encoded as interlaced. There are several variations.

1280x720 standard BluRay is always progressive at 23.97, 24, 50, or 59.94 fps.
I meant my sources are. Bluray source that I have is progressive and DVD is interlaced.

Quote:
Originally Posted by LemMotlow View Post
Can't answer that. No one knows anything about your source videos.
Here are samples and a script
dvd - https://dl.dropboxusercontent.com/u/58215671/dvd.ts
bluray - https://dl.dropboxusercontent.com/u/...71/bluray.m2ts

Code:
dvd=MPEG2Source("C:\Users\win8\Desktop\dvd.d2v", cpu=0).Trim(4,0) # This trim is to start progressive frame of this sample. Doesn't exist in my real script
bd=lwlibavvideosource("C:\Users\win8\Desktop\bluray.m2ts").Trim(178,0) # This trim is for match first frame with dvd's first frame. Doesn't exist in my real script
dvd.TFM().crop(0,2,0,0).TDecimate(mode=1)
nnedi3_rpow2(2,cshift="spline36resize")
d1=Spline36Resize(1280,718)
d2=Spline36Resize(1280,720)
dvd=overlay(d2,d1)

overlay(dvd,bd.Spline36Resize(1260,718,0.5,0.5,-0.5,0),10,2)
EDIT: For these samples, they are off by one frame. But for whole video it appears randomly.

Last edited by bxyhxyh; 29th August 2014 at 21:03.
bxyhxyh is offline   Reply With Quote
Old 29th August 2014, 19:51   #4  |  Link
LemMotlow
Registered User
 
Join Date: Jul 2011
Location: Tennessee, USA
Posts: 237
The BluRay has been inverse telecined and is progressive at 23.976 fps.
The dvd (why is DVD in a .ts file?) was formerly progressive with 3:2 pulldown (telecine). Instead of inverse telecine, some clever individual has field-blend deinterlaced it. The formerly telecined frames are field-blended. Unless someone has some ideas and solutions otherwise, no way to repair those frames.

Regardless, upscaling standard def will have lower quality and other differences. Even if you could get good frames for overlay, the differences in overlaid frames would produce flicker and/or uneven playback.

Last edited by LemMotlow; 29th August 2014 at 19:57.
LemMotlow is offline   Reply With Quote
Old 29th August 2014, 20:58   #5  |  Link
bxyhxyh
Registered User
 
Join Date: Dec 2011
Posts: 349
Quote:
Originally Posted by LemMotlow View Post
The dvd (why is DVD in a .ts file?) was formerly progressive with 3:2 pulldown (telecine).
I've cut both with TSMuxer.

Quote:
Originally Posted by LemMotlow View Post
Instead of inverse telecine, some clever individual has field-blend deinterlaced it. The formerly telecined frames are field-blended. Unless someone has some ideas and solutions otherwise, no way to repair those frames.
What? I see no blends to be fixed.

Problem here is Decimation.
Decimation based on other progressive source.

Also DVD.Spline36Resize(1280,720,10.5,1.5,-10.5,-0).crop(0,0,0,-2) is same as bd.Spline36Resize(1280,718,0,0,0,-2.5) pixel wise.
That would help to decide which frame should be decimated.

Last edited by bxyhxyh; 29th August 2014 at 21:06.
bxyhxyh is offline   Reply With Quote
Old 29th August 2014, 21:55   #6  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 3,460
Yes, there are resizing and AR differences, but they line up in terms of matching frames for me. Could it be L-smash issue /difference ?

For example try MPEG2Source (DGIndex), and AVCSource (DGAVCIndex)

MPEG2Source()
AssumeTFF()
TFM().TDecimate()
Trim(1,0)

AVCSource()
Trim(176,0)
Trim(0,324)
poisondeathray is offline   Reply With Quote
Old 29th August 2014, 22:08   #7  |  Link
bxyhxyh
Registered User
 
Join Date: Dec 2011
Posts: 349
I use DGSourceIM for bluray and DGIndex for DVD.
And tried L Smash for bluray and DGIndex for DVD
Still same.
bxyhxyh is offline   Reply With Quote
Old 29th August 2014, 22:10   #8  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 3,460
Quote:
Originally Posted by bxyhxyh View Post
I use DGSourceIM for bluray and DGIndex for DVD.
And tried L Smash for bluray and DGIndex for DVD
Still same.
Why do I get different results ? They match here in terms of decimation and frames

or do your testclips not exhibit the problem ?

Did you try what I posted above ?
poisondeathray is offline   Reply With Quote
Old 29th August 2014, 22:23   #9  |  Link
bxyhxyh
Registered User
 
Join Date: Dec 2011
Posts: 349
Quote:
Originally Posted by poisondeathray View Post
Why do I get different results ? They match here in terms of decimation and frames

or do your testclips not exhibit the problem ?

Did you try what I posted above ?
Yes, It is ok for samples, but not ok for full vidoes.
Combed frames caused by TFM may be screwing up decimation.

I will try QTGMC. Since I need only 10 pixels from both sides, there wouldn't significant quality loss.
bxyhxyh is offline   Reply With Quote
Old 30th August 2014, 00:08   #10  |  Link
LemMotlow
Registered User
 
Join Date: Jul 2011
Location: Tennessee, USA
Posts: 237
Quote:
Originally Posted by poisondeathray View Post
Why do I get different results ? They match here in terms of decimation and frames

or do your testclips not exhibit the problem ?

Did you try what I posted above ?
I take my comments back and go along with poisondeathray. FFMS2, DirectShowSource, other translators, etc., etc., all screw up the dvd and throw frames all over the place. Phooey. I went back to my old standby for this kind of streaming .ts stuff and used TVMW to get a clean avi for AviSource, then TIVTC'd the dvd sample. Frames match for me, at least for 125 frames or so. All the other file openers gave me schizo results with that "DVD".

TFM the cause of combing? I doubt it. After I got a proper AVI from that weirdo dvd.ts, TIVTC worked perfectly. No combing, either.

Last edited by LemMotlow; 30th August 2014 at 03:14.
LemMotlow is offline   Reply With Quote
Reply

Tags
decimation

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

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

Forum Jump


All times are GMT +1. The time now is 10:34.


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