•   
  • 1
  • 2
  • 3(current)
  • 4
  • 5
  • 15
  •   
PVR Simple SQL Client w/ Recording
#31
(2018-05-23, 21:54)NGC3144 Wrote: I was trying to use it on RPi3 running LibreELEC but unfortunately ffmpeg is compiled without ffprobe and libx264.

You can change codec for ffmpeg call in settings of addon. As for ffprobe, it uses it to fetch video duration once recording completes, unfortunately there is no way to know the duration from ffmpeg while record is running. You can comment out ffprobe part of code, but your videos may not have an appropriate duration and the addon may work unexpectedly..

Can you compile ffmpeg for your device with ffprobe for your device?
Reply
#32
Yep, ffprobe can be easy added with this small patch to ffmpeg package in LibreELEC:

diff --git a/packages/multimedia/ffmpeg/package.mk b/packages/multimedia/ffmpeg/package.mk
index 43d136a..e1013b1 100644
--- a/packages/multimedia/ffmpeg/package.mk
+++ b/packages/multimedia/ffmpeg/package.mk
@@ -131,7 +131,7 @@ configure_target() {
               --pkg-config="$TOOLCHAIN/bin/pkg-config" \
               --enable-optimizations \
               --disable-extra-warnings \
-              --disable-ffprobe \
+              --enable-ffprobe \
               --disable-ffplay \
               --disable-ffserver \
               --enable-ffmpeg \
Reply
#33
Hi, maybe you can use one of these ffmpeg static builds (static linked libs) without need of building anything. I'm using it now on my Odroid C2 with official LibreElec 8.2.5 and it works well. https://johnvansickle.com/ffmpeg/
Reply
#34
Nice work! You've achieved the holy grail of iptv simple client. Smile
All you need to do is to create builds for a few dozen Kodi versions, devices and operating system combinations. Wink

I managed to get it working on Ubuntu 16.04 but it needed a few extras.
This is my experience so far:

Kodi needs to be checked out with the Krypton branch.
It needs to be built too with all the dependencies to build it.
Folllow the ubuntu readme then the linux readme in xbmc/docs.

cmake needs upgrading manually or it can't extract zlib from the tar.gz file in depends.
I followed these instructions: https://askubuntu.com/a/865294

The xbmc-pvr-iptvsimple project name needs to be  renamed to pvr.iptvsimple to follow the build instructions.

The cmake command needs to be the one from the Krypton branch. The one in the readme.md is for Leia.
https://github.com/kodi-pvr/pvr.iptvsimple/tree/Krypton

The PVRScheduler spins at 100% cpu unless you add in a sleep() into the while loop like this:
https://github.com/primaeval/xbmc-pvr-ip...b71930dR89

Python addons can run executables from the Android data/data folder if the permissions are changed to executable by the kodi user.
I've done that in my IPTV Recorder addon.
At that very least you might be able to launch ffmpeg via rpc through a python addon if it can't be done in the c pvr addon.
https://github.com/primaeval/plugin.vide...in.py#L387
https://github.com/primaeval/plugin.vide...in.py#L401

My current IPTV Recorder ffmpeg settings use a simple ts container to reduce cpu to a minimum.
I also found a few ffmpeg parameters that deal with bad stream connections that might be useful for you.
https://github.com/primaeval/plugin.vide...in.py#L612
Reply
#35
If you guys could come together and make this work for android i know loads of people would bow to you as gods.. lol also iptv simple epg is always an hour out on my machine even if i set the time delay (dont work) but this maybe something from my epg source.
Reply
#36
You should be able to add a tvg-shift to your channels in the m3u to correct offsets.
https://kodi.wiki/view/Add-on:IPTV_Simple_Client#Usage
Reply
#37
(2018-05-24, 20:39)primaeval Wrote: Nice work! You've achieved the holy grail of iptv simple client. Smile
All you need to do is to create builds for a few dozen Kodi versions, devices and operating system combinations. Wink

I managed to get it working on Ubuntu 16.04 but it needed a few extras.
This is my experience so far:

Kodi needs to be checked out with the Krypton branch.
It needs to be built too with all the dependencies to build it.
Folllow the ubuntu readme then the linux readme in xbmc/docs.

cmake needs upgrading manually or it can't extract zlib from the tar.gz file in depends.
I followed these instructions: https://askubuntu.com/a/865294

The xbmc-pvr-iptvsimple project name needs to be  renamed to pvr.iptvsimple to follow the build instructions.

The cmake command needs to be the one from the Krypton branch. The one in the readme.md is for Leia.
https://github.com/kodi-pvr/pvr.iptvsimple/tree/Krypton

The PVRScheduler spins at 100% cpu unless you add in a sleep() into the while loop like this:
https://github.com/primaeval/xbmc-pvr-ip...b71930dR89

Python addons can run executables from the Android data/data folder if the permissions are changed to executable by the kodi user.
I've done that in my IPTV Recorder addon.
At that very least you might be able to launch ffmpeg via rpc through a python addon if it can't be done in the c pvr addon.
https://github.com/primaeval/plugin.vide...in.py#L387
https://github.com/primaeval/plugin.vide...in.py#L401

My current IPTV Recorder ffmpeg settings use a simple ts container to reduce cpu to a minimum.
I also found a few ffmpeg parameters that deal with bad stream connections that might be useful for you.
https://github.com/primaeval/plugin.vide...in.py#L612

This is good stuff, thanks for sharing.

(2018-05-28, 11:08)maughanorama Wrote: If you guys could come together and make this work for android i know loads of people would bow to you as gods.. lol also iptv simple epg is always an hour out on my machine even if i set the time delay (dont work) but this maybe something from my epg source.

I think the answer would be to have addon call a python script, but I need to learn a little bit more. Primeval addon I believe does this, but it’s not embedded in iptv client for various drawbacks and limitation.

Even if I get full functionality in android, it would still require users to compile entire Kodi apk, which is not an easy task... I’ll still look into it though.
Reply
#38
I have succesfully compiled on OSMC OS (based on debian 9 stretch) on Rapsberry Pi 2. 

EPG and m3u channel lists works, but recording does not... I'm using ffmpeg static build from https://johnvansickle.com/ffmpeg/
After adding recording to scheduler, I can see after a while notification about recording starts, but after some short time recording ends. No video file is created in recording directory (on sdcard - Kodi user has rw access - pvr cache files are created there)
When I run manually from shell ffmpeg command copied from kodi.log - output file is created and recording is working...

In kodi.log:
https://paste.ubuntu.com/p/zTnW3W7236/
Reply
#39
rtmp streams are handled as a special case and they used to be downloaded with rtmpdump in @rkubera 's version.
https://github.com/rkubera/pvr.iptvsimpl...d.cpp#L243
https://github.com/gonzalo-hvega/pvr.ipt...d.cpp#L239

I don't know if @el_gonz87 has tested with rtmp streams but I haven't got access to any.
I suspect ffmpeg needs something extra in the command line for rtmp.
Reply
#40
I've said that when I copy-paste ffmpeg command with all params from kodi.log and manually execute it in shell - output file is created and ffmpeg is copying stream to file.

But I think that te problem can be in bad use of " chars in -i param:/usr/local/bin/ffmpeg -i "rtmp://178.62.237.17/live/[email protected]&pass=xxx --swfUrl="[email protected]" --pageUrl="1527671051"" -c copy -f flv "/media/Lexar/Kodi/Recordings/PVR/Agenci NCIS Los Angeles (2018-05-30T12-17-38).flv"bash maybe can handle it, but maybe kodi does not...

Here I have found adding those chars:

https://github.com/gonzalo-hvega/pvr.ipt...d.cpp#L272

I can try to remove those extra " chars from code and test it again, but tommorow.
Reply
#41
Are you sure those inner quotes are getting escaped in the command line to ffmpeg?
They should either be single quotes or backslash escaped, I would have thought.
As it stands the command is getting tokenized in the wrong places.
Reply
#42
Yea I’m thinking there is an issue with the quotes and when exec-stream tries to parse it, it fails.

I wrote a script to quickly check these issues, will try to test when I get home this weekend.
Reply
#43
I have changed this line:
https://github.com/gonzalo-hvega/pvr.ipt...d.cpp#L272

To:
strParams = strParams + " --"+lineVect[0]+"="+lineVect[1];

And recrding of rtmp streams is now working. So I can confirm that problem is with too many " chars

Now I have problem with duration of those recordings, ffprobe says that duration is 00:00:00. I have tried adding --use_wallclock_as_timestamps 1 -fflags +genpts to output parameters but with no luck...
Reply
#44
Does it actually need the CorrectDurationFLVFile function now?
Maybe that was only needed for rtmpdump.
https://github.com/gonzalo-hvega/pvr.ipt...d.cpp#L421
Reply
#45
(2018-05-31, 16:15)Mr Groch Wrote: I have changed this line:
https://github.com/gonzalo-hvega/pvr.ipt...d.cpp#L272

To:
strParams = strParams + " --"+lineVect[0]+"="+lineVect[1];

And recrding of rtmp streams is now working. So I can confirm that problem is with too many " chars

Now I have problem with duration of those recordings, ffprobe says that duration is 00:00:00. I have tried adding --use_wallclock_as_timestamps 1 -fflags +genpts to output parameters but with no luck...
I think this is an FFMPEG issue. It may be due to the -v copy parameters, maybe it does not create timestamps appropriately. The fact FFPROBE detects a duration of 0 makes me think the FLV file doesn't have the appropriate data to get a duration. Have you tried actually remuxing? using a video codec and audio codec?

I must admit I was not able to test rtmp streams as I have none.
Reply
  •   
  • 1
  • 2
  • 3(current)
  • 4
  • 5
  • 15
  •   
 
Thread Rating:
  • 11 Vote(s) - 4.18 Average



Logout Mark Read Team Forum Stats Members Help
PVR Simple SQL Client w/ Recording4.1811
This forum uses Lukasz Tkacz MyBB addons.