Channel plugin (Updated 12-06-23)

Discuss third-party additions, plugins and translations for PS3 Media Server

Re: Channel plugin (Updated 12-03-14)

Postby gripped » Wed Mar 21, 2012 7:35 pm

SharkHunter wrote:@gripped - last weekend sopcast worked like a char m for me. This weekend nothing worked. Haven't got around to look at it yet. It should work in linux as well as windows. It could be that the mencoder you got doesn't like sopcast (or the other way around). I'll look deeper into when time emerges...


Cheers. I'll Have more of a play myself this weekend see if I can narow it down at all.
gripped
 
Posts: 2
Joined: Tue Mar 20, 2012 1:16 am

Re: Channel plugin (Updated 12-03-14)

Postby glenrocks » Mon Mar 26, 2012 8:34 pm

Hi SH,
I was using your great 1channel.ch (after XBMC jumpy 1channel had issues) and realized that there are no page navigation in it. Here are the changes I made :) : for page navigation and also added source names too as it would be easier for users to pick their working provider (i.e host-xx are sockshare/putlocker which mostly work for me) Thanks for all the channels :) Two thumbs up!!

Code: Select all
macrodef movieMacro {
   folder {
      #<div class="index_item index_item_ie"><a href="/watch-2280191-Hangover-2" title="Watch Hangover 2 (2011)"><img src="http://images.1channel.ch/thumbs/2280191_Hangover_2_2011.jpg"
      matcher=<div class=\"index_item index_item_ie\"><a href=\"([^\"]+)\" title=\"Watch ([^\"]+)\"[^>]*><img src=\"([^\"]+)\"
      order=url,name,thumb
      url=http://www.1channel.ch
      folder {
         #<a href="/external.php?title=The+Walking+Dead&url=aHR0cDovL3d3dy5wdXRsb2NrZXIuY29tL2ZpbGUvMEY2RUY0NUIyRkE2MjI2MQ==&domain=cHV0bG9ja2VyLmNvbQ==&loggedin=0" onClick="return  addHit('1889616332', '1')" rel="nofollow" title="Watch Version 1 of The Walking Dead" target="_blank">Version 1</a>
         matcher=href=\"([^\"]+)\"[^>]+>(Version[^<]+)</a>[\s]+.*[\s]+.*"><.*=[^/]+/[^/|']+[/|']([^.]+)
         order=url,name,name
         prop = name_separator= - ,
         url=http://www.1channel.ch
         type=empty
         media {
            script=lockerScript
            subtitle=swesub,s4u,allSubs,podnapisiTV
            prop=name_index=1
         }
      }
   }
   folder {
      matcher=<a href="(/index[^"]+)">([^<]+)</a>
      order=url,name
      url=http://www.1channel.ch
      prop=prepend_name=Goto -
      type=recurse
   }
}


I also had a question regarding rtmpdump+ffmpeg.. whats the best way to sync video+audio if streams go out of sync..esp with some streams, I had issue that audio plays on but video lags over the time.. Any suggestions how to correct that? Would appreciate your help.
glenrocks
 
Posts: 89
Joined: Sun Aug 21, 2011 5:06 pm

Re: Channel plugin (Updated 12-03-14)

Postby SharkHunter » Tue Mar 27, 2012 8:04 pm

glenrocks wrote:Hi SH,
I was using your great 1channel.ch (after XBMC jumpy 1channel had issues) and realized that there are no page navigation in it. Here are the changes I made :) : for page navigation and also added source names too as it would be easier for users to pick their working provider (i.e host-xx are sockshare/putlocker which mostly work for me) Thanks for all the channels :) Two thumbs up!!

I also had a question regarding rtmpdump+ffmpeg.. whats the best way to sync video+audio if streams go out of sync..esp with some streams, I had issue that audio plays on but video lags over the time.. Any suggestions how to correct that? Would appreciate your help.


Added this to the 1channel.ch. Gr8 work!

As for rtmpdump+ffmpeg I'm no real expert at this but you could try and swap to mencoder instead (chage this
Code: Select all
$TRANSCODER = $FFMPEG + ffmpegArgs
to
Code: Select all
$TRANSCODER = $MENCODER + mencoderArgs
in the rtmpdump.groovy file). The you could play around with mencoder options like "-mc" and stuff...
SharkHunter
 
Posts: 941
Joined: Tue Jun 01, 2010 8:39 pm

Re: Channel plugin (Updated 12-03-14)

