Convert any file to video and video to file
Project description
PixelFuse
Convert any file to video and video to file.
WARNING: videos created from files are extremely fragile
💿 Installation
- Set up using
pip
:
pip install pixelfuse
- Install from
Git
:
pip install git+https://github.com/TheTS-labs/PixelFuse.git
Usage
Convert file to video(convertToVideo
)
To convert a file into a video just write the following command:
python -m pixelfuse fileToVideo "test/example.text.txt"
Where "test/example.text.txt" the file you want to convert to video
As output you get the file output.avi
- video 640x480, 1.0 FPS, codec HFYU like this
As for the parameters:
path: str
- mandatory, the path to the file you want to convertfps: float
- frame rate, default is1.0
width: int
- Video length, default is480px
height: int
- Video height,640px
by defaultfourcc: str
- Codec, a string of 4 characters, WARNING: Use lossless codecs ONLY, default is "HFYU
".output: str
- Path to output file, default is "output.avi
", note you need to use file extension compatible with codec, for example if you useHFYU
codec you can NOT specifyoutput
asoutput.mp4
verbose: int
- Output level, from 0 to 3, default is 2
Convert video to file(convertToFile
)
To get your file back now you need to use this command:
python -m pixelfuse videoToFile "test/example.video.avi"
Where "test/example.video.avi" is the file you want to convert into
As output, you will get the file with the name it was converted into a video. For example, if you converted the file "example.image.jpg", when you convert the video back to a file you get a file named example.image.jpg
Regarding the parameters:
path: str
- Mandatory, the path to the video you want to convert back to a fileverbose: int
- Output level, from 0 to 2, default is 2decoder: str
- Which decoder to use, default is an empty string. Available decoders:-
v1
- Less memory efficient decoder, may be useful if standard decoder detects meta frame by mistake. Keep in mind that all video will be loaded into RAM
-
- Blank line - Standard decoder
Warning
Because of the way this converter works, the video output is very, very fragile
In order for you to be able to convert the file back, every pixel MUST remain unchanged, that is what you should avoid:
- Use ONLY lossless codecs, as all other codecs corrupt the pixels. E.g. FFMPEG
FFV1
, HuffmanHFYU
, LagarithLAGS
, etc. - Do not convert videos to other formats, as this will most likely cause pixel damage
- Keep in mind that if you upload videos to YouTube, it will re-encode the video(and, guess what, damage the pixels), so if you want to download videos from YouTube, you'll need to use Google Takeout
- Do not trim the video, it will trim some of the information, and therefore the file you converted
- Do not apply filters to the video, for example. Anything that can change pixels will damage the file and you won't be able to decode it
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for pixelfuse-1.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8a365077fb7e3367b5d7e587f2a1bc84747ccd331afc6692005d4730c07a5462 |
|
MD5 | b8e3a886949c5a90e1c10b1c8502e905 |
|
BLAKE2b-256 | 58b9dabfb586414fc1a94085036ffe3da9333e17e9828d60c73d846615f5c9c8 |