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 March 2020, 12:31   #1201  |  Link
gpower2
gMKVExtractGUI author
 
gpower2's Avatar
 
Join Date: Aug 2003
Location: Greece / Thessaloniki
Posts: 251
Hey guys!

I run into a problem with LSmashSource by using the LWLibavAudioSource with AviSynth+ 3.5

The resulting audio script has significantly smaller length from the original file. (03:17 instead of 04:07)
The original audio track properties are:

Code:
Audio
ID                                       : 1
Format                                   : WMA
Format version                           : Version 2
Codec ID                                 : 161
Codec ID/Info                            : Windows Media Audio
Description of the codec                 : Windows Media Audio 9.2 -  20 kbps, 32 kHz, mono (A/V) 1-pass CBR
Duration                                 : 4 min 7 s
Bit rate mode                            : Constant
Bit rate                                 : 1 411 kb/s
Channel(s)                               : 1 channel
Sampling rate                            : 32.0 kHz
Bit depth                                : 16 bits
Stream size                              : 41.6 MiB (21%)
Language                                 : English (Great Britain)
After testing different versions, I finally managed to pinpoint the version that broke this particular script:

Code:
commit 2f9d49914f42c2ffe62a9fc20b48de4d3657ffd9 [revision 921]
Author: Yusuke Nakamura <muken.the.vfrmaniac@gmail.com>
Date:   Tue Dec 20 07:21:13 2016 +0900

    lwindex: Consider draining mode for actual audio decoding.
All the versions from r921 till the latest 20200207 have the wrong result.

I also tested with FFMS2 and I had no problem with that.

Could someone take a look?

Thank you very much!
gpower2 is offline   Reply With Quote
Old 21st March 2020, 10:29   #1202  |  Link
gpower2
gMKVExtractGUI author
 
gpower2's Avatar
 
Join Date: Aug 2003
Location: Greece / Thessaloniki
Posts: 251
Hi!

Unfortunately I can't share the file here, and you have disabled private messages here.

Is there any other channel I can reach you in order to share the file with you?
gpower2 is offline   Reply With Quote
Old 22nd March 2020, 13:13   #1203  |  Link
gpower2
gMKVExtractGUI author
 
gpower2's Avatar
 
Join Date: Aug 2003
Location: Greece / Thessaloniki
Posts: 251
Quote:
Originally Posted by HolyWu View Post
https://github.com/HolyWu/L-SMASH-Wo...ks_20200322.7z
  • Update to FFmpeg-20200322-ea46b45.
  • Update to dav1d 0.6.0.
  • AviSynth: Add Meson build system and fix compilation for non-Windows.
  • lwindex: Fix incorrect frame length being written into index file when decoding WMAv2.
I confirm that the issue I had with WMAv2 is now fixed!

Thank you so much for the swift resolve HolyWu!
gpower2 is offline   Reply With Quote
Old 25th March 2020, 09:44   #1204  |  Link
Morku
Registered User
 
Join Date: Jul 2012
Posts: 208
Can someone help me, please?
When I load this kind of video (e.g. in VirtualDub2) with l-smash as avs: https://www.dropbox.com/s/nq65dc8ha0ogww7/x.mov?dl=1

using:
Code:
vid = LSMASHVideoSource("x.mov", format="YUV420P10")
aud = LSMASHAudioSource("x.mov")

AudioDub(vid, aud)
the audio is distorted. I am using latest HolyWu build. What I am doing wrong?
Thank you!
Morku is offline   Reply With Quote
Old 25th March 2020, 13:18   #1205  |  Link
LigH
German doom9/Gleitz SuMo
 
LigH's Avatar
 
Join Date: Oct 2001
Location: Germany, rural Altmark
Posts: 6,753
Video: AVDH 1280x720 29.97fps 97223kbps [V: Apple Video Media Handler [eng] (dnxhd dnxhr hqx, yuv422p10le, 1280x720, 97223 kb/s)]
Audio: PCM 48000Hz stereo 1536kbps [A: Apple Sound Media Handler [eng] (pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s)]

Codec ID: sowt

My guess would be that the endianness of the PCM audio was not correctly respected.
__________________

New German Gleitz board
MediaFire: x264 | x265 | VPx | AOM | Xvid
LigH is offline   Reply With Quote
Old 25th March 2020, 23:12   #1206  |  Link
qyot27
...?
 
