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 22nd March 2023, 15:29   #2361  |  Link
kedautinh12
Registered User
 
Join Date: Jan 2018
Posts: 2,153
AviSynthPlus r3973
https://gitlab.com/uvz/AviSynthPlus-Builds
kedautinh12 is offline   Reply With Quote
Old 25th March 2023, 21:40   #2362  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
with yv411 source using LWLibavVideoSource or ffms2 both give _ChromaLocation = 2 and make avspmod, ConvertToRGB or ConvertToYV16 give error

__________________
See My Avisynth Stuff

Last edited by real.finder; 28th March 2023 at 22:17.
real.finder is offline   Reply With Quote
Old 28th March 2023, 11:17   #2363  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,309
Quote:
Originally Posted by real.finder View Post
with yv411 source using LWLibavVideoSource of ffms2 both give _ChromaLocation = 2 and make avspmod, ConvertToRGB or ConvertToYV16 give error

Probably 0-"left" and 2-"topleft" (they are the same in other-than-4:2:0 formats) could be enabled? I think, this is how it is handled, but since there is no valid choice at 411, using any _Chromalocation hint was disabled until now.
pinterf is offline   Reply With Quote
Old 28th March 2023, 22:21   #2364  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
Quote:
Originally Posted by pinterf View Post
Probably 0-"left" and 2-"topleft" (they are the same in other-than-4:2:0 formats) could be enabled? I think, this is how it is handled, but since there is no valid choice at 411, using any _Chromalocation hint was disabled until now.
I think maybe it safe to make it if 411 then _Chromalocation could has 0-"left" or 2-"topleft"
__________________
See My Avisynth Stuff
real.finder is offline   Reply With Quote
Old 3rd April 2023, 08:03   #2365  |  Link
FranceBB
Broadcast Encoder
 
FranceBB's Avatar
 
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,883
Avisynth 3.7.3 Beta 9, using the following script:

Quote:
BlankClip(length=0)
makes ffmpeg go crazy as I described here: https://forum.doom9.org/showthread.php?t=184819

Even AVSPmod mod really doesn't like length=0 in BlankClip():



Given that using BlankClip(length=1) produces 1 frame of black, namely frame 0:



what is BlankClip(length=0) supposed to output? And why is it making FFMpeg go on forever and AVSPmod mod fail?
I even tried with VirtualDub, it doesn't fail, and although the preview is bogus like this:



it does produce a file which is 1 frame long (frame 0) of pure black when I play it back with MPC-HC:



I reported the issue to the ffmpeg community, but the more I test the more I think that we (the Avisynth community) might be the one at fault here.
I'm not sure. What do you think, guys?
FranceBB is offline   Reply With Quote
Old 3rd April 2023, 14:40   #2366  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,346
BlankClip(length=0) makes no sense, but there should be an appropriate error message such as "Not a clip"
poisondeathray is offline   Reply With Quote
Old 4th April 2023, 02:43   #2367  |  Link
qyot27
...?
 
qyot27's Avatar
 
Join Date: Nov 2005
Location: Florida
Posts: 1,419
Quote:
Originally Posted by poisondeathray View Post
BlankClip(length=0) makes no sense, but there should be an appropriate error message such as "Not a clip"
This. FFmpeg reads video and audio packets separately, and if either reaches EOF, it attempts to read the other one before exiting, because it is easily possible - and not a bug - that either video or audio might be longer than the other, and it shouldn't be truncated.

The error is that length=0 is treated by BlankClip as somehow valid when it isn't, and ends up creating an audio stream of infinite length, which FFmpeg then attempts to read/output. Forcing an output length via the -t parameter would probably demonstrate that it is indeed attempting to write an ever-increasing number of audio samples, until the process is killed.
qyot27 is offline   Reply With Quote
Old 4th April 2023, 12:17   #2368  |  Link
FranceBB
Broadcast Encoder
 
