mov2txt

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Message
Author
misol101
Posts: 383
Joined: 02 May 2016 18:20

mov2txt

#1 Post by misol101 » 09 May 2016 13:27

Image

** UPDATED with color support! Link to color demos:
http://www.mediafire.com/download/x2i1etf0f9ljp4t/StateOfTheArt.7z (run sota.bat)
http://www.mediafire.com/download/2mvtjtckpgj5akj/LickWeed.7z (run Lickweed.bat)
http://www.mediafire.com/download/19va0b5zkx27gqr/SmackMyBitchUp.7z (run smbu.bat)

I saw and liked this link by Honguito98 (taking a movie file and converting it into text frames that can be printed like a movie in the console window):

http://ss64.org/viewtopic.php?id=1835

especially this:

https://www.youtube.com/watch?v=y7FaEzNF970

but I couldn't find any actual scripts, only downloads seemed to be the demos themselves, with a huge binary r3d file.

So anyway... I decided to recreate the steps in the thread and create a script to make these things.

Download link http://www.mediafire.com/download/cxta2zpdqkuz1x7/mov2txt.zip

This archive contains a compiled version of jp2a, because I could not find a Windows binary and had to compile it myself, so I wanted to save you the headache. I hope this is ok, license files for jp2a are still in there.

What you also need for this is to download and install ffmpeg if you don't have it.

The archive also contains a 10 second test I made from a video file. To play it, type

mode 120,45&playm2t.bat c7

The script to create these things is called mov2txt.bat. Example usage to make the example movie:

mov2txt.bat c7.avi /ST 3:45 /TD 10 /CS 1 6 6 /W 120

..which takes the movie c7.avi, starting from 3:45 into the movie and 10 seconds ahead, with output Width 120 and using CharSet number 1, with blackness increased by 6 and whiteness increased by 6 (this essentially means contrast in the output is increased)

This creates the folder c7, with jpg and txt files.

Once the folder with images is created, the video to image extraction can be skipped by adding /SKIPEXTRACT to the line. This is useful for playing around with different CS charsets/contrast, or testing any /EXTRAS


http://www.mediafire.com/view/bu56idec7vd137a/c7.PNG
Last edited by misol101 on 16 May 2017 19:27, edited 10 times in total.

misol101
Posts: 383
Joined: 02 May 2016 18:20

Re: mov2txt

#2 Post by misol101 » 09 May 2016 13:47

mov2txt usage:

mov2txt moviefile [/ST startTime] [/TD timeDuration] [/OUT name] [/W width] [/H height] [/CS altcharset1-4 nofBlack nofWhite] [/COLOR cleanColorTreshold] [/LIGHTBG] [/REMOVEJPG] [/SKIPEXTRACT] [/EXTRAS extras]

Charsets for non-color are:
1: " ·•■◘█"
2: " ░▒▓█"
3: " .:wM"
4: " █":
(..plus the messed up 5 which creates garbled output" ·•○■◘█" :) )

(the charsets for COLOR are similar, but reversed...)

If no CharSet is given, jp2a uses its default one.

nofBlack multiplies the first character in the charset x times
nofWhite multiplies the last character in the charset x times

