Schedule a recording by importing a command script into WMC?

Global guide related discussion. All Windows versions.
Post Reply
GarbeDown

Posts: 6
Joined: Sun Aug 26, 2018 6:10 pm
Location:

HTPC Specs: Show details

Schedule a recording by importing a command script into WMC?

#1

Post by GarbeDown » Thu Feb 25, 2021 10:43 pm

I searched a lot in this forum before asking...
Does anyone know how to import a script (XML, I think) into WMC to schedule the recording of a single show?

I am using a Hauppauge "WinTV-quadHD" tuner card for OTA shows, and TitanTV for a program guide. TitanTV generated a .TVPI script (sample below) which also contains metadata for the show. In all my poking around in WMC, I have not yet found a way to "read" or use that script file - did I miss something?

I am not (yet) interested in EPG123 and its requirement for a $25/year subscription to Schedules Direct. TitanTV works good enough for me to find shows to watch or record. I just want use the recording script it generates.

If this post belongs elsewhere, please let me know where to move it.

Thanks for reading, and for any helpful suggestions!

##### Sample .TVPI file from TitanTV follows this line. #####
<tv-program-info version="1.0">
<program>
<station>WDPN-DT5</station>
<tv-mode>digital</tv-mode>
<program-title>The Roy Rogers Show</program-title>
<episode-title>Jailbreak</episode-title>
<program-description>When a young man is mistakenly accused of murdering his fiances father, a local cafe owner takes his side and helps him break out of jail so that that they can prove the lads innocence and he can thus win his love back.</program-description>
<start-date>20210225</start-date>
<start-time>16:00</start-time>
<end-date>20210225</end-date>
<end-time>16:30</end-time>
<duration>00:30</duration>
<rf-channel>2</rf-channel>
<psip-major>2</psip-major>
<psip-minor>5</psip-minor>
<stream-number>5</stream-number>
</program>
</tv-program-info>

User avatar
garyan2

Posts: 7438
Joined: Fri Nov 27, 2015 7:23 pm
Location:

HTPC Specs: Show details

#2

Post by garyan2 » Fri Feb 26, 2021 1:20 am

You would need to create a MXF file (xml) like the below and then import it using c:\windows\ehome\loadmxf.exe. All you need is the start time, duration, and channel number. I believe this will work. So you would need something to read the script TitanTV generates, and creates the MXF file for import.

Code: Select all

<?xml version="1.0" encoding="utf-8" ?> 
<clickToRecord xmlns="urn:schemas-microsoft-com:ehome:clicktorecord">
    <body>
        <programRecord programDuration="30">
            <service>
                <key field="urn:schemas-microsoft-com:ehome:epg:service#mappedChannelNumber" match="exact">4</key>
            </service>
            <airing>
                <key field="urn:schemas-microsoft-com:ehome:epg:airing#starttime">2006-05-15T11:00:00+09:00</key>
            </airing>
        </programRecord>
    </body>
</clickToRecord>
Reference this and this.
- Gary
Keeping WMC alive beyond January 2020. https://garyan2.github.io

User avatar
garyan2

Posts: 7438
Joined: Fri Nov 27, 2015 7:23 pm
Location:

HTPC Specs: Show details

#3

Post by garyan2 » Fri Feb 26, 2021 2:23 am

Looks like the file extension needs to be .c2r ... not quite sure yet.
- Gary
Keeping WMC alive beyond January 2020. https://garyan2.github.io

User avatar
garyan2

Posts: 7438
Joined: Fri Nov 27, 2015 7:23 pm
Location:

HTPC Specs: Show details

#4

Post by garyan2 » Fri Feb 26, 2021 2:49 am

