add subtitle profiles to dlna profile editor

This commit is contained in:
Luke Pulverenti 2014-09-17 21:26:23 -04:00
parent 6130cb2403
commit 3509a401c8
6 changed files with 115 additions and 36 deletions

View file

@ -925,11 +925,6 @@ namespace MediaBrowser.Api.Playback
/// <exception cref="System.InvalidOperationException">ffmpeg was not found at + MediaEncoder.EncoderPath</exception>
protected async Task<TranscodingJob> StartFfMpeg(StreamState state, string outputPath, CancellationTokenSource cancellationTokenSource)
{
if (!File.Exists(MediaEncoder.EncoderPath))
{
throw new InvalidOperationException("ffmpeg was not found at " + MediaEncoder.EncoderPath);
}
Directory.CreateDirectory(Path.GetDirectoryName(outputPath));
await AcquireResources(state, cancellationTokenSource).ConfigureAwait(false);
@ -955,7 +950,6 @@ namespace MediaBrowser.Api.Playback
RedirectStandardInput = true,
FileName = MediaEncoder.EncoderPath,
WorkingDirectory = Path.GetDirectoryName(MediaEncoder.EncoderPath),
Arguments = commandLineArgs,
WindowStyle = ProcessWindowStyle.Hidden,

View file

@ -508,5 +508,65 @@
"ValueStudios": "Studios: {0}",
"ValueSpecialEpisodeName": "Special - {0}",
"LabelLimit": "Limit:",
"ValueLinks": "Links: {0}"
"ValueLinks": "Links: {0}",
"HeaderPeople": "People",
"HeaderCastAndCrew": "Cast & Crew",
"ValueArtist": "Artist: {0}",
"ValueArtists": "Artists: {0}",
"HeaderTags": "Tags",
"MediaInfoCameraMake": "Camera make",
"MediaInfoCameraModel": "Camera model",
"MediaInfoAltitude": "Altitude",
"MediaInfoAperture": "Aperture",
"MediaInfoExposureTime": "Exposure time",
"MediaInfoFocalLength": "Focal length",
"MediaInfoOrientation": "Orientation",
"MediaInfoIsoSpeedRating": "Iso speed rating",
"MediaInfoLatitude": "Latitude",
"MediaInfoLongitude": "Longitude",
"MediaInfoShutterSpeed": "Shutter speed",
"MediaInfoSoftware": "Software",
"HeaderIfYouLikeCheckTheseOut": "If you like {0}, check these out...",
"HeaderPlotKeywords": "Plot Keywords",
"HeaderMovies": "Movies",
"HeaderSeries": "Series",
"HeaderAlbums": "Albums",
"HeaderGames": "Games",
"HeaderBooks": "Books",
"HeaderEpisodes": "Episodes",
"HeaderSeasons": "Seasons",
"HeaderTracks": "Tracks",
"HeaderItems": "Items",
"HeaderOtherItems": "Other Items",
"ButtonFullReview": "Full review",
"ValueAsRole": "as {0}",
"ValueGuestStar": "Guest star",
"MediaInfoSize": "Size",
"MediaInfoPath": "Path",
"MediaInfoFormat": "Format",
"MediaInfoContainer": "Container",
"MediaInfoDefault": "Default",
"MediaInfoForced": "Forced",
"MediaInfoExternal": "External",
"MediaInfoTimestamp": "Timestamp",
"MediaInfoPixelFormat": "Pixel format",
"MediaInfoBitDepth": "Bit Depth",
"MediaInfoSampleRate": "Sample rate",
"MediaInfoBitrate": "Bitrate",
"MediaInfoChannels": "Channels",
"MediaInfoLayout": "Layout",
"MediaInfoLanguage": "Language",
"MediaInfoCodec": "Codec",
"MediaInfoProfile": "Profile",
"MediaInfoLevel": "Level",
"MediaInfoAspectRatio": "Aspect ratio",
"MediaInfoResolution": "Resolution",
"MediaInfoAnamorphic": "Anamorphic",
"MediaInfoInterlaced": "Interlaced",
"MediaInfoFramerate": "Framerate",
"MediaInfoStreamTypeAudio": "Audio",
"MediaInfoStreamTypeData": "Data",
"MediaInfoStreamTypeVideo": "Video",
"MediaInfoStreamTypeSubtitle": "Subtitle",
"MediaInfoStreamTypeEmbeddedImage": "Embedded Image"
}

View file

@ -1166,5 +1166,17 @@
"LabelConnectUserNameHelp": "Connect this user to a Media Browser account to enable easy sign-in access from any app without having to know the server ip address.",
"ButtonLearnMoreAboutMediaBrowserConnect": "Learn more about Media Browser Connect",
"LabelExternalPlayers": "External players:",
"LabelExternalPlayersHelp": "Display buttons to play content in external players. This is only available on devices that support url schemes, generally Android and iOS. With external players there is generally no support for remote control or resuming."
}
"LabelExternalPlayersHelp": "Display buttons to play content in external players. This is only available on devices that support url schemes, generally Android and iOS. With external players there is generally no support for remote control or resuming.",
"HeaderSubtitleProfile": "Subtitle Profile",
"HeaderSubtitleProfiles": "Subtitle Profiles",
"HeaderSubtitleProfilesHelp": "Subtitle profiles describe the subtitle formats supported by the device.",
"LabelFormat": "Format:",
"LabelMethod": "Method:",
"LabelDidlMode": "Didl mode:",
"OptionCaptionInfoExSamsung": "CaptionInfoEx (Samsung)",
"OptionResElement": "res element",
"OptionEmbedSubtitles": "Embed within container",
"OptionExternallyDownloaded": "External download",
"OptionHlsSegmentedSubtitles": "Hls segmented subtitles",
"LabelSubtitleFormatHelp": "Example: srt"
}