qyot27's Avatar
 
Join Date: Nov 2005
Location: Florida
Posts: 1,419
Quote:
Originally Posted by HolyWu View Post
  • AviSynth: Add Meson build system and fix compilation for non-Windows.
A couple of things I found when trying to actually build/use LSMASHSource on Ubuntu (although I'm pretty sure I also saw it do these on macOS and FreeBSD; I just haven't tested whether the below fixes it on those systems):

Without an install prefix set, it installs to what I guess is meson's default $libdir, so it gets installed to /usr/local/lib/x86_64-linux-gnu/avisynth/ instead of /usr/local/lib/avisynth. Since AviSynth+ installs a pkg-config file with the relevant information, it can pretty much mirror the meson.build for VapourSynth that uses pkg-config to set those values. Or does that cause some kind of conflict with MSVC builds?

The plugin entry point isn't visible, so AviSynth+ can't load it. Setting -fvisibility=default in CPPFLAGS fixed it, although since meson.build has the gnu_symbol_visibility field, that might be a better place for it, or the exact symbols could be marked visible in the source.
qyot27 is offline   Reply With Quote
Old 26th March 2020, 00:49   #1207  |  Link
sl1pkn07
Pajas Mentales...
 
Join Date: Dec 2004
Location: Spanishtán
Posts: 496
in ubuntu pkg-config see the path /usr/local/lib/pkgconfig by default?

if is no, you need set PKG_CONFIG_LIBDIR or PKG_CONFIG_PATH pounts to "/usr/local/lib/pkgconfig:" for meson can look at it

EDIT: good cat about -fvisibility=default !

edit2: patch