Here's an example with some more options shown. I've never dealt with c2r, but it looks like you don't need to import it with loadmxf. Just double-click the file... WMC is associated with it and will import it.

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<!-- Sample click-to-record (MSNBC Single-Episode Scenario) -->
<clickToRecord xmlns="urn:schemas-microsoft-com:ehome:clicktorecord">
	<body>
		<metadata>
			<description>Record tonight's news on MSNBC</description>
		</metadata>
		<!-- Include 5 minutes of hard prepadding and postpadding. If the
		specified airing is not found, allow an alternate to be scheduled. -->
		<programRecord prepadding="-300" postpadding="300" allowAlternateAirings="true" allowAlternateService="false">
			<program>
				<key field="urn:schemas-microsoft-com:ehome:epg:program#title" match="exact">MSNBC News Live</key>
			</program>
			<service>
				<key field="urn:schemas-microsoft-com:ehome:epg:service#callsign" match="exact">MSNBC</key>
			</service>
			<!-- For the EST time zone (-300 minutes from UTC), specify an explicit time. -->
			<airing timeZone="-300">
				<key field="urn:schemas-microsoft-com:ehome:epg:airing#starttime">2004-04-17T18:00:00Z</key>
			</airing>
			<!-- In other time zones, record if the program is found within
			three hours (180 minutes) of the specified UTC time. -->
			<airing searchSpan="180">
				<key field="urn:schemas-microsoft-com:ehome:epg:airing#starttime">2004-04-17T18:00:00Z</key>
			</airing>
		</programRecord>
	</body>
</clickToRecord>
- Gary
Keeping WMC alive beyond January 2020. https://garyan2.github.io

GarbeDown

Posts: 6
Joined: Sun Aug 26, 2018 6:10 pm
Location:

HTPC Specs: Show details

#5

Post by GarbeDown » Fri Feb 26, 2021 3:40 pm

Thanks, garyan2. Now that I see the format of two types of files that can be imported into WMC (the "loadable" .c2r and the "importable" MXF) I see the TitanTV file format is significantly different. Rats. :(

Below, you wrote "So you would need something to read the script TitanTV generates, and creates the MXF file for import."

Seems I am still looking for that "something". :)

User avatar
garyan2

Posts: 7438
Joined: Fri Nov 27, 2015 7:23 pm
Location:

HTPC Specs: Show details

#6

Post by garyan2 » Fri Feb 26, 2021 3:50 pm

Right, you'll need something to translate/convert the TitanTV file to the c2r file for WMC. I was wrong about the mxf file, though it can be done that way as well to create ManualRequests in the mxf format and import, but c2r is really what you need.
- Gary
Keeping WMC alive beyond January 2020. https://garyan2.github.io

Space

Posts: 2838
Joined: Sun Jun 02, 2013 9:44 pm
Location:

HTPC Specs: Show details

#7

Post by Space » Fri Feb 26, 2021 5:03 pm

Here is some documentation for c2r from Microsoft (already linked above by Gary).

It appears that you are looking to create a "manual" recording request from TitanTV, since you will not have a TV guide.

Here is example code from the above documentation for a manual request:

Code: Select all

<?xml version="1.0" encoding="utf-8" ?> 
<clickToRecord xmlns="urn:schemas-microsoft-com:ehome:clicktorecord">
    <body>
        <metadata>
                <description>Test Recording</description>
        </metadata>
        <programRecord programDuration="30">
            <service>
                <key field="urn:schemas-microsoft-com:ehome:epg:service#mappedChannelNumber" match="exact">4</key>
            </service>
            <airing>
                <key field="urn:schemas-microsoft-com:ehome:epg:airing#starttime">2006-05-15T11:00:00+09:00</key>
            </airing>
        </programRecord>
    </body>
</clickToRecord>
It actually looks pretty simple (assuming it works). You just need the channel number to record, the start date/time and the duration.

Note that I modified the code from that site to add the "metadata" section so that the manual recording can have a specified name. I found that in this post.

You can also add certain elements to the "programRecord" section, like isRecurring="{true | false}" and daysOfWeek="{bitmask}" to have it record the same channel and time each weekday(s).

User avatar
StinkyImp

Posts: 669
Joined: Thu May 11, 2017 7:53 pm
Location:

HTPC Specs: Show details

#8

Post by StinkyImp » Sun Feb 28, 2021 11:08 pm

GarbeDown wrote: Thu Feb 25, 2021 10:43 pm I searched a lot in this forum before asking...
Does anyone know how to import a script (XML, I think) into WMC to schedule the recording of a single show?
Hi GarbeDown! :wave:

May I ask you for some assistance?

I decided to take this on as a challenge but have run into an issue that you may be able to confirm for me.

I've successfully parsed the "program.tvpi" from TitanTV as follows:

Image

Here's the grid from TitanTV:

Image

As you can see, the TitanTV grid has this program starting at 2:00AM but the "program.tvpi" has it starting at 9:00AM. This is the GMT bias for my timezone.

