Package: pixelfuse
📄🔄🎞️ PixelFuseConvert any file to video and video to file.WARNING: videos created from files are very fragile. But if you create videos with the--lessfflag, the videos are not so fragile anymore💿 InstallationSet up usingpip:pipinstallpixelfuseInstall fromGit:pipinstallgit+https://github.com/TheTS-labs/PixelFuse.git🎬 UsageConvert file to video(fileToVideo)To convert a file into a video just write the following command:python-mpixelfusefileToVideo"test/example.text.txt"Where"test/example.text.txt"the file you want to convert to videoAs output you get the fileoutput.avi- video 640x480, 1.0 FPS, codec HFYUlike thisAs for the parameters:path: Path- mandatory, the path to the file you want to convertfps: float- frame rate, default is1.0width: int- Video length, default is480pxheight: int- Video height,640pxby defaultfourcc: str- Codec, a string of 4 characters,WARNING: Use lossless codecs ONLY(except for the--lessfflag), default is "HFYU".output: Path- Path to output file, default is "output.avi",note you need to use file extension compatible with codec, for example if you useHFYUcodec you can NOT specifyoutputasoutput.mp4verbose: int- Output level, from 0 to 3, default is 2lessf: bool- Changes the way the video is recorded so that the video becomes less fragile, with this flag you can use lossy compression, default isFalse🆕 Convert files to video(filesToVideo)To convert a file into a video just write the following command:python-mpixelfusefilesToVideo"test/example.text.txt""test/example.image.jpg"Where"test/example.text.txt"and"test/example.image.jpg"the files you want to convert to videoThis command will create a tar.gz archive which will later convert to a video, and delete the archiveThis command will also create a hash map in which it will write the hash ofeachfile. ThenconvertToFileunpacks all files and checks them according to this mapAs output you get the fileoutput.avi- video 640x480, 1.0 FPS, codec HFYUlike thisAs for the parameters:paths: list[Path]- mandatory, the paths to the files you want to convertfps: float- frame rate, default is1.0width: int- Video length, default is480pxheight: int- Video height,640pxby defaultfourcc: str- Codec, a string of 4 characters,WARNING: Use lossless codecs ONLY(except for the--lessfflag), default is "HFYU".output: Path- Path to output file, default is "output.avi",note you need to use file extension compatible with codec, for example if you useHFYUcodec you can NOT specifyoutputasoutput.mp4verbose: int- Output level, from 0 to 3, default is 2lessf: bool- Changes the way the video is recorded so that the video becomes less fragile, with this flag you can use lossy compression, default isFalseConvert video to file(videoToFile)To get your file(s) back now you need to use this command:python-mpixelfusevideoToFile"test/example.video.avi"Where"test/example.video.avi"is the video you want to convert into file(s)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.jpgOr a folder with files, if you converted several files. By default, the folder name is the name of the video file without path or extension, but you can specify something else with theextractDirparameterRegarding the parameters:path: Path- Mandatory, the path to the video you want to convert back to a fileverbose: int- Output level, from 0 to 2, default is 2extractDir: str- Path to extract archive fileslessf: bool- If the video was encoded with this flag, you need to use it. Otherwise the decoding will end with an error⚠️ WarningBecause of the way this converter works, the video output isvery, veryfragile,about the--lessfflag below.In order for you to convert the file back, every pixelMUST remain unchanged, here is what you should avoid:Use ONLY lossless codecs, as all other codecs corrupt the pixels. For example, FFMPEGFFV1, HuffmanHFYU, LagarithLAGSetc.Do not convert videos to other formats, as this is likely to corrupt the pixels.Remember that if you upload a video to YouTube, it will re-encode the video (and, guess what, damage the pixels), so if you want to download videos from YouTube, you need to useGoogle TakeoutDon't trim the video, it will cut off some of the information and therefore the converted file.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.Never convert zip archives, for some unknown reason the decoder (or encoder) cannot process these archives correctly. If you want to convert multiple files, it is better to usefilesToVideocommand.About--lessfflagIf you use this flag, the file will be encoded differently (using black and white squiggles), so you can compress videos with lossy codecs and post them on YouTube and download them without Google Takeout. It is also better not to apply filters, but for that mattermaybethe file can still be decoded, but it is better not to do it. Otherwise, the restrictions for the --lessf flag are the same as for the normal encoding method