VideoHelp Forum
+ Reply to Thread
Results 1 to 15 of 15
Thread
  1. Member
    Join Date
    Dec 2008
    Location
    Spain
    Search Comp PM
    I would like to make a video to show a counter like this:

    2010 - 60
    2011 - 69
    2012 - 84
    2013 - 92
    2014 - 97

    Each line should be shown alone on full screen and it should be shown for some 10 frames. Is there any program that can help with doing that? Maybe Avisynth?
    Quote Quote  
  2. AviSynth can do that. Is there some algorithm for the count on the right? Or is it just a fixed list of numbers? How many number do you have? For a fixed list:

    Code:
    BlankClip(width=640, height=360, length=10, fps=10)
    
    Subtitle("2010 - 60", size=150, x=30, y=100) \
    ++ Subtitle("2011 - 69", size=150, x=30, y=100) \
    ++ Subtitle("2012 - 84", size=150, x=30, y=100) \
    ++ Subtitle("2013 - 92", size=150, x=30, y=100) \
    ++ Subtitle("2014 - 97", size=150, x=30, y=100)
    Image Attached Files
    Quote Quote  
  3. Member
    Join Date
    Dec 2008
    Location
    Spain
    Search Comp PM
    Thanks a lot, it works very nice in Avisynth3+ !
    It's just a fixed list of numbers. But if the numbers would be 1,2,4,8,16 etc (powers of two), can it be scripted?

    I still have a few questions please:
    - How can I change the background color from black to white?
    - How can I put two lines instead of a single line? (tried "\n" and it doesn't work)
    - And how can I write a title on the top for the entire duration of the video?
    Last edited by ziptip; 15th Dec 2021 at 19:27.
    Quote Quote  
  4. If you can generate your numbers algorithmically you can use ScriptClip():

    Code:
    BlankClip(width=640, height=360, length=100, fps=1)
    ScriptClip("""Subtitle(String(current_frame+2011) + " - " + String(current_frame*5+69), size=150, x=0, y=100)""")
    ChangeFPS(10)
    The left values starts at 2011 and increments by 1 every 10 frames. The right value starts at 69 and increases by 5 every 10 frames.
    Image Attached Files
    Quote Quote  
  5. Member
    Join Date
    Dec 2008
    Location
    Spain
    Search Comp PM
    Very nice, thanks!
    How about the other questions? Background color and two lines of text
    Quote Quote  
  6. You can specify color for the BlankClip using color= . In hex it would be $FFFFFF

    eg
    BlankClip(color=$FFFFFF)

    For two lines of text you can add other subtitle lines , and positioning with x,y or align
    http://avisynth.nl/index.php/Subtitle
    Quote Quote  
  7. Member
    Join Date
    Dec 2008
    Location
    Spain
    Search Comp PM
    Thanks!
    I see you do not define the duration for each text, the Subtitles have a duration of one second by default? What if you want the second text (2011 - 69) to last for 20 frames instead of 10 frames like other lines?
    Quote Quote  
  8. I made my last post before seeing your post before it.

    Code:
    BlankClip(width=640, height=360, color=color_white, length=20, fps=1)
    ScriptClip("""Subtitle(String(current_frame+2011),         size=100, x=320, y=250, align=2, text_color=color_cyan, halo_color=color_black)""")
    ScriptClip("""Subtitle(String(int(pow(2, current_frame))), size=100, x=320, y=350, align=2, text_color=color_lightgreen, halo_color=color_black)""")
    ChangeFPS(10)
    Subtitle("Big Title", text_color=color_black, halo_color=color_gray, size= 150, x=320, align=8)
    See docs:
    http://avisynth.nl/index.php/Subtitle
    http://avisynth.nl/index.php/ConditionalFilter#ScriptClip
    Quote Quote  
  9. Member
    Join Date
    Dec 2008
    Location
    Spain
    Search Comp PM
    So you need ScriptClip only because you want to use current_frame variable, right?
    Quote Quote  
  10. Member
    Join Date
    Dec 2008
    Location
    Spain
    Search Comp PM
    If I may ask, how do you make mkv videos from Avisynth? I am using Virtualdub and it can't save MKV files
    Quote Quote  
  11. Originally Posted by ziptip View Post
    If I may ask, how do you make mkv videos from Avisynth? I am using Virtualdub and it can't save MKV files

    vdub2 has mkv export support
    Quote Quote  
  12. Member
    Join Date
    Dec 2008
    Location
    Spain
    Search Comp PM
    Thanks!
    Quote Quote  
  13. Originally Posted by ziptip View Post
    So you need ScriptClip only because you want to use current_frame variable, right?
    Yes. The runtime filters are the only way to get frame numbers.

    Originally Posted by ziptip View Post
    If I may ask, how do you make mkv videos from Avisynth? I am using Virtualdub and it can't save MKV files
    I used the x264 command line encoder. But yes, VirtualDub2 has built-in mkv export support. There's not much reason to use the older VirtualDub anymore.
    Quote Quote  
  14. Here's a script using a single Subtitle line to output 2 lines of text:

    Code:
    BlankClip(width=640, height=360, color=color_white, length=20, fps=1)
    Subtitle("Big Title", text_color=color_black, halo_color=color_gray, size= 150, x=320, align=8)
    ScriptClip("""Subtitle(String(current_frame+2011) + "\n" + String(int(pow(2, current_frame))), size=100, x=320, y=260, lsp=-100, align=2, text_color=color_cyan, halo_color=color_blue)""")
    ChangeFPS(10)
    Image
    [Attachment 62388 - Click to enlarge]
    Quote Quote  
  15. Member
    Join Date
    Dec 2008
    Location
    Spain
    Search Comp PM
    Thanks a lot, really great scripts!
    I have another question but I will create a new thread for it. It's probably more useful for other people having the same question.
    Quote Quote  



Similar Threads

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