New MythTV add-on using libcmyth

  Thread Rating:
  • 8 Votes - 4.75 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
Jimmer Offline
Donor
Posts: 337
Joined: Jan 2010
Reputation: 3
Location: Sunny Devon, UK
Post: #551
(2012-04-09 22:19)tsp42 Wrote:  I've added the sorting of recordings into movies / series folders based on duration/genre type and a user definable regular expression.

Sounds great, it's really starting to come together now.... however, since the latest merge I now get the following:

Code:
WebServer.cpp: In static member function ‘static int CWebServer::AnswerToConnection(void*, MHD_Connection*, const char*, const char*, const char*, const char*, unsigned int*, void**)’:
WebServer.cpp:158: error: invalid conversion from ‘int (*)(void*, MHD_ValueKind, const char*, const char*, const char*, const char*, const char*, uint64_t, unsigned int)’ to ‘int (*)(void*, MHD_ValueKind, const char*, const char*, const char*, const char*, const char*, size_t, size_t)’
WebServer.cpp:158: error:   initializing argument 3 of ‘MHD_PostProcessor* MHD_create_post_processor(MHD_Connection*, unsigned int, int (*)(void*, MHD_ValueKind, const char*, const char*, const char*, const char*, const char*, size_t, size_t), void*)’
make[1]: *** [WebServer.o] Error 1
make: *** [xbmc/network/network.a] Error 2

when I try to compile on my ATV1. Any pointers? Quick, dirty fixes? It doesn't appear to be a problem compiling on a modern, x86_64 kernel, just the old x86 one with Hardy (2.6.24-28-generic)

Thanks again for all the hard work!

Jimmer

EDIT: if anyone else is having this problem, I got around it by find a hardy deb for libmicrohttpd v4.2 and recompliling....
(This post was last modified: 2012-04-10 09:04 by Jimmer.)
find quote
dodoadoodoo Offline
Member
Posts: 55
Joined: Jan 2010
Reputation: 1
Post: #552
(2012-04-09 20:33)tsp42 Wrote:  no it should only fetch the metadata. Are you sure that is downloads the actual recording? Can you check if there are any recordings stored in the coverart or fanart storage group?

Being lazy I have only configured the default storage group on the b/e. And, yes you are correct, I have both the metadata and actual recordings in those folders (two drives). Seems like someone (cmyth, myth protocol?) is a little bit greedy when fetching the metadata :-)

/D
find quote
dteirney Offline
Team-XBMC Developer
Posts: 820
Joined: Jul 2007
Reputation: 6
Location: New Zealand
Post: #553
(2012-04-03 19:38)dodoadoodoo Wrote:  We quite often use "chase play" (start a recording, wait a while, begin watching while still recording) in our house. This basically works well, with the exception that the recording length is not updated while watching, it is firmly set to whatever the length was when you started watching. Not a big a deal unless you want to skip forward, at which point it becomes very annoying. Anyway, I took a look at the code, and it seems that the backend periodically informs the frontend of updated recording sizes via the CMYTH_EVENT_UPDATE_FILE_SIZE. So, I added some code in MythEventHandler::ImpMythEventHandler::Action() to store this information, and adapted PVRClientMythTV::LengthRecordedStream() to check if the EventHandler has any uptodate info. This works well, except for the little detail that LengthRecordedStream really should return the length of the stream (as seconds I presume) and not the size in bytes as provided by the backend event.

Now to my questions:
1. Am I going about this the right way?
2. Have I understood the expected units correctly?
3. If yes and yes, then how do I convert the file size to duration? I guess dividing the size with the average bitrate would do the trick, but how would I find the average bitrate?
4. Is there a simpler way to do this?

/D

I looked at doing this exact thing in the standard myth:// protocol handler as we sometimes also end up watching content that is currently recording. I'd already written a bunch of the code and then noticed that the CMYTH_EVENT_UPDATE_FILE_SIZE event wasn't being sent from the backend. After some more digging it seems that the event only gets fired for Live TV, not standard recordings. Might pay to check on that before going too far. Let me know what you find.

I'm going to look at changing it so if the program is currently recording the file length is retrieved from the backend every, say, 5 minutes. I'm pretty sure the "length" needed by the standard CFile interface in XBMC is bytes so that's all fine. As usual I am time poor so this might not happen for a while...

Not sure what the "length recorded stream" API needs for PVR content.

