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 Development

Reply
 
Thread Tools Search this Thread Display Modes
Old 26th January 2020, 13:52   #1161  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,548
Quote:
Originally Posted by manolito View Post
...

So this is all caused by different default behavior of these source filters. Why in the world can the relevant source filter authors not agree on a uniform behavior?

...
The source files are incorrectly flagged so often anything automatic will fail. We encoders are all so elitist because WE KNOW BETTER THAN THE MACHINES!
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 26th January 2020, 19:41   #1162  |  Link
videoh
Useful n00b
 
Join Date: Jul 2014
Posts: 1,667
@manolito

Are you going to give us your script for lainvob.vob that does things "your way"?
videoh is offline   Reply With Quote
Old 26th January 2020, 23:32   #1163  |  Link
manolito
Registered User
 
manolito's Avatar
 
Join Date: Sep 2003
Location: Berlin, Germany
Posts: 3,078
Oh sure, I thought that you had noticed my reply here:
https://forum.doom9.org/showthread.p...79#post1896679

MediaInfo reports this:
Quote:
Frame rate : 29.970 (30000/1001) fps
Standard : NTSC
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Interlaced
Scan order : Top Field First
And since no pulldown flags are reported, AVStoDVD treats it like a 29.97 interlaced TFF clip. The AVS script generated by AVStoDVD looks like this:
Quote:
LoadCPlugin("E:\Programme\AVStoDVD\Lib\ffms2.dll")
Audio = FFAudioSource("F:\Download\lainvob.vob", track=-1)
Video = FFVideoSource("F:\Download\lainvob.vob", track=-1, fpsnum=2997, fpsden=100, colorspace="YV12", seekmode=2)
Video = Video.ConvertToYV12(interlaced=true)
AudioDub(Video, Audio)
ffms2 does not honor pulldown flags, so the fpsnum and fpsden parameters insert duplicates to bring up the frame rate to 29.97 fps. The resulting clip looks every bit as good as the original to me, and I cannot detect any A/V sync problems (within the limits of the clip characteristics).

The converted clip is here:
https://www.sendspace.com/file/0zcoxv
manolito is offline   Reply With Quote
Old 27th January 2020, 02:02   #1164  |  Link
hello_hello
Registered User
 
Join Date: Mar 2011
Posts: 4,823
Quote:
Originally Posted by manolito View Post
And since no pulldown flags are reported, AVStoDVD treats it like a 29.97 interlaced TFF clip.
Just for the sake of arguing, doesn't "treating it like a 29.97 interlaced TFF clip" and telling ffms2 to do a VFR to 29.97fps CFR conversion seem a little contradictory? If it's a 29.97 interlaced TFF clip there's no need to a VFR to CRF conversion.

Quote:
Originally Posted by manolito View Post
ffms2 does not honor pulldown flags, so the fpsnum and fpsden parameters insert duplicates to bring up the frame rate to 29.97 fps. The resulting clip looks every bit as good as the original to me, and I cannot detect any A/V sync problems (within the limits of the clip characteristics).
Yeah, there's no reason why that shouldn't be in sync.
Because the sample is animation you get get away with lots of duplicate frames and not see a difference. If it was live action though, with lots of film sections, every fourth frame being repeated would probably get annoying fairly quickly.

I wonder why a program dedicated to DVD encoding wouldn't tell ffms2 to honour the pulldown flags by default, especially for a 29.97fps source? The script seems to indicate it's encoding the video as interlaced anyway..... although now I'm thinking about it, I recall the ffms2 help file says it'll throw an error if honouring repeat flags is enabled but the stream doesn't have any. I can't say I've tested that, but I have no idea what the logic behind that behaviour might be.
hello_hello is offline   Reply With Quote
Old 27th January 2020, 02:09   #1165  |  Link
hello_hello
Registered User
 
