Welcome to World of IPTV

Join us now to get access to all our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, and so, so much more. It's also quick and totally free, so what are you waiting for?

Forum Rules

Our Rules: Read to avoid getting banned!

Advertising

Introduce Yourself to the World with Us!

Resource Database

Find the newest resources around IPTV!

Account upgrade

Upgrade your account to unlock more benefits!

Script MKV Auto Remux Script

anowise

Basic Member
Basic Member
Joined
Jul 5, 2025
Messages
10
Reaction score
3
Points
14
Location
Bosnia
Hello,

This Bash script automatically remuxes .mkv files using FFmpeg, ensuring that only selected subtitle languages are kept and properly sorted.
It is designed to process both movies and TV series from separate input folders and generate clean, organized output files.

What the Script Does​


Input Directories​

  • Movies
  • TV Series (with season subfolders)

Processing​

Remuxes MKV files without re-encoding:
  • Video → copy
  • Audio → copy
  • Subtitles → copy

Additional features:
  • Keeps only allowed subtitle languages
  • Requires at least one predefined regional subtitle language (Bosnian / Croatian / Serbian)
  • Ignores PGS subtitles
  • Automatically detects and includes external .srt subtitle files
  • Sorts subtitles alphabetically (A → Z)
  • Adds proper subtitle metadata (language + title)
  • Skips already processed files unless new subtitles are detected
  • Uses a lock mechanism to prevent multiple simultaneous executions
  • Automatically removes stale lock files
  • Logs everything (success, failed, missing subtitles)
  • Retries failed remux attempts up to 3 times
  • Optional Telegram notification support

External Subtitles (.srt)​

External .srt files must be placed in the same directory as the input .mkv file.
They are automatically detected based on the filename language code.

 
Interesting, in my experience I recommend you to use a task quest system to separate each related process by priority and resources.

I'm working on something similar to process 100K movies and series that will include subtitles and possibly dual Audio, grouped by genres, season and episode integrated with TMDB.
 
Interesting, in my experience I recommend you to use a task quest system to separate each related process by priority and resources.

I'm working on something similar to process 100K movies and series that will include subtitles and possibly dual Audio, grouped by genres, season and episode integrated with TMDB.
Yes, but this works perfectly if you have Radarr/Sonarr + Bazarr. Also, in addition to this script, I have a script behind mp4 for a similar principle. I can also publish it if anyone needs it.
 
Channels MatchTime Unblock CDN Offshore Server Contact
100 cnx / 90€ 5Gbps / 180€ 48CPU-256GRAM 10Gbps 569€ Skype live:giefsl
500 cnx / 350€ 10Gbps / 350€ 48CPU-128GRAM 5Gbps / 349€ TG @changcdn
1000 cnx / 500€ 20Gbps / 700€ 40CPU-128GRAM 20Gbps / €980 http://coronaserver.com
Yes, but this works perfectly if you have Radarr/Sonarr + Bazarr. Also, in addition to this script, I have a script behind mp4 for a similar principle. I can also publish it if anyone needs it.

Yes, it's a very good option. The project i'm talking about is a custom make script for a platform.

Would be good see your script, I'm using celery with python (fastapi) and others tools to process large amount of movies and all the process related.
 
shape1
shape2
shape3
shape4
shape5
shape6
Back
Top