mpconverter beta 0.1





The reason I started working on this converter is that I wanted to bring over some recordings from Windows Media Center to other platforms like Kodi and Plex.  There are other tools that can do the job, however they rely on external services like Basically, these tools convert video file and fetch metadata from other websites. The problem is that some TV Series do not exist in and they will never be allowed over there due to some licensing restrictions. I’m talking mostly about sports events or competitions. So what to do when you would like to archive some of your recordings and create necessary metadata? This is where mpconverter comes in.  You can easily convert entire series or sport event and add it your library.

My second concern was the quality of encoding. In a sense, I wanted to have greater control over this process. I tried out some other tools and I found it to be little bit too complicated and unpredictable. I do most of my conversions using Handbrake and its built in encoding profiles. Therefore I wanted to have this ability in my application. I also included FFMPEG as second option.   During the testing, I discovered that running FFMPEG in silent mode is more reliable than Handbrake. As a result FFMPEG became default encoder. However, if you would like to try Handbrake, you simply make that choice in settings. Just to clarify that we are using HandbrakeCLI. In the future I would like to use actual handbrake library

The tool is intended to be run from Task Scheduler . This allows to have encoding process to be done in a background. You can also start encoding process from Queue window. My tests revealed that there is very minimal impact on HTPC performance and the speed of encoding is almost 1:1. My HTPC is rather old system based on AMD quad core CPU and 4GB or RAM. Nothing spectacular,  but it is reliable. So if there is a 30 minutes recording, it would take about 35 minutes to complete a job.

I created GUI, but it is mostly to allow you setup your preferences and specify TV Series that you would like to be monitored.  As I said before, you should run encoding process from Task Scheduler.





Initial Setup

To begin you need to install mpconverter. During setup, it will create necessary folders, encoding profiles and it will also scan your TV Recordings folder. Depending on the size of that folder it can take 30 seconds or more. Be patient,  at the end you will see a list of your recordings in left panel.

Application assumes that your recording folder is stored on C drive like this “C:\Recorded TV”. If this is not a case head over to Settings and make necessary changes. You also need to set Output folder and Temp folder. I would recommend that you create this folders on hard drive that has plenty of free space. As you know WTV recordings take a lot of space and you need that space for temporary file.

TV Channels

Depending on your cable provider some of TV Channels may be copy protected. In this case you should prevent processing recordings that contain copy restriction flags. To do that, go to Tools and select Channels. Next uncheck channels that you would like be excluded.

Channels list is built during initial setup process and that information comes directly from your recorded files.  That list may vary. Every time queue builder adds new items to queue, it also inserts new channels to a list. Therefore you should review the list periodically to see if there are any new channels that require your action.

Season Pass

This is where you decide which TV Series you would like to be monitored. You simply select you favorite series from drop down menu and press add button. Now you  need to specify preferred encoding profile. Also, file type which can be either MKV or MP4. And finally you need to type in season name. It can be a standard season number like 1, 2 or 3. But it can also be year like 2016.

We do not use database yet. Therefore, if you would like to process some series manually, you would also need to find out show season number and enter it the form.

Please do not leave any fields empty as omission may cause application to throw some errors.

Queue and Encoder

If you head over to folder


You will find two files. One is called mpconv_queue and second is called mpconv_encoder. They have distinct responsibilities. Mpconv_queue will scan your recorded TV folder and based on the criteria you specified in SeasonPass, it will match your request with any recording and it will put them into a queue. Mpconv_encoder will take it from here. It will read your queue file and initiate encoding process. Finally, when it’s completed, it will rename converted file and put it inside output folder.

Why there are two different files? I wanted to have ability to schedule queue at different times and not necessarily  start the encoding process immediately. So, you could create task in scheduler that only triggers queue activity or encoding activity. You can also create task that includes both activities run in sequence. And for the most of the users it may be the best approach.






Encoding Profiles  

You can find encoding profiles in following folder:


There are profiles for both encoders. Handbrake profiles are the same as those that you can find in the desktop application. You will recognize their names. Getting profiles for FFMPEG is little bit more complicated. I was able to narrow it down to 2 standard profiles , one is to create 720p file and another one for Mobile device.

If you open profile xml file, you will find only 3 tags. One is for encoder name, second is for profile name and third is a command line input.  If you would like to make some modifications, all you have to do is to create new xml file. Give it some name and type in proper command line arguments. You do not need to include input and output file info.  Be advised, that FFMPEG may throw an exception if you make some mistakes.  So, use Google to search for samples.


img_3401 img_3402















