CLI Utility to encode and recursively recreate directories with ffmpeg.

Overview

Logo

FFenmass

PyPI PyPI - Python Version PyPI - Downloads PyPI - License
CLI Utility to encode and recursively recreate directories with ffmpeg.
Report Bug · Request Feature

Table of Contents

  1. Getting Started
  2. Features
  3. Usage
  4. Contributing
  5. Changelogs & TODOs
  6. License (MIT)

Features

  • Processing whole directories with ffmpeg.
  • Recreating directories with identical foldernames/filenames on the output.
  • Skipping Files that have alredy been processed.
  • Deleting half processed files, to keep output directory clean.
  • Ignoring non media files.

Getting Started

FFenmass is an ffmpeg wrapper, adding the ability to process media files in directories and recreate them recursively.

Prerequisites

  • ffmpeg
  • ffpb - Yeah I cant be bothered to make a ffmpeg loading bar, this works fine.
  • tqdm
  • rich

Installation

Recommended way is using pip, as building from git can be unstable.

pip3 install ffenmass

Usage

FFenmass is transparent above ffmpeg, this means most ffmpeg syntax can be used with ffenmass as is to encode directories.

Differences to FFmpeg Syntax

-i - This needs to be a directory created beforehand, instead of a file.

output - This needs to be a directory, instead of a file.If the directory does not exist it will be created. The output must be the last argument as per standard ffmpeg syntax.

-ext - This is a custom argument, specific to ffenmass, here you will provide the extension you want for your files, examples mp4,mkv,opus,mp3 , you only provide the extension and with no ., for further clarification, look at the command comparison below.

!! Directories are required to have a trailing slash / !!

The result is, ffenmass will encode all media files detected under the input directory with the provided ffmpeg arguments and output them with the same folder structure and filenames in the output directory.


Example compared to standard ffmpeg syntax

ffmpeg -i input.mkv -vcodec libx265 -preset medium out.mp4


ffenmass -i /path/to/folder/ -vcodec libx265 -preset medium -ext mp4 /output/directory/


Directory Tree visualization of what is going on when you run the command from the example above.

/path/to/folder/                           /output/directory/
├── givemefolders/                        ├── givemefolders/      
│   ├── somefolder/                       │   ├── somefolder/
│   │   └── example_movie.mkv             │   │   └── example_movie.mp4
│   │   └── irrelevant_textfile.txt       │   │   
│   ├── another_example.mkv         →     │   ├── another_example.mp4
│   ├── morefolders/                      │   ├── morefolders/
│   │   └── a_lot_of_examples.ts          │   │   └── a_lot_of_examples.mp4  
│   └── documentary.mkv                   │   └── documentary.mp4
├── another_example.mkv                   ├── another_example.mp4
├── more-examples.mp4                     ├── more-examples.mp4 
└── examples_and_examples.ts              └── examples_and_examples.mp4


License

Distributed under the MIT License. See LICENSE for more information.

You might also like...
A simple CLI based any Download Tool, that find files and let you stream or download thorugh WebTorrent CLI or Aria or any command tool
A simple CLI based any Download Tool, that find files and let you stream or download thorugh WebTorrent CLI or Aria or any command tool

Privateer A simple CLI based any Download Tool, that find files and let you stream or download thorugh WebTorrent CLI or Aria or any command tool How

[WIP]An ani-cli like cli tool for movies and webseries

mov-cli A cli to browse and watch movies. Installation This project is a work in progress. However, you can try it out python git clone https://github

flora-dev-cli (fd-cli) is command line interface software to interact with flora blockchain.

Install git clone https://github.com/Flora-Network/fd-cli.git cd fd-cli python3 -m venv venv source venv/bin/activate pip install -e . --extra-index-u

AWS Interactive CLI - Allows you to execute a complex AWS commands by chaining one or more other AWS CLI dependency

AWS Interactive CLI - Allows you to execute a complex AWS commands by chaining one or more other AWS CLI dependency

Python-Stock-Info-CLI: Get stock info through CLI by passing stock ticker.
Python-Stock-Info-CLI: Get stock info through CLI by passing stock ticker.

Python-Stock-Info-CLI Get stock info through CLI by passing stock ticker. Installation Use the following command to install the required modules at on

Yts-cli-streamer - A CLI movie streaming client which works on yts.mx API written in python
Yts-cli-streamer - A CLI movie streaming client which works on yts.mx API written in python

YTSP It is a CLI movie streaming client which works on yts.mx API written in pyt

Library and command-line utility for rendering projects templates.
Library and command-line utility for rendering projects templates.

A library for rendering project templates. Works with local paths and git URLs. Your project can include any file and Copier can dynamically replace v

A handy command-line utility for generating and sending iCalendar events

A handy command-line utility for generating and sending iCalendar events This simple command-line utility is designed to generate an iCalendar event,

