A wrapper around ffmpeg to make it work in a concurrent and memory-buffered fashion.

Overview

Media Fixer

Have you ever had a film or TV show that your TV wasn't able to play its audio? Well this program is for you. Media Fixer is a program which converts given media to a playable format. It's a kind of wrapper for ffmpeg that works with multiple files in a concurrent & memory-buffered fashion.

Requirements

Python >= 3.8 is required. (CPython and PyPy are both supported)

Additionally ffmpeg and mediainfo are required for this program to run. They can be installed on Ubuntu as the following way:

sudo apt install ffmpeg mediainfo

Installation

Media fixer can be either installed directly via pip:

pip install media-fixer

Or it can be installed from the source:

git clone https://github.com/simsekhalit/media-fixer.git
python3 -m pip install ./media-fixer

Manual

$ python3 -m media_fixer --help
usage: media-fixer [-h] [--audio AUDIO_STREAM] [--input-options INPUT_OPTIONS] [--max-memory MAX_MEMORY] [--output-options OUTPUT_OPTIONS] SOURCE [SOURCE ...] TARGET

A wrapper around ffmpeg to make it work in a concurrent and memory-buffered fashion.

positional arguments:
  SOURCE                source files/directories (works recursively)
  TARGET                target directory

optional arguments:
  -h, --help            show this help message and exit
  --audio AUDIO_STREAM  select index of audio stream to be used (zero-indexed). defaults to 0
  --input-options INPUT_OPTIONS
                        specify custom input file options for ffmpeg (overrides default ones)
  --max-memory MAX_MEMORY
                        specify allowed max memory usage as percent
  --output-options OUTPUT_OPTIONS
                        specify custom output file options for ffmpeg (overrides default ones)

For more information: https://github.com/simsekhalit/media-fixer

Media Fixer can be used in one of the two modes, namely Auto and Custom.

Auto Mode

If no output options are given, Media Fixer works in Auto mode. Initially, an audio stream is selected with --audio. For each given file, existing audio codec is detected and if it's in DTS format, it's converted to EAC-3. Otherwise, it's just copied to the target file as it is. While doing that only the selected audio stream is processed. Rest of the audio streams are stripped out. This is useful for saving space since generally there are many audio streams in a film (English, French, Spanish, etc.), but only one of them is needed.

Custom Mode

If output options are given with --output-options, Media Fixer works in custom mode. All the given files are converted according to given output options.

Examples

SOURCE and TARGET arguments are interpreted in the same way in both modes.
Single or multiple source paths can be given. For any given source path:
If it's a file, its corresponding target is written under the target path.
If it's a directory, then it's traversed recursively and all the files under it are processed. Source directory tree is generated as the same way in the target path. Corresponding target files are written accordingly.


ℹ️ MediaInfo is a helpful tool for identifying audio streams and their formats. It can be downloaded from https://mediaarea.net/en/MediaInfo


1. There is a film and its 3rd audio (which is the audio stream with index 2) is chosen to be used:

python3 -m media_fixer --audio 2 '/mnt/HDD/Matrix 4.mkv' '/mnt/MyUSB'

Matrix 4.mkv is processed and the resulting file is written to /mnt/USB/Matrix 4.mkv


2. There is a folder which contains a season of a TV show:

/mnt/HDD/Brooklyn Nine-Nine Season 1
/mnt/HDD/Brooklyn Nine-Nine Season 1/S01E01.mkv
/mnt/HDD/Brooklyn Nine-Nine Season 1/S01E02.mkv
/mnt/HDD/Brooklyn Nine-Nine Season 1/S01E03.mkv
...

Following command is executed:

python3 -m media_fixer '/mnt/HDD/Brooklyn Nine-Nine Season 1' '/mnt/USB'

All the episodes are processed and written to /mnt/USB/Brooklyn Nine-Nine Season 1


3. Custom ffmpeg options wanted to be used:

python3 -m media_fixer --output-options '-c:v copy -c:a aac -c:s copy -f matroska -map 0:v -map 0:a:2 -map 0:s' '/mnt/HDD/Brooklyn Nine-Nine Season 1' '/mnt/USB'

Following ffmpeg command is run for each source file:

ffmpeg -i $source -c:v copy -c:a aac -c:s copy -f matroska -map 0:v -map 0:a:2 -map 0:s -y -

$source is replaced with the source file's path and output is captured from stdout, buffered there and then written to the corresponding target path.

