mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-03-19 00:26:25 +00:00
improve embedded image extraction
This commit is contained in:
@@ -484,12 +484,16 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
||||
return ExtractImage(new[] { path }, imageStreamIndex, MediaProtocol.File, true, null, null, cancellationToken);
|
||||
}
|
||||
|
||||
public Task<Stream> ExtractVideoImage(string[] inputFiles, MediaProtocol protocol, Video3DFormat? threedFormat,
|
||||
TimeSpan? offset, CancellationToken cancellationToken)
|
||||
public Task<Stream> ExtractVideoImage(string[] inputFiles, MediaProtocol protocol, Video3DFormat? threedFormat, TimeSpan? offset, CancellationToken cancellationToken)
|
||||
{
|
||||
return ExtractImage(inputFiles, null, protocol, false, threedFormat, offset, cancellationToken);
|
||||
}
|
||||
|
||||
public Task<Stream> ExtractVideoImage(string[] inputFiles, MediaProtocol protocol, int? imageStreamIndex, CancellationToken cancellationToken)
|
||||
{
|
||||
return ExtractImage(inputFiles, imageStreamIndex, protocol, false, null, null, cancellationToken);
|
||||
}
|
||||
|
||||
private async Task<Stream> ExtractImage(string[] inputFiles, int? imageStreamIndex, MediaProtocol protocol, bool isAudio,
|
||||
Video3DFormat? threedFormat, TimeSpan? offset, CancellationToken cancellationToken)
|
||||
{
|
||||
|
||||
@@ -138,10 +138,14 @@ namespace MediaBrowser.MediaEncoding.Probing
|
||||
var parts = iTunEXTC.Split(new[] { '|' }, StringSplitOptions.RemoveEmptyEntries);
|
||||
// Example
|
||||
// mpaa|G|100|For crude humor
|
||||
if (parts.Length == 4)
|
||||
if (parts.Length > 1)
|
||||
{
|
||||
info.OfficialRating = parts[1];
|
||||
info.OfficialRatingDescription = parts[3];
|
||||
|
||||
if (parts.Length > 3)
|
||||
{
|
||||
info.OfficialRatingDescription = parts[3];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user