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 March 2014, 08:42   #1861  |  Link
qyot27
...?
 
qyot27's Avatar
 
Join Date: Nov 2005
Location: Florida
Posts: 1,419
Quote:
Originally Posted by Zathor View Post
I cannot test it with old C plugins. Do you have an older build available? You have modified your last post here so that the download is not available anymore. But if I remember correctly I had a similar problem with it (the cannot write protected memory error) and that was the reason why I had not added it to MeGUI.
C-plugin builds of 2.16 and 2.17 are available from the Google Code site:
https://code.google.com/p/ffmpegsource/downloads/list?can=1&q=cplugin&colspec=Filename+Summary+Uploaded+ReleaseDate+Size+DownloadCount

I didn't build them, but if those show the issue, then it'll at least show that it's not something recent.

My own limited tests still show it with a brand new FFmpeg, so it's not that, and the -D_SYSCRT option mentioned in the FFMS2 docs didn't seem to have an effect.

This narrows it down to it being in the C plugin, it being a problem with AviSynth's C interface itself, or something that occurred to me yesterday, a side-effect of linking in a static version of libgcc (which could explain why the memory increase happens in roughly equal chunks, although I'm not sure why that would result in memory not being freed when the script closes, aside from the fact that VirtualDub keeps AviSynth.dll and DevIL.dll loaded even after the user closes the script).

The solution for that last one is pretty straightforward, but it's a lot more inconvenient (since it requires re-compiling my entire MinGW-w64 cross environment and the entire dependency chain for FFmpeg*, and then distributing libgcc_s.dll as a system lib with the FFMS2 package).

*well, I'd run the test in a VM, but if this is really the source of the problem, normal builds with a shared libgcc would have to wait until mid-April (I recompile my cross environment every six months anyway, after upgrading to the newest release of Ubuntu).

Last edited by qyot27; 26th March 2014 at 08:47.
qyot27 is offline   Reply With Quote
Old 26th March 2014, 22:44   #1862  |  Link
Zathor
Registered User
 
Join Date: Nov 2009
Posts: 2,405
Quote:
Originally Posted by qyot27 View Post
C-plugin builds of 2.16 and 2.17 are available from the Google Code site:
https://code.google.com/p/ffmpegsource/downloads/list?can=1&q=cplugin&colspec=Filename+Summary+Uploaded+ReleaseDate+Size+DownloadCount

I didn't build them, but if those show the issue, then it'll at least show that it's not something recent.
Yes, based on my limited tests both builds also have the same problem. I can see a more or less constant memory increase.
Zathor is offline   Reply With Quote
Old 30th March 2014, 15:28   #1863  |  Link
qyot27
...?
 
qyot27's Avatar
 
Join Date: Nov 2005
Location: Florida
Posts: 1,419
As an update, my attempt at using a shared version of GCC (by simply installing the repository version of the MinGW-w64 toolchain in 14.04 beta) crashed and burned. Even with the requisite dlls present for FFMS2/ffmsindex to rely on, it ended up failing to index immediately, even though it didn't crash. I still need to test with Clang, though.
qyot27 is offline   Reply With Quote
Old 6th April 2014, 12:30   #1864  |  Link
Zathor
Registered User
 
Join Date: Nov 2009
Posts: 2,405
I am using ffms2_r827-msvc2010 now for nearly 2 weeks and had not a single problem and especially no memory problem. So thank you very much for this build!
Zathor is offline   Reply With Quote
Old 8th April 2014, 08:04   #1865  |  Link
LigH
German doom9/Gleitz SuMo
 
LigH's Avatar
 
Join Date: Oct 2001
Location: Germany, rural Altmark
Posts: 6,753
Other users in the german doom9/Gleitz board report a wrong audio skew in certain cases, like this sample (40 MB).

This file is reported to have a negative delay, which FFMS2 apparently tries to respect by stuffing the audio stream, but the duration seems to be incorrect, 23 ms missing.
__________________

New German Gleitz board
MediaFire: x264 | x265 | VPx | AOM | Xvid
LigH is offline   Reply With Quote
Old 8th April 2014, 15:35   #1866  |  Link
sneaker_ger
Registered User
 