Use MythTV for recording TV? Try the integrated MythTV support in XBMC Media Center. Now with commercial skip support built-in and integration with the Movie database!
find quote
tdavis Offline
Member
Posts: 87
Joined: Jan 2010
Reputation: 0
Post: #554
(2012-04-09 22:19)tsp42 Wrote:  I've added the sorting of recordings into movies / series folders based on duration/genre type and a user definable regular expression.

fiveisalive: Yes I believe so. The system boost library is placed in /usr/lib while the home-made is usually placed in /usr/local/lib.

Oh, good.. but for some reason, on my mythtv setup, it's SeriesTitle::Program (seperated by '::').

Any ideas on what to change this to? I've been playing around, but seem to be getting no where..

Oh, never mind.. I figured it out, just added "::.*" and it started to work.
(This post was last modified: 2012-04-10 05:41 by tdavis.)
find quote
dodoadoodoo Offline
Member
Posts: 55
Joined: Jan 2010
Reputation: 1
Post: #555
(2012-04-10 01:51)dteirney Wrote:  
(2012-04-03 19:38)dodoadoodoo Wrote:  We quite often use "chase play" (start a recording, wait a while, begin watching while still recording) in our house. This basically works well, with the exception that the recording length is not updated while watching, it is firmly set to whatever the length was when you started watching. Not a big a deal unless you want to skip forward, at which point it becomes very annoying. Anyway, I took a look at the code, and it seems that the backend periodically informs the frontend of updated recording sizes via the CMYTH_EVENT_UPDATE_FILE_SIZE. So, I added some code in MythEventHandler::ImpMythEventHandler::Action() to store this information, and adapted PVRClientMythTV::LengthRecordedStream() to check if the EventHandler has any uptodate info. This works well, except for the little detail that LengthRecordedStream really should return the length of the stream (as seconds I presume) and not the size in bytes as provided by the backend event.

Now to my questions:
1. Am I going about this the right way?
2. Have I understood the expected units correctly?
3. If yes and yes, then how do I convert the file size to duration? I guess dividing the size with the average bitrate would do the trick, but how would I find the average bitrate?
4. Is there a simpler way to do this?

/D

I looked at doing this exact thing in the standard myth:// protocol handler as we sometimes also end up watching content that is currently recording. I'd already written a bunch of the code and then noticed that the CMYTH_EVENT_UPDATE_FILE_SIZE event wasn't being sent from the backend. After some more digging it seems that the event only gets fired for Live TV, not standard recordings. Might pay to check on that before going too far. Let me know what you find.

I'm going to look at changing it so if the program is currently recording the file length is retrieved from the backend every, say, 5 minutes. I'm pretty sure the "length" needed by the standard CFile interface in XBMC is bytes so that's all fine. As usual I am time poor so this might not happen for a while...

Not sure what the "length recorded stream" API needs for PVR content.

What version did you test with? I am running a 0.24 b/e and I seem to get the CMYTH_EVENT_UPDATE_FILE_SIZE event for all current recordings.
find quote
Jimmer Offline
Donor
Posts: 337
Joined: Jan 2010
Reputation: 3
Location: Sunny Devon, UK
Post: #556
(2012-04-10 05:37)tdavis Wrote:  
(2012-04-09 22:19)tsp42 Wrote:  I've added the sorting of recordings into movies / series folders based on duration/genre type and a user definable regular expression.

fiveisalive: Yes I believe so. The system boost library is placed in /usr/lib while the home-made is usually placed in /usr/local/lib.

Oh, good.. but for some reason, on my mythtv setup, it's SeriesTitle::Program (seperated by '::').

Any ideas on what to change this to? I've been playing around, but seem to be getting no where..

Oh, never mind.. I figured it out, just added "::.*" and it started to work.

Care to share your explicit regexp? I personally tried many combinations including ::.* but couldn't get it working for me. I still get:

Homeland::Semper I
|------Homeland::Semper I

Homeland::Pilot
|------Homeland::Pilot

Homeland::Grace
|------Homeland::Grace

So, many individual top folders, each with their single episodes inside. Obviously, I'd be looking for something like:

Homeland
|------Semper I
|------Pilot
|------Grace

I wonder why the default regexp works for tsp and not for us? I wouldn't have thought there was that much variation in how mythbackend serves up the episode names....

Jim
find quote
dteirney Offline
Team-XBMC Developer
Posts: 820
Joined: Jul 2007
Reputation: 6
Location: New Zealand
Post: #557
(2012-04-10 09:23)dodoadoodoo Wrote:  What version did you test with? I am running a 0.24 b/e and I seem to get the CMYTH_EVENT_UPDATE_FILE_SIZE event for all current recordings.

