Kodi Community Forum
TV Guide Fullscreen - possibly the most powerful TV Guide in the world. ;) - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: Add-on Support (https://forum.kodi.tv/forumdisplay.php?fid=27)
+---- Forum: Program Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=151)
+---- Thread: TV Guide Fullscreen - possibly the most powerful TV Guide in the world. ;) (/showthread.php?tid=282157)



RE: TV Guide Fullscreen - possibly the most powerful TV Guide in the world. ;) - primaeval - 2016-12-15

(2016-12-15, 15:19)Drt1989 Wrote:
(2016-12-15, 14:54)primaeval Wrote:
(2016-12-15, 14:45)Drt1989 Wrote: ---- Have you thought of somehow adding recording functionality? Now that we can set reminders straight from the Guide, imagine having a Record option too.
I know this would probably have to be handled by a 3rd party player so is probably a dead end. Just an idea.

It's been there ever since AutoPlayWith's were added. You just need to do a bit of extra manual labour. Wink

If you have ffmpeg installed for your device it should be fairly easy but needs a bit of work.

See if you can follow the instructions in
addons\script.tvguide.fullscreen\resources\playwith\readme.txt

I haven't made it generic yet because there are some major variations on all the devices, operating systems and Kodi versions.

If you have a playercorefactory.xml player that can do recording you can use that instead.

[EDIT] It won't be as good as a dedicated pvr recording backend but it does work for addons which the pvr doesn't.


Ah.... I didn't mention that this would be on Android OSConfused.......... I'll read the readme as I can at least try on Windows.

I really feel I should get into programming. There's a lot of ideas I have but it's as though I can't write because I don't know the language. Kodi has become a bit of a playground for me! Have you got any tips on where to start learning?

I got it working on Android. There is a build of ffmpeg that works on that.
I think I used this one. Look for a link to prebuilt-binaries.
https://github.com/WritingMinds/ffmpeg-android

This is the fastest way to learn any new programming language. I always start there.
https://learnxinyminutes.com/


RE: TV Guide Fullscreen - possibly the most powerful TV Guide in the world. ;) - FXB78 - 2016-12-15

I had a go at using AutoPlayWith with VLC in Windows, but I must admit I gave up after a while as I couldn't get it to work. For some reason which baffled me I could never get it to pass the url over to VLC. I'm sure there's a way but unfortunately it ended up being over my head Smile


RE: TV Guide Fullscreen - possibly the most powerful TV Guide in the world. ;) - primaeval - 2016-12-15

(2016-12-15, 15:44)FXB78 Wrote: I had a go at using AutoPlayWith with VLC in Windows, but I must admit I gave up after a while as I couldn't get it to work. For some reason which baffled me I could never get it to pass the url over to VLC. I'm sure there's a way but unfortunately it ended up being over my head Smile

Some of the streams can't be played in VLC especially ones that add header data after a | such as X-Forwarded-For and User-Agent.
They should work in ffmpeg.exe as that is what Kodi uses internally (mostly).

This person is the expert in playercorefactory.xml players:
https://github.com/NapoleonWils0n/kodi-playercorefactory


RE: TV Guide Fullscreen - possibly the most powerful TV Guide in the world. ;) - Drt1989 - 2016-12-15

Quote:I got it working on Android. There is a build of ffmpeg that works on that.
I think I used this one. Look for a link to prebuilt-binaries.
https://github.com/WritingMinds/ffmpeg-android

This is the fastest way to learn any new programming language. I always start there.
https://learnxinyminutes.com/

Thanks,

I am trying my way through this now. I am stuck..... I have the ffmpeg file. From the readme I need to add the link to ffmpeg in PlayerCoreFactory.xml, is this right?

Sorry noob question I know!


RE: TV Guide Fullscreen - possibly the most powerful TV Guide in the world. ;) - primaeval - 2016-12-15

(2016-12-15, 16:59)Drt1989 Wrote:
Quote:I got it working on Android. There is a build of ffmpeg that works on that.
I think I used this one. Look for a link to prebuilt-binaries.
https://github.com/WritingMinds/ffmpeg-android

This is the fastest way to learn any new programming language. I always start there.
https://learnxinyminutes.com/

Thanks,

I am trying my way through this now. I am stuck..... I have the ffmpeg file. From the readme I need to add the link to ffmpeg in PlayerCoreFactory.xml, is this right?

Sorry noob question I know!

Here is a very basic example to get you started.
It needs a lot more to make it usable.
It will just do a 4 hour recording to a file called test.ts.
The paths need changing to yours. These ones are on windows.
Android will be very picky about where it can start programs from and the permissions of the files and folders.

Code:
<playercorefactory>
<player name="test" type="ExternalPlayer" audio="false" video="true">
<filename>c:\utils\ffmpeg.exe</filename>
<args>-i "{1}" -y -c copy -t 4:00:00 c:\temp\test.ts</args>
<hidexbmc>false</hidexbmc>
<hideconsole>true</hideconsole>
<warpcursor>none</warpcursor>
<playonestackitem>true</playonestackitem>
</player>
</players>
</playercorefactory>

