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)?