/OUT specifies an alternative name to the output folder. If not used, name is same as movie file
/EXTRAS are used in the call to jp2a, try e.g. -x, or --border.
/SKIPEXTRACT skips the video extraction part.
/REMOVEJPG removes jpgs after video extraction (don't use this if you want to use /SKIPEXTRACT!)
/W sets width of output. If only width is set and not height, height is aspect ratio corrected. If neither /W nor /H are set, output fits terminal window.
/H sets height of output. If only height is set and not width, width is aspect ratio corrected. If neither /W nor /H are set, output fits terminal window.
[/ST startTime] Can be given in seconds, or like MM:SS and similar
[/TD timeDuration] In seconds, maybe other ways too, didn't check
Note: if none of /ST or /TD are given, the entire video is extracted from start to finish (!)
/LIGHTBG is supposed to indicate that the source video has bright background. I'm not sure it actually does anything in jp2a.

/COLOR enables color output and sets a treshold for when a "clean"(space) color should be used, the higher the value the more space characters in the output (which is "clean", i.e. not a "mixed" character/color). The treshold value is more important than nofBlack and nofWhite when COLOR is used. A good default value is 64.

playm2t usage:
playm2t folder [delay] [x] [y] [color] [bcol] [normal|reverse|bounce] [startskip_nof] [endskip_nof] [repeat|norepeat] [cache "cacheFinishedCommand"]

Keys while playing are 'C/c' for next/previous color, 'p' to pause, 'r' to play reverse, 'n' to play normal, 'b' to bounce, d/D to decrease/increase delay, escape to quit
Last edited by misol101 on 12 May 2016 20:28, edited 5 times in total.

misol101
Posts: 383
Joined: 02 May 2016 18:20

Re: mov2txt

#3 Post by misol101 » 09 May 2016 13:59

Ouch, I forgot that playm2t.bat needs gotoxy.exe and cmdwiz.exe to play. Updated the linked archive.

misol101
Posts: 383
Joined: 02 May 2016 18:20

Re: mov2txt

#4 Post by misol101 » 10 May 2016 14:40

http://www.mediafire.com/view/lo2s6028n1j217l/LW.PNG

I'm back with more uselessness... :)

I also read this thread:

http://ss64.org/viewtopic.php?pid=7916#p7916

which adds color to the text video output, and again, wanted to do the same.

For this I had to modify jp2a to add color support, so the archive is updated now, with a modded version (modified image.c source also included). Also, I threw out creating m2t files, just specify the folder to play instead.

So...in order to compare mine with the original, I decided to continue Honguito98's somewhat strange behaviour of converting a video of a text demo back to text, so I converted the same video file (a demo called LickWeed).

Here it is (run LickWeed.bat) http://www.mediafire.com/download/2mvtjtckpgj5akj/LickWeed.7z

As for which one is "better", I think mine is a bit too dark and possibly the matching is worse, but on the other hand it has less artefacts... so not sure.

The command to create the output was:
mov2txt LW.mp4 /W 80 /H 50 /CS 2 0 0 /COLOR 64

misol101
Posts: 383
Joined: 02 May 2016 18:20

Re: mov2txt

#5 Post by misol101 » 10 May 2016 15:33

Apparently Dropbox hates me and shut down downloads due to "heavy traffic" (I'm sure it must have been enormous :roll: ).

All files were moved to Mediafire, sorry if anybody tried to get the files earlier today and failed.

foxidrive
Expert
Posts: 6033
Joined: 10 Feb 2012 02:20

Re: mov2txt

#6 Post by foxidrive » 10 May 2016 16:21

misol101 wrote:Apparently Dropbox hates me and shut down downloads due to "heavy traffic" (I'm sure it must have been enormous :roll: ).


Dropbox did that to me recently and it cited "bandwidth" as the reason my account was disabled.

The real reason turned out to be a zip file containing aacini's executable files from dostips, and which was incorrectly flagged as malware by just a few heuristic av scans. Heuristic scans get it wrong by the very nature of heuristics.

The file had been there for two years and I clarified that it was a false positive, but I had to delete the file due to Dropbox terms of service.

I then asked why I hadn't been notified and why it said "bandwidth" was the problem - and they said that they don't contact users if malware scans show positive, or give the real reason, as it would alert the user that their malware had been detected.

It was all a bit of specious reasoning for me, considering my initial reply was automated rubbish and not a human answering.

But there you go - there may have been a false positive to a malware scan.

misol101
Posts: 383
Joined: 02 May 2016 18:20

Re: mov2txt

#7 Post by misol101 » 10 May 2016 16:30

Hmm... strange... but interesting! Thanks!

You're right, "bandwidth" is the word they use. I guess I should start deleting files I put up recently and see if that helps. I don't think I have the one you mentioned but might be something else.

foxidrive
Expert
Posts: 6033
Joined: 10 Feb 2012 02:20

Re: mov2txt

#8 Post by foxidrive » 10 May 2016 18:39

It will be one of the exe files probably, and you can submit them here to see what the current AV programs detect.

It's free, and it uploads the file and scans it and displays the result.

http://www.virustotal.com/

misol101
Posts: 383
Joined: 02 May 2016 18:20

Re: mov2txt

#9 Post by misol101 » 11 May 2016 03:37

One more:

http://www.mediafire.com/download/x2i1e ... fTheArt.7z

A color conversion of the good old Amiga demo State Of The Art... timing with music may be crap :)



As for the scan of files, I don't really understand the results. It claims I have malware in pretty much everything. Finally I compiled this program:

#include <windows.h>
int main(int argc, char **argv) {
return 0;
}

first with tcc, and then with gcc. In the first case the AV scanner claims 2 scans found malware:
Jiangmin Trojan/Genome.dlco
Rising Malware.Undefined!8.C-449YgnhiGME (Cloud

and for the gcc one it's crazy, 15 malwares reported.

So, yeah, I don't know about that tool... maybe take that in PM instead...

foxidrive
Expert
Posts: 6033
Joined: 10 Feb 2012 02:20

Re: mov2txt

#10 Post by foxidrive » 11 May 2016 04:01

If you can upload screenshots of the scan result to http://www.imgur.com/ and show the link then it would give useful details.


If it mentions heuristic then that means the AV took a guess based upon certain characteristics, but can easily be a false positive because it isn't using actual known malware signatures.

misol101
Posts: 383
Joined: 02 May 2016 18:20

Re: mov2txt

#11 Post by misol101 » 12 May 2016 03:27

So. did anybody look at one of the color movie conversions? I'm interested in if it runs smooth or not on different machines. The first time it runs it might lag a bit since the files are not in the cache, but after that I'm hoping it runs ok. It might possibly be too fast on some machines as well

misol101
Posts: 383
Joined: 02 May 2016 18:20

Re: mov2txt

#12 Post by misol101 » 12 May 2016 20:31

Archives were updated again. I added optional caching of frames to playm2t.bat. This adds a slightly annoying initial delay for the two color demos, but on the other hand it will always run smooth even if the files were not in the file cache.

misol101
Posts: 383
Joined: 02 May 2016 18:20

Re: mov2txt

#13 Post by misol101 » 14 May 2016 12:31

Last time I'll bother you with just new content, promise :mrgreen:

Here is "Smack my bitch up" by The Prodigy!

If nothing else, this shows that real-life, dark, and chaotic videos maybe shouldn't be converted to extended ASCII... at all :)

NSFW!

http://www.mediafire.com/download/19va0b5zkx27gqr/SmackMyBitchUp.7z



http://www.mediafire.com/view/43o3uvk71a3uec3/smacki.PNG

misol101
Posts: 383
Joined: 02 May 2016 18:20

Re: mov2txt

#14 Post by misol101 » 16 Jun 2016 17:02

No new movies, as promised :mrgreen:

I just wanted to point out that if you try to run these things and get stuck in the initial caching forever, or the animation runs incredibly slow, then most likely, the antivirus program is to blame! I recently ran some of thse things on a friend's computer where it was really slow. Turns out it was the antivirus running in some kind of sandbox mode, slowing down the execution of my external programs gotoxy.exe and cmdwiz.exe horribly.

In these cases, turning off the antivirus temporarily speeds things up enormously.

So just in case these things move like syrup, don't blame me, blame your antivirus (probably) :mrgreen:

(alright, enough repetition now)

foxidrive
Expert
Posts: 6033
Joined: 10 Feb 2012 02:20

Re: mov2txt

#15 Post by foxidrive » 17 Jun 2016 02:35

misol101 wrote:Turns out it was the antivirus running in some kind of sandbox mode, slowing down the execution of my external programs gotoxy.exe and cmdwiz.exe horribly.


Most antivirus programs have an exclusion or whitelist feature, and programs can be added there so the AV program ignores them.

Post Reply