Wild idea

Discuss issues related to PS3 Media Server development (only for programmers)

Wild idea

Postby Raptor399 » Tue Feb 14, 2012 10:15 pm

I was investigating issue #1381 and it I stumbled onto the code in DLNAResource.java where files are being streamed: getInputStream().

What struck me as odd, is that it appears as if seeking in streams seems to only be implemented for MPEG files:

Code: Select all
            if (timeRange.getStartOrZero() > 0 && this instanceof RealFile) {
               fis.skip(MpegUtil.getPossitionForTimeInMpeg(((RealFile) this).getFile(), (int) timeRange.getStartOrZero() ));

It started me thinking: what if we're streaming MKV's to a Popcornhour, or Quicktime Movies to an iPad? Don't they need seeking as well?

Then I got this wild idea: what if we used FFMpeg for our seeking needs? It would be quite like transcoding, but instead copying. It would instantly make all FFMpeg supported formats seekable. :-)
Something like this would do the trick:

Code: Select all
ffmpeg INPUTFILE -ss [time] -c copy OUTPUTFILE

Do you think it would be a good idea to create a StreamUtil.getInputStream(File file, Range.Time range)?
Project Member
Posts: 1916
Joined: Thu Mar 10, 2011 12:06 am

Re: Wild idea

Postby ExSport » Wed Feb 15, 2012 2:35 pm

Not a wild idea at all 8-)
I already mentioned it some time before for chapters when content is streamed.
For now when chapters are used for [no encoding] content, file is played always from start.
Here ffmpeg can help.
Anyway I am able to seek(FF/RW) for files directly suppored by renderer like AVI(DivX,XviD), ts/m2ts, mpeg etc on PanTV (direct streaming).
This TV doesn't support timeseek but when using "time2byteseek" feature, also transcoded files are "seekable". Also remuxed files are seekable.
So what exactly are you pointing out? That FF/RW doesn't work for containers directly supported by renderer like MKV on Popcorn etc.?
I don't know how PMS seeks for native files but it works on PS3 and also on PanTV.
Only problem is transcoding where we have to enable "hidden" time2byteseek conversion for renderers with no timeseek support to achieve FF/RW functionality.
Also when talking about CHAPTERS, we can add this bug to the list...viewtopic.php?f=11&t=11284&p=62765&hilit=1835#p62765
Code: Select all
When chapters used, goto or rewind will start video again from beginning
It is because PMS ignores chapter time offset and didn't count with it so when we will start movie from 30min mark(-ss 1800) and FF/RW or PS3 goto is used, PMS will jump to e.g. 10min(-ss 600) which is replaced with chapter offset so it starts again from -ss 1800. If I used goto to 40min, -ss was 2400 so it started from there but it should start from 1800+2400
Posts: 2191
Joined: Mon Jan 19, 2009 5:40 pm

Return to Developers

Who is online

Users browsing this forum: No registered users and 1 guest