Join Date: Mar 2011
Posts: 4,823
Quote:
Originally Posted by manolito View Post
This is the main reason why I always hate when the author of a tool which is widely used by other software suddenly decides that he wants to change defaults or calling conventions without any regard for backwards compatibility. MediaInfo is a good example, most GUIs which use it stopped working with versions after 18.5. And now the same thing happens with the latest LSMASH build by HolyWu. I really hate this, I call it "Apple Attitude".
I'm still waiting to learn why one of the methods I suggested for determining when lsmash writes the source path to the index file wouldn't keep GUI's that use them as the source happy while not inconveniencing those who like to move and rename their source/index files.
hello_hello is offline   Reply With Quote
Old 27th January 2020, 15:32   #1166  |  Link
TheFluff
Excessively jovial fellow
 
Join Date: Jun 2004
Location: rude
Posts: 1,100
Quote:
Originally Posted by hello_hello View Post
I recall the ffms2 help file says it'll throw an error if honouring repeat flags is enabled but the stream doesn't have any. I can't say I've tested that, but I have no idea what the logic behind that behaviour might be.
That line is not strictly accurate, I think. AFAIK, you'll only get an error if you try to apply RFF's to a video stream encoded using a codec that's incapable of supporting them at all.
TheFluff is offline   Reply With Quote
Old 27th January 2020, 18:00   #1167  |  Link
videoh
Useful n00b
 
Join Date: Jul 2014
Posts: 1,667
Thank you, manolito, for your script. It's easy to show that it is producing garbage compared to a proper conversion. I'll just look at video here (although audio sync also fluctuates significantly). Your script is producing 29.97 when most people will want 23.976 without dupes. Nevertheless, I omit the TDecimate call in my version so as to be able to compare the methods. Also note that I do not deinterlace either in DGSource() or via TFM() postprocessing, so the DG method is deriving good progressive frames throughout. Here is the script I use for comparing the methods:

Code:
LoadCPlugin("ffms2.dll")
manolito = FFVideoSource("lainvob.vob", track=-1, fpsnum=2997, fpsden=100, colorspace="YV12", seekmode=2).subtitle("manolito")

loadplugin("d:\don\Programming\C++\dgdecnv\DGDecodeNV\x32\release\dgdecodenv.dll")
loadplugin("D:\Don\Programming\C++\Avisynth filters\tritical stuff\TIVTC\tivtc.dll")
dgsource("G:\Streams\MPG\Pulldown\lainvob.dgi",fieldop=0)
dg=tfm(PP=0).subtitle("DG")
#tdecimate()

stackhorizontal(dg,manolito)
Now load the script in VirtualDub and step linearly from the beginning. There will be lots of laced frames seen in the manolito version. Here are some notable locations:

548
606
714
730-840 birds are interlaced
876 lacing on scene change
900 lacing on scene change
933- lots of laced frames from here

Don't do random access because ffms2 doesn't do it correctly and my numbers above are for linear play from the beginning.

Any reasonable person would reject the manolito method. It's way worse than "not optimal". As several have claimed, the correct way to handle material like this is to honor the pulldown and then do IVTC using (for example) TFM/TDecimate.

Last edited by videoh; 27th January 2020 at 18:06.
videoh is offline   Reply With Quote
Old 27th January 2020, 18:32   #1168  |  Link
manolito
Registered User
 
manolito's Avatar
 
Join Date: Sep 2003
Location: Berlin, Germany
Posts: 3,078
Quote:
Originally Posted by videoh View Post
Now load the script in VirtualDub and step linearly from the beginning. There will be lots of laced frames seen in the manolito version.
You don't get it. I DO NOT watch my movies by stepping through the frames. It is meaningless.

Of course my conversion has interlaced frames. When I make a DVD the common recommendation is to keep interlaced sources interlaced and let the TV handle the deinterlacing.

I showed the 2 versions of the clip to a friend without telling him what to look for (he is a journalist for a public TV broadcaster). He could not tell which version was which.

