Sony BDP-S370 (DLNA-compatible with new firmware M03.R.567)

Discuss alternative media renderers (not PS3) supported by PS3 Media Server (e.g. Xbox 360, TVs &c.)

Re: Sony BDP-S370 (DLNA-compatible with new firmware M03.R.5

Postby pixelfougb » Sat Dec 04, 2010 12:27 am

grolschie wrote:The patch is here:
viewtopic.php?f=15&t=6930&start=180#p38045

It's a source code patch, so it needs the entire source tree downloaded, not that .exe file.



thanks a lot !
pixelfougb
 
Posts: 32
Joined: Fri Dec 03, 2010 7:08 pm
Location: France

Re: Sony BDP-S370 (DLNA-compatible with new firmware M03.R.5

Postby grolschie » Sat Dec 04, 2010 12:35 am

Actually, just re-reading your post, this patch is specifically for the BDP-Sx70 players, so might not work with a digital photoframe.
grolschie
 
Posts: 263
Joined: Thu Jun 10, 2010 7:05 am

Re: Sony BDP-S370 (DLNA-compatible with new firmware M03.R.5

Postby pixelfougb » Sat Dec 04, 2010 12:50 am

no , it's ok for digital frame with a profile like Streamium.conf. i work on it , i have picture , the file kodak.conf , it's ok for music and photos and lag for video ( it seems wifi g lag). i work with svn . i compil the projet this night.
pixelfougb
 
Posts: 32
Joined: Fri Dec 03, 2010 7:08 pm
Location: France

Re: Sony BDP-S370 (DLNA-compatible with new firmware M03.R.5

Postby grolschie » Sat Dec 04, 2010 1:01 am

You might be better to simply edit the renderer .conf file, because this patch fixes where the files won't even play on these particular players. Do you know what file formats the frame supports? If so, then tell it to stream those rather than transcode perhaps.
grolschie
 
Posts: 263
Joined: Thu Jun 10, 2010 7:05 am

Re: Sony BDP-S370 (DLNA-compatible with new firmware M03.R.5

Postby pixelfougb » Sat Dec 04, 2010 2:27 pm

hello grolschie,
for my kodak , 1 just edit a render.conf for ps3 work with my new renders. 1 also make picture for my renders then 1 must compile the projet
for my blue-ray sony , i must includ your patch , a render profile and a picture in the last distrib. and re-compil the projet.

i create a topic for my kodak picture frame . how use the transcode parameters ?

thanks for all your answer.
pixelfougb
 
Posts: 32
Joined: Fri Dec 03, 2010 7:08 pm
Location: France

Re: Sony BDP-S370 (DLNA-compatible with new firmware M03.R.5

Postby naps1saps » Mon Dec 06, 2010 2:29 am

For some reason the patch will not patch for me. It gives me an error:

c:\Users\gdeeth\Desktop\ps3mediaserver\ps3mediaserver>patch -p0 < ps3ms-410-content-range.patch
patching file net/pms/configuration/RendererConfiguration.java
Hunk #1 FAILED at 305.
1 out of 1 hunk FAILED -- saving rejects to file net/pms/configuration/RendererConfiguration.java.rej
patching file net/pms/dlna/DLNAMediaInfo.java
patch: **** malformed patch at line 20: public class DLNAMediaInfo implements Cloneable {

I'm using this code as the patch:
Code: Select all
--- net/pms/configuration/RendererConfiguration.java   2010-10-06 11:52:33.968750000 +1300
+++ net/pms/configuration/RendererConfiguration.java   2010-10-03 08:47:26.515625000 +1300
@@ -305,6 +305,12 @@ public class RendererConfiguration {
      return getBoolean(SHOW_DVD_TITLE_DURATION, false);
   }   
   
+      private static final String CUSTOM_MENCODER_OPTIONS="CustomMencoderOptions";
+
+   public String getCustomMencoderOptions() {
+      return getString(CUSTOM_MENCODER_OPTIONS, null);
+   }
+   
   private RendererConfiguration() throws ConfigurationException {
      this(null);
   }

--- net/pms/dlna/DLNAMediaInfo.java   2010-10-06 11:52:35.515625000 +1300
+++ net/pms/dlna/DLNAMediaInfo.java   2010-10-06 11:59:02.734375000 +1300
@@ -68,7 +68,8 @@ import org.jaudiotagger.tag.Tag;
public class DLNAMediaInfo implements Cloneable {
     
   public static final long ENDFILE_POS = 99999475712L;
-   public static final long TRANS_SIZE = 100000000000L;
+   public static long TRANS_SIZE = 100000000000L;
+
   //private static SimpleDateFormat sdfExif = new SimpleDateFormat("yyyy:MM:dd HH:mm:ss");
   
   // stored in database

--- net/pms/dlna/DLNAResource.java   2010-10-06 11:52:35.453125000 +1300
+++ net/pms/dlna/DLNAResource.java   2010-10-01 18:51:46.265625000 +1300
@@ -48,6 +48,7 @@ import net.pms.external.StartStopListene
import net.pms.formats.Format;
import net.pms.io.OutputParams;
import net.pms.io.ProcessWrapper;
+import net.pms.io.SizeLimitInputStream;
import net.pms.network.HTTPResource;
import net.pms.util.FileUtil;
import net.pms.util.ImagesUtil;
@@ -725,7 +726,12 @@ public abstract class DLNAResource exten
                  }
                  else
                     dlnaspec = "DLNA.ORG_PN=" + getMPEG_PS_PALLocalizedValue(c);
-            } else if (mime.equals("image/jpeg"))
+                        }
+         //**HACK**
+                  else if (mime.equals("video/vnd.dlna.mpeg-tts"))
+                  dlnaspec = "DLNA.ORG_PN=" + getMPEG_TS_SD_EULocalizedValue(c);
+         //**HACK**
+                 else if (mime.equals("image/jpeg"))
               dlnaspec = "DLNA.ORG_PN=JPEG_LRG";
            else if (mime.equals("audio/mpeg"))
               dlnaspec = "DLNA.ORG_PN=MP3";
@@ -935,6 +941,16 @@ public abstract class DLNAResource exten
            ((IPushOutput) this).push(out);
            if (low > 0 && fis != null)
               fis.skip(low);
+            // WoH
+            if(high > low && fis != null)
+            {
+               long bytes = (high - (low < 0 ? 0 : low)) + 1;
+               
+               PMS.debug("Using size-limiting stream (" + bytes + " bytes)");
+               SizeLimitInputStream slis = new SizeLimitInputStream(fis, bytes);
+               return slis;
+            }
+            // /WoH
            return fis;
         }
         
@@ -948,6 +964,15 @@ public abstract class DLNAResource exten
            fis = getInputStream();
         if (low > 0 && fis != null)
            fis.skip(low);
+         // WoH
+         if(high > low && fis != null)
+         {
+            long bytes = (high - (low < 0 ? 0 : low)) + 1;
+           
+            PMS.debug("Using size-limiting stream (" + bytes + " bytes)");
+            fis = new SizeLimitInputStream(fis, bytes);
+         }
+         // /WoH
         if (timeseek != 0 && this instanceof RealFile)
            fis.skip(MpegUtil.getPossitionForTimeInMpeg(((RealFile)this).file, (int) timeseek));
         return fis;

--- net/pms/dlna/RealFile.java   2010-10-06 11:52:35.437500000 +1300
+++ net/pms/dlna/RealFile.java   2010-10-06 11:57:46.359375000 +1300
@@ -273,6 +273,16 @@ public class RealFile extends DLNAResour
   }

   public long length() {
+   
+      String fileName = file.getName().toLowerCase();
+         
+      if (fileName.endsWith(".avi") || fileName.endsWith(".divx") || fileName.endsWith(".mpeg")
+            || fileName.endsWith(".mpg") || fileName.endsWith(".mp3")){
+          DLNAMediaInfo.TRANS_SIZE = 100000000000L;
+      } else {
+         DLNAMediaInfo.TRANS_SIZE = -1L;
+      }
+   
      if (player != null && player.type() != Format.IMAGE)
         return DLNAMediaInfo.TRANS_SIZE;
      else if (media != null && media.mediaparsed)

--- net/pms/dlna/WebStream.java   2010-10-06 11:52:35.500000000 +1300
+++ net/pms/dlna/WebStream.java   2010-10-06 12:00:18.953125000 +1300
@@ -54,6 +53,7 @@ public class WebStream extends DLNAResou
   }

   public long length() {
+      DLNAMediaInfo.TRANS_SIZE = -1L;
      return DLNAMediaInfo.TRANS_SIZE;
   }


--- net/pms/encoders/MEncoderVideo.java   2010-10-06 11:52:33.468750000 +1300
+++ net/pms/encoders/MEncoderVideo.java   2010-10-03 08:55:28.500000000 +1300
@@ -1080,9 +1080,13 @@ private JTextField mencoder_ass_scale;
      }
     
      String add = ""; //$NON-NLS-1$
-      if (configuration.getMencoderDecode() == null || configuration.getMencoderDecode().indexOf("-lavdopts") == -1) { //$NON-NLS-1$
+      if (params.mediaRenderer.getCustomMencoderOptions() != null) {
+               if (params.mediaRenderer.getCustomMencoderOptions().indexOf("-lavdopts") == -1) //$NON-NLS-1$
+            add = " -lavdopts debug=0"; //$NON-NLS-1$
+      }
+      else if (configuration.getMencoderDecode() == null || configuration.getMencoderDecode().indexOf("-lavdopts") == -1) //$NON-NLS-1$
         add = " -lavdopts debug=0"; //$NON-NLS-1$
-      }
+     
     
      String alternativeCodec = "";//"-ac ffac3,ffdca, ";  //$NON-NLS-1$
      if (dvd)
@@ -1093,7 +1097,8 @@ private JTextField mencoder_ass_scale;
         channels = wmv?2:CodecUtil.getRealChannelCount(configuration, params.aid);
      PMS.debug("channels=" + channels);

-      StringTokenizer st = new StringTokenizer(alternativeCodec + "-channels " + channels + " " + configuration.getMencoderDecode() + add, " "); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+      StringTokenizer st = new StringTokenizer(alternativeCodec + "-channels " + channels + " " + ((params.mediaRenderer.getCustomMencoderOptions()!=null)?(params.mediaRenderer.getCustomMencoderOptions()):configuration.getMencoderDecode()) + add, " "); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+
      overridenMainArgs = new String [st.countTokens()];
      int i = 0;
      boolean next = false;

--- net/pms/io/SizeLimitInputStream.java   1970-01-01 13:00:00.000000000 +1300
+++ net/pms/io/SizeLimitInputStream.java   2010-10-01 18:00:00.265625000 +1300
@@ -0,0 +1,252 @@
+package net.pms.io;
+
+/*
+ * Input stream wrapper with a byte limit.
+ * Copyright (C) 2004 Stephen Ostermiller
+ * http://ostermiller.org/contact.pl?regarding=Java+Utilities
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * See COPYING.TXT for details.
+ */
+
+import java.io.*;
+
+/**
+ * An input stream wrapper that will read only a set number of bytes from the
+ * underlying stream.
+ *
+ * @author Stephen Ostermiller
+ *         http://ostermiller.org/contact.pl?regarding=Java+Utilities
+ * @since ostermillerutils 1.04.00
+ */
+public class SizeLimitInputStream extends InputStream {
+
+   /**
+    * The input stream that is being protected. All methods should be forwarded
+    * to it, after checking the size that has been read.
+    *
+    * @since ostermillerutils 1.04.00
+    */
+   protected InputStream in;
+
+   /**
+    * The number of bytes to read at most from this Stream. Read methods should
+    * check to ensure that bytesRead never exceeds maxBytesToRead.
+    *
+    * @since ostermillerutils 1.04.00
+    */
+   protected long maxBytesToRead = 0;
+
+   /**
+    * The number of bytes that have been read from this stream. Read methods
+    * should check to ensure that bytesRead never exceeds maxBytesToRead.
+    *
+    * @since ostermillerutils 1.04.00
+    */
+   protected long bytesRead = 0;
+
+   /**
+    * The number of bytes that have been read from this stream since mark() was
+    * called.
+    *
+    * @since ostermillerutils 1.04.00
+    */
+   protected long bytesReadSinceMark = 0;
+
+   /**
+    * The number of bytes the user has request to have been marked for reset.
+    *
+    * @since ostermillerutils 1.04.00
+    */
+   protected long markReadLimitBytes = -1;
+
+   /**
+    * Get the number of bytes actually read from this stream.
+    *
+    * @return number of bytes that have already been taken from this stream.
+    *
+    * @since ostermillerutils 1.04.00
+    */
+   public long getBytesRead() {
+      return bytesRead;
+   }
+
+   /**
+    * Get the maximum number of bytes left to read before the limit (set in the
+    * constructor) is reached.
+    *
+    * @return The number of bytes that (at a maximum) are left to be taken from
+    *         this stream.
+    *
+    * @since ostermillerutils 1.04.00
+    */
+   public long getBytesLeft() {
+      return maxBytesToRead - bytesRead;
+   }
+
+   /**
+    * Tell whether the number of bytes specified in the constructor have been
+    * read yet.
+    *
+    * @return true iff the specified number of bytes have all been read.
+    *
+    * @since ostermillerutils 1.04.00
+    */
+   public boolean allBytesRead() {
+      return getBytesLeft() == 0;
+   }
+
+   /**
+    * Get the number of total bytes (including bytes already read) that can be
+    * read from this stream (as set in the constructor).
+    *
+    * @return Maximum bytes that can be read until the size limit runs out
+    *
+    * @since ostermillerutils 1.04.00
+    */
+   public long getMaxBytesToRead() {
+      return maxBytesToRead;
+   }
+
+   /**
+    * Create a new size limit input stream from another stream given a size
+    * limit.
+    *
+    * @param in
+    *            The input stream.
+    * @param maxBytesToRead
+    *            the max number of bytes to allow to be read from the
+    *            underlying stream.
+    *
+    * @since ostermillerutils 1.04.00
+    */
+   public SizeLimitInputStream(InputStream in, long maxBytesToRead) {
+      this.in = in;
+      this.maxBytesToRead = maxBytesToRead;
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   @Override
+   public int read() throws IOException {
+      if (bytesRead >= maxBytesToRead) {
+         return -1;
+      }
+      int b = in.read();
+      if (b != -1) {
+         bytesRead++;
+         bytesReadSinceMark++;
+      }
+      return b;
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   @Override
+   public int read(byte[] b) throws IOException {
+      return this.read(b, 0, b.length);
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   @Override
+   public int read(byte[] b, int off, int len) throws IOException {
+      if (bytesRead >= maxBytesToRead) {
+         return -1;
+      }
+      long bytesLeft = getBytesLeft();
+      if (len > bytesLeft) {
+         len = (int) bytesLeft;
+      }
+      int bytesJustRead = in.read(b, off, len);
+      bytesRead += bytesJustRead;
+      bytesReadSinceMark += bytesJustRead;
+      return bytesJustRead;
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   @Override
+   public long skip(long n) throws IOException {
+      if (bytesRead >= maxBytesToRead) {
+         return -1;
+      }
+      long bytesLeft = getBytesLeft();
+      if (n > bytesLeft) {
+         n = bytesLeft;
+      }
+      return in.skip(n);
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   @Override
+   public int available() throws IOException {
+      int available = in.available();
+      long bytesLeft = getBytesLeft();
+      if (available > bytesLeft) {
+         available = (int) bytesLeft;
+      }
+      return available;
+   }
+
+   /**
+    * Close this stream and underlying streams. Calling this method may make
+    * data on the underlying stream unavailable.
+    * <p>
+    * Consider wrapping this stream in a NoCloseStream so that clients can call
+    * close() with no effect.
+    *
+    * @since ostermillerutils 1.04.00
+    */
+   @Override
+   public void close() throws IOException {
+      in.close();
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   @Override
+   public void mark(int readlimit) {
+      if (in.markSupported()) {
+         markReadLimitBytes = readlimit;
+         bytesReadSinceMark = 0;
+         in.mark(readlimit);
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   @Override
+   public void reset() throws IOException {
+      if (in.markSupported() && bytesReadSinceMark <= markReadLimitBytes) {
+         bytesRead -= bytesReadSinceMark;
+         in.reset();
+         bytesReadSinceMark = 0;
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   @Override
+   public boolean markSupported() {
+      return in.markSupported();
+   }
+}
\ No newline at end of file

--- net/pms/network/RequestV2.java   2010-10-06 12:05:36.765625000 +1300
+++ net/pms/network/RequestV2.java   2010-10-06 12:12:34.406250000 +1300
@@ -227,6 +227,9 @@ public class RequestV2 extends HTTPResou
                     highRange = totalsize -1;
                  }
                  output.setHeader(HttpHeaders.Names.CONTENT_RANGE, "bytes " + lowRange + "-" + highRange + "/" +totalsize);
+                  // WoH
+                  CLoverride = totalsize;
+                  // /WoH
               }
               if (contentFeatures != null)
                  output.setHeader("ContentFeatures.DLNA.ORG", files.get(0).getDlnaContentFeatures());
@@ -509,17 +512,17 @@ public class RequestV2 extends HTTPResou
           }
      } else if (inputStream != null) {
         if (CLoverride > -1) {
-            if (lowRange > 0 && highRange > 0) {
-               output.setHeader(HttpHeaders.Names.CONTENT_LENGTH, "" + (highRange-lowRange+1));
+            if (true) {
+                         output.setHeader(HttpHeaders.Names.CONTENT_LENGTH, "-1");//**HACK**
            } else if (CLoverride != DLNAMediaInfo.TRANS_SIZE) // since 2.50, it's wiser not to send an arbitrary Content length,
                                                   // as the PS3 displays a network error and asks the last seconds of the transcoded video
                                                   // deprecated since the "-1" size sent anyway
-               output.setHeader(HttpHeaders.Names.CONTENT_LENGTH, "" + CLoverride);
+               output.setHeader(HttpHeaders.Names.CONTENT_LENGTH, "-1");//**HACK**
         }
         else {
            int cl = inputStream.available();
            PMS.debug("Available Content-Length: " + cl);
-            output.setHeader(HttpHeaders.Names.CONTENT_LENGTH, "" + cl);
+            output.setHeader(HttpHeaders.Names.CONTENT_LENGTH, "-1");//**HACK**
         }
         
         if (timeseek > 0 && dlna != null) {



I tried Patter's binary on page 19 but most of my video files will not play. Half are .mkv and the other half are .mp4. none of the .mkv's will play but half of the mp4's will play.

My HDTV MPG-TS recordings are not always 100% and the PS3 is very stable playing them but the BDP-S570 will freeze at null pockets or skip to the next file when fast forwarding. Very annoying. My HD video rendering @ 20Mbps stutter on the BDP when the ps3 plays them fine.

Hopefully this patch will solve some of this but I can't get it patched. It would be very nice if someone would patch it then have a download available for us.

SHOULD I TRY TO MODIFY THE FILES MANUALLY?
naps1saps
 
Posts: 3
Joined: Mon Dec 06, 2010 2:08 am

Re: Sony BDP-S370 (DLNA-compatible with new firmware M03.R.5

Postby grolschie » Mon Dec 06, 2010 7:01 am

I have edited my old post and replaced the patch text with a link to a .zip file.
grolschie
 
Posts: 263
Joined: Thu Jun 10, 2010 7:05 am

Re: Sony BDP-S370 (DLNA-compatible with new firmware M03.R.5

Postby naps1saps » Tue Dec 07, 2010 2:41 am

The patched build seems to work better but still needs some work. Most of my files will play but my HD video recordings are flakey when fast forwarding and sometimes do not play all the way through. Also my 30Mbit HD renderings from video editing stutter when playing them except on USB. It is not the bit rate or the computer because higher bit rates play just fine like 60Mbit files and the CPU is not overloaded. Most MP4 files will freeze the player causing it to restart unless you use the Transcoded version.

One thing that is really really bugging me is that when a new file is put in the share folder, the list does not update on the bdp unless you go into the computer and close the server then open it again. The list updates on the PS3 just fine when you exit the list and go back in. It seems as though the communication going from the bdp to the server is not being understood correctly. I might do some reasearch this winter break to see if I can help any. I've been taking Java programming classes and have done some work with API's before.
naps1saps
 
Posts: 3
Joined: Mon Dec 06, 2010 2:08 am

Re: Sony BDP-S370 (DLNA-compatible with new firmware M03.R.5

Postby grolschie » Tue Dec 07, 2010 4:59 am

Are you using ethernet? I can stream a AVC 1080p (33mbit?) movie trailer no problems via WiFi, no stutter. The file is only 158MB big though.

The patch could be made more usable by testing and letting the changes affect only BDP players.
grolschie
 
Posts: 263
Joined: Thu Jun 10, 2010 7:05 am

Re: Sony BDP-S370 (DLNA-compatible with new firmware M03.R.5

Postby naps1saps » Tue Dec 07, 2010 8:09 am

I can try that if I knew what I was doing exactly. I also have a ps3 to check for errors. The file is 1080p MPEG2 35Mbit Max VBR 1:16@231MB
naps1saps
 
Posts: 3
Joined: Mon Dec 06, 2010 2:08 am

PreviousNext

Return to Alternative Media Renderers

Who is online

Users browsing this forum: Google [Bot] and 6 guests