VideoHelp Forum




+ Reply to Thread
Results 1 to 27 of 27
  1. Hi ,


    Do you have any idea for making continuous rotating video with using Virtualdub and it's filters?

    There is rotate option but it is just a static and makes 90-180-270 degrees rotation. I need a continuous rotating.

    Thanks.

    P.S. : You may advice other alternative video editors/makers freeware like Virtualdub , which will be also usefull.
    Quote Quote  
  2. Member
    Join Date
    Jul 2009
    Location
    Spain
    Search Comp PM
    Use the Rotate plugin for Avisynth.
    You can open the Avisynth script in VirtualDub.
    Quote Quote  
  3. Thanks a lot , but this script only rotates the video once in the given value in underlines&bold marked line. I need a plugin that makes a spinning video on the given angle value. For example 10 is the input value and each frame of the video is rotated 10 degrees until it reaches 360 , it continues to rotate/spin the video

    loadplugin("rotate.dll")
    avisource("g:\test.avi")
    converttoRGB32()
    Rotate(1.0) # 1 degree rotation
    Quote Quote  
  4. You only need to program 1 revolution, if you want it to continue, use loop

    Use start and end to indicate the frame

    http://avisynth.org.ru/rotate/rotate.html
    http://avisynth.org/mediawiki/Loop
    Quote Quote  
  5. Thanks for you answer.

    I have tried but only i get the first frame 10 degrees rotated and than there is no loop in rotating. I put loop command on top of the script to down but nothing changed. I do not know avs script language well.
    Loop(-1) gives and error.

    loadplugin("rotate.dll")
    avisource("c:\test1.avi")
    converttoRGB32()
    Rotate(10.0)
    Loop()
    Quote Quote  
  6. You need to specify the number of loops and rotate parameters

    Here is an example to illustrate with a static image , rotated 5x with loop, 10 degree rotation per frame, 29.97 fps clip.

    I have uploaded the end result, and the source test image below

    Avisynth starts numbering at zero, so 0-34 is 35 frames. Each individual loop has to be set to 1 before completion, so 350 degrees, because the 1st frame of the next loop will be zero degrees or 360 degrees . Otherwise you will get overlap and a duplicate frame. This is why start=0 (start frame), end=34 (end frame), and endangle is 350 , not 360 . In other words, 35 frames and 350 degrees

    If you want something different you have to adjust the math

    Code:
    ImageSource("2.png",0,34,fps=29.97)
    ConvertToYV12()
    Rotate(angle=0,color=color_white,start=0, end=34, endangle=350)
    Loop(5)
    Image Attached Thumbnails Click image for larger version