mpconverter includes ability to notify you about encoding status. This is done through email. You need to enter all necessary information in GUI application settings.

I do not collect any email information or any sensitive information. I have no plans of doing it now or in the future. Just to let you know, that your credentials are stored in xml global settings file. If you are worried about your security, simply do not use this feature

If you plan to use it, then you will receive email every time your run mpconv_queue. It will contain all the items that are currently in your queue, including the ones that were already completed.

mpconv_encoder will send emails when encoding process starts and when it is completed. So for every file, you should receive two emails. If for some reason you will not see a second one, it will mean that something went wrong.



img_3404 img_3406















I mentioned before that major source of metadata are sites like Since, we do not use them at this moment, metadata comes directly from recorded file. That includes series and episodes titles; episode description; genre and recording time. For obvious reason we do not have TV Series description or fanart. This part it’s you own responsibility.

mpconverter creates standard nfo files for Kodi. So you should have no problems importing them into your library.

Naming convetion for indivudal file looks like this

\TV SeriesName\Season Number\TV SeriesName – S0XE0X – EpisodeName

If the series exists in, then you should not have any problems importing it into Plex either. It will scan the folder and fetch necessary metadata.

For those recordings that do not have entry in thetvdb database, you will have to rely on the importer that was created by Plex community. It’s called XBMCInfoImporter and it will read Kodi nfo files and import them into Plex Library. There is simply no other way of doing it right now.

You can get XBMCInfoImporter from here

 As you probably know, Windows Media Center has its own set of issues with Guide Listings missing description or even episode titles. I would like to have ability to edit metadata directly in WTV file. I’m looking into this. At this point metadata is extracted from a file and put into a xml file that is located inside


These files have the same name as original WTV files. If you cut out commercials in video editing software, save them and do not change their names. Otherwise new xml file will be created.

Some video editors may affect metadata stored inside WTV file. Warning! Leave original WTV file in Recorded TV folder, always work with a copy of a file.

Some recordings may not have a proper episode title. This is mostly true for some daily repeating shows. In this case we use following naming convention

\TV SeriesName\Season Number\TV SeriesName  (Day of the Week, Month, Day Number, Time Recorded)

Example: SeriesName (Sun, Oct 16, 22.55 PM)

Commercial skipping

mpconverter does not support commercial skipping. Over the years I tested various tools and I found process of identifying commercial breaks to be highly unreliable.  Every once a while comskip or ShowAnalyzer fails in the department. The same goes for VideoReDo. It turns out, that before you commit to any changes, the best way is to review cuts first.

So this is what I would recommend doing it. Use video editor and scan WTV file. Edit it and cut out commercials. Export new file to WTV and put it back into Recorded TV folder.  Make sure that file name is the same as before, otherwise mpconverter may encounter some issues with metadata.

Renaming Files

I you would like to rename WTV files and create necessary metadata, I added profile called RenameOnly. Original files will remain unedited, but they can be organized in folder structure that can be recognized by Plex and Kodi.

In addition, sometimes during conversion something may go wrong, so you will end up with completed MKV file inside temp folder. In this case you can still rename file and create Kodi metadata file by going to Tools and selecting Rename Files.

Task Scheduler

There are various options when you create new task in scheduler. In my own experience, I know that sometimes the same options selected on one PC, may not be replicated on another PC. In fact when you search internet, you will find posts where different users describe their own success and failure stories.

Task scheduler gives you an option of running task hidden. You may be asked to provide your credentials when you press OK button. Windows also gives you another option for scheduling hidden task. You can do this by changing user that creates task. Simply press “Change User or Group” and replace your default user name with “SYSTEM”. Next, reboot your PC. Try to run task and monitor temp folder to see if anything is happening.

I had more success running mpconverter with FFMPEG as main encoder, for some reason HandbrakeCLI refuses comply with request.

Under Actions tab select “New” and “Start a Program”. If you want to run both queue and encoder at the same time include them both, otherwise create two separate tasks.






How does this work?

Let me explain what actually happens during the process. We start with mpconv_queue. It scan Recorded TV folder, extracts metadata for any new recordings. It creates necessary xml files and puts them in metadata folder. It also has some clean up duties. If WTV file was deleted, then any corresponding metadata file is also removed. In addition, any entry that exists in queue file that does not have original WTV file anymore, will be deleted too. Therefore you do not need to worry about your queue. It will be automatically cleaned up as soon you delete WTV file from your hard drive.

