Log in

View Full Version : [new filter] insert framenumber (fast)


hanfrunz
24th March 2005, 22:23
Hello everyone,

Here (http://www.neuron2.net/hanfrunz/framenumber_version_0.4.zip) is my new little filter. It displays the actual framenumber + a choosen offset in the lower left or right corner of the video. It is very fast, because it does not use any windows fonts or antialising or any other stuff like that. It uses a hard coded font and just copies it to the videomemory.

UPDATE version 0.4b: here (http://neuron2.net/hanfrunz/framenumber_version_0.4b.zip)


hanfrunz

Didée
25th March 2005, 00:56
Mmmh, that fluids editing, especially the weird ones. Good idea, thanks! :)

slk001
28th March 2005, 20:34
Good job! It really IS fast, too!

HighInBC
12th April 2005, 20:17
You rock! I am always astonished at how slow a clip becomes by adding the internal show frame thingy!

Mabye the AVISynth dev team should consider a similiar aproach to the internal filter.

Thanks!

chaynik
4th August 2009, 14:52
Sorry to dig up an ancient thread, I just wanted to say that I love this filter and have been using it extensively.

Is it at all possible to add ShowSMPTE functionality to this filter? I love the idea of using a simple hardcoded font without all the fancy shmancy antialiasing and font selection ShowSMPTE allows for (completely unnecessary in my opinion).

Thanks in advance.

hanfrunz
4th August 2009, 16:46
Is it at all possible to add ShowSMPTE functionality to this filter?

I always thought about implemening this :)
I hope i find some free minutes in the next days to do it.

hanfrunz

chaynik
4th August 2009, 23:39
I always thought about implemening this :)
I hope i find some free minutes in the next days to do it.

hanfrunz

That would be amazing! Would it also be possible to set a Y offset for the text placement for cases when there's letterbox and you want the framenumber/TCG to be in active picture. Right now I've been cropping to active picture, inserting framenumber() and then recreating the letterbox with AddBorders(). A simple framenumber(Y=n) would be so much more efficient.

Thanks in advance!

b66pak
5th August 2009, 16:48
thanks...
_

hanfrunz
11th August 2009, 15:04
Hello everyone,

ok here (http://www.sendspace.com/file/1uipdk) is a new version of frameNumber and a new funcion frameTC. FrameTC inserts a SMPTE-timecode like the internal avs-function showsmpte. But it uses a hard coded font and is faster (i think :) )
If i find the time i'll add a string based offset for the frameTC function. Right now offset=number of frames.

Read the readme file in the packages for more info on how to use it.

regards
hanfrunz

chaynik
12th August 2009, 22:36
Thank you, hanfrunz!

After some testing, it seems that the offset argument of the frameTC function doesn't work properly in YV12, with the output looking like this:
http://i28.tinypic.com/6ozrph.png

After converting to YUY2, it displays properly, but the "dots" (what's the proper term for these?) don't follow the digits themselves;
http://i26.tinypic.com/10xzehk.png

Would be great if you can fix these. Also, would it be possible to add an hour offset? That should be easier than a whole XX:XX:XX:XX string like you mentioned, I believe, and very practical. :)

Thanks again!

hanfrunz
13th August 2009, 09:16
mmh i'll check the yv12 issue. If you like an one hour offset you can just use offset=framerate()*60*60

regards,
hanfrunz

Gavino
13th August 2009, 09:45
If you like an one hour offset you can just use offset=framerate()*60*60
That would have to be round(framerate()*60*60), since offset is an int and framerate returns a float.

hanfrunz
13th August 2009, 09:49
That would have to be round(framerate()*60*60), since offset is an int and framerate returns a float.

Yes of course :) I assumed 25fps, because i live in PAL-land.