Name:	2.png
Views:	2664
Size:	21.3 KB
ID:	8252  

    Image Attached Files
    Quote Quote  
  7. Dear poisondeathray ,

    Thanks a lot for your fast response. I have succesfully rotated the video i wanted. I used this command lines

    loadplugin("rotate.dll")
    avisource("c:\test1.avi")
    converttoRGB32()
    Rotate(angle=0,color=color_white,start=0, end=250, endangle=355)
    Loop(1)
    Quote Quote  
  8. Colud you please help me for making a video from bitmap files?

    1. I want to make a video from Test1.bmp , with 1000 frames and 25 fps and the output will be compressed by xvid or other. The final result should be Test1.avi (xvid). I can do this with AVS or use Virtualdub

    2. BTW should i change color space RGB to YUVs? I think this will define the final file size???

    3. If i want to make video from 3-4 bitmaps , what should be the script?


    ImageSource("C:\Test1.bmp",0,999,fps=25)
    ConvertToYV12() <<<<< YUV or RGB???
    Rotate(angle=0,color=color_white,start=0, end=999, endangle=355) <<< 5 degree is better and more slower compared to 10 degree. 10 rotates very fast
    Loop(5)
    Quote Quote  
  9. Originally Posted by frmys View Post
    1. I want to make a video from Test1.bmp , with 1000 frames and 25 fps and the output will be compressed by xvid or other. The final result should be Test1.avi (xvid). I can do this with AVS or use Virtualdub
    You can use ImageSource() in avsynth

    Code:
    ImageSource("Test1.bmp", 0, 999, fps=25)



    2. BTW should i change color space RGB to YUVs? I think this will define the final file size???
    Yes, add ConvertToYV12() after imagesource . Xvid only works in YUV

    Code:
    ImageSource("Test1.bmp", 0, 999, fps=25)
    ConvertToYV12()

    The final file size is determined by bitrate (e.g. bitrate in xvid)

    filesize = bitrate x running time



    3. If i want to make video from 3-4 bitmaps , what should be the script?
    What do you mean ? one after each other? how do you want them arranged ?
    Quote Quote  
  10. 1. I have dragged the avs into virtualdub and i will play with it inside Virtualdub for compression etc.

    3. If i have 3 bmp files and i want all of the to be rotated in an order like "Test1.bmp , rotated 5 degrees in 25 fps and for 1000 frames" later continue with "Test2.bmp roated 5 degrees in 25 fps and for 2000 frames" and finally "Test3.bmp ,rotated 10 degrees in 25 fps and for 500 frames". Can i have single a final output video file with 3500 frames and consisting of 40 seconds of test1.bmp , 80 seconds of test2.bmp and 20 seconds of test3. bmp

    The reason why i ask in detail is to learn from you more scripts tricks that i can alter and play around. For example your first script help me to give a start

    4. Is there a site that only has sample scripts that can be easily understood and apllied by newbies? I can make alteration acc. to my needs and try to achive progress without help of others.

    Thanks again for your help
    Quote Quote  
  11. Originally Posted by frmys View Post
    3. If i have 3 bmp files and i want all of the to be rotated in an order like "Test1.bmp , rotated 5 degrees in 25 fps and for 1000 frames" later continue with "Test2.bmp roated 5 degrees in 25 fps and for 2000 frames" and finally "Test3.bmp ,rotated 10 degrees in 25 fps and for 500 frames". Can i have single a final output video file with 3500 frames and consisting of 40 seconds of test1.bmp , 80 seconds of test2.bmp and 20 seconds of test3. bmp

    You can assign them variables, then join them with A+B+C

    You can use A=last , this means everything above is now called "A"

    In this example, I kept the parameters the same, but know how to adjust them now (speed, duration, frames etc....)

    e.g.

    Code:
     
    ImageSource("C:\Test1.bmp",0,999,fps=25)
    ConvertToYV12() 
    Rotate(angle=0,color=color_white,start=0, end=999, endangle=355) 
    Loop(5) 
    A=last
     
    ImageSource("C:\Test2.bmp",0,999,fps=25)
    ConvertToYV12() 
    Rotate(angle=0,color=color_white,start=0, end=999, endangle=355) 
    Loop(5) 
    B=last
     
    ImageSource("C:\Test3.bmp",0,999,fps=25)
    ConvertToYV12() 
    Rotate(angle=0,color=color_white,start=0, end=999, endangle=355) 
    Loop(5) 
    C=last
     
    A+B+C



    4. Is there a site that only has sample scripts that can be easily understood and apllied by newbies? I can make alteration acc. to my needs and try to achive progress without help of others.
    Unfortunately no.... I would start with avisynth mediawiki
    http://avisynth.org/mediawiki/Main_Page
    Quote Quote  
  12. Member
    Join Date
    Jul 2009
    Location
    Spain
    Search Comp PM
    Originally Posted by poisondeathray View Post
    Originally Posted by frmys View Post
    3. If i have 3 bmp files and i want all of the to be rotated in an order like "Test1.bmp , rotated 5 degrees in 25 fps and for 1000 frames" later continue with "Test2.bmp roated 5 degrees in 25 fps and for 2000 frames" and finally "Test3.bmp ,rotated 10 degrees in 25 fps and for 500 frames". Can i have single a final output video file with 3500 frames and consisting of 40 seconds of test1.bmp , 80 seconds of test2.bmp and 20 seconds of test3. bmp
    Code:
    ImageSource("C:\Test1.bmp",0,999,fps=25)
    ConvertToYV12() 
    Rotate(angle=0,color=color_white,start=0, end=999, endangle=355) 
    Loop(5) 
    A=last
    ...
    Using Loop(5) will give you 5000 frames instead of 1000.
    It's not clear what "rotated 5 degrees for 1000 frames means", but that code gives 5 revolutions (each with a jump at the end from 355 degrees to 360), with a rotation rate of approx 0.355 degrees per frame.
    Assuming what you actually want is 5 complete revolutions over 1000 frames, I would use
    Code:
    ImageSource("C:\Test1.bmp",0,999,fps=25)
    ConvertToYV12() 
    Rotate(angle=0,color=color_white,start=0, end=999, endangle=5*360)
    A=last
    ...
    (Actually, angle=0, start=0 and end=999 (the end) are the defaults, so could be omitted.)
    The code for the third part would be amended similarly to give 10 revolutions (assuming that's what's wanted).

    Note that post#6 is wrong and gives 350/34 degrees per frame instead of 10 - the clip should have 36 frames, not 35.
    Also, Loop(1) in post#7 is redundant - Loop(1) just produces a (single) copy of its input.
    Last edited by Gavino; 18th Aug 2011 at 11:21.
    Quote Quote  
  13. I stated that I just didn't alter the values (I just copy & pasted it) , It was just to illustrate the use of variables

    But post 6 is incorrect, ... yes my math sux

    Thanks for correction gavino
    Quote Quote  
  14. Dear Gavino and Poisondeathray ,

    Thanks for your effords, you've helped me a lot. With the given information i can make rotating animations (avi , gif etc.)

    Have a nice day
    Quote Quote  
  15. Member
    Join Date
    Jul 2009
    Location
    Spain
    Search Comp PM
    Originally Posted by poisondeathray View Post
    I stated that I just didn't alter the values (I just copy & pasted it) , It was just to illustrate the use of variables
    Yes, the original error came from the OP:
    Originally Posted by frmys View Post
    ImageSource("C:\Test1.bmp",0,999,fps=25)
    ConvertToYV12() <<<<< YUV or RGB???
    Rotate(angle=0,color=color_white,start=0, end=999, endangle=355) <<< 5 degree is better and more slower compared to 10 degree. 10 rotates very fast
    Loop(5)
    frmys, I don't understand where endangle=355 comes from here, so I don't know what you are trying to achieve. My guess was that you actually want 5 revolutions over 1000 frames. Is that correct?
    Quote Quote  
  16. Dear Gavino,

    355 comes from here :

    Acc. to Poisondeathray's script it was 350 , which is 10 degree less than a complete 360 cycle. I realized that 10 degree in rotation is fast so i decreased to 5 ( 360-5 = 355) . This is the reason why i use 355. I was trying to adjust rotation speed

    You are right Loop(1) is meaningless , i was only trying to get a script that runs without errors and later to be modified acc. to situation. Your method is better to make "360x5 ( or any other loops)

    My aim is to make something rotate in a cyle that i can adjust. For example 1 complete turn/cycle in 10 seconds (25x10=250 frames) or every cycle should be completed in 2 seconds etc.

    I need the correct and logical code for adjusting both rotation speed and cycles. Please help for the proper code.

    Now i use :

    loadplugin("rotate.dll")
    ImageSource("Test1.bmp",0,999,fps=25.00)
    ConvertToYV12()
    Rotate(angle=0,color=color_black,start=0, end=999, endangle=360)

    This script works but sometimes the rotation is not proper with some stops/interrupts and after that it continues . i have avsscript 2.58 installed and have 4 core intel cpu (i750) , the test.bmp is 600x600 pixels.
    Quote Quote  
  17. I think Gavino was implying that you don't need loop, just use the multiplication factor for the number of rotations when used with endangle. I didn't know rotate could use that syntax but it works

    so 2*360 would be 2 turns , 3*360 would be 3 turns, etc...

    The rest is just math, which I'm not too good at....

    For example 1 complete turn/cycle in 10 seconds (25x10=250 frames)
    Code:
    ImageSource("test1.bmp",0,249,fps=25)
    ConvertToYV12()
    rotate(angle=0,color=color_white,start=0, end=249, endangle=1*360)
    That's 1 rotation in 10 seconds. If you enter 2*360 it would be 2 rotations in 10 seconds. I used 249 as the end frame because you start numbering at zero



    If you wanted 1 rotation in 2 seconds, you need find out the number of frames : 25 fps x2 seconds = 50 frames , so I use 49 as the end frame (because you start numbering at zero)

    Code:
    ImageSource("test1.bmp",0,49,fps=25)
    ConvertToYV12()
    rotate(angle=0,color=color_white,start=0, end=49, endangle=1*360)
    That's 1 rotation in 2 seconds for a 25fps clip
    Quote Quote  
  18. Ok, thanks again . So as a result :

    1. If i want a video for 1 minute at 25 fps (60 loops are needed) and the 1 complete rotation to be finished in 1 seconds , i must have a code as follows :

    loadplugin("rotate.dll")
    ImageSource("Test1.bmp",0,24,fps=25.00)
    ConvertToYV12()
    Rotate(angle=0,color=color_black,start=0, end=24, endangle=360)
    Loop(60)

    or

    loadplugin("rotate.dll")
    ImageSource("Test1.bmp",0,1499,fps=25.00) ..........1499 comes from :1 munite = 60 seconds >>> 60x 25 fps-1 = 1499
    ConvertToYV12()
    Rotate(angle=0,color=color_black,start=0, end=1499, endangle=21600) ...............21600= 60 secondsx 360 degrees

    2 . If i want a rotation is 2 seconds than i have to divide 21600/2 = 10800

    I have tested all above scripts and they all work fine. Only there are 2 problems

    1. The rotation played on mediaplayer is not flawless, jerky
    2. The rotated image needs anti-alisting. The played video looks like Ruffles Cips
    Quote Quote  
  19. The 2nd script should work, but the 1st will have repeats causing jerky playback (the 360 degree mark, and zero degree of the next loop will be adjacent, 2 same frames causing choppy playback - this is why I used 350 instead of 360 when using loop in the example in post 6, you would need a different number but you need to do some math to figure it out. I think it would be 360-(360/25) )

    How are you playing this? did you encode to xvid ? maybe you have playback problem? Try encoding the script to a video then test again

    Use an antialiasing filter, there are several to choose from e.g. AAA(), antialiasing(), daa(), saa() etc.. etc...
    http://avisynth.org/mediawiki/External_filters#Anti-aliasing




    EDIT: I think my math is wrong (again) , it should be 1500 for the end frame (not n-1 or 1499)

    ImageSource("Test1.bmp",0,1500,fps=25.00)
    ConvertToYV12()
    Rotate(angle=0,color=color_black,start=0, end=1500, endangle=60*360)
    AAA()
    Last edited by poisondeathray; 18th Aug 2011 at 15:59.
    Quote Quote  
  20. Member
    Join Date
    Jul 2009
    Location
    Spain
    Search Comp PM
    Originally Posted by poisondeathray View Post
    The 2nd script should work, but the 1st will have repeats causing jerky playback (the 360 degree mark, and zero degree of the next loop will be adjacent, 2 same frames causing choppy playback - this is why I used 350 instead of 360 when using loop in the example in post 6, you would need a different number but you need to do some math to figure it out. I think it would be 360-(360/25) )
    That's correct, I think. The trickier maths was the reason I used the solution without Loop().

    EDIT: I think my math is wrong (again) , it should be 1500 for the end frame (not n-1 or 1499)

    ImageSource("Test1.bmp",0,1500,fps=25.00)
    ConvertToYV12()
    Rotate(angle=0,color=color_black,start=0, end=1500, endangle=60*360)
    AAA()
    I think it should still be 1499.
    end=1500 gives 1501 frames, so a duration slightly longer than the desired 60 secs.
    Quote Quote  
  21. Hi again ,

    The final script is now as follows:

    ImageSource("info1.bmp",0,99,fps=25.00)
    ConvertToYV12()
    A=last

    loadplugin("rotate.dll")
    ImageSource("rotate.bmp",0,249,fps=25.00)
    ConvertToYV12()
    Rotate(angle=0,color=color_black,start=0, end=249, endangle=3600)
    B=last

    ImageSource("info2.bmp",0,99,fps=25.00)
    ConvertToYV12()
    C=last

    loadplugin("rotate.dll")
    ImageSource("rotate.bmp",0,249,fps=25.00)
    ConvertToYV12()
    Rotate(angle=0,color=color_black,start=0, end=249, endangle=1800)
    D=last

    ImageSource("info3.bmp",0,99,fps=25.00)
    ConvertToYV12()
    E=last

    loadplugin("rotate.dll")
    ImageSource("rotate.bmp",0,249,fps=25.00)
    ConvertToYV12()
    Rotate(angle=0,color=color_black,start=0, end=249, endangle=1200)
    F=last

    A+B+C+D+E+F

    ------------------------

    "info.bmp" is a picture with text embedded information about the "rotate.bmp" . Rotation duration is always 250 frames @25 fps but "endangel" is decreased to achive rotaion speed .""last" command ends the partial scritp action and next squence can start. Finally "A+B+C+D+E+F" joins all operation as a single output

    I wanted to save the output from Virtualdub in xvid and h264 format as "interlaced" . I checked the output video infos and thet are interlaced as topfield first. When i pause the video , i do not see very much signs of interlace method , they look fine as progressive. Do i miss something to do?

    Thanks for all help and advices.
    Quote Quote  
  22. Why is your goal interlaced ?

    You need to start with a 50p source to interlace it , 25p isn't enough for true interlace

    It should be 500 frames at 50 FPS, then Convert 50 frames per second to 50 fields per second


    #50p source
    AssumeTFF().SeparateFields().SelectEvery(4, 0, 3).Weave()

    This will give you 50i output from a 50p source, TFF


    Then you have to set the encoder to encode as interlaced
    Quote Quote  
  23. I want to see de-interlace capacities and motion speed of my lcd tv. this is the reason why i try to get the final video as interlaced. My source is a bmp which has a white thick line (20 pixels wide ,also an other one looks like + sign) in the middle of 1920x1080 sized black foreground. It is rotated like a windmill.

    what is the explanation of this command?

    Assume Top Field First ()<<< this is clear
    Separate Fields(). <<< for deinterlacing blend fields is used , so i think this is the reverse of it for making interlaced.
    SelectEvery(4, 0, 3)???????
    Weave()<<<??? comes from Bob or Weave?
    Quote Quote  
  24. SeparateFields(): takes each frame and splits it into two sequential fields.

    SelectEvery(4,0,3): for every group of four frames (numbered 0,1,2,3) select (keep) frames 0 and 3, throw away 1 and 2. Since SeparateFields() was called first, and the video is assumed to be TFF, you are left with the top field of the first frame and the bottom field of the second.

    Weave(): weaves sequential fields back into frames.

    Four frames: 1 2 3 4
    SeparateFields(): 1t 1b 2t 2b 3t 3b 4t 4b:
    SelectEvery(4,0,3) 1t 2b 3t 4b
    Weave(): 1t+2b 3t+4b

    The end result is an interlaced video at half the frame rate of the original. Eg, 60p to 30i.
    Last edited by jagabo; 19th Aug 2011 at 12:24.
    Quote Quote  
  25. frmys - BTW, "30i" and "60i" mean the same thing, they both mean 29.97 frames per second or 59.94 fields per second, just different naming convetions . Just like in "PAL" land 25i and 50i means the same thing


    I want to see de-interlace capacities and motion speed of my lcd tv. this is the reason why i try to get the final video as interlaced. My source is a bmp which has a white thick line (20 pixels wide ,also an other one looks like + sign) in the middle of 1920x1080 sized black foreground. It is rotated like a windmill.
    Instead of making your own, you can buy DVD's or Blu-rays with test patterns. You can find free test patterns videos as well

    e.g.
    http://www.avsforum.com/avs-vb/showthread.php?t=1157287

    You should use a non scaled image, because scaling is another variable with processing and can affect interpretation of results. (I don't know of any TV that is 600x600 native resolution - I think that's what you said your test image was?)

    the test.bmp is 600x600 pixels.
    Quote Quote  
  26. Dear jagabo ,

    Thanks for the explanation of command. So this is 2:2 PAL i think what should be the new command for 3:2 NTSC? Also other Pulldown script will be very usefull. Of course i will use 50 fps for PAL and 60 for NTSC


    Dear Poisondeathray ,

    Thanks for the test video links. I also want to try to make something on my own with help. I have prepared many 1920x1080 pics for test by using paint.net and irfanview. Paint.net for making full backgrounds or effects or i make parts with it and combine the pieces with irfanivew's create panaroma function.

    For example 240x1080 , 8 pieces of pics made with Paint.net in all colors can be merged by Irfanivew " New Panorama Pic" , So the final pic is 1920x1080
    Quote Quote  
  27. Originally Posted by frmys View Post
    So this is 2:2 PAL i think what should be the new command for 3:2 NTSC?
    I'm not sure what you mean by that. You wouldn't use this process to go from 60p to 24p with pulldown. It doesn't make sense. You would only use it to go from 60p to 30i, or 50p to 25i. If you want a rotating video of 24 fps with pulldown you would make a 24p video then use pulldown to make 30i video. The easiest way to add the pulldown:

    WhateverSource("video.ext") #23.976 fps progressive source
    ChangeFPS(59.94) #duplicate frames to make 59.94 fps
    AssumeTFF()
    SeparateFields()
    SelectEvery(4,0,3)
    Weave()
    Then encode that as 29.97i.

    Instead of creating a new video you could use your 60p video slowed down:

    WhateverSource("video.ext") #59.94 fps progressive source
    AssumeFPS(23.976) #pretend it's 23.976 fps
    ChangeFPS(59.94) #duplicate frames to make 59.94 fps
    AssumeTFF()
    SeparateFields()
    SelectEvery(4,0,3)
    Weave()
    The resulting video will rotate at 1/2.5 the rate of the original.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!