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?
+ Reply to Thread
Results 1 to 15 of 15
-
-
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)
-
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 18:27.
-
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)
-
Very nice, thanks!
How about the other questions? Background color and two lines of text -
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 -
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? -
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)
http://avisynth.nl/index.php/Subtitle
http://avisynth.nl/index.php/ConditionalFilter#ScriptClip -
So you need ScriptClip only because you want to use current_frame variable, right?
-
If I may ask, how do you make mkv videos from Avisynth? I am using Virtualdub and it can't save MKV files
-
Yes. The runtime filters are the only way to get frame numbers.
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. -
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)
[Attachment 62388 - Click to enlarge] -
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.
Similar Threads
-
how to add time counter of exist video file ?
By yanshof in forum ProgrammingReplies: 4Last Post: 10th May 2019, 02:57 -
adding audio files to exist video with ffmpeg make the video currapted
By yanshof in forum Video ConversionReplies: 2Last Post: 21st Jan 2018, 14:37 -
adding audio files to exist video with ffmpeg make the video currapted
By yanshof in forum ProgrammingReplies: 1Last Post: 21st Jan 2018, 13:56 -
Panasonic DMR-EZ485V audio and counter questions
By pamelajaye in forum DVD & Blu-ray RecordersReplies: 0Last Post: 14th Jul 2017, 14:56 -
FFmpeg, How to fix VideoPID continuity counter error?
By Keita in forum Video ConversionReplies: 0Last Post: 28th Jun 2017, 07:41