Here's my patch for ffdshow's AviSynth filter that implements buffering to
allow AviSynth access to more than just the current frame. It also allows
an AviSynth script to adjust the number of frames, as long as this happens
evenly distributed across the whole video.
I've added 4 new controls to the AviSynth page:
* Buffer back: number of previous frames to keep around, i.e. the number of
frames AviSynth can look back.
* Buffer current: a top limit for the number of frames that will be
buffered for a single output frame; the actual value for this is calculated
by dividing the number of frames going in by the number of frames going out
- but if your video is a million frames and you request only one, without a
limit one million frames would be buffered, which would probably just crash
the player... :)
* Buffer ahead: number of frames to buffer ahead before feeding anything to
AviSynth, i.e. the number of frames AviSynth can look ahead.
* Apply pulldown: applies a 3:2 pulldown to the video according to the
interlace flags that the frames coming in have. Should be activated for
IVTC, bobbing and other stuff that drops or adds frames. Deactivate it if
you want progressive frames straight from a DVD, unless it was flagged
incorrectly.
If you get jerky video, that most of the time means the buffering values
are to small.
For example, the following script needs to buffer 1 frame back and 10
ahead:
TFM(order=1)
TDecimate(mode=1,hybrid=1)
The default 10/10/10 is probably a good compromise; and keeping more back
buffers only uses more memory but doesn't slow things down. Also, you
should probably use something like SetMemoryMax(16) in your script to limit
the amount of memory AviSynth uses.
I've also made a minor modification to the libmpeg2 codec to flag sequence
starts and ends as fieldtype flags so the filter can flush what's left at
the end of a sequence - without that, you'd lose several frames at the end
of the video, which wouldn't be so bad, but static DVD menus that are only
1 frame long would never get displayed without this.
In other news, I'm probably blowing the AviSynth environment away a bit too
often, but that was the only way I could think of to clear AviSynth's cache
- with some modifications at least seeking could probably be made to avoid
this.
Also, I probably should check out how to change the reported FPS value in
the video headers, but it does work as long as the timestamps are
correct...
np: Boards Of Canada - Everything You Do Is A Balloon (Skampler)
Nobody/Anonymous
None
None
Public
|
Date: 2007-05-24 16:03
|
|
Date: 2007-05-23 22:01
|
|
Date: 2007-05-21 07:16
|
|
Date: 2007-05-21 05:30 Logged In: NO |
|
Date: 2007-05-20 20:21
|
|
Date: 2007-05-14 20:39
|
|
Date: 2007-05-14 20:38
|
|
Date: 2007-05-01 15:18
|
|
Date: 2007-04-29 18:48
|
|
Date: 2007-04-15 13:51
|
|
Date: 2007-04-14 08:59
|
|
Date: 2007-04-12 21:04
|
|
Date: 2007-04-12 18:52
|
|
Date: 2007-04-11 21:02
|
|
Date: 2007-04-11 18:54
|
|
Date: 2007-04-09 15:23
|
|
Date: 2007-04-05 10:35
|
|
Date: 2007-04-04 14:39
|
|
Date: 2007-04-04 13:17
|
|
Date: 2007-03-26 19:14
|
|
Date: 2007-03-25 17:29
|
|
Date: 2007-03-23 16:43
|
|
Date: 2007-03-23 15:31
|
|
Date: 2007-03-21 21:32
|
|
Date: 2007-03-21 19:46
|
|
Date: 2007-03-21 13:40
|
|
Date: 2007-03-20 21:16
|
|
Date: 2007-03-20 07:51
|
|
Date: 2007-03-19 22:57
|
|
Date: 2007-03-18 18:25
|
|
Date: 2007-03-18 18:16
|
|
Date: 2007-03-16 21:33
|
|
Date: 2007-03-16 08:28
|
|
Date: 2007-03-16 04:56
|
|
Date: 2007-03-15 22:16
|
|
Date: 2007-03-15 21:56
|
|
Date: 2007-03-15 20:48
|
|
Date: 2007-03-15 16:43
|
|
Date: 2007-03-15 11:50
|
|
Date: 2007-03-15 08:13
|
|
Date: 2007-03-14 18:21
|
|
Date: 2007-03-10 20:11
|
|
Date: 2007-03-10 20:08
|
|
Date: 2007-03-10 20:08
|
|
Date: 2007-03-10 20:07
|
| Filename | Description | Download |
|---|---|---|
| Improved_AviSynth_Buffering_1.diff | Patch against rev. 1007 | Download |
| Improved_AviSynth_Buffering_2.diff | Updated patch to fix problems with Overlay Renderer, still against rev. 1007 | Download |
| Improved_AviSynth_Buffering_3.diff | Updated patch to fix an off-by-one error, make 0/1/0 do no buffering and return the source fieldtype, against rev. 1048 | Download |
| Improved_AviSynth_Buffering_4.diff | Updated patch with AviSynth OSD info, defaults set to 0/10/0 and Apply Pulldown off, reset AviSynth on BeginFlush to work around DVD Navigator bug, against rev. 1074 | Download |
| Improved_AviSynth_Buffering_5.diff | Updated patch with additional OSD info whether pulldown is being applied or not, added debug printouts, agains | Download |
| Improved_AviSynth_Buffering_6.diff | Updated patch: Skip ahead in AviSynth instead of reinitializing everything, make timestamps strictly increasing, remove "Current" buffer setting, add "Use Current" button to apply current max back/ahead buffers, against rev. 1093 | Download |
| Improved_AviSynth_Buffering_7.diff | Updated patch: Fixed a division by zero crash, reported number of back buffers after a seek was to high, script errors now actually produce a clip, against rev. 1094 | Download |
| Improved_AviSynth_Buffering_8.diff | Updated patch: Added some comments, don't always reallocate the buffers, fixed possible crash in the encoder, really make timestamps strictly increasing, against rev. 1103 | Download |
| Improved_AviSynth_Buffering_9.diff | Updated patch: Disable buffering when "Apply pulldown" is off and ahead and back buffers are set to 0, use original timestamps when the number of frames isn't changed, against rev. 1125 | Download |
| Improved_AviSynth_Buffering_11.diff | Updated patch: Fix crashes caused by still uninitialized buffer variables when AviSynth filter instances requested frames right after being created, fix bogus timestamps right after flushing/seeking, against rev. 1126 | Download |
| Improved_AviSynth_Buffering_12.diff | Updated patch: reset AviSynth less, added a help page, one additional pulldown option, aspect ratio variables, against rev. 1167 | Download |
| avisynth_config.png | Filter screenshot for the help page | Download |
| Improved_AviSynth_Buffering_13.diff | Updated patch: checkbox to toggle all buffering on/off, tooltips for buffer edit fields, return a proper black frame if no frames are buffered, fix missing video if script is empty, tweak resources (IDs/dialog), against rev. 1186 | Download |
| Improved_AviSynth_Buffering_14.diff | Updated patch: Fix aspect ratio handling, don't create a new AviSynth clip in setOutFmt if frame size and AR are still the same, quench aspect ratio DPRINTF spam, reset the "Enable buffering" checkbox when resetting the filter settings, against rev. 1193 | Download |
| Field | Old Value | Date | By |
|---|---|---|---|
| status_id | Open | 2007-05-24 16:03 | kurt_pruenner |
| close_date | - | 2007-05-24 16:03 | kurt_pruenner |
| File Added | 230308: Improved_AviSynth_Buffering_14.diff | 2007-05-23 22:01 | kurt_pruenner |
| File Added | 229930: Improved_AviSynth_Buffering_13.diff | 2007-05-20 20:21 | kurt_pruenner |
| File Added | 229152: avisynth_config.png | 2007-05-14 20:39 | kurt_pruenner |
| File Added | 229151: Improved_AviSynth_Buffering_12.diff | 2007-05-14 20:38 | kurt_pruenner |
| File Added | 227361: Improved_AviSynth_Buffering_11.diff | 2007-05-01 15:18 | kurt_pruenner |
| File Added | 227128: Improved_AviSynth_Buffering_9.diff | 2007-04-29 18:48 | kurt_pruenner |
| File Added | 225033: Improved_AviSynth_Buffering_8.diff | 2007-04-15 13:51 | kurt_pruenner |
| File Added | 224588: Improved_AviSynth_Buffering_7.diff | 2007-04-11 18:54 | kurt_pruenner |
| File Added | 224264: Improved_AviSynth_Buffering_6.diff | 2007-04-09 15:23 | kurt_pruenner |
| File Added | 222370: Improved_AviSynth_Buffering_5.diff | 2007-03-26 19:14 | kurt_pruenner |
| File Added | 222194: Improved_AviSynth_Buffering_4.diff | 2007-03-25 17:29 | kurt_pruenner |
| File Added | 221128: Improved_AviSynth_Buffering_3.diff | 2007-03-18 18:16 | kurt_pruenner |
| File Deleted | 219793: | 2007-03-10 20:08 | kurt_pruenner |
| File Added | 219794: Improved_AviSynth_Buffering_2.diff | 2007-03-10 20:08 | kurt_pruenner |
| File Deleted | 219792: | 2007-03-10 20:08 | kurt_pruenner |
| File Added | 219793: Improved_AviSynth_Buffering_2.diff | 2007-03-10 20:08 | kurt_pruenner |
| File Added | 219792: Improved_AviSynth_Buffering_2.diff | 2007-03-10 20:07 | kurt_pruenner |
| File Added | 219519: Improved_AviSynth_Buffering_1.diff | 2007-03-09 00:19 | kurt_pruenner |
Copyright © 2010 Geeknet, Inc. All rights reserved. Terms of Use