FranceBB's Avatar
 
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,883
Gotcha.
So... what next? I think we should be throwing an error and display it correctly as an error if length=0 is passed to BlankClip() instead of failing silently.

The good thing is that a new version of Avisynth is being worked on, so perhaps we can include this in 3.7.3 Beta 10 (or one of the next betas before the stable release)?

Anyway, it's just a proposition as I've addressed it in the code at work last Sunday (yes, I rushed to work on Sunday when I saw the server crash eheheheheh). Anyway, as far as my use case is concerned, now if there's a clip of 0 frame, length is forced to 1 as one workaround in the AVS Script that my supply chain generates automatically (and I'll make sure to include the fix in the next public release of FFAStrans, if Steinar approves my pull request).

I'll let the ffmpeg guy know as well and close the ticket there anyway, since this is not a bug on their end.
FranceBB is offline   Reply With Quote
Old 5th April 2023, 22:04   #2369  |  Link
gispos
Registered User
 
Join Date: Oct 2018
Location: Germany
Posts: 996
Quote:
Originally Posted by FranceBB View Post
Avisynth 3.7.3 Beta 9, using the following script:



makes ffmpeg go crazy as I described here: https://forum.doom9.org/showthread.php?t=184819

Even AVSPmod mod really doesn't like length=0 in BlankClip():
At first I was also surprised that no error 'Not a clip' is output, had to look 2 - 3 times to find the error. Fixed.

Edit:
Avisynth should have returned an error here, but probably does not.
Code:
self.src_frame = self.clip.get_frame(frame)
if self.clip.get_error():
    Error()
    return False
__________________
Live and let live

Last edited by gispos; 5th April 2023 at 22:11.
gispos is offline   Reply With Quote
Old 5th April 2023, 22:56   #2370  |  Link
qyot27
...?
 
qyot27's Avatar
 
Join Date: Nov 2005
Location: Florida
Posts: 1,419
Now it does:
https://github.com/AviSynth/AviSynth...eee829223d1d54
qyot27 is offline   Reply With Quote
Old 5th April 2023, 23:14   #2371  |  Link
qyot27
...?
 
qyot27's Avatar
 
Join Date: Nov 2005
Location: Florida
Posts: 1,419
To explain a bit further, I'm now not really sure if it was generating valid audio either, because if I tried to do
Code:
ffmpeg -i test.avs -vn -acodec copy output.wav
the output length reported before it errored out was something like -577100 hours. Which would indicate a problem with the integer used to represent the length of the stream. And the AviSynth docs have the following rather useful tidbit when describing audio samples properties:
Code:
Returns the number of samples of the audio of the clip (type: int). Be aware of possible overflow on very long clips (2^31 samples limit).
Which made me think there might be an overflow happening for the length of the clip, since 2^31 = 2,147,483,648 seconds / 60 = 35,791,394.133 minutes / 60 = 596,523.235 hours. Like I said, it's not exact (~577100 vs. 596523) but with other kinds of overhead, it's close enough. That may be a completely wrong assumption about what the issue actually was, but it doesn't really matter, since it will error out now if BlankClip is set to less than 1 frame long.
qyot27 is offline   Reply With Quote
Old 6th April 2023, 09:46   #2372  |  Link
FranceBB
Broadcast Encoder
 
FranceBB's Avatar
 
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,883
Thanks for the fix and the explanation, Stephen!
(also thanks to Gispos for addressing it in AVSPmod mod; I didn't report it in the AVSPmod mod thread only 'cause I thought it should really be Avisynth throwing a proper error anyway, but thanks for addressing it for older version of AVS too in AVSPmod mod )
FranceBB is offline   Reply With Quote
Old 6th April 2023, 19:35   #2373  |  Link
gispos
Registered User
 