Join Date: Dec 2002
Posts: 5,565
To add more info, timecodes of the sample:
Code:
track_ID: 1
Media timescale: 3000
DTS = 0, CTS = 0
DTS = 100, CTS = 100
DTS = 200, CTS = 200
DTS = 300, CTS = 300
[...]
DTS = 22200, CTS = 22200
DTS = 22300, CTS = 22300

track_ID: 2
Media timescale: 44100
Edit box of the video track:
Code:
            [edts: Edit Box]
                position = 248
                size = 36
                [elst: Edit List Box]
                    position = 256
                    size = 28
                    version = 0
                    flags = 0x000000
                    entry_count = 1
                    entry[0]
                        segment_duration = 21750
                        media_time = 598
                        media_rate = 1.000000
Both duration and sync seem to be off, but I'm not sure I interpreted the edit box correctly (negative video delay 598s/3000?).
sneaker_ger is offline   Reply With Quote
Old 28th April 2014, 10:31   #1867  |  Link
Overdrive80
Anime addict
 
Overdrive80's Avatar
 
Join Date: Feb 2009
Location: Spain
Posts: 673
Possible bug in ffvideosource??? http://forum.doom9.org/showthread.ph...75#post1679175
__________________
Intel i7-6700K + Noctua NH-D15 + Z170A XPower G. Titanium + Kingston HyperX Savage DDR4 2x8GB + Radeon RX580 8GB DDR5 + ADATA SX8200 Pro 1 TB + Antec EDG750 80 Plus Gold Mod + Corsair 780T Graphite
Overdrive80 is offline   Reply With Quote
Old 28th April 2014, 10:36   #1868  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,548
Quote:
Originally Posted by Overdrive80 View Post
No, not at all. Because of these reasons:

1. The two scripts are not equivalent, which is evident since you need assumefps() in there at all
2. Seeking in demuxed video streams is never accurrate
3. Seeking in mpeg-ish containers usually doesn't end well either
4. Why megui is adding vfr to cfr conversion to every ffvideosource call is also a bit of a mystery
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 28th April 2014, 11:45   #1869  |  Link
Overdrive80
Anime addict
 
Overdrive80's Avatar
 
Join Date: Feb 2009
Location: Spain
Posts: 673
Ok, thanks for you answer.
__________________
Intel i7-6700K + Noctua NH-D15 + Z170A XPower G. Titanium + Kingston HyperX Savage DDR4 2x8GB + Radeon RX580 8GB DDR5 + ADATA SX8200 Pro 1 TB + Antec EDG750 80 Plus Gold Mod + Corsair 780T Graphite
Overdrive80 is offline   Reply With Quote
Old 28th April 2014, 13:12   #1870  |  Link
hello_hello
Registered User
 
Join Date: Mar 2011
Posts: 4,823
Quote:
Originally Posted by Overdrive80 View Post
Quote:
Originally Posted by Myrsloik View Post
No, not at all. Because of these reasons:
I did some more testing. It does appear to be a ffmpegsource bug.

Quote:
Originally Posted by Myrsloik View Post
1. The two scripts are not equivalent, which is evident since you need assumefps() in there at all
assumefps() wasn't needed. It was just a test.

Quote:
Originally Posted by Myrsloik View Post
4. Why megui is adding vfr to cfr conversion to every ffvideosource call is also a bit of a mystery
I think it's a good idea, because the input is expected to be CFR.
I tested the sample myself and it appears to only be a problem when the video is in an AVI created by VirtualDub(Mod) and the frame rate is 23.976 (well the only other frame rate I tested was 25fps and that was fine). If you take the AVI created by VirtualDubMod and remux it with avimux, the problem goes away, as it does if you remux as an MKV and index, so (not understanding how it works myself) there appears to be some sort of frame rate miscommunication going on between VirtualDub created AVIs and ffmpegsource.
hello_hello is offline   Reply With Quote
Old 29th April 2014, 01:54   #1871  |  Link
foxyshadis
ангел смерти
 
foxyshadis's Avatar
 
Join Date: Nov 2004
Location: Lost
Posts: 9,558
Numerator/Denominator overflow? Does the import use 32-bit arithmetic? Avisynth used to export enormous fractions that required 64-bit arithmetic to properly handle, until it was changed in 2.5.7 or 2.5.8 to recognize certain common numbers and reduce the rest. Any old files from before then will still have the bad behavior, at least until remuxed by something that'll reduce the fractions.
foxyshadis is offline   Reply With Quote
Old 29th April 2014, 06:45   #1872  |  Link
hello_hello
Registered User
 