[EDIT] A couple of links:
http://kodi.wiki/view/external_players
http://kodi.wiki/view/HOW-TO:Use_external_players_on_Android


RE: TV Guide Fullscreen - possibly the most powerful TV Guide in the world. ;) - Drt1989 - 2016-12-15

Okay, I understand to a point....
The .py files need to be changed with the correct paths as well I guess? From what I understand in those .py files is already arguements? - Is there still a need for playercore as well (I guess yes as it defines what the player is etc)
This is on the todo at a later date list.
However. From looking at this, it would seem that there is no function to stop recording when the program has finished?

-----

For now I am happy to where I (you have gotten me) am with the guide. The next thing I want to do i the search any program. I'll read through this post and pick out some pieces.

Thanks all, hopefully I'll be able to help rather than just keep asking questions!


RE: TV Guide Fullscreen - possibly the most powerful TV Guide in the world. ;) - primaeval - 2016-12-15

(2016-12-15, 18:01)Drt1989 Wrote: Okay, I understand to a point....
The .py files need to be changed with the correct paths as well I guess? From what I understand in those .py files is already arguements? - Is there still a need for playercore as well (I guess yes as it defines what the player is etc)
This is on the todo at a later date list.
However. From looking at this, it would seem that there is no function to stop recording when the program has finished?

-----

For now I am happy to where I (you have gotten me) am with the guide. The next thing I want to do i the search any program. I'll read through this post and pick out some pieces.

Thanks all, hopefully I'll be able to help rather than just keep asking questions!

You need to choose either the playercorefactory way or the py way.

There is an example Android folder in resources too.

There are only a couple of paths that need to be changed depending on your setup at the bottom of the py files.

It is still a pretty advanced exercise though.


Pressing 4 on a Program in the main EPG will give you the options to search by Title or Synopsis or show the Categories search.


RE: TV Guide Fullscreen - possibly the most powerful TV Guide in the world. ;) - Drt1989 - 2016-12-15

Quote:You need to choose either the playercorefactory way or the py way.

There is an example Android folder in resources too.

There are only a couple of paths that need to be changed depending on your setup at the bottom of the py files.

It is still a pretty advanced exercise though.


Pressing 4 on a Program in the main EPG will give you the options to search by Title or Synopsis or show the Categories search.

Thanks. I thought so.

Is it correct to assume the below limitations:

- You can not play another stream while recording with ffmpeg
-You can not record mutiple streams at the same time
- There is no way for the recording to just be a particular program, It will continue to record until stopped, even using the playwith.py?
- I am asking too many questions and annoying the developer Tongue


RE: TV Guide Fullscreen - possibly the most powerful TV Guide in the world. ;) - gillmacca - 2016-12-15

easy question here.
I haven't tried the remind function yet (will do in the future)
I understand what remind once means, but what does remind always mean? Does this remind you of the programme regardless what channel it is on, or does it just remind you on that particular channel (hoping the latter)


RE: TV Guide Fullscreen - possibly the most powerful TV Guide in the world. ;) - Drt1989 - 2016-12-15

(2016-12-15, 18:29)gillmacca Wrote: easy question here.
I haven't tried the remind function yet (will do in the future)
I understand what remind once means, but what does remind always mean? Does this remind you of the programme regardless what channel it is on, or does it just remind you on that particular channel (hoping the latter)


Just tested this. It works as you' like.Big Grin


RE: TV Guide Fullscreen - possibly the most powerful TV Guide in the world. ;) - primaeval - 2016-12-15

(2016-12-15, 18:36)Drt1989 Wrote:
(2016-12-15, 18:29)gillmacca Wrote: easy question here.
I haven't tried the remind function yet (will do in the future)
I understand what remind once means, but what does remind always mean? Does this remind you of the programme regardless what channel it is on, or does it just remind you on that particular channel (hoping the latter)


Just tested this. It works as you' like.Big Grin

Yes it is Channel specific. I think it is any channel and always in the original TV Guide.


RE: TV Guide Fullscreen - possibly the most powerful TV Guide in the world. ;) - primaeval - 2016-12-15

(2016-12-15, 18:18)Drt1989 Wrote:
Quote:You need to choose either the playercorefactory way or the py way.

There is an example Android folder in resources too.

There are only a couple of paths that need to be changed depending on your setup at the bottom of the py files.

It is still a pretty advanced exercise though.


Pressing 4 on a Program in the main EPG will give you the options to search by Title or Synopsis or show the Categories search.

Thanks. I thought so.

Is it correct to assume the below limitations:

- You can not play another stream while recording with ffmpeg
-You can not record mutiple streams at the same time
- There is no way for the recording to just be a particular program, It will continue to record until stopped, even using the playwith.py?
- I am asking too many questions and annoying the developer Tongue