Postby SharkHunter » Wed Mar 28, 2012 7:27 pm

Sometimes I get carried away and do stuff do fast. I might have done it again. The "host_45" stuff is not so user good locking names is it? So a new Channel (1.63) is out adding xxx_merge property, which can be added to all possible objects (folders,items,media etc.). The xxx_merge (replace xxx with url,thumb or name) prop should point to a script, any script will do but most prefarbly a NIPL script. This script will be called and can do any type of mangling of the strin (=url,thumb,name). The prop is used on 1channel (https://github.com/SharkHunter/Channel/ ... channel.ch) to wash the "host_45" away and replace it with a much more readable name (that is sockshare).
SharkHunter
 
Posts: 941
Joined: Tue Jun 01, 2010 8:39 pm

Re: Channel plugin (Updated 12-03-28)

Postby darklink911 » Fri Mar 30, 2012 8:59 pm

So I got a little problem with the channels.

Kanal5play, SVTplay and TV6 is working for me. But I can't get TV3, TV4, or Youtube to work.

In the attached debugs I played up two objects from each channel to verify that not a single file from each channel worked or didn't work.
The error I get on the regular channels that doesn't work is always "[win32\ffmpeg.exe] Process C:\Program Files (x86)\PS3 Media Server-SHB\win32\ffmpeg.exe has a return code of 1! Maybe an error occured... check the log file"

In the debug file an example for the TV4 channel is as follows. FFMPEG just stops.
Code: Select all
INFO  2012-03-30 21:36:08.330 [New I/O server worker #1-12] Starting transcode/remux of Gladiatorerna del 11
DEBUG 2012-03-30 21:36:08.330 [New I/O server worker #1-12] Creating pipe \\.\pipe\pmsencoder_transcoder_out_1333136168330_561
DEBUG 2012-03-30 21:36:08.331 [Thread-163] Waiting for pipe connection \\.\pipe\pmsencoder_transcoder_out_1333136168330_561
DEBUG 2012-03-30 21:36:08.550 [win32\ffmpeg.exe] Starting C:\Program Files (x86)\PS3 Media Server-SHB\win32\ffmpeg.exe -v 0 -y -threads 4 -i "rtmpe://cp70051.edgefcs.net/tv4ondemand/mp4root/2012-03-22/pid3388016(2173508_T3MP415).mp4 swfVfy=1 swfUrl=http://cdn01.tv4.se/polopoly_fs/1.1615597.1280745068!approot/tv4video.swf" -threads 4 -target ntsc-dvd \\.\pipe\pmsencoder_transcoder_out_1333136168330_561
DEBUG 2012-03-30 21:36:08.563 [win32\ffmpeg.exe] Reading pipe: \\.\pipe\pmsencoder_transcoder_out_1333136168330_561
DEBUG 2012-03-30 21:36:08.773 [win32\ffmpeg.exe] Attaching thread: win32\ffmpeg.exe
INFO  2012-03-30 21:36:14.749 [Thread-168] renderer: 192.168.1.69, file: rtmpdump://channel?-r=rtmpe%3A%2F%2Fcp70051.edgefcs.net%2Ftv4ondemand%2Fmp4root%2F2012-03-22%2Fpid3388016%282173508_T3MP415%29.mp4&--swfVfy=http%3A%2F%2Fcdn01.tv4.se%2Fpolopoly_fs%2F1.1615597.1280745068%21approot%2Ftv4video.swf
INFO  2012-03-30 21:36:20.079 [win32\ffmpeg.exe] Process C:\Program Files (x86)\PS3 Media Server-SHB\win32\ffmpeg.exe has a return code of 1! Maybe an error occured... check the log file
DEBUG 2012-03-30 21:36:22.750 [Buffered IO End Checker] Stopping process: win32\ffmpeg.exe
DEBUG 2012-03-30 21:36:22.750 [Buffered IO End Checker] Stopping process: win32\ffmpeg.exe
INFO  2012-03-30 21:36:24.251 [Thread-170] renderer: 192.168.1.69, file: rtmpdump://channel?-r=rtmpe%3A%2F%2Fcp70051.edgefcs.net%2Ftv4ondemand%2Fmp4root%2F2012-03-22%2Fpid3388016%282173508_T3MP415%29.mp4&--swfVfy=http%3A%2F%2Fcdn01.tv4.se%2Fpolopoly_fs%2F1.1615597.1280745068%21approot%2Ftv4video.swf


This happens for TV4 and TV3 which is the regular channels that I want working. I don't care too much about the other channels really. They are a minor problem for me right now.
Other than those it would be nice to get the Youtube channel working. Instead of FFMPEG shutting down it is CMD that returns an error. "[cmd.exe] Process cmd.exe has a return code of 255! Maybe an error occured... check the log file
" I can't watch Youtube via the Web folder either, it returns the same error.

I have no clue how to solve it, the only thing I tried for the FFMPEG issue was downloading the latest ffmpeg.exe from ffmpeg.org and replaced it with the one from SHB41. Also if I press Channels -> "Install/Update" the channels doesn't self-install. They have never been able to for me even though PMS-SHB has admin rights. So I manually put the channels there from Extra->channels.

Thanks for a very nice plugin and SHB. Would be awesome if I could get everything to work :)
P.S the zip for the debug files landed at 272 kb so I couldn't upload because of 256kb limit. So I remade it into a .rar at 110kb. Hope you don't mind.
Attachments
pms_dbg-darklink911.rar
(110.96 KiB) Downloaded 71 times
darklink911
 
Posts: 8
Joined: Thu Mar 01, 2012 6:54 pm

Re: Channel plugin (Updated 12-03-28)

Postby glenrocks » Fri Mar 30, 2012 9:15 pm

$TRANSCODER = $FFMPEG + ffmpegArgs
I looked at rtmpdump.groovy file and could not see ffmpeg..seems rtmpdump.exe I have defaults to ffmpeg based on swf/flv format (seems I never used subtitles). I tried adding transcoder line when it checks for (seenURL) ..I was wondering if there is a way to add arguments to ffmpeg?

$TRANSCODER = $MENCODER + mencoderArgs
I tried this and PMS+rtmpdump does kick mencoder instead but renderer cannot connect w/ no PMS buffer (I do see mencoder running though). I also noticed that rtmpdump+.groovy doesn't close rtmpdump+mencoder processes (rtmpdump does close/clean ffmpeg+rtmpdump processes though). So I am confused..possible that I have wrong .groovy file? Help needed plz.

host_45 away and replace it with a much more readable name (that is sockshare)
Perfecto. I didnt know a way with my limited skills (w/ no idea how to decode) and url source did not have site names...lol :| It works now the way it was supposed to be..two thumbs up!!
glenrocks
 
Posts: 89
Joined: Sun Aug 21, 2011 5:06 pm

Re: Channel plugin (Updated 12-03-28)

Postby SharkHunter » Sat Mar 31, 2012 7:14 am

darklink911 - At least tv4 changed their player try this new .ch file (replace the contents of tv.ch with this). Tv3 and TV6 uses the exact same streaming params so if one work the other should work. Does tv8 work? (it also uses the same as tv3/tv6).
Don't replace ffmpeg if you dont make sure it has the rtmp lib compiled into it. If you do use the rtmpdump.groovy script below and experiment with the "rtmpdump.force=true" flag. See the jumpy thread for more info. Youtube works for me at least my "favorites" on youtube...
Code: Select all
version=0.21
channel TV4 {
   img=http://cdn01.tv4.se/polopoly_fs/2.740!logoImage/807786835.png
   folder {
      type=ATZ
      name=A-Z
      url=http://www.tv4play.se/alla_program
      folder {
         # Programs
         #matcher=<img alt=\"[^\"]+\" src=\"([^\"]+)\"[^>]*>.*?<h3[^>]*><a href=\"([^\"]+)\" title=\"([^\"]+)\">
         # <h3 class="video-title"><a href="/dokumentarer/112_-_luftens_hjaltar">112 - luftens hjältar</a></h3>
         matcher=<h3 class=\"video-title\">[^<]*<a href=\"([^\"]+)\">([^<]+)</a>
          #order=thumb,url,name
         order=url,name
         url=http://www.tv4play.se/
         folder {
            # Episodes
            #<a href="/dokumentarer/akutmottagningen?title=akutmottagningen_del_15&amp;videoid=1142950"><img alt="Akutmottagningen del 15" src="http://cdn01.tv4.se/polopoly_fs/1.1916211!picture/440637053.jpg_gen/derivatives/w180/440637053.jpg" /></a>
            matcher=<a href=\"([^\"]+)\"><img alt=\"([^\"]+)\" src=\"([^\"]+)\" />
            order=url,name,thumb
            #url=http://www.tv4play.se/
            #type=empty
            item {
               # Fetch the smil
               #matcher=<a href=\"[^&]+&amp;videoid=([^\"]+)\"
               matcher=<a href=\"[^;]+;videoid=([^\"]+)\"
               #matcher=<link href=\".*videoid=([^\"]+)\" rel
               url=http://anytime.tv4.se/webtv/metafileFlash.smil?p=
               prop=only_first,auto_media,append_url=&bw=1800&emulate=true&sl=true&
               order=url
               media {
                  #matcher=<meta base=\"(rtmp[^\"]+)\" /></head><body><switch><video src=\"(mp4:[^\?]+)\?
                  #matcher=<meta base=\"(rtmp[^\"]+)\" />[^\"]+\"(mp4.*MP415[^\?]+)\?
                  matcher=<meta base=\"(rtmp[^\"]+)\" />[^\"]+\"(mp4:.*MP415[^\?]+)\?
                  #order=url,url
                  order=url,playpath
                  put=swfVfy=http://www.tv4play.se/flash/tv4playflashlets.swf
               }
            }
         }
      }
   }
}


glenrocks - Here is an veriosn of rtmpdump which uses mencoder instead of ffmpeg (note I removed all subs stuff).

Code: Select all
/*
    rtmpdump://channel?-v&-r=http%3A//example.com&-y=yvalue&-W=Wvalue

    -o is set automatically
    -r or --rtmp is required
    boolean values can be set without a value e.g. rtmpdump://channel?url=http%3A//example.com&--live&--foo=bar
    values *must* be URL-encoded
    keys can be, but hyphens are not special characters, so they don't need to be
*/

init {
    profile ('rtmpdump://') {
        pattern {
            protocol 'rtmpdump'
            match { RTMPDUMP }
        }

        action {
            def pairs = $HTTP.getNameValuePairs($URI) // uses URLDecoder.decode to decode the name and value
         def rtmpdumpArgs = []
         def mencoderArgs =[]
         def ffmpegArgs = []
         def seenURL = false
         def seenSub = false
         def args = ''
         def swfUrl=''
         def force=pmsConf['rtmdump.force']

         //mencoderArgs << '-mc' << '0.1'
         //mencoderArgs << '-channels' << '6'

            for (pair in pairs) {
                def name = pair.name
                def value = pair.value

                switch (name) {
                    case 'url': // deprecated
                    case '-r':
                    case '--rtmp':
               case 'rtmp':
                        if (value) {
                            $URI = value//quoteURI(value)
                            seenURL = true
                        }
                        break
               case '-y':
                  args+=' playpath='+value
                  rtmpdumpArgs << name
                  rtmpdumpArgs << quoteURI(value)
                  break
               case '-s':
                  swfUrl=' swfUrl='+value
                  rtmpdumpArgs << name
                  rtmpdumpArgs << quoteURI(value)
                  break
               case '-a':
                  args+=' app='+value
                  rtmpdumpArgs << name
                  rtmpdumpArgs << quoteURI(value)
                  break
               case '-W':
               case 'swfVfy':
               case '--swfVfy':
                   swfUrl=' swfUrl='+value
                  args+=' swfVfy=1'
                  rtmpdumpArgs << name
                  rtmpdumpArgs << quoteURI(value)
                  break
               case '-v':
                  args+=' live=1'
                  rtmpdumpArgs << name
                  break
               case '-p':
                  args+=' pageurl='+value
                  rtmpdumpArgs << name
                  rtmpdumpArgs << quoteURI(value)
                  break
                  
               case 'subs':
                  if(value) {
                     mencoderArgs << '-sub' << quoteURI(value)
                     seenSub = true
                  }
                  break
               case 'subcp':
                  if(value)
                     mencoderArgs << '-subcp' << quoteURI(value)
                  break
               case 'subtext':
                  if(value)
                     mencoderArgs << '-subfont-text-scale' << quoteURI(value)
                  break
               case 'subtext':
                  if(value)
                     mencoderArgs << '-subfont-outline' << quoteURI(value)
                  break
               case 'subblur':
                  if(value)
                     mencoderArgs << '-subfont-blur' << quoteURI(value)
                  break
               case 'subpos':
                  if(value)
                     mencoderArgs << '-subpos' << quoteURI(value)
                  break
               case 'subout':
                  break
                    default:
                        if (value)
                     args+=' '+name+"="+value
                  rtmpdumpArgs << name
                        // not all values are URIs, but quoteURI() is harmless on Windows and a no-op on other platforms
                        if (value)
                            rtmpdumpArgs << quoteURI(value)
                }
            }
            if (seenURL) {
                // rtmpdump doesn't log to stdout, so no need to use -q on Windows
            $PARAMS.waitbeforestart = 6000L
               $URI=quoteURI($URI)
               $DOWNLOADER = "$RTMPDUMP -o $DOWNLOADER_OUT -r ${$URI}"
               $DOWNLOADER += rtmpdumpArgs
                  $TRANSCODER = $MENCODER + mencoderArgs
            } else {
                log.error("invalid rtmpdump:// URI: no -r or --rtmp parameter supplied: ${$URI}")
            }
        }
    }
}
SharkHunter
 
Posts: 941
Joined: Tue Jun 01, 2010 8:39 pm

Re: Channel plugin (Updated 12-03-28)

Postby darklink911 » Sun Apr 01, 2012 3:13 pm

SharkHunter wrote:darklink911 - At least tv4 changed their player try this new .ch file (replace the contents of tv.ch with this). Tv3 and TV6 uses the exact same streaming params so if one work the other should work. Does tv8 work? (it also uses the same as tv3/tv6).
Don't replace ffmpeg if you dont make sure it has the rtmp lib compiled into it. If you do use the rtmpdump.groovy script below and experiment with the "rtmpdump.force=true" flag. See the jumpy thread for more info. Youtube works for me at least my "favorites" on youtube...


Thanks, got TV4 working. That version isn't up on the git for the channels so I thought I had the latest version. And I reinstalled SHB to get the proper FFMPEG back and I think Viasat.ch wasn't working because it turned out I didn't have the latest java jdk. I'm not sure but it's working now. Cheers mate.
Last edited by chocolateboy on Sun Apr 01, 2012 3:25 pm, edited 1 time in total.
Reason: no need to quote the whole post
darklink911
 
Posts: 8
Joined: Thu Mar 01, 2012 6:54 pm

Re: Channel plugin (Updated 12-03-28)

Postby glenrocks » Sun Apr 01, 2012 11:13 pm

Hi SH- Thanks for the script...it certainly did help me understand how to manipulate ffmpeg and rtmpdump..now I have to figure out all the arguments :| ..lol..wish there was some nifty expert settings site to learn from as tool documentation is just too general..I did not try mencoder settings as handshake between rtmpdump2.4+ffmpeg and renderer worked after the script and latest version of ffmpeg build (from mplayer site). I will let you know when I try that option again. :)

Just curious, whats waitbeforestart for? 6000L is buffer size or seconds? I remember reading somewhere that there was PMS bug for long delay when HTTP engine v2 is on..is that still true for latest PMS builds?

I also realized that there is common.ch...can that call local scripts too (just in case navix/boseman scripts dont work)? It would nice to have fallback structure for script calls :) Can it call XBMC py scripts...lol (I know it would be stretching it) :| No harm asking though :)