Join Date: Oct 2018
Location: Germany
Posts: 996
Quote:
Originally Posted by FranceBB View Post
...
(also thanks to Gispos for addressing it in AVSPmod mod; I didn't report it in the AVSPmod mod thread only 'cause I thought it should really be Avisynth throwing a proper error anyway, but thanks for addressing it for older version of AVS too in AVSPmod mod )
You can also test it right now
https://drive.google.com/drive/folde...usp=share_link
__________________
Live and let live
gispos is offline   Reply With Quote
Old 7th April 2023, 07:47   #2374  |  Link
FranceBB
Broadcast Encoder
 
FranceBB's Avatar
 
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,883
Quote:
Originally Posted by gispos View Post
It works and it correctly returns an error message.



While this outputted an image without asking any questions about the audio, just like before:

FranceBB is offline   Reply With Quote
Old 7th April 2023, 13:05   #2375  |  Link
gispos
Registered User
 
Join Date: Oct 2018
Location: Germany
Posts: 996
Quote:
Originally Posted by FranceBB View Post
It works and it correctly returns an error message.

While this outputted an image without asking any questions about the audio, just like before:
If I understand correctly, that's so good ?
But it will probably change when avisynth gives an error on BlankClip(0). Then there is nothing I can do about it.
__________________
Live and let live
gispos is offline   Reply With Quote
Old 7th April 2023, 15:28   #2376  |  Link
FranceBB
Broadcast Encoder
 
FranceBB's Avatar
 
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,883
Quote:
Originally Posted by gispos View Post
If I understand correctly, that's so good ?
It's fine, it's fine, thanks

Quote:
Originally Posted by gispos View Post
But it will probably change when avisynth gives an error on BlankClip(0).
Yeah and rightly so. I would rather get a proper error than a memory leak in FFMpeg that takes my whole farm of several servers down and makes me rush back to the office after getting an incident on Spark and a phone call on a Sunday! XD
FranceBB is offline   Reply With Quote
Old 8th April 2023, 12:09   #2377  |  Link
gispos
Registered User
 
Join Date: Oct 2018
Location: Germany
Posts: 996
Quote:
Originally Posted by FranceBB View Post
Yeah and rightly so. I would rather get a proper error than a memory leak in FFMpeg...
My mistake, I thought you use BlankClip(0) in the script for something.
At the second look I recognized it now... The script was only meant as an example... Sometimes it takes longer...
__________________
Live and let live
gispos is offline   Reply With Quote
Old 8th April 2023, 12:31   #2378  |  Link
DTL
Registered User
 
Join Date: Jul 2018
Posts: 1,041
Some syntax request for some resizers:

Currently AVS resampling engine also used as convolution filter with resizer's kernel for non-resizing processing. So it required not very nice hacky way of forcing processing using non-zero src_left and/or src_top small float value. Also non-zero non-required shift may more degrade output.

So 2 ideas:
1. Add more param to resizers like force_processing (fp) = 0 (default - no), 1,2,3 (H, V, H+V), or horfp=false/true and verfp=false/true.

2. Add naming aliases with H(V) ending - like standard GaussResize and GaussResizeH/GaussResizeV/GaussResizeHV (conditionless forced H, V or HV processing). It looks like shortest way of script typing.

Mostly needed for resizers with user-adjustable kernel (taps or p or b,c params).

May be other ideas exist how to force resizer processing if width and height not changed ?

Last edited by DTL; 8th April 2023 at 22:26.
DTL is offline   Reply With Quote
Old 11th April 2023, 10:40   #2379  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,309
Quote:
Originally Posted by real.finder View Post
I think maybe it safe to make it if 411 then _Chromalocation could has 0-"left" or 2-"topleft"
Opened an issue at github, just for the reference. I had (and maybe will continue to have) busy working weeks, you'll notice a minor slowdown for some days.
Then I can finally have a look at DTL's (old and new) resizer related things.
pinterf is offline   Reply With Quote
Old 16th April 2023, 01:15   #2380  |  Link
kedautinh12
Registered User
 
Join Date: Jan 2018
Posts: 2,153
AviSynthPlus r3982
https://gitlab.com/uvz/AviSynthPlus-Builds
kedautinh12 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 15:22.


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