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 20th January 2020, 11:06   #1121  |  Link
kedautinh12
Registered User
 
Join Date: Jan 2018
Posts: 2,153
Quote:
Originally Posted by HolyWu View Post
https://github.com/HolyWu/L-SMASH-Wo...ks_20200118.7z
  • VideoSource: Fix missing frames in some H264 streams.
  • LWLibav: Change the default of 'repeat' to true.
  • LWLibav: Fix VP8 decoding issue with alt-ref frames.
Can you update support vfr to cfr like ffms2???
kedautinh12 is offline   Reply With Quote
Old 20th January 2020, 14:08   #1122  |  Link
manolito
Registered User
 
manolito's Avatar
 
Join Date: Sep 2003
Location: Berlin, Germany
Posts: 3,078
Quote:
Originally Posted by kedautinh12 View Post
Can you update support vfr to cfr like ffms2???
I do not understand your problem...

ffms2 and LSMASH both support VFR to CFR conversion, and they use identical methods. As soon as the user specifies FPSNUM and FPSDEN in the parameter list, both tools will spit out a CFR clip. They do this by duplicating or dropping frames as necessary to reach the specified frame rate.

So what exactly is your problem with LSMASH?
manolito is offline   Reply With Quote
Old 21st January 2020, 05:04   #1123  |  Link
kedautinh12
Registered User
 
Join Date: Jan 2018
Posts: 2,153
Quote:
Originally Posted by manolito View Post
I do not understand your problem...

ffms2 and LSMASH both support VFR to CFR conversion, and they use identical methods. As soon as the user specifies FPSNUM and FPSDEN in the parameter list, both tools will spit out a CFR clip. They do this by duplicating or dropping frames as necessary to reach the specified frame rate.

So what exactly is your problem with LSMASH?
I changed VFR to CFR with FPSNUM and FPSDEN but video after encoded video don't sync with audio. But it's work with directshowsource mod

my script:
LSMASH: LWLibavVideoSource("C:\Users\84945\Downloads\Otome Shinto - Otome Shinto no Uta [1440x1080 h264 M-ON! HD].ts", fpsnum=30000, fpsden=1001)

and directshowsource mod: dss2("C:\Users\84945\Downloads\Otome Shinto - Otome Shinto no Uta [1440x1080 h264 M-ON! HD].ts", fps=29.970).AssumeFPS(30000,1001)
ConvertBits(8)

video test: https://drive.google.com/open?id=1wU...8xMPkrUHv9p3OT

Last edited by kedautinh12; 21st January 2020 at 05:07.
kedautinh12 is offline   Reply With Quote
Old 21st January 2020, 11:40   #1124  |  Link
sneaker_ger
Registered User
 
Join Date: Dec 2002
Posts: 5,565
Quote:
Originally Posted by kedautinh12 View Post
my script:
LSMASH: LWLibavVideoSource("C:\Users\84945\Downloads\Otome Shinto - Otome Shinto no Uta [1440x1080 h264 M-ON! HD].ts", fpsnum=30000, fpsden=1001)
Where is the audio in your script?
sneaker_ger is offline   Reply With Quote
Old 21st January 2020, 11:47   #1125  |  Link
kedautinh12
Registered User
 
Join Date: Jan 2018
Posts: 2,153
Quote:
Originally Posted by sneaker_ger View Post
Where is the audio in your script?
I use megui and use auto encode so don't need audio script
kedautinh12 is offline   Reply With Quote
Old 21st January 2020, 11:55   #1126  |  Link
sneaker_ger
Registered User
 
Join Date: Dec 2002
Posts: 5,565
Sync is relation video to audio. You only provide us with info about video. How are we supposed to reproduce your test?

(Actually for me your sample is only a black screen with the "M O N" logo at the bottom right, just a small blink of the real video at the start.)