I think we can stop this here...
manolito is offline   Reply With Quote
Old 27th January 2020, 18:41   #1169  |  Link
videoh
Useful n00b
 
Join Date: Jul 2014
Posts: 1,667
Quote:
Originally Posted by manolito View Post
I think we can stop this here...
No way, Jose.

Quote:
Originally Posted by manolito View Post
Of course my conversion has interlaced frames.
Translation: Of course my method sucks.

DG derangement is a terrible thing. I will pray for you.

Last edited by videoh; 27th January 2020 at 18:58.
videoh is offline   Reply With Quote
Old 27th January 2020, 18:48   #1170  |  Link
TheFluff
Excessively jovial fellow
 
Join Date: Jun 2004
Location: rude
Posts: 1,100
Quote:
Originally Posted by manolito View Post
You don't get it. I DO NOT watch my movies by stepping through the frames. It is meaningless.

Of course my conversion has interlaced frames. When I make a DVD the common recommendation is to keep interlaced sources interlaced and let the TV handle the deinterlacing.

I showed the 2 versions of the clip to a friend without telling him what to look for (he is a journalist for a public TV broadcaster). He could not tell which version was which.

I think we can stop this here...
If you want interlaced output then why on earth would you not honor pulldown flags?
TheFluff is offline   Reply With Quote
Old 27th January 2020, 18:50   #1171  |  Link
videoh
Useful n00b
 
Join Date: Jul 2014
Posts: 1,667
Echoing TheFluff, if you are "making a DVD" why is any conversion necessary at all? The lainvob.vob clip is already a DVD sample.

People want to make film-rate MKVs, etc. Your script fails badly for that. The progressive frames are waiting there, begging to be extracted.

Quote:
a journalist for a public TV broadcaster
That explains everything. Fake news!

Last edited by videoh; 27th January 2020 at 19:40.
videoh is offline   Reply With Quote
Old 27th January 2020, 19:01   #1172  |  Link
manolito
Registered User
 
manolito's Avatar
 
Join Date: Sep 2003
Location: Berlin, Germany
Posts: 3,078
Quote:
Originally Posted by TheFluff View Post
If you want interlaced output then why on earth would you not honor pulldown flags?
I already said this repeatedly:

I use a GUI for my conversions. For DVD conversions I use AVStoDVD. AVStoDVD analyzes the source using MediaInfo. For the clip in question MediaInfo DOES NOT report pulldown flags, it reports 29.97 interlaced TFF instead. And if AVStoDVD thinks that there are no pulldown flags then it will NOT try to honor them.

To save the reputation of AVStoDVD I have to add that whenever it encounters an MPEG2 or VOB source it strongly suggests to index the source with DGIndex. And DGIndex does honor pulldown flags by default. I just have my reasons to avoid DG software as much as I can...

Last edited by manolito; 27th January 2020 at 19:04.
manolito is offline   Reply With Quote
Old 27th January 2020, 19:07   #1173  |  Link
videoh
Useful n00b
 
Join Date: Jul 2014
Posts: 1,667
Quote:
Originally Posted by manolito View Post
I just have my reasons to avoid DG software as much as I can...
As I said, DG derangement is a terrible thing. Care to share those reasons with us?

Don't forget that we now have other source filters that do the right thing by honoring pulldown. I'm happy to know that DG tools have blazed the trail!

Did you have any comment on my earlier questions? For example, how would you handle a transport stream with irregular frame repeats?

Last edited by videoh; 27th January 2020 at 19:15.
videoh is offline   Reply With Quote
Old 27th January 2020, 19:38   #1174  |  Link
TheFluff
Excessively jovial fellow
 
