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. |
|
|
Thread Tools | Search this Thread | Display Modes |
6th August 2012, 10:28 | #22 | Link |
Registered User
Join Date: Jan 2006
Posts: 1,867
|
Like I said, you can use the call plugin to run a batch script or whatever, but it's only run once before the script starts.
Here's how to read and plot pixels: Code:
Function GetPixel(clip clip, int x, int y) { #Return luma of a pixel current_frame=0 clip IsYUY2 ? ConvertToYV12 : clip#AverageLuma only works on planar. YV12 is planar. pointresize(6,6,x,y,1,1)#Blow up the pixel at x,y by 6 times (minimum possible with resize) int(AverageLuma) } Function PutPixel(clip clip, int x, int y, int luma) { #Plot a pixel clip ClipIsYV12=IsYV12 ClipIsYV12 ? ConvertToYUY2 : last pointresize(width*2, height) u=128 v=128 pixel=blankclip(last, color_yuv=luma*65536+u*256+v, width=2, height=1) layer(last, pixel, "add", 256, x*2, y)#Layer only works with YUY2 pointresize(width/2, height) ClipIsYV12 ? ConvertToYV12 : last } The array implementation in avslib is quite slow. I have the same thoughts of a meta-data per-frame with another clip; but it could be added at the bottom. The garbage in the last few lines can be be cropped out. You can extend this to RGB with showred.converttoyv12 for example. You could also make a kind of array in a clip by plotting pixels and reading them. My slicer and addcode plugins can also read and plot int's on a line of video. http://forum.doom9.org/showthread.ph...74#post1582574 for myself: keywords pset, plot, plot a pixel, plot(x,y), pset(x,y) edit: thank you me! I swear, this is the 5th time I've searched for this post. Last edited by jmac698; 1st March 2015 at 12:30. |
Tags |
file i/o, frame, imagesource, imagewriter, metadata |
Thread Tools | Search this Thread |
Display Modes | |
|
|