View file

@ -16,16 +16,14 @@ namespace MediaBrowser.ServerApplication.FFMpeg
// OS X builds: http://ffmpegmac.net/
// OS X x64: http://www.evermeet.cx/ffmpeg/
public static string Version = ffmpegOsType("Version");
public static string Version = getFfmpegValue("Version");
public static string[] FfMpegUrls = GetDownloadUrls();
public static string FFMpegFilename = getFfmpegValue("FFMpegFilename");
public static string FFProbeFilename = getFfmpegValue("FFProbeFilename");
public static string FFMpegFilename = ffmpegOsType("FFMpegFilename");
public static string FFProbeFilename = ffmpegOsType("FFProbeFilename");
public static string ArchiveType = getFfmpegValue("ArchiveType");
public static string ArchiveType = ffmpegOsType("ArchiveType");
private static string ffmpegOsType(string arg)
private static string getFfmpegValue(string arg)
{
OperatingSystem os = Environment.OSVersion;
PlatformID pid = os.Platform;
@ -61,7 +59,6 @@ namespace MediaBrowser.ServerApplication.FFMpeg
case "ArchiveType":
return "gz";
}
break;
}
if (PlatformDetection.IsX86)
{
@ -76,10 +73,9 @@ namespace MediaBrowser.ServerApplication.FFMpeg
case "ArchiveType":
return "gz";
}
break;
}
}
if (PlatformDetection.IsLinux)
else if (PlatformDetection.IsLinux)
{
if (PlatformDetection.IsX86)
{
@ -94,8 +90,8 @@ namespace MediaBrowser.ServerApplication.FFMpeg
case "ArchiveType":
return "gz";
}
break;
}
else if (PlatformDetection.IsX86_64)
{
// Linux on x86 or x86_64
@ -110,16 +106,28 @@ namespace MediaBrowser.ServerApplication.FFMpeg
case "ArchiveType":
return "gz";
}
break;
}
}
// Unsupported Unix platform
return "";
break;
}
switch (arg)
{
case "Version":
return "path";
case "FFMpegFilename":
return "ffmpeg";
case "FFProbeFilename":
return "ffprobe";
case "ArchiveType":
return "";
default:
return string.Empty;
}
return "";
}
private static string[] GetDownloadUrls()
public static string[] GetDownloadUrls()
{
var pid = Environment.OSVersion.Platform;
@ -210,8 +218,7 @@ namespace MediaBrowser.ServerApplication.FFMpeg
var sysName = uname.sysname ?? string.Empty;
IsMac = string.Equals(sysName, "Darwin", StringComparison.OrdinalIgnoreCase);
IsLinux = string.Equals(sysName, "Linux", StringComparison.OrdinalIgnoreCase) ||
sysName.EndsWith("BSD", StringComparison.OrdinalIgnoreCase);
IsLinux = string.Equals(sysName, "Linux", StringComparison.OrdinalIgnoreCase);
var archX86 = new Regex("(i|I)[3-6]86");
IsX86 = archX86.IsMatch(uname.machine);

View file

@ -55,14 +55,26 @@ namespace MediaBrowser.ServerApplication.FFMpeg
};
}
var version = FFMpegDownloadInfo.Version;
if (string.Equals(version, "path", StringComparison.OrdinalIgnoreCase))
{
return new FFMpegInfo
{
ProbePath = FFMpegDownloadInfo.FFProbeFilename,
EncoderPath = FFMpegDownloadInfo.FFMpegFilename,
Version = version
};
}
var rootEncoderPath = Path.Combine(_appPaths.ProgramDataPath, "ffmpeg");
var versionedDirectoryPath = Path.Combine(rootEncoderPath, FFMpegDownloadInfo.Version);
var versionedDirectoryPath = Path.Combine(rootEncoderPath, version);
var info = new FFMpegInfo
{
ProbePath = Path.Combine(versionedDirectoryPath, FFMpegDownloadInfo.FFProbeFilename),
EncoderPath = Path.Combine(versionedDirectoryPath, FFMpegDownloadInfo.FFMpegFilename),
Version = FFMpegDownloadInfo.Version
Version = version
};
Directory.CreateDirectory(versionedDirectoryPath);
@ -166,7 +178,7 @@ namespace MediaBrowser.ServerApplication.FFMpeg
private async Task DownloadFFMpeg(string directory, IProgress<double> progress)
{
foreach (var url in FFMpegDownloadInfo.FfMpegUrls)
foreach (var url in FFMpegDownloadInfo.GetDownloadUrls())
{
progress.Report(0);

View file

@ -2104,12 +2104,6 @@
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
<None Include="dashboard-ui\css\fonts\mblogo.eot">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="dashboard-ui\css\fonts\mblogo.ttf">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="dashboard-ui\css\fonts\mblogo.woff">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>