You might also like...
Your own movie streaming service. Easy to install, easy to use. Download, manage and watch your favorite movies conveniently from your browser or phone. Install it on your server, access it anywhere and enjoy.
Your own movie streaming service. Easy to install, easy to use. Download, manage and watch your favorite movies conveniently from your browser or phone. Install it on your server, access it anywhere and enjoy.

Vigilio Your own movie streaming service. Easy to install, easy to use. Download, manage and watch your favorite movies conveniently from your browser

MoviePy is a Python library for video editing,  can read and write all the most common audio and video formats
MoviePy is a Python library for video editing, can read and write all the most common audio and video formats

MoviePy is a Python library for video editing: cutting, concatenations, title insertions, video compositing (a.k.a. non-linear editing), video processing, and creation of custom effects. See the gallery for some examples of use.

Text2Video's purpose is to help people create videos quickly and easily by simply typing out the video’s script and a description of images to include in the video.
Text2Video's purpose is to help people create videos quickly and easily by simply typing out the video’s script and a description of images to include in the video.

Text2Video Text2Video's purpose is to help people create videos quickly and easily by simply typing out the video’s script and a description of images

Takes a video as an input and creates a video which is suitable to upload on Youtube Shorts and Tik Tok (1080x1920 resolution).

Shorts-Tik-Tok-Creator Takes a video as an input and creates a video which is suitable to upload on Youtube Shorts and Tik Tok (1080x1920 resolution).

Real-time video and audio streams over the network, with Streamlit.

streamlit-webrtc Example You can try out the sample app using the following commands.

Been busy guys, will be reviewing and integrating pull requests shortly. Thanks to all contributors!               LATEST RELEASE: 6.0.0 - flatpak @ https://flathub.org/apps/details/com.ozmartians.VidCutter - snap @ https://snapcraft.io/vidcutter - see https://github.com/ozmartian/vidcutter/releases for more details...
Docker container to expose a local RTMP, RTSP, and HLS stream for all your Wyze cameras including v3

Docker container to expose a local RTMP, RTSP, and HLS stream for all your Wyze cameras including v3. No Third-party or special firmware required.

KonomiTV: Kind and Optimized Next brOadcast watching systeM Infrastructure for TV
KonomiTV: Kind and Optimized Next brOadcast watching systeM Infrastructure for TV

備考・注意事項 現在 α 版で、まだ実験的なプロダクトです。通常利用には耐えないでしょうし、サポートもできません。 安定しているとは到底言いがたい品質ですが、それでも構わない方のみ導入してください。 使い方などの説明も用意できていないため、自力でトラブルに対処できるエンジニアの方以外には現状おすすめ

Youtube as covert-channel - Control systems remotely and execute commands by uploading videos to Youtube
Youtube as covert-channel - Control systems remotely and execute commands by uploading videos to Youtube

covert-tube A program to control systems remotely by uploading videos to Youtube using Python to create the videos and the listener, emulating some ma

Owner
Halit Şimşek
Software Engineer at Atlassian, Opsgenie
Halit Şimşek
Your self hosted Youtube media server

The Tube Archivist Your self hosted Youtube media server Core functionality Subscribe to your favourite Youtube channels Download Videos using yt-dlp

Simon 2.1k Dec 31, 2022
A Simple Telegram Bot By @Tellybots to add Subtitle Files in Video

Video-subtitle-merger A Simple Telegram Bot By @Tellybots to add Subtitle Files in Video Features Force Sub Button Added Soon Support Media Type Such

6 Dec 31, 2021
Become a virtual character with just your webcam!

Become a virtual character with just your webcam!

Rich 300 Jan 03, 2023
Automatically segment in-video YouTube sponsorships.

SponsorBlock Auto Segment [Model Download] Automatically segment in-video YouTube sponsorships. Trained on a large dataset of YouTube sponsor transcri

Akmal 7 Aug 22, 2022
Docker container to expose a local RTMP, RTSP, and HLS stream for all your Wyze cameras including v3

Docker container to expose a local RTMP, RTSP, and HLS stream for all your Wyze cameras including v3. No Third-party or special firmware required.

1.2k Jan 07, 2023
BlogBot - a Python script that create blogs from YouTube videos.

BlogBot - Convert Youtube Videos To Blogs BlogBot is a Python script that create blogs from YouTube videos.

Nikhil Bhamere 4 Apr 22, 2022
This is a simple script to generate a .opml file from a list of youtube channels.

Youtube to rss Don't spend more time than you need to on youtube.com This is a simple script to generate a .opml file from a list of youtube channels.

