mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-16 05:53:03 +03:00
Use FFmpeg concat for DVD and BD folder playback
This commit is contained in:
@@ -918,6 +918,46 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
||||
.Select(f => f.FullName);
|
||||
}
|
||||
|
||||
public void GenerateConcatConfig(MediaSourceInfo source, string concatFilePath)
|
||||
{
|
||||
var files = new List<string>();
|
||||
var videoType = source.VideoType;
|
||||
if (videoType == VideoType.Dvd)
|
||||
{
|
||||
files = GetPrimaryPlaylistVobFiles(source.Path, null).ToList();
|
||||
}
|
||||
else if (videoType == VideoType.BluRay)
|
||||
{
|
||||
files = GetPrimaryPlaylistM2TsFiles(source.Path, null).ToList();
|
||||
}
|
||||
|
||||
var lines = new List<string>();
|
||||
|
||||
foreach (var path in files)
|
||||
{
|
||||
var fileinfo = _fileSystem.GetFileInfo(path);
|
||||
var mediaInfoResult = GetMediaInfo(
|
||||
new MediaInfoRequest
|
||||
{
|
||||
MediaType = DlnaProfileType.Video,
|
||||
MediaSource = new MediaSourceInfo
|
||||
{
|
||||
Path = path,
|
||||
Protocol = MediaProtocol.File,
|
||||
VideoType = videoType
|
||||
}
|
||||
},
|
||||
CancellationToken.None).GetAwaiter().GetResult();
|
||||
|
||||
var duration = TimeSpan.FromTicks(mediaInfoResult.RunTimeTicks.Value).TotalSeconds;
|
||||
|
||||
lines.Add("file " + "'" + path + "'");
|
||||
lines.Add("duration " + duration);
|
||||
}
|
||||
|
||||
File.WriteAllLinesAsync(concatFilePath, lines, CancellationToken.None).GetAwaiter().GetResult();
|
||||
}
|
||||
|
||||
public bool CanExtractSubtitles(string codec)
|
||||
{
|
||||
// TODO is there ever a case when a subtitle can't be extracted??
|
||||
|
||||
Reference in New Issue
Block a user