Conversion process is two-steps activity. First, we remux WTV to MPEG file using FFMPEG. We simply take video and audio stream, separate them and put them back together in different container. FFMPEG has ability to fix some time stamps issues. Please do not be worried about any error messages that FFMPEG shows in console window. This seems to be quiet normal. Mpeg file is created in Temp folder.

Second step, is actual encoding that can be done with either FFMPEG of Handbrake. Once it is completed, MKV or MP4 file that was created is renamed and moved to output folder. Finally queue file is updated.

What to do when something goes wrong?

Since the encoding process is done in a background you should have some idea how long it takes to convert one hour show on your HTPC. In this case email notifications are very helpful. If you do not receive second email telling you that job was completed, then you should start investigating. First thing you should do is to check Temp folder to see if there are any leftover files. If temp folder is empty, take a look in Output folder to see if converted file exists. Also check queue file to see if any of the items has “true” written in started tag. Clear that tag.

Check Task Scheduler to see if created task is still running. Stop it. Reboot your HTPC.

Sometimes it happens that FFMPEG and Handbrake hangs during mkv encoding. It is unclear why MPEG/WTV files fail during the process. In this case, reboot your PC and delete any remaining files from Temp folder. Re-Queue items and start conversion again. In most cases, files will be converted successfully.

If want to re-process the same file make sure that tags started and completed in queue file are empty.  Encoder keeps track of processed files in order to assign correct episode number. Go to following folder and check if episode xml file was created. You can safely delete last one, this way any new encoded file will have the same number.



I’m running this tool on Windows 7 64bit. I did not have a chance to test it on Windows 8.

Windows 10 will not play WTV files out of the box, however mpconverter will work with your recorded files. Simply point Recorded TV folder in Settings to your network share.

Final thoughts

I hope you will enjoy using this tool. I tried to make is as simple and straight forward as possible. I have it running on my HTPC for last couple months and it does really good job processing files that I want. I can setup recording and have it ready to sync to my phone Plex app before I leave for work. Also, when I get back home, I know that it will show up as TV Series in my Kodi and Plex library. I like the fact that I can specify which shows or episodes I want to process. In addition, I can decide at what time it should be done. That gives me greater control over conversion. Quality of final product is predictable too. So no more guessing how it will look too. I made over 100 conversions so far, and I did not encounter any major issues.

Although it is a beta release, you should give this tool a try. It is still under development. This is more like a proof of concept. I’m planning to make some changes to source code and interface will eventually change too.

If you encounter any issues or if you have any questions please post them in comments below. Thank you.

Enjoy it!

PlexDbFix. Moving database between computers.

This is probably one of the most annoying things for anybody who has Plex or Kodi database setup on their computer. At some point of time, something goes wrong and you have to wipe everything clean. As a result, all your past history including play status and bookmarks are gone.

I went through this process couple times.  It’s not fun, therefore I’m always cautious about losing ability to restore database to its previous state.

Recently, I had a problem with Plex Server that was residing on one the shares on my server. I decided to install Plex docker instead of plugin too. I also wanted to move it cache drive. It would seem like trivial thing. Install docker and map the paths to existing library. But for some reason Plex server refused to start. Changing file permissions did not fix the issue. Of course everything was working great when I started from scratch with a new database.

After multiple trial and errors I was able to figure out that problem was caused by additional files that are in the same folder as database. Basically, when SQLite database is initiated, it creates 2 files that are like a fingerprint for database. In order to substitute database you have to delete them first.

Once I figure out what is causing the problem I decided to try to move database to different PC. I knew exactly what I have to do, but to my surprise media files were not playing.  With a help of great tool SQLite Spy I was able to inspect file paths. Clearly in order to move database from one location to another, these paths need to be corrected.

I was able to do it in fairly quick. I had some parts of the code from different applications I was working on. All I had to do is to reuse it in the way that it made sense for this particular problem.

At the end standalone application PlexDBFix is a result of the initial idea.




First it connects to Plex database. It retrieves media parts paths and puts the in the top ListView. Now you have 4 options where do you want to move database. In addition, you need to specify which part of the string you want to replace and what you want to replace it with. Pressing preview button will show changes. Apply button will actually update media_parts and sections tables.


Important! Before you proceed always backup your original database file and stop Plex Server.

When making changes you need to specify where you are moving database file. There are four options. You can transfer your database from Server to PC or vice versa. Also, you have choice selecting PC to PC or Server to Server when changing in between a folders only.

Next, you have decide what part of file path you want to substitute. Hitting Preview button will show you how it will look.

Finally you need to press Apply for actual changes to take place. There is no undo button, so as I said before backup your original database file first.

Why do you need to make this changes?

