mpconverter beta 0.1

 

mce_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 thetvdb.com. Basically, these tools convert video file and fetch metadata from other websites. The problem is that some TV Series do not exist in thetvdb.com 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.

 

mainform

 

 

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 thetvdb.com 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

C:\Users\UserName\AppData\Roaming\mpconverter\bin

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.

 

 

kodi_1

 

 

Encoding Profiles  

You can find encoding profiles in following folder:

C:\Users\UserName\AppData\Roaming\mpconverter\profiles

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

 

 

 

 

 

 

 

 

 

 

 

 

 

Notifications

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

 

 

 

 

 

 

 

 

 

 

 

 

 

Metadata

I mentioned before that major source of metadata are sites like thetvdb.com. 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 thetvdb.com, 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

C:\Users\UserName\AppData\Roaming\mpconverter\metadata

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.

 

 

plex_1

 

 

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.

C:\Users\UserName\AppData\Roaming\mpconverter\completed

Windows

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!

7 thoughts on “mpconverter beta 0.1

    1. What operating system are you using?
      Go to “C:\Users\YourName\mpconverter\metadata” and see if there are any xml files created.

  1. Yes thanks for doing this. I am also not able to get this to work. It creates the XML files but nothing else. I am using Win 10 Pro

    1. When you open the xml files in Notepad. Do you see a title and series name?
      Did you follow instruction in initial setup? Including setting up input and output libraries?
      Is the TreeView in GUI populating with Series Names?

      It could be also folder permissions issue.

      I would like to help you, but I need more information.

      I run this tool on Windows 7

      1. Thanks for getting back to me. Here is the info from the metadata…

        The Walking Dead_AMCHD_2016_12_04_20_58_00.wtv
        The Walking Dead
        Sing Me a Song
        A much more detailed look into the world of the Saviors and their home, the Sanctuary, is shown. Meanwhile, members of Alexandria look for supplies.
        Windows Recorded TV Show
        731
        ‎12/‎4/‎2016 ‏‎12:00 AM
        ‎12/‎4/‎2016 ‏‎8:58 PM
        AMCHD
        AMC HDTV (East)
        drama;other
        91

        Monday

        The files are showing in the tree correctly. I have found one mistake that I made when creating the folders. I have corrected the folder and still nada. So I have uninstalled the program and reinstalled it with the defaults. Changed the folders to C:\Users\Public\Recorded TV\MPConverter\output and C:\Users\Public\Recorded TV\MPConverter\temp. The queue said it completed but still not showing any files in temp folder or output folder.

        1. It seems to be extracting metadata correctly and as you said you can see recordings in a tree. I suggest you change output and temp folder to larger size drive like “D:\temp” & “D:\output”.

          Try to add a recording to queue and make sure that you do not leave any fields empty. Open queue and press Start button. You should see command line window starting. If that is not working, go to \mpconverter\bin and run mpconv_encoder as admin. You need to have some recording in queue already and tag completed has to be empty.

          I will setup forum. This will allow better support to users.

Leave a Reply

Your email address will not be published. Required fields are marked *