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 9th January 2020, 05:10   #1101  |  Link
l33tmeatwad
Registered User
 
l33tmeatwad's Avatar
 
Join Date: Jun 2007
Posts: 414
Quote:
Originally Posted by HolyWu View Post
I just tested it by 32-bit AVSMeter on a few clips with codecs avc hevc vc-1 mpeg2 vp9 av1, and I couldn't reproduce it.
Tried it on two different Windows 10 machines (both 64-bit Windows) and on macOS though WINE. The x64 version works on the same machines.
l33tmeatwad is offline   Reply With Quote
Old 9th January 2020, 06:35   #1102  |  Link
l33tmeatwad
Registered User
 
l33tmeatwad's Avatar
 
Join Date: Jun 2007
Posts: 414
Quote:
Originally Posted by HolyWu View Post
I tried it on x64 Win10 as well. But I couldn't reproduce it due to lack of useful information. Post your full script and the mediainfo of your media file. What program did you use to open the script? Have you tried to open other media files and it's still the same?
I'll post some more information tomorrow when I'm at my computer again, but it was several MP4s containing x264 encoded video. The script was literally just LWLibavVideoSource and nothing else and works with the x64 plugin. It is not even generating the index file with the x86 version, just displays access violation in the AvsPmod preview window with no specific error codes.
l33tmeatwad is offline   Reply With Quote
Old 9th January 2020, 06:58   #1103  |  Link
manolito
Registered User
 
manolito's Avatar
 
Join Date: Sep 2003
Location: Berlin, Germany
Posts: 3,078
Just like HolyWu I could not reproduce it on my machine...

Hardware:
Core i5 (two physical cores plus two hyperthreading cores)
8 GB RAM

Software:
Win7 64
AVS+ 3.40 32bit
Latest HolyWu LSMASH build from Nov 2019
Old StaxRip 32bit version as the host software
Current X264 32bit MABS build by Ligh

Source:
Concert Show by Toto
AVC video 1280x720 @25fps progressive in MP4 container

Target format:
AVC video @704x396 @25fps progressive in MKV container

AVS Script:
Quote:
LWLibavVideoSource("D:\Toto.mp4", cachefile="D:\Toto temp files\Toto.lwi", format="YUV420P8")
ChangeFPS(25.00)
Crop(0,0, -Width % 4,-Height % 4)
ColorMatrix(source=0,dest=2)
RequestLinear(rlim=50, clim=50)
ConvertToYV12()
Spline36Resize(704,396)
avstp_set_threads(1)
Prefetch(4)

Two things to note about the script:
1. The ChangeFPS call right after the source filter has the only purpose to force linear access. I could have used RequestLinear instead. In MT mode this is necessary, otherwise the speed will drop to a snail's pace. (FFMS2 has the same behavior)
See here:
https://forum.doom9.org/showthread.p...54#post1883754

2. The RequestLinear call after ColorMatrix ist required to prevent crashes in MT mode. It is also necessary to force MT_SERIALIZED for ColorMatrix and RequestLinear if MT is used.
See here:
https://forum.doom9.org/showthread.p...79#post1865279
The relevant information is in the third paragraph of the post.


But with these settings the latest LWLibavVideoSource versions are absolutely stable on my machine...

Last edited by manolito; 10th January 2020 at 02:45.
manolito is offline   Reply With Quote
Old 9th January 2020, 12:41   #1104  |  Link
Taurus
Registered User
 
Taurus's Avatar
 
Join Date: Mar 2002
Location: Krautland
Posts: 903
Quote:
Originally Posted by manolito View Post

But with these settings the latest LWLibavVideoSource versions are absolutely stable on my machine...
Same here...
Using almost identical settings as manolito mentioned.
No crash, no nothing, pur fun
Taurus is offline   Reply With Quote
Old 9th January 2020, 16:26   #1105  |  Link
l33tmeatwad
Registered User
 
l33tmeatwad's Avatar
 
Join Date: Jun 2007
Posts: 414
After testing a few things I found out what I think is triggering it. Apparently files that contain cover art (iTunes) appear to crash the x86 version, a recontainered version will work fine. It's odd that it works on the x64 version but not the x86 version. The following machines were used to test with the same settings:

Machine 1
Code:
Processor: Core i7-8700 @ 3.20GHz
RAM: 16GB
Operating System: Windows 10 LTSB (2019) (64-bit)
Software: AviSynth+ 3.4.0
AvsPmod v2.6.1.1
Microsoft Visual C++ 2015-2019 Redist (14.24.28127)
Machine 2
Code:
Processor: Core i3-4160 @ 3.60GHz
RAM: 8GB
Operating System: Windows 10 LTSB (2019) (64-bit)
Software: AviSynth+ 3.4.0
AvsPmod v2.6.1.1
Microsoft Visual C++ 2015-2019 Redist (14.24.28127)
Machine 3
Code:
Processor: Core i5 @ 2.5GHz
RAM: 8GB
Operating System: macOS 10.11.6
Software: PlayOnMac (WINE, System Version 3.9)
AviSynth+ 3.4.0
AvsPmod v2.6.1.1
Media File
Code:
General
Complete name                            : 8bit Sample.mp4
Format                                   : MPEG-4
Format profile                           : Base Media
Codec ID                                 : isom (isom/iso2/avc1/mp41)
File size                                : 60.5 MiB
Duration                                 : 3 min 13 s
Overall bit rate                         : 2 616 kb/s
Cover                                    : Yes

Video
ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : High@L3.1
Format settings                          : CABAC / 4 Ref Frames
Format settings, CABAC                   : Yes
Format settings, Reference frames        : 4 frames
Codec ID                                 : avc1
Codec ID/Info                            : Advanced Video Coding
Duration                                 : 3 min 13 s
Bit rate                                 : 2 440 kb/s
Width                                    : 960 pixels
Height                                   : 720 pixels
Display aspect ratio                     : 4:3
Frame rate mode                          : Constant
Frame rate                               : 23.976 (24000/1001) FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.147
Stream size                              : 56.4 MiB (93%)
Writing library                          : x264 core 133 r2334 a3ac64b
Encoding settings                        : cabac=1 / ref=3 / deblock=1:0:0 / analyse=0x3:0x113 / me=hex / subme=7 /
psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 /
trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 /
chroma_qp_offset=-2 / threads=6 / lookahead_threads=1 / sliced_threads=0 /
nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 /
bframes=3 / b_pyramid=2 / b_adapt=1 / b_bias=0 / direct=1 / weightb=1 /
open_gop=0 / weightp=2 / keyint=240 / keyint_min=23 / scenecut=40 /
intra_refresh=0 / rc_lookahead=40 / rc=crf / mbtree=1 / crf=16.0 / qcomp=0.60 /
qpmin=0 / qpmax=69 / qpstep=4 / vbv_maxrate=17500 / vbv_bufsize=17500 /
crf_max=0.0 / nal_hrd=none / ip_ratio=1.40 / aq=1:1.00
Color range                              : Limited
Color primaries                          : BT.709
Transfer characteristics                 : BT.709
Matrix coefficients                      : BT.709
Codec configuration box                  : avcC

Audio
ID                                       : 2
Format                                   : AAC LC
Format/Info                              : Advanced Audio Codec Low Complexity
Codec ID                                 : mp4a-40-2
Duration                                 : 3 min 13 s
Duration_LastFrame                       : -19 ms
Bit rate mode                            : Constant
Bit rate                                 : 169 kb/s
Channel(s)                               : 2 channels
Channel layout                           : L R
Sampling rate                            : 48.0 kHz
Frame rate                               : 46.875 FPS (1024 SPF)
Compression mode                         : Lossy
Stream size                              : 3.90 MiB (6%)
Default                                  : Yes
Alternate group                          : 1
AviSynth Script
Code:
LWLibavVideoSource("8bit Sample.mp4", format="YUV420P8")

Last edited by l33tmeatwad; 14th January 2020 at 21:54.
l33tmeatwad is offline   Reply With Quote
Old 9th January 2020, 20:04   #1106  |  Link
Taurus
Registered User
 
Taurus's Avatar
 