Last edited by sneaker_ger; 21st January 2020 at 11:57.
sneaker_ger is offline   Reply With Quote
Old 21st January 2020, 12:57   #1127  |  Link
kedautinh12
Registered User
 
Join Date: Jan 2018
Posts: 2,153
Quote:
Originally Posted by sneaker_ger View Post
Sync is relation video to audio. You only provide us with info about video. How are we supposed to reproduce your test?

(Actually for me your sample is only a black screen with the "M O N" logo at the bottom right, just a small blink of the real video at the start.)
I fixed with trim from frame 31 to end and cut audio like this with function avs cutter of megui but error vfr to cfr. When i used with directshowsource mod don't need trim and vfr to cfr work fine

Last edited by kedautinh12; 21st January 2020 at 13:04.
kedautinh12 is offline   Reply With Quote
Old 21st January 2020, 13:15   #1128  |  Link
manolito
Registered User
 
manolito's Avatar
 
Join Date: Sep 2003
Location: Berlin, Germany
Posts: 3,078
I played with the uploaded sample a little bit. Just playing it in DirectShow based players works fine, but after converting it I get the same problem like sneaker_ger (just a small blink of the video at the start). So your sample seems to have problems to begin with...

Another likely cause for issues is the format. Interlaced HD transport streams are always a challenge for source filters, so I made it a habit to repack such sources into an MKV container before trying to convert them.

But the real problem about audio sync does come from the source filter. Captured transport streams often have a huge audio delay. Your sample has an audio delay of -632 ms, after repacking to MKV the delay is -631 ms (almost identical). And different source filters treat such delays differently.

For DirectShow based souce filters as well as for ffms2 my experience is that this delay has to be discarded when muxing converted audio and video streams. LSMASH hehaves differently, the delay needs to be honored for perfect audio sync. (I believe that the DG source filters behave identically). I think that the reason is that some source filters just delete video frames at the start before a valid key frame while others like LSMASH repeat the first valid video frame up to the point where the audio starts.

On my tests I got perfect audio sync with the uploaded sample by discarding the delay value under DSS2Mod and honoring the delay value for LSMASH.
manolito is offline   Reply With Quote
Old 21st January 2020, 14:49   #1129  |  Link
kedautinh12
Registered User
 
Join Date: Jan 2018
Posts: 2,153
Quote:
Originally Posted by manolito View Post
I played with the uploaded sample a little bit. Just playing it in DirectShow based players works fine, but after converting it I get the same problem like sneaker_ger (just a small blink of the video at the start). So your sample seems to have problems to begin with...

Another likely cause for issues is the format. Interlaced HD transport streams are always a challenge for source filters, so I made it a habit to repack such sources into an MKV container before trying to convert them.

But the real problem about audio sync does come from the source filter. Captured transport streams often have a huge audio delay. Your sample has an audio delay of -632 ms, after repacking to MKV the delay is -631 ms (almost identical). And different source filters treat such delays differently.

For DirectShow based souce filters as well as for ffms2 my experience is that this delay has to be discarded when muxing converted audio and video streams. LSMASH hehaves differently, the delay needs to be honored for perfect audio sync. (I believe that the DG source filters behave identically). I think that the reason is that some source filters just delete video frames at the start before a valid key frame while others like LSMASH repeat the first valid video frame up to the point where the audio starts.

On my tests I got perfect audio sync with the uploaded sample by discarding the delay value under DSS2Mod and honoring the delay value for LSMASH.
I think error don't relate with delay of audio, i used aegisub and make karaoke sub sync audio and video and after encoded only audio sync with karaoke sub but video

Last edited by kedautinh12; 21st January 2020 at 14:55.
kedautinh12 is offline   Reply With Quote
Old 22nd January 2020, 07:34   #1130  |  Link
kedautinh12
Registered User
 