I appreciate your responses...as always, thanks :) Enjoy your Sunday.
glenrocks
 
Posts: 89
Joined: Sun Aug 21, 2011 5:06 pm

Re: Channel plugin (Updated 12-03-28)

Postby SharkHunter » Mon Apr 02, 2012 7:54 am

glenrocks - the waitbeforestart is how many milliseconds PMS waits before starting to read from the player (I think) so you could say it is how much it will buffer BUT it is not 6 sec of the video stream it is 6 sec since start of the player during which you could (depending on network speed etc.) get anything form 0 sec of video and many minutes. Sopcast for example needs a very long time here (say 30 secs) and sometimes it still fails. Just setting that value to a very large value isn't a solution to all the worlds problems since the render might feel that waiting for a video for that long is a waste of time and will give up.
The HTTPv2 gives longer startup time in general. Think it's still valid.
As for script you can basically call whatever script you like. Look at iPlayer and Kanal5 which both uses perl scripts to produce the actual video url. I had a wild idea of integrating Jython and XBMC but then infidel came to the rescue with Jumpy which solves that for us...(you can always try calling a XBMC/python script in the .ch files it will at least do something...)
SharkHunter
 
Posts: 941
Joined: Tue Jun 01, 2010 8:39 pm

PreviousNext

Return to Additions and Plugins

Who is online

Users browsing this forum: No registered users and 5 guests