Join Date: Mar 2011
Posts: 4,823
Quote:
Originally Posted by foxyshadis View Post
Numerator/Denominator overflow? Does the import use 32-bit arithmetic?
I vaguely understand what you're saying but I don't know how to check that.

The file in question was created via Avisynth 2.6.0.4, at least in my case. I also tried AviSynth+ 2.6.0.5 portable with the same result.
I originally thought it was a VirtualDub problem but after testing a little more I think I was wrong. If I create the AVI using MeGUI (the writing application is Lavf55.33.100) the same problem occurs. The encoder used seems to make no difference. I've tried Lagaryth, huffyuv and Xvid.

For whatever reason remuxing the AVI with Avimux fixes the problem. As does remuxing as an MKV with MKVMergeGUI. Remuxing with VirtualDub doesn't fix the problem.

Adding fpsnum and fpsden to each script seems like a good idea to me. That way the frame rate is always constant and should help prevent audio sync problems. If the frame rate is constant in the first place, adding them should make no difference.
It's one of the reasons I use ffvideosource in preference to LSmash, which doesn't (as far as I know) have a similar frame rate conversion function.
hello_hello is offline   Reply With Quote
Old 29th April 2014, 07:15   #1873  |  Link
hello_hello
Registered User
 
Join Date: Mar 2011
Posts: 4,823
While we're on the subject, here's a sample of an instance where adding fpsnum and fpsden to a script is a good idea. Aside from one missing/duplicate frame, the video is constant frame rate, 25fps. Without fpsnum and fpsden in the script, ffvideosource outputs a total of one frame less, and a frame rate of 24.971fps (it seems to output the average frame rate). Lsmash does likewise, with no way to tell it not to. AviSource/DirectShowSource "get it right" and output the correct number of frames and the correct frame rate.

I don't quite understand why ffvideosource and LSmash don't output the same as AviSource by default, so fpsnum and fpsden wouldn't be required. Without them, I think the only way to encode the video "correctly" would be to extract the timecodes from the original file and use them when remuxing the encoded version. By adding fpsnum and fpsden to each script, MeGUI eliminates the need for doing so and the encoded version has a "constant frame rate".

http://ge.tt/6fbWjpe1/v/0

Last edited by hello_hello; 29th April 2014 at 07:17.
hello_hello is offline   Reply With Quote
Old 22nd May 2014, 12:28   #1874  |  Link
qyot27
...?
 
qyot27's Avatar
 
Join Date: Nov 2005
Location: Florida
Posts: 1,419
FFMS2 C-plugin r892+41

Optimized for Pentium-III and SSE.

FFmpeg r63367 git-f932e5f, built on May 22 2014 03:46:47 with gcc 4.9.0 (GCC):
Code:
  libavutil      52. 86.100 / 52. 86.100
  libavcodec     55. 63.100 / 55. 63.100
  libavformat    55. 40.100 / 55. 40.100
  libavdevice    55. 13.101 / 55. 13.101
  libavfilter     4.  5.100 /  4.  5.100
  libavresample   1.  2.  0 /  1.  2.  0
  libswscale      2.  6.100 /  2.  6.100
  libswresample   0. 19.100 /  0. 19.100
  libpostproc    52.  3.100 / 52.  3.100

  configuration:
    --prefix=/home/qyot27/win32_build
    --cross-prefix=i686-w64-mingw32-
    --enable-gpl
    --enable-version3
    --disable-w32threads
    --enable-avresample
    --disable-encoders
    --disable-muxers
    --disable-doc
    --disable-debug
    --disable-network
    --disable-hwaccels
    --disable-indevs
    --disable-outdevs
    --cpu=pentium3
    --extra-cflags='-mfpmath=sse -march=pentium3 -msse -mtune=pentium3 -DPTW32_STATIC_LIB'
    --target-os=mingw32
    --arch=x86
    --optflags=-O0
There's now a native Opus decoder in libavcodec, so there's no longer a need to link to libopus just for that.


EDIT 2014-06-29: Updated build here.

