Skip to content

Repository files navigation

TS to MP4 Converter

TS to MP4 Converter is a lightweight Windows desktop utility built with C# and WPF (.NET Framework 4.8) for batch converting MPEG Transport Stream (.ts) files to MP4.

Platform Framework Language UI License

Overview

Select a folder and all .ts files inside it are instantly listed as queued entries. Hit Start and the converter processes them one by one — remuxing each file with mkvmerge and stream-copying to MP4 with ffmpeg — while updating every row's status live in the table. Progress, timing, and per-file results are tracked in real time and can be exported to CSV when done.

Features

  • Instant file preview — selecting a folder immediately lists all .ts files found (recursively) with a WAITING status before conversion even starts.
  • Live in-place status updates — each row transitions WAITING → CONVERTING... (N%) → COMPLETED without adding or removing rows, keeping the list stable throughout.
  • Real-time progress — per-file percentage is derived from mkvmerge's native stdout progress output, updating smoothly from 0 to 99 %.
  • Batch processing — converts all files in a folder sequentially to avoid CPU/IO contention during video encoding.
  • Keep or delete source files — optionally remove the original .ts after a successful conversion.
  • Overwrite control — skip files whose MP4 output already exists, or overwrite them.
  • Flexible output — save converted files to the same source folder, or pick a separate output directory.
  • Cancellable — a Stop button cancels the running conversion cleanly, killing the active process and recording an abort entry in the log.
  • Log filtering — filter the conversion table by status (All, COMPLETED, FAILED, SKIPPED) at any time.
  • CSV export — export the full conversion log (action, prefix, source, destination, status) to a .csv file; only enabled after a successful run.
  • Completion actions — optionally play a notification sound and/or open the output folder when the batch finishes.
  • Dark / Light theme — toggle between themes at any time; preference is persisted across sessions.
  • Dependency check — on launch, verifies that both ffmpeg.exe and mkvmerge.exe are reachable on the system PATH and disables Start if either is missing.
  • Custom window chrome — frameless, draggable title bar for a clean, modern look.
  • Styled info dialogs — success, info, and error notifications use a themed in-app dialog instead of the system MessageBox.

Screenshots

TS to MP4 Converter

Getting Started

Prerequisites

  • Windows 7 SP1 or later (Windows 10 / 11 recommended)
  • .NET Framework 4.8 (pre-installed on modern Windows)
  • ffmpeg — add ffmpeg.exe to your system PATH (ffmpeg.org)
  • MKVToolNix — add mkvmerge.exe to your system PATH (mkvtoolnix.download)
  • Visual Studio 2019 / 2022 with the .NET desktop development workload (only required to build from source)

Build from source

  1. Clone the repository:
    git clone https://github.com/xecvas/TS-to-MP4.git
    cd TS-to-MP4
  2. Open TS to MP4.sln in Visual Studio.
  3. Build the solution (Ctrl+Shift+B) or publish a Release build.
  4. Run TS to MP4.exe from bin/Release (or bin/Debug).

Download a release

Alternatively, download the latest pre-built executable from the Releases page and run TS to MP4.exe directly — no installation required.

Usage

  1. Launch TS to MP4 Converter. The app checks for ffmpeg and mkvmerge on startup — both must be on the PATH before conversion can begin.
  2. Click Browse next to Source Folder and select the folder containing your .ts files. All files found (including subfolders) are immediately listed in the table with a WAITING status.
  3. Set your Output Folder, or tick Save to Source Folder to convert in place.
  4. Choose your Conversion Options:
    • Keep Original Source Files — leaves the .ts files untouched after conversion.
    • Overwrite Existing Files — replaces any MP4 that already exists at the output path.
    • Play Notification Sound on Finish — plays a system sound when the batch completes.
    • Open Output Folder on Finish — opens the output directory in Explorer after the run.
  5. Click START CONVERSION. Each row updates live: WAITING → CONVERTING... (N%) → COMPLETED / FAILED / SKIPPED.
  6. Click STOP / CANCEL at any time to abort. The active file is terminated cleanly and an abort entry is added to the log.
  7. Use the All Status filter dropdown to narrow the log view by outcome.
  8. Once the batch completes, click Export Log to save the full conversion table as a .csv file.
  9. Click 🔄 Recheck to reset the UI and re-run the dependency check at any time.

Project Structure

TS to MP4/
├── Models/
│   └── Models.cs               # AppSettings, LogInfo (INotifyPropertyChanged), SummaryStats
├── Utilities/
│   ├── ThemeHelper.cs          # ThemeHelper (brush switching), DialogHelper (folder picker), ProcessHelper (async process runner)
│   └── ConverterEngine.cs      # SettingsService (JSON persistence), ConverterService (batch engine + dependency check)
├── App.xaml / App.xaml.cs      # Application entry point
├── InfoWindow.xaml / .xaml.cs  # Themed info / success / error notification dialog
├── AboutWindow.xaml / .xaml.cs # About dialog
└── MainWindow.xaml / .xaml.cs  # Main UI — file selection, batch control, live log table, theme toggle

Built With

  • C# / WPF on .NET Framework 4.8
  • mkvmerge (MKVToolNix) — remuxes .ts to .mkv; stdout Progress: N% lines drive the per-file progress bar
  • ffmpeg — stream-copies the remuxed .mkv to .mp4 with -c copy (near-instant, no re-encode)
  • System.Threading.Tasks + CancellationToken — cancellable, non-blocking async batch conversion loop
  • IProgress<T> — marshals per-file progress callbacks from the background thread to the UI SynchronizationContext
  • INotifyPropertyChanged — live in-place DataGrid cell updates (Status, Action, Prefix) without row replacement
  • System.Web.Script.Serialization — lightweight JSON settings persistence to %LocalAppData%\TS to MP4\settings.json

Contributing

Contributions are welcome! If you'd like to contribute:

  1. Fork the repository.
  2. Create a feature branch (git checkout -b feature/my-feature).
  3. Commit your changes (git commit -m "Add my feature").
  4. Push to the branch (git push origin feature/my-feature).
  5. Open a Pull Request.

Please keep changes consistent with the existing .NET Framework 4.8 / WPF target and avoid introducing dependencies on newer .NET runtimes.

License

This project is licensed under the terms found in LICENSE.txt.

Author

Created with ❤️ by xecvas

About

TS to MP4 Converter is a lightweight Windows desktop utility built with C# and WPF (.NET Framework 4.8) for batch converting MPEG Transport Stream (`.ts`) files to MP4.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages