Additional SUBs info in TRANSCODE folder+forced SUBs support

General discussion about PS3 Media Server (no support or requests)

Re: r365 bugs and request

Postby ExSport » Thu Nov 05, 2009 7:20 am

Hi Shagrath
Wooooooh, finally we coordinated our minds :mrgreen:
I thought it will not be easily possible to change this behavior so file will not be transcoded when preference will say to disable subs. Ok in this point I am reconciled with it.
But what about other part of my find outs/request? Forced subs behavior(preference)... 8-)
Code: Select all
...About subtitle preference it is described again in last post. There is no way how to load forced subs only or full subs when forced are present. Also when no preferred subs match and *,off is not mentioned then first subs are loaded(first one loaded-alphabetically sorted and forced tag has preference)...
Many thanks
ExSport
 
Posts: 2168
Joined: Mon Jan 19, 2009 5:40 pm

Re: r365 bugs and request

Postby ExSport » Sun Nov 08, 2009 12:50 pm

OK Shagrath, you are forcing me to learn JAVA! ;)
Here is dirty patch for forced subtitles:
Code: Select all
Index: net/pms/encoders/Player.java
===================================================================
--- net/pms/encoders/Player.java   (revision 367)
+++ net/pms/encoders/Player.java   (working copy)
@@ -155,7 +155,7 @@
       if (matchedSub != null && params.sid == null) {
          if (matchedSub.lang != null && matchedSub.lang.equals("off")) {
             PMS.debug(" Disabled the subtitles: " + matchedSub);
-            return;
+            //return;
          } else
             params.sid = matchedSub;
       }
@@ -170,14 +170,30 @@
          if (configuration.getUseSubtitles()) {
             // priority to external subtitles
             for(DLNAMediaSubtitle sub:media.subtitlesCodes) {
-               PMS.debug("Found subtitles track : " + sub);
-               if (sub.file != null) {
-                  PMS.debug("Found external file : " + sub.file.getAbsolutePath());
-                  params.sid = sub;
-                  break;
+               if (matchedSub.lang !=null && matchedSub.lang.equals("off")) {
+                  if (sub.flavor != null && sub.flavor.equalsIgnoreCase("forced")) {
+                     if (Iso639.isCodesMatching(sub.lang,configuration.getMencoderSubLanguages())) {
+                        PMS.debug("Forcing prefered subtitles : " + sub.getLang() + "/" + sub.flavor);
+                        PMS.debug("Forced subtitles track : " + sub);
+                        if (sub.file != null) {
+                           PMS.debug("Found external forced file : " + sub.file.getAbsolutePath());
+                        }
+                     params.sid = sub;
+                     break;
+                     }
+                  }
+                  continue;
+               } else {
+                  PMS.debug("Found subtitles track : " + sub);
+                  if (sub.file != null) {
+                     PMS.debug("Found external file : " + sub.file.getAbsolutePath());
+                     params.sid = sub;
+                     break;
+                  }
                }
-            }
+            }            
          }
+         if (matchedSub.lang !=null && matchedSub.lang.equals("off")) return;
          
          //
          if (params.sid == null) {

How it works?
When Autoload subtitles with the same file name is ENABLED and forced subtitles exist, PMS will load them automatically.
Due to possibility of more forced subtitles in different languages I used Subtitle language priority value for defining which forced subs can be loaded. This value can be set to only one preferred "forced" subs(no "," possible)!

An Example how to configure it(my settings):
Code: Select all
Audio language priority: cs,en,de

Code: Select all
Subtitles language priority: cs

Code: Select all
Audio/subtitles language priority: cs,off;sk,off;en,cs;en,sk;und,off;*,cs;*,sk;en,en;*,en;de,de;*,de;*,off

This settings will try to load forced subs in czech when czech audio exists and if not it will disable subs = cs,off

To make it work you need this naming conventions for tagging subs as forced ones:
Code: Select all
moviename.cs-forced.srt

Loading preferred subs you can achieve by choosing moviename [MEncoder] {External Subtitles} outside #TRANSCODE# folder or by choosing moviename [MEncoder] {External Subtitles} or [MEncoder] file in #TRANSCODE# folder.

When Autoload subtitles with the same file name is DISABLED, PMS doesn't try to find forced subs!!!

BR
ExSport
Attachments
r367-fixed_forced_subs_by_ExSport.zip
r367-Forced_subs_Patch_by_ExSport
(749 Bytes) Downloaded 111 times
ExSport
 
Posts: 2168
Joined: Mon Jan 19, 2009 5:40 pm

Re: r365 bugs and request

Postby ExSport » Sun Nov 08, 2009 1:42 pm

For those who don't know how to compile it by own here is pre-compiled pms.java: http://www.megaupload.com/?d=89TCP51V
Replace your old PMS.java in PMS installation dir with new one (don't unpack this file but copy as is).

This file includes also other patches (included in attached file):
- !!-- Fix 23.976/25fps A/V Mismatch --!! directly visible in #TRANSCODE# folder
- build-in parameter -mc 0 -noskip is replaced with -mc 0.005 -quiet to count with possible audio delays in file(helps with unsynced audio)
- support of loading preferred forced subs
- included Shagrath patch for Samsung TV's (viewtopic.php?f=2&t=2908&p=19051#p19051)
- changes done on latest r367 build
Attachments
r367-fixes_done_by_ExSport.zip
PATCH-r367-optimalizations_done_by_ExSport
(1.97 KiB) Downloaded 112 times
ExSport
 
Posts: 2168
Joined: Mon Jan 19, 2009 5:40 pm

Re: r365 bugs and request-working patch for forced subs support

Postby shagrath » Sun Nov 08, 2009 10:14 pm

wow, thanks, and Java is fun to learn you know :)
shagrath
Project Lead
 
Posts: 2667
Joined: Wed Jan 14, 2009 1:39 pm

Re: r365 bugs and request-working patch for forced subs support

Postby ExSport » Mon Nov 09, 2009 6:22 pm

:mrgreen:
Now last question to solve and it is how to force folder !!-- Fix 23.976/25fps A/V Mismatch --!! to be at first place in #TRANSCODE# folder... 8-)
Could you help? Thx ;)
ExSport
 
Posts: 2168
Joined: Mon Jan 19, 2009 5:40 pm

Re: r365 bugs and request-working patch for forced subs support

Postby Stonga » Sat Nov 14, 2009 8:06 pm

Where do I put the .patch files?
Stonga
 
Posts: 22
Joined: Sun Oct 25, 2009 5:10 pm

Re: r365 bugs and request-working patch for forced subs support

Postby ExSport » Sat Nov 14, 2009 8:11 pm

Nowhere.
Patch file is for patching source code and then you need this source code compile.
Because that there is already compiled file named pms.java ;)
ExSport
 
Posts: 2168
Joined: Mon Jan 19, 2009 5:40 pm

Re: r365 bugs and request-working patch for forced subs support

Postby Stonga » Sat Nov 14, 2009 8:13 pm

That was fast.. Thanks.

Disregard my private message to you then. :)

One more thing. When I put your PMS.jar file in the installation folder, the version nr of ps3 media server change to 1.20.. What's that about?
And it's only half the size of the original.

Edit: I can't see the a/v fix thing inside the transcode folder. It's not in the 'Video Settings' folder either. I never have been able to with any of the files on this forum.
Stonga
 
Posts: 22
Joined: Sun Oct 25, 2009 5:10 pm

Re: r365 bugs and request-working patch for forced subs support

Postby ExSport » Sat Nov 14, 2009 8:48 pm

It is half size because of better compression.
Version info depends on version defined in source code on google code. In reality it is r367 = v1.20beta
About not visible A/V Fix in #TRANSCODE# folder: you need to rewrite original pms.java file in install directory and make sure you don't unpack this file there but copy as is only.
Also check if process javaw.exe is not "hanged" in memory before you start PMS again.
ExSport
ExSport
 
Posts: 2168
Joined: Mon Jan 19, 2009 5:40 pm

Re: r365 bugs and request-working patch for forced subs support

Postby Stonga » Sat Nov 14, 2009 8:59 pm

ExSport wrote:It is half size because of better compression.
Version info depends on version defined in source code on google code. In reality it is r367 = v1.20beta
About not visible A/V Fix in #TRANSCODE# folder: you need to rewrite original pms.java file in install directory and make sure you don't unpack this file there but copy as is only.
Also check if process javaw.exe is not "hanged" in memory before you start PMS again.
ExSport


If you mean overwrite the original PMS.jar file with the new one when you say rewrite, then yes.. That's what I'm doing.
Javaw.exe is not hanging in memory before I restart PMS.

I don't understand. I've never been able to access the A/V Fix before. And I'm following the instructions by the letter.
I'm running build r366+update.jar.
Stonga
 
Posts: 22
Joined: Sun Oct 25, 2009 5:10 pm

PreviousNext

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 2 guests