I have this text file that contains the binary code for a photograph. I'm trying to convert it to a movie file through my Unix command line, but it's not working.
So I've tried
<IMG.txt >IMG.mov
but that didn't work– it only created a blank file.
I don't know a lot about doing this sort of thing through the command line, so does anyone know of a way to do it?
I'm using the Terminal application on Mac OS X High Sierra.
Thanks!
max
Edit:
Is there a sort of copy command or something like that for Unix?
What is the format of the input file? What format do you want the output video file to be? Do you want it be the same resolution as the photograph, or cropped/extended to a particular aspect ratio/resolution? What should the duration of the output video file be?
For command-line image/video-editing tools, look into ffmpeg.
Is there a sort of copy command or something like that for Unix?
The extension of the filename doesn't matter as far as the content of the file is concerned. If the content of the file is an image format (JPEG, or PNG, etc.), then it's an image, full stop.
If you want your file explorer or what have you to correctly do things like preview or open the file in your default photo viewer, then your original idea of copying to a new name or renaming the file is what you want.
@max
This is how I interpret your monumentally clear request:
A. THE PROBLEM
1. There is a file of yours called xyz.txt
2. If the file is simply renamed xyz.bmp it represents a normal picture file as a normal .bmp file. (The .txt suffix is accidental (or whatever))
3. Using the Terminal app (only) on a Mac you want to display the picture.
B. ONE POSSIBLE SOLUTION
1. Open Terminal
2. cd to the folder containing the xyz.txt file
(Use the ls command to verify that the location is correct)
3. mv xyz.txt xyz.bmp i.e rename file
4. open -a preview xyz.bmp xyz picture will then be displayed in Preview
I'm actually working on an application that will take a text file (or whatever file you drop into it) and "convert it to an image" i.e. change the extension to .jpg or .png or something like that.
Mac has an application for doing this called Automator; so ironically, I'll be making an application with an application!