Join Date: Mar 2002
Location: Krautland
Posts: 903
@l33tmeatwad:
I can confirm your findings.
Any other: directshowsource, dss2, ffvideoSource, etc. is doing fine.
This is on Win7_64bit with avisynth_32bit.
Have'nt tested avisynth_64bit.
Thanks for sharing your insight...
Taurus is offline   Reply With Quote
Old 11th January 2020, 15:26   #1107  |  Link
l33tmeatwad
Registered User
 
l33tmeatwad's Avatar
 
Join Date: Jun 2007
Posts: 414
Awesome, thanks for the speedy fix!
l33tmeatwad is offline   Reply With Quote
Old 11th January 2020, 16:32   #1108  |  Link
Taurus
Registered User
 
Taurus's Avatar
 
Join Date: Mar 2002
Location: Krautland
Posts: 903
Thank you!
Taurus is offline   Reply With Quote
Old 12th January 2020, 12:55   #1109  |  Link
outhud
Registered User
 
Join Date: Aug 2018
Posts: 21
I want to compile L-SMASH-Works for Vapoursynth on Linux. Which repository should I use for this? Are there compile instructions somewhere?
outhud is offline   Reply With Quote
Old 12th January 2020, 15:19   #1110  |  Link
Are_
Registered User
 
Join Date: Jun 2012
Location: Ibiza, Spain
Posts: 321
https://github.com/HolyWu/L-SMASH-Works/

Code:
git clone https://github.com/HolyWu/L-SMASH-Works
cd L-SMASH-Works/VapourSynth/
mkdir build
meson . build/
ninja -C build/
https://github.com/l-smash/l-smash is a dependency for the vapoursynth plugin, besides ffmpeg and vapoursynth itself.

Last edited by Are_; 12th January 2020 at 15:22.
Are_ is offline   Reply With Quote
Old 12th January 2020, 17:17   #1111  |  Link
outhud
Registered User
 
Join Date: Aug 2018
Posts: 21
Quote:
Originally Posted by Are_ View Post
https://github.com/HolyWu/L-SMASH-Works/

Code:
git clone https://github.com/HolyWu/L-SMASH-Works
cd L-SMASH-Works/VapourSynth/
mkdir build
meson . build/
ninja -C build/
https://github.com/l-smash/l-smash is a dependency for the vapoursynth plugin, besides ffmpeg and vapoursynth itself.
Thanks. I've installed ffmpeg, vapoursynth and l-smash. It seems ninja fails on the last step for L-SMASH-Works with:
Code:
 
