havc


Namehavc JSON
Version 1.4.0 PyPI version JSON
download
home_pagehttps://github.com/zaytiri/handbrake-automatic-video-converter
SummaryAn automatic video converter using HandBrake CLI.
upload_time2024-10-09 22:30:35
maintainerNone
docs_urlNone
authorzaytiri
requires_python>=3.10.6
licenseNone
keywords handbrake cli console video converter encoder
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            [![Downloads](https://pepy.tech/badge/havc)](https://pepy.tech/project/havc)

[DEV.to Tutorial](https://dev.to/liathyr/how-to-encode-files-preserving-folder-hierarchy-4phi)

# Handbrake Automatic Video File Batch Converter

An automatic video converter using HandBrake CLI to batch convert all files found in recursive mode. In other words, all videos found on a given folder, and subsequent folders, will be converted on original location while original file will be transferred to another folder for easy removal.

### HandBrake

This is a video converter and the HandBrake GUI can be found [here](https://handbrake.fr), which also has a HandBrake CLI.

For more information, follow [this](https://handbrake.fr/docs/en/latest/table-of-contents.html) link.

## Table of Contents

- [Description](#description)
- [Features](#features)
- [Prerequisites](#prerequisites)
- [Installation](#installation)
- [Usage](#usage)
- [Support](#support)
- [License](#license)
- [Status](#status)

<a name="description"></a>

## Description

Given a specific folder, all video files found with user-given extensions will be converted to a target extension also provided by the user.

The converted video file will stay in the original folder while the original file will be transferred to another folder. This has the benefit of easy removal of the original files, as well as if a file does not encode successfully the original file still exists and can be converted again.

The program also accepts a user custom command which must have placeholders to be replaced by the original file path and converted file path.

In a first use of the program, all given arguments will be saved in a external file so the user does not have to always write the same repeated command.

In the end, an output file will be created containing:

- all the files' information, files' original size and converted size;
- if the file was successfully encoded;
- the size difference between all files;
- a list of files and their absolute paths which were not converted successfully;
- a list of files and their absolute paths which were skipped during encoding.

Initially, this project has the aim of reducing files size to ocupy the least amount of space in the disk and comparing between original size and converted size, but since a user can input a custom command, this can also be used just to convert a lot of files in a folder for other purposes.

<a name="features"></a>

## Features

| Status | Feature                                                              |
|:-------|:---------------------------------------------------------------------|
| ✅      | convert a lot of files in their corresponding folders                |
| ✅      | convert files with multiple different extensions at the same time    |
| ✅      | transfer of original files in an external folder for easy removal    |
| ✅      | configurations will be saved in an external file                     |
| ✅      | use of an automatic basic command aimed to reduce file size          |
| ✅      | a custom HandBrake command with placeholders can also be inserted    |
| ✅      | output file containing converted files information and their success |
| ✅      | option to shutdown computer when program is done                     |
| ✅      | when duplicate files exists these are skipped.                       |

Any new features are **very** welcome! Please open an issue to make a request.

### Skipped Files
- Program will skip files if it encounters duplicate files (with the same name and target extension), not doing anything with them. This information will be added to the output file summary.

### Future features

- Currently, this program only uses the Handbrake encoding tool. In the future, it will be implemented an option to also use the FFmpeg encoding tool. The user can then choose which one best suits him/her.

<!--#### Done ✅-->

<a name="prerequisites"></a>

## Prerequisites

[Python 3](https://www.python.org/downloads/) must also be installed.

To use this project, the HandBrake command line version must be installed. This installation can be found
in [this link](https://handbrake.fr/downloads.php) under 'Downloads->Other->Command Line Version'

You will also need the ffmpeg CLI. You can find the link here.

### For Linux Users (Debian/Ubuntu)
The HandBrake CLI can be installed by following the next commands:
```
sudo apt update
```

```
sudo apt install handbrake-cli
```

```
which HandBrakeCLI
```

<!-- The last command is useful for making sure the installation was successful.
Also it shows you where the executable is. You will need this path to input as the root path in this program's arguments (-r).

The ffmpeg CLI can be installed by following the next commands:
```
sudo apt update
```

```
sudo apt install ffmpeg
``` -->

<a name="installation"></a>

## Installation

```
pip --no-cache-dir install havc
```

or,

```
pip3 --no-cache-dir install havc
```

<a name="usage"></a>

## Usage

| Command                                            | Required | Description                                                                       |
|:---------------------------------------------------|:---------|:----------------------------------------------------------------------------------|
| -r                                                 | ✅        | absolute path folder to the HandBrake.exe (command line version)                  |
| -c                                                 | ✅        | absolute path folder containing the files to convert                              |
| -e                                                 | ✅        | multiple file extensions to find and convert                                      |
| -t                                                 | ✅        | file extension the converted file will have                                       |
| -d                                                 | ❌        | folder's name or an absolute path to the folder which will contain original files |
| -cc                                                | ❌        | custom handbrake command with placeholders (now reusable)                                        |
| --safety-question <br/>/<br/> --no-safety-question | ❌        | enable or disable the safety question                                             |
| --shutdown <br/>/<br/> --no-shutdown               | ❌        | enable or disable shutting down computer when program is done                     |
| --enable-delete <br/>/<br/> --no-enable-delete               | ❌        | if disabled, original files will not be moved to an external folder. they will stay in the same folder as the converted files                     |

#### Notes

- First command must have all required arguments except if these arguments already are configured in external file.
- Non-required arguments will also be saved in the external file if specified.
- The folder containing original filed has the default name of 'TO-DELETE' and the default path, if none is given, is the same directory as the path folder containing the files to convert.
- The dot '.' before each extension is completely optional.
- Because the program modifies the original files by moving them to another folder, one must be certain the correct folder is being modified so there is a question to make sure the user wants to continue. However, this feature can be disabled to let the program run freely, **_but be warned_**. The default of this value is 'true'.
- Shutting down the computer is disabled, by default.
- Disabling deletion of files, means that original files will remain in the same folder as converted files. This is true by default. Option does not get persisted between runs.


---

Any additional help can be provided if the following command is run:

```
havc --help
```
or,
```
havc -h
```

Example of the initial command:

```
havc -r "C:\path\to\Desktop" -c "C:\path\to\Desktop\folder to convert" -e mp4 mkv -t m4v
```

After this, the external file will be configured and then the following command becomes valid (always using the previous configurations):

```
havc
```

If any argument has to be modified just run the command with the necessary argument, for instance, if the extensions have to be modified, we simply run:

```
havc -e mov .avi mp4
```

<a name="support"></a>

## Support

The following links contain documentation about how to make a HandBrake command:

- [Command Line Reference](https://handbrake.fr/docs/en/latest/cli/command-line-reference.html)

- [CLI Options](https://handbrake.fr/docs/en/latest/cli/cli-options.html)

<a name="license"></a>

## License

[MIT](https://choosealicense.com/licenses/mit/)

<a name="status"></a>

## Status

This project started as a simple one file script, but then I saw the opportunity to make a program more complex that could also not only help the community, but also help my development. With that said, this project was also developed for educational purposes, so any bugs, suggestions, new features, improvements, etc, don't hesitate to ask, open an issue or a pull request.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/zaytiri/handbrake-automatic-video-converter",
    "name": "havc",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10.6",
    "maintainer_email": null,
    "keywords": "handbrake, cli, console, video, converter, encoder",
    "author": "zaytiri",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/88/cf/07dfca330fa907f5696b8f6d5ed91388dce2cf5b3ecf9deeb01562d2f581/havc-1.4.0.tar.gz",
    "platform": null,
    "description": "[![Downloads](https://pepy.tech/badge/havc)](https://pepy.tech/project/havc)\n\n[DEV.to Tutorial](https://dev.to/liathyr/how-to-encode-files-preserving-folder-hierarchy-4phi)\n\n# Handbrake Automatic Video File Batch Converter\n\nAn automatic video converter using HandBrake CLI to batch convert all files found in recursive mode. In other words, all videos found on a given folder, and subsequent folders, will be converted on original location while original file will be transferred to another folder for easy removal.\n\n### HandBrake\n\nThis is a video converter and the HandBrake GUI can be found [here](https://handbrake.fr), which also has a HandBrake CLI.\n\nFor more information, follow [this](https://handbrake.fr/docs/en/latest/table-of-contents.html) link.\n\n## Table of Contents\n\n- [Description](#description)\n- [Features](#features)\n- [Prerequisites](#prerequisites)\n- [Installation](#installation)\n- [Usage](#usage)\n- [Support](#support)\n- [License](#license)\n- [Status](#status)\n\n<a name=\"description\"></a>\n\n## Description\n\nGiven a specific folder, all video files found with user-given extensions will be converted to a target extension also provided by the user.\n\nThe converted video file will stay in the original folder while the original file will be transferred to another folder. This has the benefit of easy removal of the original files, as well as if a file does not encode successfully the original file still exists and can be converted again.\n\nThe program also accepts a user custom command which must have placeholders to be replaced by the original file path and converted file path.\n\nIn a first use of the program, all given arguments will be saved in a external file so the user does not have to always write the same repeated command.\n\nIn the end, an output file will be created containing:\n\n- all the files' information, files' original size and converted size;\n- if the file was successfully encoded;\n- the size difference between all files;\n- a list of files and their absolute paths which were not converted successfully;\n- a list of files and their absolute paths which were skipped during encoding.\n\nInitially, this project has the aim of reducing files size to ocupy the least amount of space in the disk and comparing between original size and converted size, but since a user can input a custom command, this can also be used just to convert a lot of files in a folder for other purposes.\n\n<a name=\"features\"></a>\n\n## Features\n\n| Status | Feature                                                              |\n|:-------|:---------------------------------------------------------------------|\n| \u2705      | convert a lot of files in their corresponding folders                |\n| \u2705      | convert files with multiple different extensions at the same time    |\n| \u2705      | transfer of original files in an external folder for easy removal    |\n| \u2705      | configurations will be saved in an external file                     |\n| \u2705      | use of an automatic basic command aimed to reduce file size          |\n| \u2705      | a custom HandBrake command with placeholders can also be inserted    |\n| \u2705      | output file containing converted files information and their success |\n| \u2705      | option to shutdown computer when program is done                     |\n| \u2705      | when duplicate files exists these are skipped.                       |\n\nAny new features are **very** welcome! Please open an issue to make a request.\n\n### Skipped Files\n- Program will skip files if it encounters duplicate files (with the same name and target extension), not doing anything with them. This information will be added to the output file summary.\n\n### Future features\n\n- Currently, this program only uses the Handbrake encoding tool. In the future, it will be implemented an option to also use the FFmpeg encoding tool. The user can then choose which one best suits him/her.\n\n<!--#### Done \u2705-->\n\n<a name=\"prerequisites\"></a>\n\n## Prerequisites\n\n[Python 3](https://www.python.org/downloads/) must also be installed.\n\nTo use this project, the HandBrake command line version must be installed. This installation can be found\nin [this link](https://handbrake.fr/downloads.php) under 'Downloads->Other->Command Line Version'\n\nYou will also need the ffmpeg CLI. You can find the link here.\n\n### For Linux Users (Debian/Ubuntu)\nThe HandBrake CLI can be installed by following the next commands:\n```\nsudo apt update\n```\n\n```\nsudo apt install handbrake-cli\n```\n\n```\nwhich HandBrakeCLI\n```\n\n<!-- The last command is useful for making sure the installation was successful.\nAlso it shows you where the executable is. You will need this path to input as the root path in this program's arguments (-r).\n\nThe ffmpeg CLI can be installed by following the next commands:\n```\nsudo apt update\n```\n\n```\nsudo apt install ffmpeg\n``` -->\n\n<a name=\"installation\"></a>\n\n## Installation\n\n```\npip --no-cache-dir install havc\n```\n\nor,\n\n```\npip3 --no-cache-dir install havc\n```\n\n<a name=\"usage\"></a>\n\n## Usage\n\n| Command                                            | Required | Description                                                                       |\n|:---------------------------------------------------|:---------|:----------------------------------------------------------------------------------|\n| -r                                                 | \u2705        | absolute path folder to the HandBrake.exe (command line version)                  |\n| -c                                                 | \u2705        | absolute path folder containing the files to convert                              |\n| -e                                                 | \u2705        | multiple file extensions to find and convert                                      |\n| -t                                                 | \u2705        | file extension the converted file will have                                       |\n| -d                                                 | \u274c        | folder's name or an absolute path to the folder which will contain original files |\n| -cc                                                | \u274c        | custom handbrake command with placeholders (now reusable)                                        |\n| --safety-question <br/>/<br/> --no-safety-question | \u274c        | enable or disable the safety question                                             |\n| --shutdown <br/>/<br/> --no-shutdown               | \u274c        | enable or disable shutting down computer when program is done                     |\n| --enable-delete <br/>/<br/> --no-enable-delete               | \u274c        | if disabled, original files will not be moved to an external folder. they will stay in the same folder as the converted files                     |\n\n#### Notes\n\n- First command must have all required arguments except if these arguments already are configured in external file.\n- Non-required arguments will also be saved in the external file if specified.\n- The folder containing original filed has the default name of 'TO-DELETE' and the default path, if none is given, is the same directory as the path folder containing the files to convert.\n- The dot '.' before each extension is completely optional.\n- Because the program modifies the original files by moving them to another folder, one must be certain the correct folder is being modified so there is a question to make sure the user wants to continue. However, this feature can be disabled to let the program run freely, **_but be warned_**. The default of this value is 'true'.\n- Shutting down the computer is disabled, by default.\n- Disabling deletion of files, means that original files will remain in the same folder as converted files. This is true by default. Option does not get persisted between runs.\n\n\n---\n\nAny additional help can be provided if the following command is run:\n\n```\nhavc --help\n```\nor,\n```\nhavc -h\n```\n\nExample of the initial command:\n\n```\nhavc -r \"C:\\path\\to\\Desktop\" -c \"C:\\path\\to\\Desktop\\folder to convert\" -e mp4 mkv -t m4v\n```\n\nAfter this, the external file will be configured and then the following command becomes valid (always using the previous configurations):\n\n```\nhavc\n```\n\nIf any argument has to be modified just run the command with the necessary argument, for instance, if the extensions have to be modified, we simply run:\n\n```\nhavc -e mov .avi mp4\n```\n\n<a name=\"support\"></a>\n\n## Support\n\nThe following links contain documentation about how to make a HandBrake command:\n\n- [Command Line Reference](https://handbrake.fr/docs/en/latest/cli/command-line-reference.html)\n\n- [CLI Options](https://handbrake.fr/docs/en/latest/cli/cli-options.html)\n\n<a name=\"license\"></a>\n\n## License\n\n[MIT](https://choosealicense.com/licenses/mit/)\n\n<a name=\"status\"></a>\n\n## Status\n\nThis project started as a simple one file script, but then I saw the opportunity to make a program more complex that could also not only help the community, but also help my development. With that said, this project was also developed for educational purposes, so any bugs, suggestions, new features, improvements, etc, don't hesitate to ask, open an issue or a pull request.\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "An automatic video converter using HandBrake CLI.",
    "version": "1.4.0",
    "project_urls": {
        "Changelog": "https://github.com/zaytiri/handbrake-automatic-video-converter/blob/main/CHANGELOG.md",
        "GitHub": "https://github.com/zaytiri/handbrake-automatic-video-converter",
        "Homepage": "https://github.com/zaytiri/handbrake-automatic-video-converter"
    },
    "split_keywords": [
        "handbrake",
        " cli",
        " console",
        " video",
        " converter",
        " encoder"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "576b779ea272d17c3fe9e25a93a8dd5c3ae15340704e934bc962a0e00af5463a",
                "md5": "305c25f64cbf98fdfd17ff9fbb3856a3",
                "sha256": "569304d9a2bdbed1b100fb4b6b0acc77e6400ff2335710c987281cc509294b21"
            },
            "downloads": -1,
            "filename": "havc-1.4.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "305c25f64cbf98fdfd17ff9fbb3856a3",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10.6",
            "size": 18978,
            "upload_time": "2024-10-09T22:30:33",
            "upload_time_iso_8601": "2024-10-09T22:30:33.941124Z",
            "url": "https://files.pythonhosted.org/packages/57/6b/779ea272d17c3fe9e25a93a8dd5c3ae15340704e934bc962a0e00af5463a/havc-1.4.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "88cf07dfca330fa907f5696b8f6d5ed91388dce2cf5b3ecf9deeb01562d2f581",
                "md5": "45df2a74ae318a182e473e1e98e72fd1",
                "sha256": "9874a998aa1a0b01a1222f5e6e7cd1b83a226f130fea16992881e364d11eea44"
            },
            "downloads": -1,
            "filename": "havc-1.4.0.tar.gz",
            "has_sig": false,
            "md5_digest": "45df2a74ae318a182e473e1e98e72fd1",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10.6",
            "size": 17977,
            "upload_time": "2024-10-09T22:30:35",
            "upload_time_iso_8601": "2024-10-09T22:30:35.558731Z",
            "url": "https://files.pythonhosted.org/packages/88/cf/07dfca330fa907f5696b8f6d5ed91388dce2cf5b3ecf9deeb01562d2f581/havc-1.4.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-10-09 22:30:35",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "zaytiri",
    "github_project": "handbrake-automatic-video-converter",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "havc"
}
        
Elapsed time: 1.61627s