2015-04-24 02:15:29 +00:00
|
|
|
|
using MediaBrowser.Model.Dlna;
|
|
|
|
|
using System.Collections.Generic;
|
2015-02-28 13:42:47 +00:00
|
|
|
|
|
|
|
|
|
namespace MediaBrowser.Server.Implementations.Sync
|
|
|
|
|
{
|
|
|
|
|
public class CloudSyncProfile : DeviceProfile
|
|
|
|
|
{
|
|
|
|
|
public CloudSyncProfile(bool supportsAc3, bool supportsDca)
|
|
|
|
|
{
|
|
|
|
|
Name = "Cloud Sync";
|
|
|
|
|
|
|
|
|
|
MaxStreamingBitrate = 20000000;
|
|
|
|
|
MaxStaticBitrate = 20000000;
|
|
|
|
|
|
|
|
|
|
var mkvAudio = "aac,mp3";
|
|
|
|
|
var mp4Audio = "aac";
|
|
|
|
|
|
|
|
|
|
if (supportsAc3)
|
|
|
|
|
{
|
|
|
|
|
mkvAudio += ",ac3";
|
|
|
|
|
mp4Audio += ",ac3";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (supportsDca)
|
|
|
|
|
{
|
2016-08-30 17:39:15 +00:00
|
|
|
|
mkvAudio += ",dca,dts";
|
2015-02-28 13:42:47 +00:00
|
|
|
|
}
|
|
|
|
|
|
2015-03-30 16:16:34 +00:00
|
|
|
|
var videoProfile = "high|main|baseline|constrained baseline";
|
2015-04-27 17:55:57 +00:00
|
|
|
|
var videoLevel = "40";
|
2015-03-30 16:16:34 +00:00
|
|
|
|
|
2015-02-28 13:42:47 +00:00
|
|
|
|
DirectPlayProfiles = new[]
|
|
|
|
|
{
|
2015-04-24 02:15:29 +00:00
|
|
|
|
//new DirectPlayProfile
|
|
|
|
|
//{
|
|
|
|
|
// Container = "mkv",
|
|
|
|
|
// VideoCodec = "h264,mpeg4",
|
|
|
|
|
// AudioCodec = mkvAudio,
|
|
|
|
|
// Type = DlnaProfileType.Video
|
|
|
|
|
//},
|
2015-02-28 13:42:47 +00:00
|
|
|
|
new DirectPlayProfile
|
|
|
|
|
{
|
|
|
|
|
Container = "mp4,mov,m4v",
|
|
|
|
|
VideoCodec = "h264,mpeg4",
|
|
|
|
|
AudioCodec = mp4Audio,
|
|
|
|
|
Type = DlnaProfileType.Video
|
2015-03-08 05:37:48 +00:00
|
|
|
|
},
|
|
|
|
|
new DirectPlayProfile
|
|
|
|
|
{
|
|
|
|
|
Container = "mp3",
|
|
|
|
|
Type = DlnaProfileType.Audio
|
2015-02-28 13:42:47 +00:00
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2015-03-30 16:16:34 +00:00
|
|
|
|
ContainerProfiles = new[]
|
|
|
|
|
{
|
|
|
|
|
new ContainerProfile
|
|
|
|
|
{
|
|
|
|
|
Type = DlnaProfileType.Video,
|
|
|
|
|
Conditions = new []
|
|
|
|
|
{
|
|
|
|
|
new ProfileCondition
|
|
|
|
|
{
|
|
|
|
|
Condition = ProfileConditionType.NotEquals,
|
|
|
|
|
Property = ProfileConditionValue.NumAudioStreams,
|
|
|
|
|
Value = "0",
|
|
|
|
|
IsRequired = false
|
|
|
|
|
},
|
|
|
|
|
new ProfileCondition
|
|
|
|
|
{
|
|
|
|
|
Condition = ProfileConditionType.EqualsAny,
|
|
|
|
|
Property = ProfileConditionValue.NumVideoStreams,
|
|
|
|
|
Value = "1",
|
|
|
|
|
IsRequired = false
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
2015-02-28 13:42:47 +00:00
|
|
|
|
|
2015-03-30 16:16:34 +00:00
|
|
|
|
var codecProfiles = new List<CodecProfile>
|
2015-02-28 13:42:47 +00:00
|
|
|
|
{
|
|
|
|
|
new CodecProfile
|
|
|
|
|
{
|
|
|
|
|
Type = CodecType.Video,
|
2015-03-30 16:16:34 +00:00
|
|
|
|
Codec = "h264",
|
2015-02-28 13:42:47 +00:00
|
|
|
|
Conditions = new []
|
|
|
|
|
{
|
|
|
|
|
new ProfileCondition
|
|
|
|
|
{
|
|
|
|
|
Condition = ProfileConditionType.LessThanEqual,
|
|
|
|
|
Property = ProfileConditionValue.VideoBitDepth,
|
|
|
|
|
Value = "8",
|
|
|
|
|
IsRequired = false
|
|
|
|
|
},
|
|
|
|
|
new ProfileCondition
|
2015-03-30 16:16:34 +00:00
|
|
|
|
{
|
|
|
|
|
Condition = ProfileConditionType.LessThanEqual,
|
|
|
|
|
Property = ProfileConditionValue.Width,
|
|
|
|
|
Value = "1920",
|
|
|
|
|
IsRequired = true
|
|
|
|
|
},
|
|
|
|
|
new ProfileCondition
|
2015-02-28 13:42:47 +00:00
|
|
|
|
{
|
|
|
|
|
Condition = ProfileConditionType.LessThanEqual,
|
|
|
|
|
Property = ProfileConditionValue.Height,
|
|
|
|
|
Value = "1080",
|
2015-03-30 16:16:34 +00:00
|
|
|
|
IsRequired = true
|
|
|
|
|
},
|
|
|
|
|
new ProfileCondition
|
|
|
|
|
{
|
|
|
|
|
Condition = ProfileConditionType.LessThanEqual,
|
|
|
|
|
Property = ProfileConditionValue.RefFrames,
|
|
|
|
|
Value = "4",
|
|
|
|
|
IsRequired = false
|
|
|
|
|
},
|
|
|
|
|
new ProfileCondition
|
|
|
|
|
{
|
|
|
|
|
Condition = ProfileConditionType.LessThanEqual,
|
|
|
|
|
Property = ProfileConditionValue.VideoFramerate,
|
|
|
|
|
Value = "30",
|
|
|
|
|
IsRequired = false
|
|
|
|
|
},
|
|
|
|
|
new ProfileCondition
|
|
|
|
|
{
|
|
|
|
|
Condition = ProfileConditionType.Equals,
|
|
|
|
|
Property = ProfileConditionValue.IsAnamorphic,
|
|
|
|
|
Value = "false",
|
|
|
|
|
IsRequired = false
|
|
|
|
|
},
|
|
|
|
|
new ProfileCondition
|
|
|
|
|
{
|
|
|
|
|
Condition = ProfileConditionType.LessThanEqual,
|
|
|
|
|
Property = ProfileConditionValue.VideoLevel,
|
|
|
|
|
Value = videoLevel,
|
|
|
|
|
IsRequired = false
|
|
|
|
|
},
|
|
|
|
|
new ProfileCondition
|
|
|
|
|
{
|
|
|
|
|
Condition = ProfileConditionType.EqualsAny,
|
|
|
|
|
Property = ProfileConditionValue.VideoProfile,
|
|
|
|
|
Value = videoProfile,
|
|
|
|
|
IsRequired = false
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
new CodecProfile
|
|
|
|
|
{
|
|
|
|
|
Type = CodecType.Video,
|
|
|
|
|
Codec = "mpeg4",
|
|
|
|
|
Conditions = new []
|
|
|
|
|
{
|
|
|
|
|
new ProfileCondition
|
|
|
|
|
{
|
|
|
|
|
Condition = ProfileConditionType.LessThanEqual,
|
|
|
|
|
Property = ProfileConditionValue.VideoBitDepth,
|
|
|
|
|
Value = "8",
|
2015-02-28 13:42:47 +00:00
|
|
|
|
IsRequired = false
|
|
|
|
|
},
|
|
|
|
|
new ProfileCondition
|
2015-03-30 16:16:34 +00:00
|
|
|
|
{
|
|
|
|
|
Condition = ProfileConditionType.LessThanEqual,
|
|
|
|
|
Property = ProfileConditionValue.Width,
|
|
|
|
|
Value = "1920",
|
|
|
|
|
IsRequired = true
|
|
|
|
|
},
|
|
|
|
|
new ProfileCondition
|
|
|
|
|
{
|
|
|
|
|
Condition = ProfileConditionType.LessThanEqual,
|
|
|
|
|
Property = ProfileConditionValue.Height,
|
|
|
|
|
Value = "1080",
|
|
|
|
|
IsRequired = true
|
|
|
|
|
},
|
|
|
|
|
new ProfileCondition
|
2015-02-28 13:42:47 +00:00
|
|
|
|
{
|
|
|
|
|
Condition = ProfileConditionType.LessThanEqual,
|
|
|
|
|
Property = ProfileConditionValue.RefFrames,
|
2015-03-26 19:21:40 +00:00
|
|
|
|
Value = "4",
|
2015-02-28 13:42:47 +00:00
|
|
|
|
IsRequired = false
|
2015-03-30 16:16:34 +00:00
|
|
|
|
},
|
|
|
|
|
new ProfileCondition
|
|
|
|
|
{
|
|
|
|
|
Condition = ProfileConditionType.LessThanEqual,
|
|
|
|
|
Property = ProfileConditionValue.VideoFramerate,
|
|
|
|
|
Value = "30",
|
|
|
|
|
IsRequired = false
|
|
|
|
|
},
|
|
|
|
|
new ProfileCondition
|
|
|
|
|
{
|
|
|
|
|
Condition = ProfileConditionType.Equals,
|
|
|
|
|
Property = ProfileConditionValue.IsAnamorphic,
|
|
|
|
|
Value = "false",
|
|
|
|
|
IsRequired = false
|
2015-02-28 13:42:47 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2015-03-30 16:16:34 +00:00
|
|
|
|
codecProfiles.Add(new CodecProfile
|
|
|
|
|
{
|
2015-03-31 16:24:16 +00:00
|
|
|
|
Type = CodecType.VideoAudio,
|
2015-04-09 05:20:23 +00:00
|
|
|
|
Codec = "ac3",
|
2015-03-30 16:16:34 +00:00
|
|
|
|
Conditions = new[]
|
|
|
|
|
{
|
|
|
|
|
new ProfileCondition
|
|
|
|
|
{
|
|
|
|
|
Condition = ProfileConditionType.LessThanEqual,
|
|
|
|
|
Property = ProfileConditionValue.AudioChannels,
|
2015-04-15 21:59:20 +00:00
|
|
|
|
Value = "6",
|
2015-04-14 19:11:29 +00:00
|
|
|
|
IsRequired = false
|
2015-04-09 05:20:23 +00:00
|
|
|
|
},
|
|
|
|
|
new ProfileCondition
|
2015-07-13 21:26:11 +00:00
|
|
|
|
{
|
|
|
|
|
Condition = ProfileConditionType.LessThanEqual,
|
|
|
|
|
Property = ProfileConditionValue.AudioBitrate,
|
|
|
|
|
Value = "320000",
|
|
|
|
|
IsRequired = true
|
|
|
|
|
},
|
|
|
|
|
new ProfileCondition
|
2015-04-09 05:20:23 +00:00
|
|
|
|
{
|
|
|
|
|
Condition = ProfileConditionType.Equals,
|
|
|
|
|
Property = ProfileConditionValue.IsSecondaryAudio,
|
|
|
|
|
Value = "false",
|
|
|
|
|
IsRequired = false
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
codecProfiles.Add(new CodecProfile
|
|
|
|
|
{
|
|
|
|
|
Type = CodecType.VideoAudio,
|
2015-04-14 19:11:29 +00:00
|
|
|
|
Codec = "aac,mp3",
|
2015-04-09 05:20:23 +00:00
|
|
|
|
Conditions = new[]
|
|
|
|
|
{
|
|
|
|
|
new ProfileCondition
|
|
|
|
|
{
|
|
|
|
|
Condition = ProfileConditionType.LessThanEqual,
|
|
|
|
|
Property = ProfileConditionValue.AudioChannels,
|
|
|
|
|
Value = "2",
|
2015-03-31 16:24:16 +00:00
|
|
|
|
IsRequired = true
|
2015-03-30 16:16:34 +00:00
|
|
|
|
},
|
|
|
|
|
new ProfileCondition
|
2015-07-13 21:26:11 +00:00
|
|
|
|
{
|
|
|
|
|
Condition = ProfileConditionType.LessThanEqual,
|
|
|
|
|
Property = ProfileConditionValue.AudioBitrate,
|
|
|
|
|
Value = "320000",
|
|
|
|
|
IsRequired = true
|
|
|
|
|
},
|
|
|
|
|
new ProfileCondition
|
2015-03-30 16:16:34 +00:00
|
|
|
|
{
|
|
|
|
|
Condition = ProfileConditionType.Equals,
|
|
|
|
|
Property = ProfileConditionValue.IsSecondaryAudio,
|
|
|
|
|
Value = "false",
|
|
|
|
|
IsRequired = false
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
CodecProfiles = codecProfiles.ToArray();
|
|
|
|
|
|
2015-02-28 13:42:47 +00:00
|
|
|
|
SubtitleProfiles = new[]
|
|
|
|
|
{
|
|
|
|
|
new SubtitleProfile
|
|
|
|
|
{
|
|
|
|
|
Format = "srt",
|
|
|
|
|
Method = SubtitleDeliveryMethod.External
|
2015-03-30 19:57:37 +00:00
|
|
|
|
},
|
|
|
|
|
new SubtitleProfile
|
|
|
|
|
{
|
|
|
|
|
Format = "vtt",
|
|
|
|
|
Method = SubtitleDeliveryMethod.External
|
2015-02-28 13:42:47 +00:00
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
TranscodingProfiles = new[]
|
|
|
|
|
{
|
|
|
|
|
new TranscodingProfile
|
|
|
|
|
{
|
|
|
|
|
Container = "mp3",
|
|
|
|
|
AudioCodec = "mp3",
|
|
|
|
|
Type = DlnaProfileType.Audio,
|
|
|
|
|
Context = EncodingContext.Static
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
new TranscodingProfile
|
|
|
|
|
{
|
|
|
|
|
Container = "mp4",
|
|
|
|
|
Type = DlnaProfileType.Video,
|
|
|
|
|
AudioCodec = "aac",
|
|
|
|
|
VideoCodec = "h264",
|
|
|
|
|
Context = EncodingContext.Static
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
new TranscodingProfile
|
|
|
|
|
{
|
|
|
|
|
Container = "jpeg",
|
|
|
|
|
Type = DlnaProfileType.Photo,
|
|
|
|
|
Context = EncodingContext.Static
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|