/usr/bin/ld: /usr/local/lib/liblsmash.a(dts.o): relocation R_X86_64_PC32 against symbol 
`lsmash_remove_dts_reserved_box' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.

Last edited by outhud; 13th January 2020 at 15:43.
outhud is offline   Reply With Quote
Old 12th January 2020, 20:32   #1112  |  Link
Are_
Registered User
 
Join Date: Jun 2012
Location: Ibiza, Spain
Posts: 321
Try to recompile l-smash with
Code:
./configure --disable-static --enable-shared
Are_ is offline   Reply With Quote
Old 13th January 2020, 08:00   #1113  |  Link
outhud
Registered User
 
Join Date: Aug 2018
Posts: 21
Quote:
Originally Posted by Are_ View Post
Try to recompile l-smash with
Code:
./configure --disable-static --enable-shared
That did it! Thanks.
outhud is offline   Reply With Quote
Old 14th January 2020, 17:38   #1114  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,346
Lsmash seek /refresh issue with CPU decoding

Lsmash seek /refresh issue with CPU decoding

If you seek to frame 240, or 480, or 720 then push refresh, the frame jumps to frame 0

This was posted from another forum;
https://www.mediafire.com/file/pvojg...5719.m2ts/file


-Affects avspmod refresh, or vdub2 refresh, or vsedit refresh
-Affects x86/x64 , threads=1, avs/vpy versions, several different lsmash versions

-Decodes ok with ffms2

-Decodes ok with Lsmash decoder="h264_cuvid" (!) . But "wrong" framerate @ 59.94 . Correct frames without refresh bug. If you AssumeFPS(30000,1001), or repeat=true with selecteven() or selectodd(), it works work

-Only occurs on certain P-frames ; eg. if you go to frame 44 and refresh, it does not occur


Could it be related to frame doubling flag ? This from a Panasonic ZS7 / TZ10 that shoots 29.97p with frame doubling

Frame mode : Frame doubling

Problem still persists with repeat=true and selecteven() or selectodd()


Something to do with timecodes ? There is a discrepancy between VFR/CFR time reported by ffms2 ffinfo
poisondeathray is offline   Reply With Quote
Old 19th January 2020, 13:50   #1115  |  Link
manolito
Registered User
 
manolito's Avatar
 
Join Date: Sep 2003
Location: Berlin, Germany
Posts: 3,078
Quote:
Originally Posted by HolyWu View Post
[URL]
LWLibav: Change the default of 'repeat' to true.
Thanks a lot for the update...

Still I think that changing the default for the "repeat" parameter from false to true is not such a good idea. I do not dispute that setting it to true makes sense, my concern is that this change breaks almost all of my LSMASH based scripts.

So far the source filter behavior for all my filters has been like this:

1. MPEG2Source (and all DG source filters) honor the pulldown flags by default.

2. FFMS2 and LSMASH do not honor the pulldown flags by default.

3. DirectShow based source filters also do not honor the pulldown flags, but without specifying the fps parameter they output 29.97 fps, but not by honoring the pulldown flags, but by inserting duplicate frames instead.


I would really appreciate if all the source filter authors could agree on using the same method for treating pulldown flags - once and for all...


Cheers
manolito
manolito is offline   Reply With Quote
Old 19th January 2020, 18:42   #1116  |  Link
manolito
Registered User
 
manolito's Avatar
 
Join Date: Sep 2003
Location: Berlin, Germany
Posts: 3,078
Yes, I know that...

But:
This only applies if I do not do a VFR to CFR conversion by specifying fpsnum and fpsden (at least this is what the readme says). And since all my target formats require CFR I ALWAYS try to specify fpsnum and fpsden, even if the source already is CFR. If this is not possible because the host application does not expose the values for fpsnum and fpsden, I use ChangeFPS(23.976) right after the source filter call to do the VFR to CFR conversion.

And this is where the new default behavior breaks my scripts. Up to now with a soft telecined source LSMASH would spit out 23.976 fps, and the ChangeFPS command would make sure that I get perfect A/V sync (maybe at the cost of some duplicate or dropped frames). The new default behavior spits out 29.97 fps interlaced, and the following ChangeFPS(23.976) will probably ruin the output (because now IVTC is required).

Last edited by manolito; 19th January 2020 at 18:49.
manolito is offline   Reply With Quote
Old 19th January 2020, 19:22   #1117  |  Link
videoh
Useful n00b
 
Join Date: Jul 2014
Posts: 1,667
Seems to me you need to fix your scripts. You can make a simple batch file to do it, yes? While you are at it, define everything and do not rely on defaults. Not meaning to be contrary, just pragmatic and realistic. I think it's a no-brainer to honor pulldown by default.
videoh is offline   Reply With Quote
Old 19th January 2020, 21:01   #1118  |  Link
manolito
Registered User
 
manolito's Avatar
 
Join Date: Sep 2003
Location: Berlin, Germany
Posts: 3,078
So far your source filters have been the only ones which do it that way. Everybody else (ffms2, LSMASH and DirectShowSource based filters) did it differently, and I kind of got used to it. That does not mean that I do not see the merits or your approach, but over the years I have established workflows which are mainly geared at other source filters than yours.

And at my age you do not change your old ways easily. Especially since I use ffms2 much more often than LSMASH, and so far ffms2 does not honor pulldown flags by default.
manolito is offline   Reply With Quote
Old 19th January 2020, 21:26   #1119  |  Link
videoh
Useful n00b
 
Join Date: Jul 2014
Posts: 1,667
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.

Keep the inner child alive. Like Sherman!

Last edited by videoh; 20th January 2020 at 02:40.
videoh is offline   Reply With Quote
Old 20th January 2020, 10:31   #1120  |  Link
manolito
Registered User
 
manolito's Avatar
 
Join Date: Sep 2003
Location: Berlin, Germany
Posts: 3,078
Quote:
Originally Posted by videoh View Post
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.
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?
manolito 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 22:52.


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