Permalink
Browse files

Added VLC support by merging pull request ps3mediaserver/master#83 (t…

…hanks, LordQuackstar!)
  • Loading branch information...
1 parent a28af8a commit e3f4d4edd88016746bbcdf9635f969fda15c0dda @Raptor399 Raptor399 committed Mar 29, 2013
View
@@ -23,6 +23,8 @@ Changelog:
- rescale videos larger than the renderer's max height/width
- Updated to use "wmav2" codec (#1583)
FFmpeg Audio: support all TranscodeAudio profiles
+ VLC:
+ - Added support for VLC as engine (thanks, LordQuackstar!)
Language updates:
- Updated Brazilian translation (thanks, Bruno Arueira!)
- Updated Catalan translation (thanks, oscaroe!)
@@ -385,9 +385,10 @@ folders =
# Transcoder engines
# GUI Option: Ordered list of engines (selector)
-# System generates list of available engines, list depends on host.
-# XXX Can be empty, which overrides the default value.
-# Default: "mencoder,avsmencoder,tsmuxer,ffmpegvideo,ffmpegaudio,mplayeraudio,tsmuxeraudio,ffmpegwebvideo,vlcvideo,mencoderwebvideo,mplayervideodump,mplayerwebaudio,vlcaudio,ffmpegdvrmsremux,rawthumbs"
+# The exact list of available engines depends on the server.
+# Warning: the value can be empty, which overrides the default value and will
+# disable all engines.
+# Default: "mencoder,avsmencoder,tsmuxer,ffmpegvideo,vlctranscoder,ffmpegaudio,mplayeraudio,tsmuxeraudio,ffmpegwebvideo,vlcvideo,mencoderwebvideo,mplayervideodump,mplayerwebaudio,vlcaudio,ffmpegdvrmsremux,rawthumbs"
# engines =
@@ -793,6 +794,46 @@ audio_resample =
# Default: null
ffmpeg_video_custom_options =
+# ----------------------------------------------------------------------------
+# Transcoder Settings: VLC
+# ----------------------------------------------------------------------------
+
+# GUI Option: Enable audio sync
+# Default: false
+#VLC_audio_sync_enabled =
+
+# No GUI option. Whether or not to display subtitles.
+# Default: true
+#VLC_subtitle_enabled =
+
+# GUI Option: Audio Language Priority
+# Default: jpn,eng
+#VLC_audio_language_priority =
+
+# GUI Option: override detection
+# Default: false
+#VLC_sample_rate_override =
+
+# GUI Option: Audio Sample Rate
+# Default: 48000
+#VLC_sample_rate =
+
+# GUI Option: Video scale
+# Default: 1.0
+#VLC_scale =
+
+# GUI Option: Subtitle Language Priority
+# Default: eng,jpn
+#VLC_subtitle_language_priority =
+
+# GUI Option: Enable experimental codecs
+# Default: false
+# VLC_use_experimental_codecs =
+
+# GUI Option: Use hardware acceleration
+# Default: false
+#VLC_use_HW_acceleration =
+
# ============================================================================
# Additional settings
@@ -47,6 +47,8 @@
import net.pms.util.PropertiesUtil;
import net.pms.util.SystemErrWrapper;
import net.pms.util.TaskRunner;
+import net.pms.util.Version;
+
import org.apache.commons.configuration.ConfigurationException;
import org.apache.commons.configuration.event.ConfigurationEvent;
import org.apache.commons.configuration.event.ConfigurationListener;
@@ -403,8 +405,19 @@ public void configurationChanged(ConfigurationEvent event) {
}
}
- if (registry.getVlcv() != null && registry.getVlcp() != null) {
- LOGGER.info("Found VideoLAN version " + registry.getVlcv() + " at: " + registry.getVlcp());
+ // Check if VLC is found
+ String vlcVersion = registry.getVlcVersion();
+ String vlcPath = registry.getVlcPath();
+
+ if (vlcVersion != null && vlcPath != null) {
+ LOGGER.info("Found VideoLAN version " + vlcVersion + " at: " + vlcPath);
+
+ Version vlc = new Version(vlcVersion);
+ Version requiredVersion = new Version("2.0.2");
+
+ if (vlc.compareTo(requiredVersion) <= 0) {
+ LOGGER.error("Only VLC versions 2.0.2 and above are supported");
+ }
}
//check if Kerio is installed
@@ -174,7 +174,16 @@
private static final String KEY_UUID = "uuid";
private static final String KEY_VIDEOTRANSCODE_START_DELAY = "key_videotranscode_start_delay";
private static final String KEY_VIRTUAL_FOLDERS = "vfolders";
-
+ private static final String KEY_VLC_USE_HW_ACCELERATION = "VLC_use_HW_acceleration";
+ private static final String KEY_VLC_USE_EXPERIMENTAL_CODECS = "VLC_use_experimental_codecs";
+ private static final String KEY_VLC_AUDIO_SYNC_ENABLED = "VLC_audio_sync_enabled";
+ private static final String KEY_VLC_SUBTITLE_ENABLED = "VLC_subtitle_enabled";
+ private static final String KEY_VLC_AUDIO_PRI = "VLC_audio_language_priority";
+ private static final String KEY_VLC_SUBTITLE_PRI = "VLC_subtitle_language_priority";
+ private static final String KEY_VLC_SCALE = "VLC_scale";
+ private static final String KEY_VLC_SAMPLE_RATE_OVERRIDE = "VLC_sample_rate_override";
+ private static final String KEY_VLC_SAMPLE_RATE = "VLC_sample_rate";
+
// the name of the subdirectory under which PMS config files are stored for this build (default: PMS).
// see Build for more details
private static final String PROFILE_DIRECTORY_NAME = Build.getProfileDirectoryName();
@@ -1797,7 +1806,7 @@ public void setEnginesAsList(ArrayList<String> enginesAsList) {
ConfigurationUtil.getPossiblyBlankConfigurationString(
configuration,
KEY_ENGINES,
- "mencoder,avsmencoder,tsmuxer,ffmpegvideo,ffmpegaudio,mplayeraudio,tsmuxeraudio,ffmpegwebvideo,vlcvideo,mencoderwebvideo,mplayervideodump,mplayerwebaudio,vlcaudio,ffmpegdvrmsremux,rawthumbs"
+ "mencoder,avsmencoder,tsmuxer,ffmpegvideo,vlctranscoder,ffmpegaudio,mplayeraudio,tsmuxeraudio,ffmpegwebvideo,vlcvideo,mencoderwebvideo,mplayervideodump,mplayerwebaudio,vlcaudio,ffmpegdvrmsremux,rawthumbs"
)
);
@@ -2325,4 +2334,74 @@ public String getTranscodeFolderName() {
public void setTranscodeFolderName(String name) {
configuration.setProperty(KEY_TRANSCODE_FOLDER_NAME, name);
}
+
+ public boolean isVlcUseHardwareAccel() {
+ return getBoolean(KEY_VLC_USE_HW_ACCELERATION, false);
+ }
+
+ public void setVlcUseHardwareAccel(boolean b) {
+ configuration.setProperty(KEY_VLC_USE_HW_ACCELERATION, b);
+ }
+
+ public boolean isVlcExperimentalCodecs() {
+ return getBoolean(KEY_VLC_USE_EXPERIMENTAL_CODECS, false);
+ }
+ public void setVlcExperimentalCodecs(boolean b) {
+ configuration.setProperty(KEY_VLC_USE_EXPERIMENTAL_CODECS, b);
+ }
+
+ public boolean isVlcAudioSyncEnabled() {
+ return getBoolean(KEY_VLC_AUDIO_SYNC_ENABLED, false);
+ }
+
+ public void setVlcAudioSyncEnabled(boolean b) {
+ configuration.setProperty(KEY_VLC_AUDIO_SYNC_ENABLED, b);
+ }
+
+ public boolean isVlcSubtitleEnabled() {
+ return getBoolean(KEY_VLC_SUBTITLE_ENABLED, true);
+ }
+
+ public void setVlcSubtitleEnabled(boolean b) {
+ configuration.setProperty(KEY_VLC_SUBTITLE_ENABLED, b);
+ }
+
+ public String getVlcAudioPri() {
+ return getString(KEY_VLC_AUDIO_PRI, Messages.getString("VlcTrans.7"));
+ }
+ public void setVlcAudioPri(String text) {
+ configuration.setProperty(KEY_VLC_AUDIO_PRI, text);
+ }
+
+ public String getVlcSubtitlePri() {
+ return getString(KEY_VLC_SUBTITLE_PRI, Messages.getString("VlcTrans.9"));
+ }
+
+ public void setVlcSubtitlePri(String text) {
+ configuration.setProperty(KEY_VLC_SUBTITLE_PRI, text);
+ }
+
+ public String getVlcScale() {
+ return getString(KEY_VLC_SCALE, "1.0");
+ }
+
+ public void setVlcScale(String value) {
+ configuration.setProperty(KEY_VLC_SCALE, value);
+ }
+
+ public boolean getVlcSampleRateOverride() {
+ return getBoolean(KEY_VLC_SAMPLE_RATE_OVERRIDE, false);
+ }
+
+ public void setVlcSampleRateOverride(boolean value) {
+ configuration.setProperty(KEY_VLC_SAMPLE_RATE_OVERRIDE, value);
+ }
+
+ public String getVlcSampleRate() {
+ return getString(KEY_VLC_SAMPLE_RATE, "48000");
+ }
+
+ public void setVlcSampleRate(String value) {
+ configuration.setProperty(KEY_VLC_SAMPLE_RATE, value);
+ }
}
@@ -48,14 +48,17 @@ public String getTsmuxerPath() {
@Override
public String getVlcPath() {
SystemUtils registry = PMS.get().getRegistry();
- if (registry.getVlcp() != null) {
- String vlc = registry.getVlcp();
- String version = registry.getVlcv();
+
+ if (registry.getVlcPath() != null) {
+ String vlc = registry.getVlcPath();
+ String version = registry.getVlcVersion();
+
if (new File(vlc).exists() && version != null) {
logger.debug("Found VLC version " + version + " in Windows Registry: " + vlc);
return vlc;
}
}
+
return defaults.getVlcPath();
}
@@ -132,6 +132,7 @@ private static void registerPlayers(final PmsConfiguration configuration) {
}
registerPlayer(new FFMpegVideo(configuration));
+ registerPlayer(new VLCVideo(configuration));
registerPlayer(new MPlayerAudio(configuration));
registerPlayer(new FFMpegWebVideo(configuration));
registerPlayer(new MEncoderWebVideo(configuration));
Oops, something went wrong.

0 comments on commit e3f4d4e

Please sign in to comment.