Plex Server database contains information about file paths of your media files. Therefore, when you move it form one location to another, Plex server will not be able to locate them unless you make actual changes. As you probably noticed, we are changing information for video files. We do not touch anything related to artwork. It’s not necessary to do it. Database holds only reference to these files. Therefore you have two options:

  • Copy/Paste folder containing artwork
  • Start from scratch. Create sections that match sections already created in existing database. Scan media folder and allow Plex download necessary metadata. Finally, substitute new created database with the saved one.

Where is Plex Server database located?

Depending on your platform and server setup, you should be able to navigate to Plex Media Server folder and find Plug-in Support. There is a Database folder containing a file that we are looking for. This is an example showing location on my home PC

“\Plex Media Server\Plex Media Server\Plug-in Support\Databases\com.plexapp.plugins.library.db”

Final step

Before we complete moving database to a new location, we have to do delete two files. Do not worry they will be recreated automatically when Plex Server starts again. If we fail to do so, Plex Server will simply not recognize our new database. These files are in the same folder as our database and they are:





Video Converter. Step by step.

Let me explain what exactly happens when encoding job is triggered. These are major steps and they may be modified in the future. For now program works as single entity, but probably it will be much more efficient to break it down into two components: queue and conversion as separate console apps.

  • Initial Step includes parsing xml files that store application preferences.
  • Scanning Recorded TV folder for newly added files. We utilize LINQ queries to do the job. Files that are currently being recorded are ignored. These files do not contain complete metadata yet and that allows us to identify them first.
  • Extracting metadata from recorded WTV files and writing information into separate xml files with corresponding original file name. I will write separate post on how to get metadata from TV recordings.
  • Cleaning up orphaned metadata xml files. Some recordings may be already deleted.

These steps lead us to building our queue:

  • Parsing existing metadata xml files
  • Parse xml file called job.process.xml that contains names of the items that we want to convert. Concept is similar to Season Pass. We also include our preferences for final product like file format MKV/MP4 and encoding profile.
  • We use LINQ queries to identify recordings that were not processed yet. We can also specify some additional criteria here like channels that need to be excluded from processing.
  • Our findings are written to job.queue.xml file

Conversion steps:

  • Parsing queue xml file
  • Parsing encoding profiles.
  • Queue items should be sorted out based on defined priorities
  • Getting first item in a queue for processing
  • Converting WTV to DVR-MS using WTVConverter.exe
  • Converting DVR-MS to MPEG using FFMPEG
  • Converting MPEG to MKV/MP4 using either FFMPEG or Handbrake

Post-processing steps:

  • Renaming completed files and organizing them into proper folder structure. Separating movies and TV Series items.
  • Creating Kodi type nfo metadata files. Our priority is to use metadata that we already extracted from WTV files. However we will also add ability to retrieve metadata from services like and

As a final step we should check queue to see if there is any additional pending item.

This is a rough idea what should be done when we want to convert a video recording. As you can see we have 3 parts:

  • Building queue
  • Conversion
  • Post-processing

If we combine all of them into single process we are risking some unexpected outcomes. For examples if something fails during post-processing, we may not be able to continue with converting another file in a queue. Therefore it may be better to separate these tasks. On the other hand it would make more sense to isolate building queue first and leave conversion and post-processing together.

That pesky WTV file format.

I spent whole week trying to put something together that would do a job. Soccer tournament Euro 2016 is around a corner and I wanted to record games and test encoding files with Handbrake.

I have to say that this whole experience is really frustrating. Handbrake supports WTV files recorded with Windows Media Center, but every once a while Handbrake desktop app stops conversion process for no apparent reasons. It would seem that there might be issue with wtv itself. So out of 10 files, it is most likely that at least one of them would fail to complete. Similar things were happening while I was testing HandbrakeCLI on my HTPC computer. Console window would just stay open for hours and job would refuse to finish.

I tried different approach and converted WTV file to MPEG format using FFMPEG and setup a job for HandbrakeCLI. Again result is unpredictable. Some files would complete and some simply would refuse to continue.

Since Handbrake was giving me so much trouble, I decided to do conversion in FFMPEG only. First change WTV file to MPEG and then convert MPEG to MKV format. It seemed in the beginning that FFMPEG does a better job, but at some point it failed too. Encoding process stalled for hours.

At this point I had to revert to converting WTV file to DVR-MS format first using Microsoft built-in WTVConverter.exe . This actually reduced errors significantly. I believe that it happened only once or twice and after reboot of HTPC job started and continued until it was finish.

