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 Usage
Register FAQ Calendar Today's Posts Search

Reply
 
Thread Tools Search this Thread Display Modes
Old 7th January 2015, 16:55   #1  |  Link
rogs
Registered User
 
Join Date: May 2014
Posts: 3
Avisynth script for 'typewriter style' text sequence

I am pretty new to Avisynth usage, so please excuse any comments that may appear to have an obvious solution!

I had a requirement to create a 'typewriter style' incremental text sequence, which needed to appear as if a real (human) typist had made it.
That of course meant using 'random' spacing to make the effect more human like.
Armed with an audio track simulating the correct sequence of key presses, I used my audio editor to discover the exact 'frame' locations of each key press.

I then wrote a simple (but quite long!) AviSynth script using SubtitleEx to create the 'sequential' text file, with characters appearing at selected frame locations.

It all seemed to work pretty well - there's a sample of the finished file HERE - (The file is only about 1MB).

For some reason though, I was forced to create each line separately. Although I could usually run the whole script (about 85 lines) in AvsPMod OK, Virtualdub would crash every time - about 2/3 way through - with the warning:

'An out-of-bounds memory access (access violation) occurred in module 'SubtitleEx'...
...reading address 00FDC511...
...while running thread "Dub-I/O" (thread.cpp:197)'

Cutting the script in half, and all was well (although extra editing was required afterwards of course!).

The script was very simple - if a bit cumbersome at 85 odd lines - but as a beginner I couldn't think of an alternative approach.
I've attached a short sample from the script (the rest is simply a logical continuation of the same).

Is there anything I can do to try and prevent Vdub from crashing when trying to run the whole thing?......

Or should I reconsider the whole idea in a different way?
For this project, having characters appearing at exactly the same interval each time would not be appropriate.

As I say, apologies in advance if I've missed something I should have easily discovered for myself.....
Attached Files
File Type: txt typewriter sample.txt (2.0 KB, 28 views)
rogs is offline   Reply With Quote
Old 7th January 2015, 20:52   #2  |  Link
wonkey_monkey
Formerly davidh*****
 
wonkey_monkey's Avatar
 
Join Date: Jan 2004
Posts: 2,496
You could try setting lastframe of each SubtitleEx to be the the next firstframe-1, e.g. 80 on the first line, 96 on the second line.

This would stop the filter applying itself 90+ times over in the final frames - instead each line would only apply to its own section of the video. I'm not sure whether that would really solve your problem, though, not knowing exactly how SubtitleEx works.

I'm surprised that the earlier text didn't get a little thicker around the edges, especially when, at frame 1100, you'd be painting 90 or so "T" on top of each other in the first position. But again, don't know how SubtitleEx works...
__________________
My AviSynth filters / I'm the Doctor
wonkey_monkey is offline   Reply With Quote
Old 7th January 2015, 21:06   #3  |  Link
rogs
Registered User
 
Join Date: May 2014
Posts: 3
Thanks for that suggestion David. Looking again at the script, I should perhaps have realised myself that effectively 'layering' (up to) 80 odd layers of the same character on top of each other may cause problems.

Visually though, I hadn't noticed any thickening.. although some of the fonts don't look that good at certain sizes.
I'm not sure how (if?) SubtitleEx scales fonts?.... as I say, I'm very much a beginner I'm afraid!

I'll modify the script and see if that improves things. Thanks again for the suggestion.
rogs is offline   Reply With Quote
Old 7th January 2015, 21:15   #4  |  Link
foxyshadis
Angel of Night
 
foxyshadis's Avatar
 
Join Date: Nov 2004
Location: Tangled in the silks
Posts: 9,559
xyVSFilter with an ASS file using the \k tag would be a simpler choice. You can set the secondary color to transparent, so it looks like each character appears at the right time instead of changing color. You just have to convert frames to hundreds of a second (or get them directly from the audio file).
foxyshadis is offline   Reply With Quote
Old 7th January 2015, 21:46   #5  |  Link
rogs
Registered User
 
Join Date: May 2014
Posts: 3
@davidhorman --- That looks to have solved my 'crashing' problem, so thanks again for that suggestion.
As I say, looking again I should perhaps have realised myself.....I shall use my 'beginner' status as a defence!

@foxshadis -- thanks for the suggestion. I've had a quick look at the xyVS filter you mentioned, and I have to say that at -on first reading - my eyes glazed over almost immediately. I shall try and read further....
rogs is offline   Reply With Quote
Reply


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 11:44.


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