Comments
  • Resuming Encodes

    Resuming Encodes

    Redo the queue system, add optional functionality to resume directory encodings based on files present between source and output directories.

    Compare source filename's list with output's filename list to see which files are present on the output and skip them

    Possible argument names --resume

    Issues this may bring?

    If a user has a file name myfile.txt in the output directory and a file name myfile.mp4 in the input directory, it will get skipped. As FFenmass is file extension ignorant by design.

    Good trade off.

    enhancement 
    opened by george-avn 1
  • Make unprocessed media reside in /var/tmp/ until encoding is finished.

    Make unprocessed media reside in /var/tmp/ until encoding is finished.

    Make media that has not finished encoding reside in /var/tmp/ until encoding is finished, to avoid having corrupted files on the output directory in case of program termination.

    enhancement 
    opened by george-avn 1
Releases(v0.2.9)
  • v0.2.9(Jul 10, 2021)

  • v0.2.7(Jul 4, 2021)

    0.2.7

    • Rich and ffpb are now dependencies.
    • Added a file filter, now only media files will be parsed when scanned.
    • Using ffbp for a progress bar because I dont want to make one.
    • Using Rich to make text prettier.
    • Yaspin no longer a dependency, replaced by ffbp.
    • Code cleaned up, file related functions are under their own Class.
    • Small changes to comments to be more thorough.
    Source code(tar.gz)
    Source code(zip)
  • 0.2.6(Jun 18, 2021)

  • 0.2.5(Jun 16, 2021)

    0.2.5

    • Migrated from os.path over to pathlib.(yay)
    • Added additional required argument -ext.
    • FFenmass now handled file extensions
    • -f argument is no longer required by ffenmass and is not checked.
    • Some ground work to prepare for windows testing and debuging.
    • Updated Readme with better examples.
    • Additional Code docs to help me mostly.
    Source code(tar.gz)
    Source code(zip)
  • 0.2.4(Jun 13, 2021)

    0.2.4

    • FFenmass will now clean after itself, if interupted during processing, the item that was last in progress will be deleted.
    • FFenmass will skip files that already exist with the same filename in the output directory.
    • Encoding queue is now sorted alphanumerically.
    • Yaspin is now a dependency.
    • TQDM is now a dependency.
    • Prettyfied output.
    • FFmpeg is now mute (again).
    Source code(tar.gz)
    Source code(zip)
  • v0.2.3(Jun 8, 2021)

    0.2.3

    • Made ffmpeg less verbose using -hide_banner
    • FFenmass will now clear the terminal after each encode bc ffmpeg talks too much
    • Made a less ugly and proper Readme
    Source code(tar.gz)
    Source code(zip)
  • v0.2.2(Jun 8, 2021)

    Simplified code, optimized imports
    Rich is no longer a dependency
    Updated README and Made Changelongs and TODO reside under CHANGELOGS.md
    
    Source code(tar.gz)
    Source code(zip)
Owner
George Av.
RESTfull APIS, Web backends, Databases and anything python.
George Av.
A very simple python script to encode and decode PowerShell one-liners.

PowerShell Encoder A very simple python script to encode and decode PowerShell one-liners. I used Raikia's PowerShell encoder ALOT, but one day it wen

John Tear 5 Jul 29, 2022
Python wrapper and CLI utility to render LaTeX markup and equations as SVG using dvisvgm and svgo.

latex2svg Python wrapper and CLI utility to render LaTeX markup and equations as SVG using dvisvgm and svgo. Based on the original work by Tino Wagner

Matthias C. Hormann 4 Feb 18, 2022
A cd command that learns - easily navigate directories from the command line

NAME autojump - a faster way to navigate your filesystem DESCRIPTION autojump is a faster way to navigate your filesystem. It works by maintaining a d

William Ting 14.5k Jan 3, 2023
CLI utility to search and download torrents from major torrent sites

CLI Torrent Downloader About CLI Torrent Downloader provides convenient and quick way to search torrent magnet links (and to run associated torrent cl

x0r0x 86 Dec 19, 2022
Python CLI utility and library for manipulating SQLite databases

sqlite-utils Python CLI utility and library for manipulating SQLite databases. Some feature highlights Pipe JSON (or CSV or TSV) directly into a new S

Simon Willison 1.1k Jan 4, 2023
AlienFX is a CLI and GUI utility to control the lighting effects of your Alienware computer.

AlienFX is a Linux utility to control the lighting effects of your Alienware computer. At present there is a CLI version (alienfx) and a gtk GUI versi

Stephen Harris 218 Dec 26, 2022
CLI utility for updating the EVE Online static data export in a postgres database

EVE SDE Postgres updater CLI utility for updating the EVE Online static data export postgres database. This has been tested with the Fuzzwork postgres

Markus Juopperi 1 Oct 29, 2021
This is a CLI utility that allows you to view RedFlagDeals.com on the command line.

RFD Description Motivation Installation Usage View Hot Deals View and Sort Hot Deals Search Advanced View Posts Shell Completion bash zsh Description

Dave G 8 Nov 29, 2022
A simple cli utility for importing or exporting dashboard json definitions using the Grafana HTTP API.

grafana-dashboard-manager A simple cli utility for importing or exporting dashboard json definitions using the Grafana HTTP API. This may be useful fo

Beam Connectivity 31 Jan 6, 2023
Sink is a CLI tool that allows users to synchronize their local folders to their Google Drives. It is similar to the Git CLI and allows fast and reliable syncs with the drive.

Sink is a CLI synchronisation tool that enables a user to synchronise local system files and folders with their Google Drives. It follows a git C

Yash Thakre 16 May 29, 2022