As long as you have a mechanism to start ffmpeg in the background you can start as many recordings as your bandwidth and device can handle.

There is an option in AutoPlayWiths to stop the recording at the end of the program.

If you use the python route you have more control and can specify a timed recording.

I would see how far you get with the python route.

I don't mind helping people as long as they experiment and try things out.
I'm in the "teach a man to code" school of helping.


RE: TV Guide Fullscreen - possibly the most powerful TV Guide in the world. ;) - gillmacca - 2016-12-15

(2016-12-15, 18:43)primaeval Wrote:
(2016-12-15, 18:36)Drt1989 Wrote:
(2016-12-15, 18:29)gillmacca Wrote: easy question here.
I haven't tried the remind function yet (will do in the future)
I understand what remind once means, but what does remind always mean? Does this remind you of the programme regardless what channel it is on, or does it just remind you on that particular channel (hoping the latter)


Just tested this. It works as you' like.Big Grin

Yes it is Channel specific. I think it is any channel and always in the original TV Guide.

Excellent. Just what I am looking for (for now...lol)


RE: TV Guide Fullscreen - possibly the most powerful TV Guide in the world. ;) - Drt1989 - 2016-12-15

(2016-12-15, 18:50)primaeval Wrote:
(2016-12-15, 18:18)Drt1989 Wrote:
Quote:You need to choose either the playercorefactory way or the py way.

There is an example Android folder in resources too.

There are only a couple of paths that need to be changed depending on your setup at the bottom of the py files.

It is still a pretty advanced exercise though.


Pressing 4 on a Program in the main EPG will give you the options to search by Title or Synopsis or show the Categories search.

Thanks. I thought so.

Is it correct to assume the below limitations:

- You can not play another stream while recording with ffmpeg
-You can not record mutiple streams at the same time
- There is no way for the recording to just be a particular program, It will continue to record until stopped, even using the playwith.py?
- I am asking too many questions and annoying the developer Tongue

As long as you have a mechanism to start ffmpeg in the background you can start as many recordings as your bandwidth and device can handle.

There is an option in AutoPlayWiths to stop the recording at the end of the program.

If you use the python route you have more control and can specify a timed recording.

I would see how far you get with the python route.

I don't mind helping people as long as they experiment and try things out.
I'm in the "teach a man to code" school of helping.

That's so refreshing to hear. I have read the readme again, studied the .py and....

I moved my ffmpeg to data/data in Android (with Root access) (simply using the .py as a template)

I have a folder on my sda1 named Recordings.

I have enabled autoplaywiths in settings. I am currently recording the end of bbc news as a test.

One question is - do I need to define my path to save the recording as it's written as comment in the .py

I haven't made any changes:

Code:
# Play with your own preferred player and paths
if url:
    name = "%s = %s = %s" % (start,channel,title)
    name = name.encode("cp1252")
    filename = xbmc.translatePath("special://temp/%s.ts" % name)
    #filename = "/storage/recordings/%s.ts" % name         <----------------- Should I have inputted this (or my own path) above?
    ffmpeg = r"c:\utils\ffmpeg.exe"
    ffmpeg = r"/usr/bin/ffmpeg"
    cmd = [ffmpeg, "-y", "-i", url, "-c", "copy", "-t", str(seconds), filename]
    p = Popen(cmd,shell=True)
    #p = Popen(cmd,shell=False)



RE: TV Guide Fullscreen - possibly the most powerful TV Guide in the world. ;) - primaeval - 2016-12-15

(2016-12-15, 19:55)Drt1989 Wrote: That's so refreshing to hear. I have read the readme again, studied the .py and....

I moved my ffmpeg to data/data in Android (with Root access) (simply using the .py as a template)

I have a folder on my sda1 named Recordings.

I have enabled autoplaywiths in settings. I am currently recording the end of bbc news as a test.

One question is - do I need to define my path to save the recording as it's written as comment in the .py

I haven't made any changes:

Code:
# Play with your own preferred player and paths
if url:
    name = "%s = %s = %s" % (start,channel,title)
    name = name.encode("cp1252")
    filename = xbmc.translatePath("special://temp/%s.ts" % name)
    #filename = "/storage/recordings/%s.ts" % name         <----------------- Should I have inputted this (or my own path) above?
    ffmpeg = r"c:\utils\ffmpeg.exe"
    ffmpeg = r"/usr/bin/ffmpeg"
    cmd = [ffmpeg, "-y", "-i", url, "-c", "copy", "-t", str(seconds), filename]
    p = Popen(cmd,shell=True)
    #p = Popen(cmd,shell=False)

Your path depends on your device. Have a root around in adb if it's not obvious from whatever file manager you're using.
One of the examples uses the Kodi temp directory which should be writeable by ffmpeg.

Write the value of any variable you're interested in in the log with:
xbmc.log(repr(variable))
where variable might be cmd or filename for example.

Make sure ffmpeg is working on the command line first. You won't be able to see any error values when you run it from Kodi.
It needs the full path for the output path.