Okay this one is a doozy
Let's start with what I have and what I have done then the issues I am having.
First I took a video and extracted the frames with FFMPEG which left me with a ton of frames. As we all know CMD can't do much with jpg files. So I used a program that allowed me to convert them to ASCII. With a little batch magic, I got something working to mass convert all of the images.
Code for that
JPEGCompiler.bat
@echo off
set /p video=Drag Video into Console (Currently Limited to C:/):
ffmpeg -i %video% -an -f image2 "output_%%05d.jpg"
(This works with the help of FFMPEG )
I then had to create a list of the files for the next batch to grab. This wasn't super difficult.
Jpglist.bat
dir /B *.jpg >> JPEGList.txt
And finally, a way of automating everything with an increasing variable.
JPEGCompiler.bat
@echo off
setlocal enableextensions enabledelayedexpansion
set cycles=0
cd> CD.txt
for /F "delims=" %%i in (CD.txt) do set "CD=%%i"
for /F "delims=" %%i in (CDD.txt) do set "CD=%%i"
type cd.txt | sed "s/C://">> CDD.txt
:startpoint
set "xprvar="
for /F "skip=%cycles% delims=" %%i in (JPEGList.txt) do if not defined xprvar set "xprvar=%%i"
set /a cycles=cycles+1
ascii-image-converter.exe %CDD%%xprvar% --save-txt .
goto startpoint
Using what I learned previously with the increasing variable, I used the same method to grab all of the text files and order them into a list for CMD
Textlist.bat
dir /B *.txt >> TextList.txt
That brings me to this point.
TEXTCompiler.bat
@echo off
color 02
set cycles=0
:startpoint
for /F "skip=%cycles% delims=" %%i in (TextList.txt) do set "xprvar=%%i"&goto nextline
:nextline
set /a cycles=cycles+1
type %xprvar%
call waitfor
goto startpoint
(call waitfor
is an attempt at using precise timing but it didn't really make a difference with or without it I get a little more control but the same issues are present)
The code runs fine but there are some issues. With the cls
command its like it will clear the screen way too fast and the video gets slowly and occasionally eaten from the bottom up. However, without that cls
, the ASCII art video scrolls like a boss.
There are also issues with sync from the original video. (bat plays fast or slow depending on how it's feeling?)
So my question is, is there a way to sync fps? What's the best way to go about this?
This playback can be seen here!