Join Date: Jun 2004
Location: rude
Posts: 1,100
Actually, I just realized that if you do this:
Code:
Video = FFVideoSource("F:\Download\lainvob.vob", track=-1, fpsnum=2997, fpsden=100, colorspace="YV12", seekmode=2)
What you're effectively doing is just applying pulldown. 60i sections will be left as they are, while 24p sections with RFF flags will get one of every 4 frames repeated, resulting in 30p. So you've effectively gotten the same result as honoring pulldown flags would have, except it's gonna look more stutter-y than normal soft pulldown would have, because instead of having the usual 3:2 cadence where every other frame gets an extra field, every fourth frame gets two extra fields instead. You put all of the catch-up you've accumulated over four frames in one place instead of spreading it out.

So yeah, don't do that. I still think ignoring pulldown flags is the best default and gives the best result in general if your goal is to encode progressive, but for your use case I don't see how it makes any sense.

e: Stephen got there first
TheFluff is offline   Reply With Quote
Old 27th January 2020, 19:42   #1175  |  Link
manolito
Registered User
 
manolito's Avatar
 
Join Date: Sep 2003
Location: Berlin, Germany
Posts: 3,078
Quote:
Originally Posted by videoh View Post
Don't forget that we now have other source filters that do the right thing by honoring pulldown.
We have just one, and this is the latest HolyWu build of LSMASH. ffms2 and DSS2Mod are not following your lead so far.

Quote:
Originally Posted by videoh View Post
Did you have any comment on my earlier questions? For example, how would you handle a transport stream with irregular frame repeats?
I did ask several times for a link to such a file. No result...

Quote:
Care to share those reasons with us?
Bad Karma

Last edited by manolito; 27th January 2020 at 19:46.
manolito is offline   Reply With Quote
Old 27th January 2020, 19:52   #1176  |  Link
manolito
Registered User
 
manolito's Avatar
 
Join Date: Sep 2003
Location: Berlin, Germany
Posts: 3,078
Quote:
Originally Posted by TheFluff View Post
What you're effectively doing is just applying pulldown.
Yes, I do know this. I repeat frames instead of fields, and most folks agree that repeating fields should give smoother motion. Being from PAL land I always found that even standard 3:2 NTSC pulldown results in ugly motion judder, it's just that people from NTSC land are so used to it that they don't even notice it any more.
manolito is offline   Reply With Quote
Old 27th January 2020, 19:59   #1177  |  Link
TheFluff
Excessively jovial fellow
 
Join Date: Jun 2004
Location: rude
Posts: 1,100
I'd say what most people probably do around here is encode progressive content as progressive without duplicate frames, actually. Either by ignoring pulldown flags or by applying IVTC. They don't actually make interlaced displays anymore, y'know?
TheFluff is offline   Reply With Quote
Old 27th January 2020, 20:10   #1178  |  Link
Groucho2004
 
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
Quote:
Originally Posted by TheFluff View Post
They don't actually make interlaced displays anymore, y'know?
Yes, but manolito is quite passionate about his good old CRT TV (as well as a non-SSE2 CPU). To each his own.
__________________
Groucho's Avisynth Stuff
Groucho2004 is offline   Reply With Quote
Old 27th January 2020, 20:31   #1179  |  Link
manolito
Registered User
 
manolito's Avatar
 
Join Date: Sep 2003
Location: Berlin, Germany
Posts: 3,078
Groucho, you are absolutely correct. Keeping my old hardware I do hardly sacrifice anything, and I keep my carbon dioxide footprint low. Sustainability, repair instead of throwing things into the trash bin...

//OT//
I saw that you have compiled a ColorMatrix 2.6 build which I could use for UHD sources. It just does not like my non-SSE2 CPU. Any chance for a build which does not require SSE2?

It is not really too important because my ancient non-SSE2 computer will hardly see any UHD source files. But I like to have consistent tool versions on all of my machines.
//End OT//
manolito is offline   Reply With Quote
Old 27th January 2020, 20:32   #1180  |  Link
Groucho2004
 
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
Quote:
Originally Posted by manolito View Post
Any chance for a build which does not require SSE2?
No problem.
__________________
Groucho's Avisynth Stuff
Groucho2004 is offline   Reply With Quote
Reply

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 20:37.


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