Would you be so kind as to download a tvpi file from Titan and verify that the start time in the tvpi file is offset by your timezone bias (GMT - XX:00)? If so, I can start programming for that.

Thank you!

renojim

Posts: 13
Joined: Wed Jan 15, 2020 9:06 pm
Location:

HTPC Specs: Show details

#9

Post by renojim » Mon Mar 01, 2021 5:34 am

I'm not GarbeDown, but I just tried it and the time in the tvpi file was indeed GMT. My time zone is PST and a 11pm show had a time of 7am the next day.

User avatar
StinkyImp

Posts: 669
Joined: Thu May 11, 2017 7:53 pm
Location:

HTPC Specs: Show details

#10

Post by StinkyImp » Mon Mar 01, 2021 2:28 pm

renojim wrote: Mon Mar 01, 2021 5:34 am I'm not GarbeDown, but I just tried it and the time in the tvpi file was indeed GMT. My time zone is PST and a 11pm show had a time of 7am the next day.
Thank you so much! I don't use Titan TV or have easy access to multiple time zones, so any help I can get is welcome!

As Space said, "It actually looks pretty simple (assuming it works). You just need the channel number to record, the start date/time and the duration." and so far appears to be pretty simple. Sooo...
  1. Channel number
  2. Start Date
  3. Start Time
  4. Duration
Items 2,3 and 4 - Check!

Maybe Gary can shed some light on Item 1 since he's an expert on WMC channel design. According to Microsoft's Click to Record documentation:

Image

The channel number must be in the format "major-minor" and isn't vague on the format. In preliminary testing on a few tvpi files, it imports just fine but doesn't map to the correct "minor" subchannel. I have some ideas but it's the workweek so time's limited!

Gotta go for now... :wave:

User avatar
garyan2

Posts: 7438
Joined: Fri Nov 27, 2015 7:23 pm
Location:

HTPC Specs: Show details

#11

Post by garyan2 » Mon Mar 01, 2021 10:25 pm

I took a look at the ehRecObj.dll code and they have a flaw. When it finds the channel based on the channel number provided for ATSC, it returns the major channel number of that channel rather than the entire major-minor channel number. That means any c2r for ATSC will only properly work for the x.1 channels and not for the rest of the subchannels. The only other method I see is to use the channel callsign, which probably won't match what TitanTV is providing.
- Gary
Keeping WMC alive beyond January 2020. https://garyan2.github.io

User avatar
StinkyImp

Posts: 669
Joined: Thu May 11, 2017 7:53 pm
Location:

HTPC Specs: Show details

#12

Post by StinkyImp » Tue Mar 02, 2021 2:57 pm

garyan2 wrote: Mon Mar 01, 2021 10:25 pmThat means any c2r for ATSC will only properly work for the x.1 channels and not for the rest of the subchannels.
I wish this was consistent because consistency sometimes presents a solution. In the majority of cases the c2r submission maps to the x.1 channel. In a few cases it always maps to the highest numbered "minor" channel.

For example... I have five subchannels in the threes. No matter what channel I select, the c2r file maps to channel 3.5, not 3.1 :wtf:

garyan2 wrote: Mon Mar 01, 2021 10:25 pmThe only other method I see is to use the channel callsign, which probably won't match what TitanTV is providing.
I considered that BUT was immediately inundated by thoughts of the nightmare that would create... ;)

At this point I'm not willing to throw in the towel. I'll probably spend more time on it this weekend. Thanks for your insights Gary. They're much appreciated!

User avatar
garyan2

Posts: 7438
Joined: Fri Nov 27, 2015 7:23 pm
Location:

HTPC Specs: Show details

#13

Post by garyan2 » Tue Mar 02, 2021 8:26 pm

StinkyImp wrote: Tue Mar 02, 2021 2:57 pmFor example... I have five subchannels in the threes. No matter what channel I select, the c2r file maps to channel 3.5, not 3.1 :wtf:
I didn't see that, but I didn't do a whole lot of tests. From what I saw, parsing of the c2r for the channel number would work correctly, but when it actually creates the request in ehrecobj.dll it only provides the major channel number. When the request is actually processed it simply finds the "closest" channel number. So it would be c2r = 3.3, init request = 3, final request = 3.1 (being the nearest channel number). But there must be something else for the final request for you to see 3.5 being chosen for that recording.
- Gary
Keeping WMC alive beyond January 2020. https://garyan2.github.io