Last edited by qyot27; 29th June 2014 at 05:20.
qyot27 is offline   Reply With Quote
Old 24th May 2014, 16:04   #1875  |  Link
zinga
Registered User
 
Join Date: Sep 2006
Posts: 31
Hi, just wondering, are 64-bit Windows builds available from anywhere?
A number of builds used to be provided on the Google Code page, but they're now rather outdated.
Thanks.
zinga is offline   Reply With Quote
Old 24th May 2014, 16:14   #1876  |  Link
LigH
German doom9/Gleitz SuMo
 
LigH's Avatar
 
Join Date: Oct 2001
Location: Germany, rural Altmark
Posts: 6,753
The original AviSynth 2.x did not continue the development of its 64-bit core version, which was left in a quite unstable state, therefore only few plugins were made for that platform.

Now with AviSynth plus, development appears to be rather equal for both 32-bit and 64-bit architectures, therefore support for both may be more useful again.
__________________

New German Gleitz board
MediaFire: x264 | x265 | VPx | AOM | Xvid
LigH is offline   Reply With Quote
Old 24th May 2014, 22:42   #1877  |  Link
foxyshadis
ангел смерти
 
foxyshadis's Avatar
 
Join Date: Nov 2004
Location: Lost
Posts: 9,558
Thanks qyot27, so far this is the only way I can decode HEVC. (Even the command-line fails usually.) It works great.
foxyshadis is offline   Reply With Quote
Old 24th May 2014, 22:48   #1878  |  Link
jackoneill
unsigned int
 
jackoneill's Avatar
 
Join Date: Oct 2012
Location: 🇪🇺
Posts: 760
Quote:
Originally Posted by qyot27 View Post
Code:
    --optflags=-O0
Say, doesn't that disable compiler optimisations?
__________________
Buy me a "coffee" and/or hire me to write code!
jackoneill is offline   Reply With Quote
Old 25th May 2014, 01:29   #1879  |  Link
qyot27
...?
 
qyot27's Avatar
 
Join Date: Nov 2005
Location: Florida
Posts: 1,419
Quote:
Originally Posted by jackoneill View Post
Say, doesn't that disable compiler optimisations?
Yeah, although it's mostly to avoid the flacdec issues caused by using -O2 with GCC 4.9.0 (it's fixed in the 4.9.1 prerelease branch).

I've not done any performance testing to see how much impact GCC's optimizations really have (generally, -O0 gets used with debug builds, so it may just be simpler to compare debug and release builds for any performance gap).
qyot27 is offline   Reply With Quote
Old 29th June 2014, 05:19   #1880  |  Link
qyot27
...?
 
qyot27's Avatar
 
Join Date: Nov 2005
Location: Florida
Posts: 1,419
FFMS2 C-plugin r927+41

Optimized for Pentium-III and SSE.

ffmpeg version r64300 git-f02a440 Copyright (c) 2000-2014 the FFmpeg developers
built on Jun 28 2014 22:59:08 with gcc 4.9.0 (GCC)
Code:
  libavutil      52. 90.101 / 52. 90.101
  libavcodec     55. 68.100 / 55. 68.100
  libavformat    55. 44.100 / 55. 44.100
  libavdevice    55. 13.101 / 55. 13.101
  libavfilter     4.  9.100 /  4.  9.100
  libavresample   1.  3.  0 /  1.  3.  0
  libswscale      2.  6.100 /  2.  6.100
  libswresample   0. 19.100 /  0. 19.100
  libpostproc    52.  3.100 / 52.  3.100

  configuration:
    --prefix=/home/qyot27/win32_build
    --cross-prefix=i686-w64-mingw32-
    --enable-gpl
    --enable-version3
    --disable-w32threads
    --enable-avresample
    --disable-encoders
    --disable-muxers
    --disable-doc
    --disable-debug
    --disable-network
    --disable-hwaccels
    --disable-indevs
    --disable-outdevs
    --cpu=pentium3
    --extra-cflags='-mfpmath=sse -march=pentium3 -msse -mtune=pentium3 -DPTW32_STATIC_LIB'
    --target-os=mingw32
    --arch=x86
    --optflags=-O0
EDIT 2014-07-30: Updated build here.

Last edited by qyot27; 30th July 2014 at 18:00.
qyot27 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:35.


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