Kostas 1 Oct 04, 2022
Play Video & Music on Telegram Group Video Chat

🖤 DEMONGIRL 🖤 ʜᴇʟʟᴏ ❤️ 🇱🇰 Join us ᴠɪᴅᴇᴏ sᴛʀᴇᴀᴍ ɪs ᴀɴ ᴀᴅᴠᴀɴᴄᴇᴅ ᴛᴇʟᴇʀᴀᴍ ʙᴏᴛ ᴛʜᴀᴛ's ᴀʟʟᴏᴡ ʏᴏᴜ ᴛᴏ ᴘʟᴀʏ ᴠɪᴅᴇᴏ & ᴍᴜsɪᴄ ᴏɴ ᴛᴇʟᴇɢʀᴀᴍ ɢʀᴏᴜᴘ ᴠɪᴅᴇᴏ ᴄʜᴀᴛ 🧪 ɢ

Jonathan 5 Dec 31, 2021
Code for the manim-generated scenes used in 3blue1brown videos

Code for the manim-generated scenes used in 3blue1brown videos

Grant Sanderson 4.1k Jan 09, 2023
Cvplayer - A simple video player written in python using ffpyplayer and OpenCV

Video Player cvplayer is a minimal wrapper around the ffpyplayer.MediaPlayer cla

ADI 7 Dec 19, 2022
Telegram Music/ Video Streaming Bot Using Pytgcalls

Video Player 🔥 ᴢᴀɪᴅ ᴠᴄ ᴘʟᴀyᴇʀ ɪꜱ ᴀ ᴛᴇʟᴇɢʀᴀᴍ ᴘʀᴏᴊᴇᴄᴛ ʙᴀꜱᴇᴅ ᴏɴ ᴘʏʀᴏɢʀᴀᴍ ꜰᴏʀ ᴘʟᴀʏ ᴍᴜꜱɪᴄꜱ ɪɴ ᴠᴄ ᴄʜᴀᴛꜱ... 🅡🅔🅟🅞 🅢🅣🅐🅣🅢 ʀᴇQᴜɪʀᴇᴍᴇɴᴛꜱ 📝 FFmpeg NodeJ

16 Nov 30, 2022
A project that uses optical flow and machine learning to detect aimhacking in video clips.

waldo-anticheat A project that aims to use optical flow and machine learning to visually detect cheating or hacking in video clips from fps games. Che

RicanSamurai 542 Dec 03, 2022
A web RTSP play platform based on websocket and tornado, websocket use blob binaryType read as ArrayBuffer

A web RTSP play platform based on websocket and tornado, websocket use blob binaryType read as ArrayBuffer

2 Feb 25, 2022
Python application that can be used to generate video thumbnail for mp4 and mkv file types.

Thumbnail Generator 🎬 What is This This is a Python application that can be used to generate video thumbnail for mp4 and mkv file types. Installation

Tharindu N. 13 Jan 03, 2023
Webcam Indicator is an application to recieve and send messages from your own Webcam Server.

Welcome to Webcam Indicator 👋 Webcam Indicator is an application to recieve and send messages from your own Webcam Server. 🏠 Homepage Prerequisites

Lorenzo Carbonell 2 Apr 04, 2022
Lightweight, zero-dependency proxy and storage RTSP server

python-rtsp-server Python-rtsp-server is a lightweight, zero-dependency proxy and storage server for several IP-cameras and multiple clients. Features

Vlad 39 Nov 23, 2022
Help for manipulating the plex-media-server transcode on the raspberry pi

raspi-plex-transcode Help for manipulating the plex-media-server transcode on the raspberry pi Ensure hardware decoding works and your firmware is up

10 Sep 29, 2022
A GUI based datamoshing apllication for everyone! Apply this glitch to your videos and gifs. Supports all video formats!

A GUI based datamoshing apllication for everyone! Apply this glitch to your videos and gifs. Supports all video formats!

Akascape 131 Dec 31, 2022
pyYotubemanager is full web automated bot capable of General tasks like:- Uploading a Video , Downloading , adding Title , Description , Listing types , adding Thumbnail

PyYoutubemanager Explore the docs » View Demo · Report Bug · Request Feature About The Project PyYotubemanager is full web automated bot capable of Ge

4 Jun 29, 2022
A GUI application for cropping images from videos

v-trimming-gui A GUI application for cropping images from videos. 動画をシークバーで操作しながらスクリーンショットを撮るためのアプリ。 Requirement Python =3.7 opencv-python ^4.5.5 PyS

Menrui 6 Feb 05, 2022