Here (http://www.sendspace.com/file/4x54s3) is a new bug-fixed version 0.2b.

Gavino
13th August 2009, 09:54
Even if it's 25fps, it's still a float, so you would get an error without round().

hanfrunz
13th August 2009, 10:08
oops another small bug fixed in the latest version 0.2c. Get it here (http://www.sendspace.com/file/xcq3y7)

AlanHK
18th November 2009, 06:03
oops another small bug fixed in the latest version 0.2c. Get it here (http://www.sendspace.com/file/xcq3y7)


This file has been deleted. Please contact the uploader and ask them to upload the file again. sendspace is not able to help you in this matter.


How big is this?
Maybe just attach it to your posts here, or find a home for it at http://avisynth.org/warpenterprises/

Guest
18th November 2009, 06:05
I'd be happy to host it at my website.

Taurus
18th November 2009, 13:06
The links to your builds http://www.sendspace.com/file/xcq3y7 are dead.
May I suggest http://www.mediafire.com/ for your uploads?

hanfrunz
24th November 2009, 10:43
Hello everyone,

i updated the downloadlink (see first post)
@Neuron2: it would be very nice if you put it on your website!

regards,
hanfrunz

Taurus
24th November 2009, 10:56
Thank you

AlanHK
24th November 2009, 12:23
Thanks, I got 0.2c.
But if I call it I just get
"script error: there is no function named "framenumber" "
and the same for FrameTC

Yes, I put the DLL in the plugins folder.

Is is just me?

I have Avisynth 2.58 on Win2k.

hanfrunz
24th November 2009, 14:49
mmh just checked it here on my xp system, works fine. I compiled it witc vc7 maybe you need some dlls? Anyone with similar problems? Are there general tips for compiling?

regards,
hanfrunz

Gavino
24th November 2009, 15:19
Yes, I put the DLL in the plugins folder.
Try loading it explicitly with LoadPlugin.
That way you can see if it is failing to load.

LoRd_MuldeR
24th November 2009, 16:11
mmh just checked it here on my xp system, works fine. I compiled it witc vc7 maybe you need some dlls?

Why not statically link the VC runtime library and avoid any dependency on shared libraries?

AlanHK
24th November 2009, 16:41
Try loading it explicitly with LoadPlugin.

I get "Avisynth open failure" and a load of non-ascii gibberish.

b66pak
22nd January 2010, 20:51
any working link for "UPDATE version 0.2c"?
_

AlanHK
23rd January 2010, 18:31
any working link for "UPDATE version 0.2c"?
_

Attached, hope it works for you.

IanB
23rd January 2010, 20:51
Neat!

Small issue, in the YUV formats 100% white is 235 and 100% black is 16, you are using 255 and 0. Also neutral chroma is 128 not 127.

Maybe something like :-chara = character[characternum][(h*8 + (w/2))] ? 235 : 16;

b66pak
23rd January 2010, 20:54
@AlanHK thanks a lot...
_

AlanHK
24th January 2010, 04:14
@AlanHK thanks a lot...
_
Glad to help, though it doesn't work for me.

b66pak
24th January 2010, 19:24
neither for me...i reversed to the first version...
_

hanfrunz
26th January 2010, 16:39
Hello everyone,

here (http://neuron2.net/hanfrunz/framenumber_version_0.3.zip) is a new version. I fixed the levels in YUY2 and YV12 colorspace according to ITU R-601 and compiled it as a static dll. I hope it's working now on every pc.

regards,
hanfrunz

AlanHK
27th January 2010, 04:39
I hope it's working now on every pc.

Thanks, 0.3 works on Win2k now.

It would be nice to be able to position the framenumber at the top or the middle of the frame, as often the bottom is cropped off. Say using the same keypad-style "align=" as Subtitle()

7 8 9
4 5 6
1 2 3

Or using "y=" as FrameTC().

b66pak
27th January 2010, 20:58
still crashing here (win xp sp3)...i am using it with this script:

AVISource("hfyu_encoded_sample.avi", audio=false)
framenumber(0,1)
framenumber(1000,0)

with this .avi:

Video
Format : FFVH
Codec ID : FFVH
Duration : 20s 20ms
Bit rate : 40.1 Mbps
Width : 720 pixels
Height : 400 pixels
Display aspect ratio : 16:9
Frame rate : 29.970 fps
Bits/(Pixel*Frame) : 4.649
Stream size : 95.8 MiB (100%)

after a short play the error is this (random & variable):

CAVIStreamSynth: System exception - Access Violation at 0x22b4ac0, writing to 0x2851046

i have attached a .jpg with the first frame for noticing an artifact - the discolored rectangle before the "1000" mark in the right corner...
_

AlanHK
28th January 2010, 00:24
CAVIStreamSynth: System exception - Access Violation at 0x22b4ac0, writing to 0x2851046

i have attached a .jpg with the first frame for noticing an artifact - the discolored rectangle before the "1000" mark in the right corner...

Actually I see both these problems too, on Win2k.

AVIStreamSynth: System exception - Access Violation at 0x1354915, writing to 0x80808080
The first number different each time.


I get that crash in VirtualDub if I seek back and forth several times. I had noticed the same behaviour using the AudioGraph plugin, that overlays an audio waveform. Though both are usually okay if I just play it forward.


If I use both Framerate and AudioGraph, it crashes very quickly, just by playing, after about 200-250 frames.
So I'd guess it's to do with the overlays.
Perhaps they reveal some Avisynth bug?

hanfrunz
28th January 2010, 11:29
I think framenumber has a bug in YUY2 colorspace. I'll see what is wrong there.

Gavino
28th January 2010, 14:11
I think framenumber has a bug in YUY2 colorspace.
In the code
for (w=0; w<4; w+=2) {
*(wsrcp + dummy + w+2) = 0; // add 2pix border
*(wsrcp + dummy + w+2+2) = 128;
}
the chroma byte is written to the wrong place (and potentially off the edge). Should be
*(wsrcp + dummy + w+2+1) = 128;

hanfrunz
28th January 2010, 15:35
Oh thanks Gavino! I'll fix it and post a new version soon.
The 0 should be a 16 too...

hanfrunz
1st February 2010, 18:02
here (http://www.neuron2.net/hanfrunz/framenumber_version_0.4.zip) is version 0.4 with minor bugfixes

b66pak
1st February 2010, 18:03
@hanfrunz when do you plan to release the new version?
_

hanfrunz
2nd February 2010, 09:45
@b66pak do you still have problems with version 0.4? Can you upload a sample file and your exact script. Maybe i can reproduce the error and fix the problem.

b66pak
2nd February 2010, 20:28
yes, same problem...


here is the .avs

AVISource("framenumber_croma_error.avi")

framenumber(0,1)
framenumber(1000,0)
frameTC(0,2)

info()



here is a screen (notice the corrupted croma in the down right corner - before the "1007" framenumber):
_

Gavino
3rd February 2010, 21:09
Part of the FrameNumber code setting the chroma for YV12 is wrong. Instead of:
for (j=0; j<digits/2*10; j++) {
wsrcp[ (yy+i)*src_pitchUV + x + j] = 128;
wsrcp2[(yy+i)*src_pitchUV + x + j] = 128;
I believe it should be:
for (j=0; j<digits*10/2; j++) {
wsrcp[ (yy+i)*src_pitchUV + x/2 + j] = 128;
wsrcp2[(yy+i)*src_pitchUV + x/2 + j] = 128;

hanfrunz
4th February 2010, 11:17
@gavino thanks for finding that. I think you start getting to know my code better than me :) I'll fix it in the next version soon.

b66pak
7th February 2010, 18:52
@hanfrunz any progress?
_

hanfrunz
15th February 2010, 12:29
bugfixed version 0.4b can be downloaded here (http://neuron2.net/hanfrunz/framenumber_version_0.4b.zip)

b66pak
15th February 2010, 18:07
thanks...
_

L.E. for frametc format: insted of h:m:s:frame could it be h:m:s:ms?
_

hanfrunz
16th February 2010, 16:50
thanks...
L.E. for frametc format: insted of h:m:s:frame could it be h:m:s:ms?
_

mmmh i'll think about adding an option in the next version. Why do you need milliseconds?

hanfrunz

b66pak
16th February 2010, 18:46
Why do you need milliseconds?

is needed for a cut list for processing (cutting) audio...
_

chaynik
23rd March 2010, 04:10
Thank you hanfrunz! Everything is working quite well now :)

Whenever you get a chance, would be great to add an integer offset.