User avatar
StinkyImp

Posts: 669
Joined: Thu May 11, 2017 7:53 pm
Location:

HTPC Specs: Show details

#14

Post by StinkyImp » Wed Mar 03, 2021 3:31 pm

garyan2 wrote: Tue Mar 02, 2021 8:26 pm I didn't see that, but I didn't do a whole lot of tests...
You did enough to confirm that unless an x.1 channel is being selected, the c2r import will most likely end up elsewhere.

I did a cursory review of the MXF file structure to see if I could force a recording using loadmxf as you mentioned in your first response. It appears that I could load the actual episode or movie into an otherwise blank grid and then the user could go to that show and hit the record option.

Using the c2r option that I've developed, it imports into the scheduled recordings just fine BUT the user has to go into its properties and select the correct minor channel (if required).

This is one of the very rare cases where I've taken on a project that I won't personally use. Normally if I can use a product I'll go ahead and develop it. If anyone else can get use out of it, that's great.

With that in mind... This proof of concept is valid (if the minor channel is manually updated) and I'm going to throw in the towel. This will now join my pile of uncompleted projects. :|

GarbeDown

Posts: 6
Joined: Sun Aug 26, 2018 6:10 pm
Location:

HTPC Specs: Show details

#15

Post by GarbeDown » Wed Mar 03, 2021 7:03 pm

renojim wrote: Mon Mar 01, 2021 5:34 am I'm not GarbeDown, but I just tried it and the time in the tvpi file was indeed GMT. My time zone is PST and a 11pm show had a time of 7am the next day.
I just confirmed renojim's answer about time zone is correct. The following snip from a .TVPI file was for a show at 2 AM Eastern time (GMT-5):
...
<start-date>20210304</start-date>
<start-time>07:00</start-time> <----- it added 5 hours!
<end-date>20210304</end-date>
<end-time>08:00</end-time>
<duration>01:00</duration>
...

GarbeDown

Posts: 6
Joined: Sun Aug 26, 2018 6:10 pm
Location:

HTPC Specs: Show details

#16

Post by GarbeDown » Wed Mar 03, 2021 10:14 pm

StinkyImp and garyan2: Thanks for putting so much time into this question! I don't blame you for adding this topic to your collection of un-finished projects. I will also stop pursuing my idea of getting program information metadata from the TitanTV .TVPI file into WMC. Seems like a lot of trouble just to get the "basic" information converted into something that the WMC importer can use. I already had basic recording functionality covered.

I was looking for an easy way to save the "extra" information with each recording so I could see it using Windows Explorer. Desired information is program title, program sub-title (a.k.a. episode title, most important), season & episode (if possible) and program description (not as important). So I will probably stay over here on the "dark side" and stick with WMC's competitor: Hauppauge's WinTV, which works well with TitanTV's .TPVI files. I have asked them to add program sub-title as a new feature request (fingers crossed!).

FWIW: For the past 2 years, I have had good luck with WinTV. In fact, the recording/scheduling abilities of WinTV provide some controls WMC lacks, including:
- Standby or shutdown or keep running when done - individual choice for each recording/"series".
- Start date and stop date (or indefinitely) for each "series" recording.
- Individual pad-before and pad-after minutes for each recording.
- Recurrence setting for each recording: just once, daily, or weekly (each day has a checkbox).

User avatar
StinkyImp

Posts: 669
Joined: Thu May 11, 2017 7:53 pm
Location:

HTPC Specs: Show details

#17

Post by StinkyImp » Thu Mar 04, 2021 5:18 pm

The reason this post piqued my interest is because I'm in the same situation as you. Hauppauge tuners, OTA, want to use WMC and want it as cheap as possible. I tried WinTV but the wife hated it compared to WMC so it was a no go from the start.

Based on your reply I'm pretty sure the "Click to Record" solution won't do some of the things you require. If you want to use WMC with OTA on your Hauppauge tuners, the only thing I've found that addresses the majority of your wish list items (and is free) is EPG Collector. You might want to give that a shot.

As for me... EPG123 solves my "Happy wife, happy life!" situation and delivers an exceptional WAF.

$25 per year to Schedules Direct is a small price to pay for those two items. :D

Post Reply