I got it working in way without external plugin and without reverting back temporal setting of forced 25fps.
So 50% happy because original code have to be modified = plugin version not possible.
Thanks
At the beginning I tried to do it as plugin and also in way:
- when "special" folder is left, temporal forced 25fps is reseted/reverted
- when forced 25fps is enabled by virtual file(for changing settings) in TRANSCODE subfolders, it will be reverted back when actual folder is left.
But better something than nothing
Many thanks again for help
New code without plugin support:- Code: Select all
Index: FileTranscodeVirtualFolder.java
===================================================================
--- FileTranscodeVirtualFolder.java (revision 356)
+++ FileTranscodeVirtualFolder.java (working copy)
@@ -20,6 +20,7 @@
import net.pms.PMS;
import net.pms.dlna.virtual.VirtualFolder;
+import net.pms.dlna.virtual.VirtualVideoAction;
import net.pms.encoders.MEncoderVideo;
import net.pms.encoders.Player;
import net.pms.encoders.TSMuxerVideo;
@@ -41,6 +42,16 @@
if (child.ext.getProfiles() != null) {
DLNAResource ref = child;
Player tsMuxer = null;
+ DLNAResource virtfix = child;
+ virtfix = new VirtualVideoAction(" !!-- FIX A/V Sync --!!", PMS.getConfiguration().isMencoderForceFps()) { //$NON-NLS-1$
+ public boolean enable() {
+ PMS.getConfiguration().setMencoderForceFps(!PMS.getConfiguration().isMencoderForceFps());
+ PMS.getConfiguration().setTsmuxerForceFps(PMS.getConfiguration().isMencoderForceFps());
+ return PMS.getConfiguration().isMencoderForceFps();
+ }
+ };
+ children.add(virtfix);
+ virtfix.parent = this;
for(int i=0;i<child.ext.getProfiles().size();i++) {
Player pl = PMS.get().getPlayer(child.ext.getProfiles().get(i), child.ext);
if (pl !=null && !child.player.equals(pl)) {
- Code: Select all
Index: net/pms/encoders/MEncoderVideo.java
===================================================================
--- net/pms/encoders/MEncoderVideo.java (revision 356)
+++ net/pms/encoders/MEncoderVideo.java (working copy)
@@ -1239,10 +1239,10 @@
cmdArray[cmdArray.length-8] = "-quiet"; //$NON-NLS-1$
cmdArray[cmdArray.length-7] = "-quiet"; //$NON-NLS-1$
- if (configuration.isMencoderForceFps()) {
- cmdArray[cmdArray.length-8] = "-fps"; //$NON-NLS-1$
- cmdArray[cmdArray.length-7] = "24000/1001"; //$NON-NLS-1$
- }
+// if (configuration.isMencoderForceFps()) {
+// cmdArray[cmdArray.length-8] = "-fps"; //$NON-NLS-1$
+// cmdArray[cmdArray.length-7] = "24000/1001"; //$NON-NLS-1$
+// }
cmdArray[cmdArray.length-6] = "-ofps"; //$NON-NLS-1$
cmdArray[cmdArray.length-5] = "24000/1001"; //$NON-NLS-1$
String frameRate = null;
@@ -1252,7 +1252,7 @@
if (frameRate != null) {
cmdArray[cmdArray.length-5] = frameRate;
if (configuration.isMencoderForceFps())
- cmdArray[cmdArray.length-7] = cmdArray[cmdArray.length-5];
+ cmdArray[cmdArray.length-5] = "25";
}
if (subString != null && !configuration.isMencoderDisableSubs() && !avisynth()) {
- Code: Select all
Index: net/pms/encoders/TSMuxerVideo.java
===================================================================
--- net/pms/encoders/TSMuxerVideo.java (revision 356)
+++ net/pms/encoders/TSMuxerVideo.java (working copy)
@@ -392,6 +392,9 @@
String videoparams = "level=4.1, insertSEI, contSPS, track=1"; //$NON-NLS-1$
if (this instanceof TsMuxerAudio)
videoparams = "track=224"; //$NON-NLS-1$
+ if (configuration.isTsmuxerForceFps()) {
+ fps = "25";
+ }
pw.println(videoType + ", \"" + ffVideoPipe.getOutputPipe() + "\", " + (fps!=null?("fps=" +fps + ", "):"") + videoparams); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
}
if (ffAudioPipe != null && ffAudioPipe.length == 1) {
EDIT:Precompiled pms.jar file (used latest r356) (packed with
http://www.7zip.org) :
http://www.megaupload.com/?d=EHYXE5UL