Both Handbrake and FFMPEG support WTV format, however it is better to use following path for unattended video conversion:

  • WTV to DVR-MS using WTVConverter.exe
  • DVR-MS to MPEG using FFMPEG
  • MPEG to MKV/MP4 using FFMPEG or HandbrakeCLI

Encoding is fairly fast. I would say about 1:1, but with additional conversion steps whole process takes longer. Initially I was copying WTV file to temp folder and then do conversion. Once I eliminated that step, process is little bit faster. Recording that is 2-3 hours long can take between 20GB to 30GB. When comes to HTPC performance while doing encoding job, I did not notice major impact on either watching Live or recorded TV show. My HTPC is not the most powerful PC. It uses quad core AMD processor of older generation. I would provide specs later.


EDIT: I did about 50 jobs of recorded games and so far I did not have any single failure.

Project: video converter

One of the problems with HTPC is that hard drives fill ups with recordings at much faster pace than we can watch it. Some shows can be deleted almost immediately. Other ones could be archived for later viewing. Unfortunately due to a file size of average recording, is not really practical to store entire season of some TV show in its original format.

The best approach is to remove commercials and convert them to h.264 using tools like Handbrake, VideoReDo or MCEBuddy.  That process is time consuming and it requires user interaction of setting up all available options and starting manually encoding process. Exception is MCEBuddy that does encoding automatically. However, from my personal experience I was not happy with final product.  It uses Handbrake as its encoding engine, but I was getting mixed results and selecting right encoding options is not straight forward.

There is another program called DVRMSToobox that can take care of removing commercial using Comskip or ShowAnalyzer. I believe it can also do some encoding. I used it in the past but at some point removing commercials is not that important anymore.  Skip button works pretty well. That feature is becoming less relevant. Most of the shows will be deleted anyway. If I have to remove commercial I do it manually using VideoReDo that way I have full control of parts that I want to delete.

So here comes converter that I was thinking of. These are the things that I want to achieve:

  • Create queue of items for conversion based on certain criteria
  • Select items based on a name
  • Exclude recordings for channels that are copy protected
  • Extract recordings metadata from WTV file and store it for later use
  • Encode files using HandbrakeCLI
  • Encode files using FFMPEG
  • Utilize existing handbrake and FFMPEG encoding profiles
  • Create custom encoding profiles
  • Apply different encoding profiles for different recordings based on user selection
  • Rename encoded files and create standard folder structures for movies and TV series
  • Create nfo metadata files for Kodi
  • Retrieve metadata from
  • Move files to a server
  • Rename recorded files without encoding
  • Create RSS feeds
  • This should be a console application that can be started in task manager
  • This could also be triggered as part of watch folder scenario.


FFMPEG is a command line program however Handbrake provides 2 different ways of interaction. CLI interface seems to be better suited for my needs and I was able to find more documentation on how to actually use it.

At this point I’m mostly concern on figuring out all the necessary pieces that would make my program work.  Basically I want to take a recorded file from point A to point B that means convert it first in the most predictable way.  I want to get results first.


Hello everyone!

This is not your typical tech site or blog that brings daily news about current events. Occasionally I may bring my own opinions, however for the most part I will try to make this place interesting for everyone who likes technology and programming.

I have two major hobbies.  First one is HTPC and media. That includes everything that relates to recording, playing, storing media files. Second hobby of mine is programming that is done primarily in I’m learning new programming languages, so this would be a good place to share my experience and findings.

I have couple projects that I’ve been working on. I would like bring them to a wider audience. They are still work in process, however they are functional and some of you may find them interesting enough to include them in your daily life.

My interest in programming is driven mostly by media consumption. Occasionally I find something in my media setup that annoys me and requires improvement or automation.  This is how ideas are born for a new program or script. I tinker and I try it until I find desired outcome. After a while when I use it, it becomes much more clear that certain things require different approach. As a result I return to a drawing board and make some changes to improve performance.

One of my projects that are under constant development is internet radio recorder. It started as simple vbs script that organized radio recordings and it moved to program that handles creation of RSS feeds. Next phase of development is actual internet radio stream recorder based on popular videolan player.

Second project is a video converter that would take WTV files created by Windows Media Center and encode them using FFMPEG or Handbrake to a smaller and more manageable video format like mkv or mp4.

My media setup consist of custom build HTPC computer, home server running unRaid, intel NUC computer that records radio streams, custom build home PC, Roku and iPhone. TV Recordings are done by Windows Media Center, but I prefer using Kodi for playing my movies and TV series collection. I also use Plex during my commuting hours.

I’m glad you could join me and stay tuned for next blog posts.