Join Date: Jan 2018
Posts: 2,153
Quote:
Originally Posted by HolyWu View Post
I am wondering how did you determine the sync issue was caused by VFR->CFR conversion. Have you tried omitting the fpsnum and fpsden arguments? And was there even VFR->CFR conversion taking place? It seems a no-op to me since the frame rate of your sample is already 29.97 (30000/1001) fps.
Why i use vfr to cfr same fps in directshowsource mod (value fps in script of directshowsource mod are autoset by megui) and it's work perfectly??
kedautinh12 is offline   Reply With Quote
Old 22nd January 2020, 14:10   #1131  |  Link
manolito
Registered User
 
manolito's Avatar
 
Join Date: Sep 2003
Location: Berlin, Germany
Posts: 3,078
Quote:
Originally Posted by manolito View Post
Since I live in PAL land, I have never encountered such clips with irregular pulldown or hybrid content. Can anybody provide a link to such a clip?
Bump...
manolito is offline   Reply With Quote
Old 22nd January 2020, 18:07   #1132  |  Link
hello_hello
Registered User
 
Join Date: Mar 2011
Posts: 4,823
Does the repeat option change the way the video is decoded in respect to chroma subsampling? I'm just wondering what happens when it's set to true and a source is progressive? I've never really understood how chroma subsampling is decoded in that respect.

repeat
Reconstruct frames by the flags specified in video stream and then treat all frames as interlaced if set to true and usable.


Is it safe to assume the ability to use index files as the source will remain broken?
hello_hello is offline   Reply With Quote
Old 22nd January 2020, 18:47   #1133  |  Link
hello_hello
Registered User
 
Join Date: Mar 2011
Posts: 4,823
Quote:
Originally Posted by videoh View Post
So now there are two important source filter authors that think the intent of the stream should be honored. There are many cases where irregular pulldown, hybrid content, etc., preclude an automatic rate conversion, such as you suggest, as it would destroy AV sync.
Would it destroy the AV sync? The decoder just drops or duplicates frames for a constant frame rate.

If you have a DVD that's a mixture of soft telecined 23.976fps and 29.97fps progressive or interlaced, and repeat is false but you use FPSNum and FPSDen to convert to a constant frame rate of 29.97fps, you should end up with the progressive sections having every 4th frame repeated and the audio sync should be intact, unless I'm missing something. I'm not saying it's ideal, but unless you want a VFR output, it needs to be one or the other. It's only if you don't enable repeat flags or do a VFR conversion that you'll end up with audio sync problems.

The help file says the repeat option is ignored when VFR to CFR conversion is specified, which might be why it's always been false by default, although I'm not sure how often you'd want a CFR to VFR conversion and honour repeat flags at the same time.

ffms2 can write a timecodes file as it indexes, so in that respect, not honouring repeat flags by default probably makes sense as you can use them for a VFR encode. There'd be no need to honour repeat flags and then use TIVTC to run an analysis pass to return the frame rate to variable.

I don't recall lsmash having an option to write a timecodes file though, so repeat being true by default probably makes sense.

Last edited by hello_hello; 23rd January 2020 at 15:03.
hello_hello is offline   Reply With Quote
Old 22nd January 2020, 19:15   #1134  |  Link
videoh
Useful n00b
 
Join Date: Jul 2014
Posts: 1,667
Quote:
Originally Posted by manolito View Post
Bump...
Here is one:

http://rationalqm.us/misc/lainvob.vob

It's a small sample provided under fair use. I have some larger off-air TS captures that are similar. This stuff is ubiquitous in NTSC land.

Last edited by videoh; 22nd January 2020 at 19:32.
videoh is offline   Reply With Quote
Old 22nd January 2020, 19:17   #1135  |  Link
videoh
Useful n00b
 
Join Date: Jul 2014
Posts: 1,667
Quote:
Originally Posted by hello_hello View Post
It's only if you don't enable repeat flags ... that you'll end up with audio sync problems.
Correct, and that's the point because manolito wants to ignore pulldown by default (he objects to honoring pulldown by default because it breaks his existing scripts).

Last edited by videoh; 22nd January 2020 at 19:31.
videoh is offline   Reply With Quote
Old 22nd January 2020, 21:35   #1136  |  Link
manolito
Registered User
 
manolito's Avatar
 
Join Date: Sep 2003
Location: Berlin, Germany
Posts: 3,078
Quote:
Originally Posted by videoh View Post
Here is one:

http://rationalqm.us/misc/lainvob.vob

It's a small sample provided under fair use. I have some larger off-air TS captures that are similar. This stuff is ubiquitous in NTSC land.
Thanks for the clip, but this one does not do anything for me...

I know that you are a "pedal to the metal" guy, and I prefer encoder GUIs.

First of all the sample clip is not suitable to judge A/V sync. And then most encoder GUIs use MediaInfo to determine the source properties, and this clip appears as 29.97 interlaced TFF. No pulldown detected. And the encoder treats the clip exactly like this.

I used AVStoDVD to compare conversions first using DGIndex and then using ffms2. Both looked identical to me.

To get meaningful results the source clip needs some scenes where I can judge A/V sync, and then it would help if MediaInfo would detect 3:2 Pulldown. If MediaInfo just detects 29.97 pure interlaced then there is no way that the encoder GUI could do any fancy things.


So it all comes down to the philosophy you apply. I want things to work universally under an encoder GUI like AVStoDVD or StaxRip. You are able to do all this stuff manually and find the best way to encode such clips, but this is something most users cannot (and do not want to) do.
manolito is offline   Reply With Quote
Old 22nd January 2020, 22:42   #1137  |  Link
videoh
Useful n00b
 
Join Date: Jul 2014
Posts: 1,667
The clip has irregular pulldown (which is what you asked for). If you want a longer sample, buy the DVD.

Quote:
I want things to work universally...
I want a unicorn for Christmas.

And, hey, I'm not using any super powers here. A quick preview in DGIndex clearly shows the irregular pulldown. Press F5 and let it play to the end. Then look at the field repeats in the info dialog and the film percentage in the DGI file.

If you have a clip with hybrid soft and hard pulldown, you can only honor pulldown and then do IVTC with a filter. Ignoring the pulldown would ruin AV sync. All of this is well known in NTSC land.

Last edited by videoh; 23rd January 2020 at 03:04.
videoh is offline   Reply With Quote
Old 23rd January 2020, 00:35   #1138  |  Link
manolito
Registered User
 
manolito's Avatar
 
Join Date: Sep 2003
Location: Berlin, Germany
Posts: 3,078
Quote:
Originally Posted by videoh View Post
A quick preview in DGIndex clearly shows the irregular pulldown. Press F5 and let it play to the end. Then look at the repeat fields and film percent in the info dialog.
No "Average Joe" user would ever want to do this. You are from Pluto and I am from Mars...
manolito is offline   Reply With Quote
Old 23rd January 2020, 02:25   #1139  |  Link
kedautinh12
Registered User
 
Join Date: Jan 2018
Posts: 2,153
Quote:
Repeat
Reconstruct frames by the flags specified in video stream and then treat all frames as interlaced if set to true and usable.
I test many raw with repeat and still interlaced in some frame, i think it's only use with raw have duration of video don't sync with duration of audio

Last edited by kedautinh12; 23rd January 2020 at 02:41.
kedautinh12 is offline   Reply With Quote
Old 23rd January 2020, 03:08   #1140  |  Link
videoh
Useful n00b
 
Join Date: Jul 2014
Posts: 1,667
Quote:
Originally Posted by manolito View Post
No "Average Joe" user would ever want to do this. You are from Pluto and I am from Mars...
Average Joes also do stuff like deinterlace 3:2 pulldown, and resize before deinterlacing. This is Doom9, where things are done right! Maybe VideoHelp is more your style?

Last edited by videoh; 23rd January 2020 at 03:12.
videoh 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 01:25.


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