# 📄🔄🎞️ PixelFuse
Convert any file to video and video to file.
**WARNING: videos created from files are very fragile. But if you create videos with the `--lessf` flag, the videos are not so fragile anymore**
## 💿 Installation
* Set up using `pip`:
```bash
pip install pixelfuse
```
* Install from `Git`:
```bash
pip install git+https://github.com/TheTS-labs/PixelFuse.git
```
## 🎬 Usage
### Convert file to video(`fileToVideo`)
To convert a file into a video just write the following command:
```bash
python -m pixelfuse fileToVideo "test/example.text.txt"
```
Where ["test/example.text.txt"](./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](https://drive.google.com/file/d/1OTZ9rF-6SI73BiLEwY4gJeJ2RVddLsfn/edit)
As for the parameters:
* `path: Path` - mandatory, the path to the file you want to convert
* `fps: float` - frame rate, default is `1.0`
* `width: int` - Video length, default is `480px`
* `height: int` - Video height, `640px` by default
* `fourcc: str` - Codec, a string of 4 characters, **WARNING: Use lossless codecs ONLY(except for the `--lessf` flag)**, 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 use `HFYU` codec you can NOT specify `output` as `output.mp4`**
* `verbose: int` - Output level, from 0 to 3, default is 2
* `lessf: bool` - Changes the way the video is recorded so that the video becomes less fragile, with this flag you can use lossy compression, default is `False`
### 🆕 Convert files to video(`filesToVideo`)
To convert a file into a video just write the following command:
```bash
python -m pixelfuse filesToVideo "test/example.text.txt" "test/example.image.jpg"
```
Where ["test/example.text.txt"](./test/example.text.txt) and ["test/example.image.jpg"](./test/example.image.jpg) the files you want to convert to video
This command will create a tar.gz archive which will later convert to a video, and delete the archive
This command will also create a hash map in which it will write the hash of **each** file. Then `convertToFile` unpacks all files and checks them according to this map
As output you get the file `output.avi` - video 640x480, 1.0 FPS, codec HFYU [like this](https://drive.google.com/file/d/1OTZ9rF-6SI73BiLEwY4gJeJ2RVddLsfn/edit)
As for the parameters:
* `paths: list[Path]` - mandatory, the paths to the files you want to convert
* `fps: float` - frame rate, default is `1.0`
* `width: int` - Video length, default is `480px`
* `height: int` - Video height, `640px` by default
* `fourcc: str` - Codec, a string of 4 characters, **WARNING: Use lossless codecs ONLY(except for the `--lessf` flag)**, 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 use `HFYU` codec you can NOT specify `output` as `output.mp4`**
* `verbose: int` - Output level, from 0 to 3, default is 2
* `lessf: bool` - Changes the way the video is recorded so that the video becomes less fragile, with this flag you can use lossy compression, default is `False`
### Convert video to file(`videoToFile`)
To get your file(s) back now you need to use this command:
```bash
python -m pixelfuse videoToFile "test/example.video.avi"
```
Where ["test/example.video.avi"](./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.jpg
Or 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 the `extractDir` parameter
Regarding the parameters:
* `path: Path` - Mandatory, the path to the video you want to convert back to a file
* `verbose: int` - Output level, from 0 to 2, default is 2
* `extractDir: str` - Path to extract archive files
* `lessf: bool` - If the video was encoded with this flag, you need to use it. Otherwise the decoding will end with an error
## ⚠️ Warning
Because of the way this converter works, the video output is **very, very** fragile, **about the `--lessf` flag below**.
In order for you to convert the file back, every pixel **MUST remain unchanged**, here is what you should avoid:
* Use ONLY lossless codecs, as all other codecs corrupt the pixels. For example, FFMPEG `FFV1`, Huffman `HFYU`, Lagarith `LAGS` etc.
* 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 use [Google Takeout](https://takeout.google.com/)
* Don'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 use `filesToVideo` command.
### About `--lessf` flag
If 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 matter **maybe** the 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
Raw data
{
"_id": null,
"home_page": "https://github.com/TheTS-labs/PixelFuse",
"name": "pixelfuse",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.10,<4.0",
"maintainer_email": "",
"keywords": "video,file,converter",
"author": "Roman",
"author_email": "romantovt31@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/20/6e/4ff74711df94db035da3609a3b7950e4a5437084a27a66f6a2efde5e79a9/pixelfuse-3.0.0.tar.gz",
"platform": null,
"description": "# \ud83d\udcc4\ud83d\udd04\ud83c\udf9e\ufe0f PixelFuse\n\nConvert any file to video and video to file.\n\n**WARNING: videos created from files are very fragile. But if you create videos with the `--lessf` flag, the videos are not so fragile anymore**\n\n## \ud83d\udcbf Installation\n\n* Set up using `pip`:\n```bash\npip install pixelfuse\n```\n* Install from `Git`:\n```bash\npip install git+https://github.com/TheTS-labs/PixelFuse.git\n```\n\n## \ud83c\udfac Usage\n\n### Convert file to video(`fileToVideo`)\n\nTo convert a file into a video just write the following command:\n```bash\npython -m pixelfuse fileToVideo \"test/example.text.txt\"\n```\n\nWhere [\"test/example.text.txt\"](./test/example.text.txt) the file you want to convert to video\n\nAs output you get the file `output.avi` - video 640x480, 1.0 FPS, codec HFYU [like this](https://drive.google.com/file/d/1OTZ9rF-6SI73BiLEwY4gJeJ2RVddLsfn/edit)\n\nAs for the parameters:\n* `path: Path` - mandatory, the path to the file you want to convert\n* `fps: float` - frame rate, default is `1.0`\n* `width: int` - Video length, default is `480px`\n* `height: int` - Video height, `640px` by default\n* `fourcc: str` - Codec, a string of 4 characters, **WARNING: Use lossless codecs ONLY(except for the `--lessf` flag)**, default is \"`HFYU`\".\n* `output: Path` - Path to output file, default is \"`output.avi`\", **note you need to use file extension compatible with codec, for example if you use `HFYU` codec you can NOT specify `output` as `output.mp4`**\n* `verbose: int` - Output level, from 0 to 3, default is 2\n* `lessf: bool` - Changes the way the video is recorded so that the video becomes less fragile, with this flag you can use lossy compression, default is `False`\n\n### \ud83c\udd95 Convert files to video(`filesToVideo`)\n\nTo convert a file into a video just write the following command:\n```bash\npython -m pixelfuse filesToVideo \"test/example.text.txt\" \"test/example.image.jpg\"\n```\n\nWhere [\"test/example.text.txt\"](./test/example.text.txt) and [\"test/example.image.jpg\"](./test/example.image.jpg) the files you want to convert to video\n\nThis command will create a tar.gz archive which will later convert to a video, and delete the archive\n\nThis command will also create a hash map in which it will write the hash of **each** file. Then `convertToFile` unpacks all files and checks them according to this map\n\nAs output you get the file `output.avi` - video 640x480, 1.0 FPS, codec HFYU [like this](https://drive.google.com/file/d/1OTZ9rF-6SI73BiLEwY4gJeJ2RVddLsfn/edit)\n\nAs for the parameters:\n* `paths: list[Path]` - mandatory, the paths to the files you want to convert\n* `fps: float` - frame rate, default is `1.0`\n* `width: int` - Video length, default is `480px`\n* `height: int` - Video height, `640px` by default\n* `fourcc: str` - Codec, a string of 4 characters, **WARNING: Use lossless codecs ONLY(except for the `--lessf` flag)**, default is \"`HFYU`\".\n* `output: Path` - Path to output file, default is \"`output.avi`\", **note you need to use file extension compatible with codec, for example if you use `HFYU` codec you can NOT specify `output` as `output.mp4`**\n* `verbose: int` - Output level, from 0 to 3, default is 2\n* `lessf: bool` - Changes the way the video is recorded so that the video becomes less fragile, with this flag you can use lossy compression, default is `False`\n\n### Convert video to file(`videoToFile`)\n\nTo get your file(s) back now you need to use this command:\n```bash\npython -m pixelfuse videoToFile \"test/example.video.avi\"\n```\n\nWhere [\"test/example.video.avi\"](./test/example.video.avi) is the video you want to convert into file(s)\n\nAs 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\n\nOr 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 the `extractDir` parameter\n\nRegarding the parameters:\n* `path: Path` - Mandatory, the path to the video you want to convert back to a file\n* `verbose: int` - Output level, from 0 to 2, default is 2\n* `extractDir: str` - Path to extract archive files\n* `lessf: bool` - If the video was encoded with this flag, you need to use it. Otherwise the decoding will end with an error\n\n## \u26a0\ufe0f Warning\n\nBecause of the way this converter works, the video output is **very, very** fragile, **about the `--lessf` flag below**.\n\nIn order for you to convert the file back, every pixel **MUST remain unchanged**, here is what you should avoid:\n* Use ONLY lossless codecs, as all other codecs corrupt the pixels. For example, FFMPEG `FFV1`, Huffman `HFYU`, Lagarith `LAGS` etc.\n* Do not convert videos to other formats, as this is likely to corrupt the pixels.\n* 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 use [Google Takeout](https://takeout.google.com/)\n* Don't trim the video, it will cut off some of the information and therefore the converted file.\n* 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.\n* 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 use `filesToVideo` command.\n\n### About `--lessf` flag\nIf 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 matter **maybe** the 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\n",
"bugtrack_url": null,
"license": "GPL-3.0",
"summary": "Convert any file to video and video to file",
"version": "3.0.0",
"project_urls": {
"Homepage": "https://github.com/TheTS-labs/PixelFuse",
"Repository": "https://github.com/TheTS-labs/PixelFuse"
},
"split_keywords": [
"video",
"file",
"converter"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "8019500b6bfc9b3f57f01f6f02b4b8741f8b45e7b17813398013a2973711144d",
"md5": "0c6f5530164071da4986a659cffb4e51",
"sha256": "24474b02f69085cb9e9f9ec76c312dc7749092814fa45fce5dcf7688d8cecae5"
},
"downloads": -1,
"filename": "pixelfuse-3.0.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "0c6f5530164071da4986a659cffb4e51",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10,<4.0",
"size": 35351,
"upload_time": "2023-05-21T14:35:46",
"upload_time_iso_8601": "2023-05-21T14:35:46.886818Z",
"url": "https://files.pythonhosted.org/packages/80/19/500b6bfc9b3f57f01f6f02b4b8741f8b45e7b17813398013a2973711144d/pixelfuse-3.0.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "206e4ff74711df94db035da3609a3b7950e4a5437084a27a66f6a2efde5e79a9",
"md5": "b61897e9b9cb94fb97d6bfd3573159c4",
"sha256": "1ee660098233a1c3a9bfe5f6b4a3520870acc4c11331ea73b346773dad3d40ef"
},
"downloads": -1,
"filename": "pixelfuse-3.0.0.tar.gz",
"has_sig": false,
"md5_digest": "b61897e9b9cb94fb97d6bfd3573159c4",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10,<4.0",
"size": 20787,
"upload_time": "2023-05-21T14:35:48",
"upload_time_iso_8601": "2023-05-21T14:35:48.656147Z",
"url": "https://files.pythonhosted.org/packages/20/6e/4ff74711df94db035da3609a3b7950e4a5437084a27a66f6a2efde5e79a9/pixelfuse-3.0.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-05-21 14:35:48",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "TheTS-labs",
"github_project": "PixelFuse",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "pixelfuse"
}