Code:
diff --git a/AviSynth/meson.build b/AviSynth/meson.build
index b20c0d4..97c0255 100644
--- a/AviSynth/meson.build
+++ b/AviSynth/meson.build
@@ -57,6 +57,7 @@ sources = [
 includes = include_directories('../include')
 
 deps = [
+  dependency('avisynth'),
   dependency('liblsmash'),
   dependency('libavcodec', version : '>=58.18.0'),
   dependency('libavformat', version : '>=58.12.0'),
@@ -78,5 +79,5 @@ shared_module('lsmashsource', sources,
   include_directories : includes,
   install : true,
   install_dir : join_paths(get_option('libdir'), 'avisynth'),
-  gnu_symbol_visibility : 'hidden'
+  gnu_symbol_visibility : 'default'
 )
__________________
[AUR] Vapoursynth Stuff
[AUR] Avisynth Stuff

Last edited by sl1pkn07; 26th March 2020 at 01:47.
sl1pkn07 is offline   Reply With Quote
Old 26th March 2020, 02:50   #1208  |  Link
qyot27
...?
 
qyot27's Avatar
 
Join Date: Nov 2005
Location: Florida
Posts: 1,419
I'm logged in under Windows at the moment, but as I do have WSL with Ubuntu 19.10 set up,
Code:
$ pkg-config --variable pc_path pkg-config
/usr/local/lib/x86_64-linux-gnu/pkgconfig:/usr/local/lib/pkgconfig:/usr/local/share/pkgconfig:/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig
So yes, it sees both (and more), with the path meson used at the front. But it appears like the reason it picks that one first for installing liblsmashsource.so is because while FFmpeg and L-SMASH are both detected via pkgconfig, AviSynth is not. As soon as I hook AviSynth up into the pkg-config queries in meson.build¹, it does install to /usr/local/lib/avisynth just like ConvertStacked does.

¹
Code:
diff --git a/AviSynth/meson.build b/AviSynth/meson.build
index b20c0d4..75a92fa 100644
--- a/AviSynth/meson.build
+++ b/AviSynth/meson.build
@@ -56,7 +56,10 @@ sources = [
 
 includes = include_directories('../include')
 
+avisynth_dep = dependency('avisynth').partial_dependency(compile_args : true, includes : true)
+
 deps = [
+  dependency('avisynth'),
   dependency('liblsmash'),
   dependency('libavcodec', version : '>=58.18.0'),
   dependency('libavformat', version : '>=58.12.0'),
@@ -77,6 +80,6 @@ shared_module('lsmashsource', sources,
   dependencies : deps,
   include_directories : includes,
   install : true,
-  install_dir : join_paths(get_option('libdir'), 'avisynth'),
-  gnu_symbol_visibility : 'hidden'
+  install_dir : join_paths(avisynth_dep.get_pkgconfig_variable('libdir'), 'avisynth'),
+  gnu_symbol_visibility : 'default'
 )
Make sure to check the .so with nm -D to make sure that AvisynthPluginInit3 is exported.
qyot27 is offline   Reply With Quote
Old 26th March 2020, 07:11   #1209  |  Link
sl1pkn07
Pajas Mentales...
 
Join Date: Dec 2004
Location: Spanishtán
Posts: 496
Code:
└───╼  nm -D /usr/lib/avisynth/liblsmashsource.so | grep Avis
000000000001de70 T AvisynthPluginInit3
pkgconfig is not used to know where to install the library, it is used to find where the libraries installed on the system for build the projects

you need set manually where install the libraries in meson with `--libdir` (or `--libexecdir`) and `--prefix` if you want install in a custom path

see https://mesonbuild.com/Configuring-a...directory.html
__________________
[AUR] Vapoursynth Stuff
[AUR] Avisynth Stuff

Last edited by sl1pkn07; 26th March 2020 at 07:29.
sl1pkn07 is offline   Reply With Quote
Old 26th March 2020, 08:10   #1210  |  Link
qyot27
...?
 
qyot27's Avatar
 
Join Date: Nov 2005
Location: Florida
Posts: 1,419
I am well aware of how pkg-config and custom prefixes and install dirs work.

That doesn't change the fact that I said 'to mirror the meson.build for VapourSynth':
https://github.com/HolyWu/L-SMASH-Wo...eson.build#L65

And that this means it goes into the same plugin directory VapourSynth itself creates and uses for the plugins that come with the upstream source. Something which the meson.build for AviSynth is not doing at the current time.
qyot27 is offline   Reply With Quote
Old 26th March 2020, 08:46   #1211  |  Link
sl1pkn07
Pajas Mentales...
 
Join Date: Dec 2004
Location: Spanishtán
Posts: 496
Code:
Installing liblsmashsource.so to /usr/local/lib/avisynth
without setting libdir/prefix. but my avisynth (include .pc) is installed in /usr/lib

Code:
└───╼  yay -Ql avisynthplus-git 
avisynthplus-git /etc/
avisynthplus-git /etc/avisynth/
avisynthplus-git /etc/avisynth/avisynth.conf
avisynthplus-git /usr/
avisynthplus-git /usr/include/
avisynthplus-git /usr/include/avisynth/
avisynthplus-git /usr/include/avisynth/avisynth.h
avisynthplus-git /usr/include/avisynth/avisynth_c.h
avisynthplus-git /usr/include/avisynth/avs/
avisynthplus-git /usr/include/avisynth/avs/alignment.h
avisynthplus-git /usr/include/avisynth/avs/capi.h
avisynthplus-git /usr/include/avisynth/avs/config.h
avisynthplus-git /usr/include/avisynth/avs/cpuid.h
avisynthplus-git /usr/include/avisynth/avs/minmax.h
avisynthplus-git /usr/include/avisynth/avs/posix.h
avisynthplus-git /usr/include/avisynth/avs/types.h
avisynthplus-git /usr/include/avisynth/avs/win.h
avisynthplus-git /usr/lib/
avisynthplus-git /usr/lib/libavisynth.so
avisynthplus-git /usr/lib/pkgconfig/
avisynthplus-git /usr/lib/pkgconfig/avisynth.pc
my /usr/local is complety pruned, only system directories

Code:
└───╼  LC_ALL=C pacman -Qo /usr/local
/usr/local/ is owned by filesystem 2019.10-2
in avisynth.pc
Code:
└───╼  cat /usr/lib/pkgconfig/avisynth.pc |grep ^libdir
libdir=${exec_prefix}/lib
meson not know the variable '${exec_prefix}'

so yes, i think is working
__________________
[AUR] Vapoursynth Stuff
[AUR] Avisynth Stuff

Last edited by sl1pkn07; 26th March 2020 at 10:19.
sl1pkn07 is offline   Reply With Quote
Old 27th March 2020, 16:11   #1212  |  Link
Morku
Registered User
 
Join Date: Jul 2012
Posts: 208
Quote:
Originally Posted by LigH View Post
Video: AVDH 1280x720 29.97fps 97223kbps [V: Apple Video Media Handler [eng] (dnxhd dnxhr hqx, yuv422p10le, 1280x720, 97223 kb/s)]
Audio: PCM 48000Hz stereo 1536kbps [A: Apple Sound Media Handler [eng] (pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s)]

Codec ID: sowt

My guess would be that the endianness of the PCM audio was not correctly respected.
And is there something I can change? Or just wait for a fix?
Morku is offline   Reply With Quote
Old 27th March 2020, 17:18   #1213  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,346
Quote:
Originally Posted by Morku View Post
And is there something I can change? Or just wait for a fix?
Use another audio source filter for now as a temporary workaround

eg
Code:
vid = LSmashVideoSource("x.mov")
aud = FFAudioSource("x.mov")

AudioDub(vid,aud)
Actually L-Smash works, if you use LWLibavAudioSource instead of LSmashAudioSource. It produces an index. But not sure why LSmashAudioSource fails


Code:
vid = LSmashVideoSource("x.mov")
aud = LWLibavAudioSource("x.mov")

AudioDub(vid,aud)

Last edited by poisondeathray; 27th March 2020 at 17:21.
poisondeathray is offline   Reply With Quote
Old 27th March 2020, 20:35   #1214  |  Link
Morku
Registered User
 
Join Date: Jul 2012
Posts: 208
wow, I dodn't expect a solution that quick.
Yes, the new "temporary fix" build working fine No distorted audio. Thank you.

The FFAudioSource workaround is also doing the job, but indexing takes really a long time here.
Morku is offline   Reply With Quote
Old 28th March 2020, 10:35   #1215  |  Link
LigH
German doom9/Gleitz SuMo
 
LigH's Avatar
 
Join Date: Oct 2001
Location: Germany, rural Altmark
Posts: 6,753
Nice to know that I guessed well!
__________________

New German Gleitz board
MediaFire: x264 | x265 | VPx | AOM | Xvid
LigH is offline   Reply With Quote
Old 13th April 2020, 10:58   #1216  |  Link
kedautinh12
Registered User
 
Join Date: Jan 2018
Posts: 2,153
New patched for ffmpeg 4.2.2
https://gist.github.com/maki-rxrz/5a...853b5358fb8a29
kedautinh12 is offline   Reply With Quote
Old 24th April 2020, 08:34   #1217  |  Link
bruno321
Registered User
 
Join Date: Oct 2018
Posts: 133
Quote:
Originally Posted by jones1913 View Post
Was this the last build for XP users? I'm trying it now with latest AVS+ and I'm getting "system exception -- access violation".

(If there's no LSMASHVideo for XP, what's a good alternative that would allow me to feed an m2ts directly into avspmod? DirectShowSource is giving me "no video")

Last edited by bruno321; 24th April 2020 at 09:31.
bruno321 is offline   Reply With Quote
Old 24th April 2020, 10:40   #1218  |  Link
videoh
Useful n00b
 
Join Date: Jul 2014
Posts: 1,667
Quote:
Originally Posted by bruno321 View Post
If there's no LSMASHVideo for XP, what's a good alternative
Update to Win10.
videoh is offline   Reply With Quote
Old 24th April 2020, 10:44   #1219  |  Link
bruno321
Registered User
 
Join Date: Oct 2018
Posts: 133
Ah thanks, I hadn't thought of that.

Any other answers?
bruno321 is offline   Reply With Quote
Old 24th April 2020, 11:03   #1220  |  Link
MeteorRain
結城有紀
 
Join Date: Dec 2003
Location: NJ; OR; Shanghai
Posts: 894
Windows XP does not have the functionality to correctly run modern applications.

In C++ application, static variables need to be safely initialized to properly run. It needs a large thread local storage, which Windows XP doesn't have. Of course you can disable thread safe init and re-compile, which allows it to run. But then you'll suffer thread-unsafe init and it will potentially give you incorrect result silently.

For now, most XP compatible filters are provided giving the notice that you are willing to take the risk of unreliable running results.

TL;DR: Recompile it with "/Zc:threadSafeInit-" option, make it unsafe, and it should work for you.
__________________
Projects
x265 - Yuuki-Asuna-mod Download / GitHub
TS - ADTS AAC Splitter | LATM AAC Splitter | BS4K-ASS
Neo AviSynth+ filters - F3KDB | FFT3D | DFTTest | MiniDeen | Temporal Median
MeteorRain 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:14.


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