Weird, I was using 0.24 as well. How often do you observe the events getting fired. Perhaps I wasn't looking for them long enough. Live TV fires them out quite frequently.

Use MythTV for recording TV? Try the integrated MythTV support in XBMC Media Center. Now with commercial skip support built-in and integration with the Movie database!
find quote
dodoadoodoo Offline
Member
Posts: 55
Joined: Jan 2010
Reputation: 1
Post: #558
(2012-04-10 10:23)dteirney Wrote:  
(2012-04-10 09:23)dodoadoodoo Wrote:  What version did you test with? I am running a 0.24 b/e and I seem to get the CMYTH_EVENT_UPDATE_FILE_SIZE event for all current recordings.

Weird, I was using 0.24 as well. How often do you observe the events getting fired. Perhaps I wasn't looking for them long enough. Live TV fires them out quite frequently.

I get them every tenth second actually, looking like this (log excerpt):
10:35:07 T:2752543600 DEBUG: AddOnLog: MythTV cmyth PVR Client: EVENT ID: CMYTH_EVENT_UPDATE_FILE_SIZE, EVENT databuf: 4037 2012-04-10T10:34:00 59765576
10:35:17 T:2752543600 DEBUG: AddOnLog: MythTV cmyth PVR Client: EVENT ID: CMYTH_EVENT_UPDATE_FILE_SIZE, EVENT databuf: 4037 2012-04-10T10:34:00 73847716
find quote
tsp42 Offline
Senior Member
Posts: 222
Joined: Aug 2011
Reputation: 11
Location: Denmark
Post: #559
The matched String between (?<title> and the next ) will be used as the folder name. If no match is found the entire title plus subtitle will be used. To match the :: used as the current separator between title and subtitle use: ^(?<title>.+?)::
The RegEx documentation is available here: http://www.boost.org/doc/libs/1_34_1/lib..._perl.html
Mythtv can't extract the episode from the EIT data I get. I don't have any subtitles and the episode number is encode in the title like: the walking dead (18) so the current default RegEx is used to recognize this pattern. I will change the default value in the next update.

Libcmyth MythTV addon for xbmc-pvr [source] [forum thread]
(This post was last modified: 2012-04-10 10:50 by tsp42.)
find quote
Jimmer Offline
Donor
Posts: 337
Joined: Jan 2010
Reputation: 3
Location: Sunny Devon, UK
Post: #560
(2012-04-10 10:45)tsp42 Wrote:  The matched String between (?<title> and the next ) will be used as the folder name. If no match is found the entire title plus subtitle will be used. To match the :: used as the current separator between title and subtitle use: ^(?<title>.+?)::
The RegEx documentation is available here: http://www.boost.org/doc/libs/1_34_1/lib..._perl.html
Mythtv can't extract the episode from the EIT data I get. I don't have any subtitles and the episode number is encode in the title like: the walking dead (18) so the current default RegEx is used to recognize this pattern. I will change the default value in the next update.

Thanks! That totally worked..... was starting to tear my hair out!

Just a little wrinkle though:

When I schedule recordings through mythweb, they are stored in mythconverg as title/subtitle, e.g:

Title / Subtitle / Description
Homeland / Semper I / "Big plans are made for national hero Brody, but his increasingly erratic behaviour threatens his status as the media's latest darling, prompting the vice president to send an adviser to check him out. Carrie nears the end of her four-week surveillance warrant and grows desperate for evidence linking the marine to Abu Nazir, but Saul instructs her to focus on the terrorist's money trail. Thriller, starring Claire Danes and Damian Lewis."

which the addon will display in the refocus skin as Homeland::Semper I with the appropriate description

However, if I schedule the same recording through the addon itself, it will be stored as:

Title / Subtitle / Description
Homeland: Semper I / Tue Apr 10 09:30:00 2012 / ""

which the addon will display as Homeland: Semper I::Tue Apr 10 09:30:00 2012 with no description information

obviously, this will create a differently titled show for each manually created recording which will not match the naming scheme used by the other mythweb scheduled recordings and they will lack episode descriptions. This has happened to me a few times where regularly scheduled recordings made via mythweb have failed for whatever reason and then I have scheduled "fill" recordings via the addon.

Some extra info: I live in the UK (using dvb-t) and primarily use the RadioTimes xmltv grabber for guide data, but also use EIT for channels that are omitted by RadioTimes. All of the above occurs whether or not the source is EIT or XMLTV. All channels provided by EIT also have correctly coloured EPG entries, whereas XMLTV one's are all the same colour irregardless of type of programming displayed.....

Thanks again for all the hard work!
find quote
Post Reply