ANSI is nothing but text. Even Animated ANSI is nothing but text. The text is interpreted by the system to display a certain way which gives you a desired output with software that can view it properly. There is no way to turn text into video thus no way to save the desired output as a video file.
However, if what you really want is to video capture the interpreted ANSI for display on youtube, then you will have to view the ansi in your ansi viewer of choice and then record what it displays with external video capture software. I personally would recommend OBS.