Web content will not stream

For help and support with PS3 Media Server in general
Forum rules
Please make sure you follow the Problem Reporting Guidelines before posting if you want a reply.

Re: Web content will not stream

Postby infidel » Tue Mar 01, 2011 9:42 pm

chocolateboy wrote:I'll post an updated version of those WEB.conf entries (which should work out of the box) after the next release.

As long as you're refactoring everything, a few observations based on my adventures with feeding commandlines (no doubt you've considered all these in some form already, I mention them in the spirit of aspiring to make pmsencoder akin to greasemonkey):

  • All-purpose downloader and transcoder protocols for arbitrary commandlines, which shouldn't really require custom scripts, would be nice. The logic of it would be that any commandline that runs ok in the user's terminal can be dropped as-is into WEB.conf with keywords DOWNLOADER_OUT and TRANSCODER_OUT to be filled-in by the script, e.g. ideally

    downloader.groovy
    Code: Select all
    // videostream.Web,foo=foo,downloader://"c:\some where\foo.exe" -o DOWNLOADER_OUT
    script {
       profile ('downloader') {
          pattern {
             protocol 'downloader'
          }

          action {
             // all parsing/splitting/quote-matching/escaping handled internally by pmsencoder
             $DOWNLOADER = $URI.split('://')[1].replace('DOWNLOADER_OUT', $DOWNLOADER_OUT)
          }
       }
    }


    and similarly for transcoder.groovy. In this scenario the "live news" rtmpdump commands would look like
    Code: Select all
    videostream.Web,Live News=Aljazeera English,downloader:///usr/bin/rtmpdump -o DOWNLOADER_OUT -v -r etc...

    and x11grab would simply be
    Code: Select all
    videostream.Web,Screen=Screen,transcoder:///usr/bin/ffmpeg -f x11grab -r 30 -s 1920x1080 -i :0.0  TRANSCODER_OUT etc...

    allowing -s, -r, etc to be set right in WEB.conf without too much fuss. Also anyone could then write a script in their preferred language as long as the output filename is passed on the commandline, e.g 'downloader://mydownloader.bat DOWNLOADER_OUT'.

  • On the subject of running commandlines as-is I ran across org.apache.tools.ant.types.Commandline, which is small and provides reasonably robust parsing, quote-matching etc. It allows spaces in quoted blocks, strips outer quotes when splitting into lists, basically covers all the usual commandline tricks as one would expect. It would have to be extended for url processing, though (or maybe there's a better maven corollary?).

  • Automatic support for arbitrary protocols would be nice, too. If a script declares "pattern { protocol 'foo' }" then it can be taken for granted that the action block attempts to handle it.

  • I don't know if it's possible in groovypp, but @Grab() syntax for importing faraway external libs would really allow anything to be done inside a script without having to go upstream and patch pmsencoder itself. I tried all flavors of grape.Grab which work fine in groovy but not in pmsencoder. I defer to your expertise, maybe this can't be done due to groovypp's static nature, documentation seems to be non-existent.

Many thanks for this great plugin not to mention the highly instructive source code which is a pleasure to browse!
infidel
 
Posts: 278
Joined: Sun Aug 15, 2010 4:56 pm

Re: Web content will not stream

Postby chocolateboy » Tue Mar 01, 2011 10:20 pm

infidel wrote:All-purpose downloader and transcoder protocols for arbitrary commandlines, which shouldn't really require custom scripts, would be nice.


Good idea. I was already moving towards that with the pmsencoder:// protocol (allowing the downloader and/or transcoder to be specified) but you've crystallized it. It will have to wait though (unless you want to have a crack at it :-)) as there are already too many issues/enhancements to deal with at the moment. (And it will have to be a valid URI i.e. with a query string, URL-encoded values, no spaces &c.).

On the subject of running commandlines as-is I ran across org.apache.tools.ant.types.Commandline[/*]


Yes, I looked at that. For better or worse, PMS has its own way of handling external processes, and when downloader support was first added bringing in another library wasn't optimal. I'll take another look at it now that (some of) the dust has settled.

Automatic support for arbitrary protocols would be nice, too. If a script declares "pattern { protocol 'foo' }" then it can be taken for granted that the action block attempts to handle it.


If there's a pressing need for it, yes, but pmsencoder:// and the current list should cover most needs.

@Grab() syntax for importing faraway external libs


I haven't tested it, but that should work. The scripts are just plain old (dynamic) Groovy.

Cheers!
chocolateboy
Project Member
 
Posts: 2580
Joined: Wed Sep 16, 2009 10:05 am

Re: Web content will not stream

Postby chocolateboy » Tue Mar 01, 2011 10:29 pm

dushashi wrote:
Code: Select all
vcodec=mpeg2video:vbitrate=4096:threads=1:acodec=ac3:abitrate=128


How can I improve this? Can i increase vbitrate?


You can try, but 4096 kilobits per second is 4 times higher than most Megaupload AVIs.
chocolateboy
Project Member
 
Posts: 2580
Joined: Wed Sep 16, 2009 10:05 am

Re: Web content will not stream

Postby grolschie » Tue Mar 01, 2011 10:32 pm

chocolateboy wrote:
grolschie wrote:I suspect that the format being sent to my blu-ray player isn't recognised.


You'll have to experiment (on the command line) with different mencoder/ffmpeg output settings and report what works (make sure you play them via #--TRANSCODE--# -> [No encoding]):
...


Many thanks. Is there a script template that I can use to try these different settings please? The default pmsencoder 1.4.0 which output a mpeg2 format seems to work - but ffmpeg seems to decode the sound of some files better for me. Thanks.

Or are you saying to output to a file, and try streaming that file using ps3ms but not using pmsencoder to find a suitable setting?
grolschie
 
Posts: 263
Joined: Thu Jun 10, 2010 7:05 am

Re: Web content will not stream

Postby infidel » Wed Mar 02, 2011 12:28 am

chocolateboy wrote:I haven't tested it, but that should work. The scripts are just plain old (dynamic) Groovy.


Not that this is anything urgent, but just for the record, given test.groovy:
Code: Select all
@Grab(group='org.apache.ant', module='ant', version='[1.8.2,)')
import org.apache.tools.ant.types.Commandline
for (String arg:Commandline.translateCommandline("hello world"))
   System.out.println(arg);

evaluating it in groovy using this script:
Code: Select all
def file = new File("pmsencoder/test.groovy")
def groovy = new GroovyShell(new Binding())
groovy.evaluate(new FileInputStream(file), file.getPath())
outputs:
hello
world

but in debug.log I get
[main] TRACE 17:54:58.239 org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
[main] TRACE 17:54:58.240 /home/y/git/pms-linux-1.21.0/pmsencoder/test.groovy: 1: unable to resolve class org.apache.tools.ant.types.Commandline
[main] TRACE 17:54:58.241 @ line 1, column 1.
[main] TRACE 17:54:58.242 @Grab(group='org.apache.ant', module='ant', version='[1.8.2,)')
[main] TRACE 17:54:58.242 ^


I tried any number of variants of this based on stackoverflow.com examples; all work in groovy but fail in pmsencoder.
infidel
 
Posts: 278
Joined: Sun Aug 15, 2010 4:56 pm

Re: Web content will not stream

Postby chocolateboy » Wed Mar 02, 2011 3:30 am

PMSEncoder 1.5.2 has been released.

This release improves handling for the rtmpdump:// and navix:// protocols. Please consult the release notes before upgrading.
chocolateboy
Project Member
 
Posts: 2580
Joined: Wed Sep 16, 2009 10:05 am

Re: Web content will not stream

Postby chocolateboy » Wed Mar 02, 2011 3:48 am

chocolateboy wrote:I'll post an updated version of those WEB.conf entries (which should work out of the box) after the next release.


http://ps3mediaserver.org/forum/viewtop ... 461#p46461
chocolateboy
Project Member
 
Posts: 2580
Joined: Wed Sep 16, 2009 10:05 am

Re: Web content will not stream

Postby grolschie » Wed Mar 02, 2011 5:13 am

chocolateboy wrote:
grolschie wrote:I suspect that the format being sent to my blu-ray player isn't recognised.



ffmpeg

Try varying the target e.g.:

  • ntsc-dvd
  • pal-dvd

Code: Select all
ffmpeg -i input.vid -target pal-dvd deleteme.tmp


You may have to use a different extension for the output file e.g. .mpg, .mpeg, .m2v, .mp2, .vob &c.


The following works fine:
Code: Select all
ffmpeg -v 0 -y -threads 2 -i <<url>> -target pal-dvd -s 1280x720" test.avi


How do I tell pmsencoder 1.5.2 to use this for web.conf and also Channel plugin please?

I got the "-v 0 -y -threads 2" part from the debug.log. I needed to add the "-s <<resolution>>" part, because the original was 16:9 but it got squished into 4:3 with the "-target pal-dvd".
grolschie
 
Posts: 263
Joined: Thu Jun 10, 2010 7:05 am

Re: Web content will not stream

Postby chocolateboy » Wed Mar 02, 2011 2:03 pm

I got the "-v 0 -y -threads 2" part from the debug.log


Those options are irrelevant in this context, which is why I omitted them from the detailed instructions.

grolschie wrote:I needed to add the "-s <<resolution>>" part, because the original was 16:9 but it got squished into 4:3 with the "-target pal-dvd".


"Squished" is not the same as "doesn't work" and "isn't recognised". Please be clear on what "doesn't work" in future so I don't waste time changing the code to "fix" something that isn't broken.

How do I tell pmsencoder 1.5.2 to use this


Save this in the script directory.

INIT.groovy

Code: Select all
init {
    $FFMPEG_OUT += [ '-s', '1280x720' ]
}
chocolateboy
Project Member
 
Posts: 2580
Joined: Wed Sep 16, 2009 10:05 am

Re: Web content will not stream

Postby grolschie » Wed Mar 02, 2011 7:41 pm

Hello.

"Doesn't work" is indeed the default behaviour for 1.5.x for me. I get a "file is corrupt" or something message when I tried to play any stream on the BDP-S370. Maybe I wasn't clear?

As you suggested, adding "-target dvd-pal" to the commandline, and streaming the resulting file, that worked but squished because DVD resolution is 4:3 and the stream was 16:9.

Adding "-target dvd-pal -s 1280x720" worked and wasn't squished.

I will try the init.groovy soon. Thanks for your help.
grolschie
 
Posts: 263
Joined: Thu Jun 10, 2010 7:05 am

PreviousNext

Return to General Help and Support

Who is online

Users browsing this forum: Yahoo [Bot] and 16 guests